← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~ahayzen/ubuntu-weather-app/uc1.3-migrations into lp:ubuntu-weather-app

 

Andrew Hayzen has proposed merging lp:~ahayzen/ubuntu-weather-app/uc1.3-migrations into lp:ubuntu-weather-app.

Commit message:
* Migrate to use new uc1.3 page headers - also fixes topMargin on bottom edge page
* Migrate to use sdk bottom edge

Requested reviews:
  Ubuntu Weather Developers (ubuntu-weather-dev)

For more details, see:
https://code.launchpad.net/~ahayzen/ubuntu-weather-app/uc1.3-migrations/+merge/300508

* Migrate to use new uc1.3 page headers - also fixes topMargin on bottom edge page
* Migrate to use sdk bottom edge


Note this is likely failing autopilot, but is more of a functional review.
-- 
Your team Ubuntu Weather Developers is requested to review the proposed merge of lp:~ahayzen/ubuntu-weather-app/uc1.3-migrations into lp:ubuntu-weather-app.
=== modified file 'app/components/CMakeLists.txt'
--- app/components/CMakeLists.txt	2015-03-03 18:37:59 +0000
+++ app/components/CMakeLists.txt	2016-07-19 18:03:11 +0000
@@ -1,3 +1,4 @@
+add_subdirectory(HeadState)
 add_subdirectory(ListItemActions)
 
 file(GLOB COMPONENTS_QML_JS_FILES *.qml *.js)

=== added directory 'app/components/HeadState'
=== added file 'app/components/HeadState/CMakeLists.txt'
--- app/components/HeadState/CMakeLists.txt	1970-01-01 00:00:00 +0000
+++ app/components/HeadState/CMakeLists.txt	2016-07-19 18:03:11 +0000
@@ -0,0 +1,4 @@
+# make the qml files visible on qtcreator
+file(GLOB HEAD_STATE_QML_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.qml)
+
+add_custom_target(com_ubuntu_music_HEAD_STATE_QMLFiles ALL SOURCES ${HEAD_STATE_QML_FILES})

=== added file 'app/components/HeadState/LocationsHeadState.qml'
--- app/components/HeadState/LocationsHeadState.qml	1970-01-01 00:00:00 +0000
+++ app/components/HeadState/LocationsHeadState.qml	2016-07-19 18:03:11 +0000
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2016
+ *      Andrew Hayzen <ahayzen@xxxxxxxxx>
+ *      Victor Thompson <victor.thompson@xxxxxxxxx>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+import QtQuick 2.4
+import Ubuntu.Components 1.3
+
+
+State {
+    name: "default"
+
+    property PageHeader thisHeader: PageHeader {
+        flickable: thisPage.flickable
+        leadingActionBar {
+            actions: [
+                Action {
+                    iconName: "down"
+                    onTriggered: thisPage.pop()
+                }
+            ]
+        }
+        title: i18n.tr("Locations")
+        trailingActionBar {
+            actions: [
+                Action {
+                    iconName: "add"
+                    objectName: "addLocation"
+                    onTriggered: mainPageStack.push(Qt.resolvedUrl("../../ui/AddLocationPage.qml"))
+                }
+            ]
+        }
+        visible: thisPage.state === "default"
+    }
+    property Item thisPage
+
+    PropertyChanges {
+        target: thisPage
+        header: thisHeader
+    }
+}

=== renamed file 'app/components/MultiSelectHeadState.qml' => 'app/components/HeadState/MultiSelectHeadState.qml'
--- app/components/MultiSelectHeadState.qml	2015-11-02 21:28:34 +0000
+++ app/components/HeadState/MultiSelectHeadState.qml	2016-07-19 18:03:11 +0000
@@ -19,49 +19,55 @@
 import QtQuick 2.4
 import Ubuntu.Components 1.3
 
-PageHeadState {
+
+State {
     id: selectionState
-    actions: [
-        Action {
-            iconName: "select"
-            text: i18n.tr("Select All")
-            onTriggered: {
-                if (listview.selectedItems.length === listview.model.count) {
-                    listview.clearSelection()
-                } else {
-                    listview.selectAll()
-                }
-            }
-        },
-        Action {
-            enabled: listview.selectedItems.length > 0
-            iconName: "delete"
-            text: i18n.tr("Delete")
-            visible: removable
-
-            onTriggered: {
-                removed(listview.selectedItems)
-
-                listview.closeSelection()
-            }
-        }
-
-    ]
-    backAction: Action {
-        text: i18n.tr("Cancel selection")
-        iconName: "back"
-        onTriggered: {
-            listview.clearSelection()
-            listview.state = "normal"
-        }
-    }
-    head: thisPage.head
     name: "selection"
 
-    PropertyChanges {
-        target: thisPage.head
-        backAction: selectionState.backAction
-        actions: selectionState.actions
+    property PageHeader thisHeader: PageHeader {
+        flickable: thisPage.flickable
+        leadingActionBar {
+            actions: [
+                Action {
+                    text: i18n.tr("Cancel selection")
+                    iconName: "back"
+                    onTriggered: {
+                        listview.clearSelection()
+                        listview.state = "normal"
+                    }
+                }
+            ]
+        }
+        title: i18n.tr("Locations")
+        trailingActionBar {
+            actions: [
+                Action {
+                    iconName: "select"
+                    text: i18n.tr("Select All")
+                    onTriggered: {
+                        if (listview.selectedItems.length === listview.model.count) {
+                            listview.clearSelection()
+                        } else {
+                            listview.selectAll()
+                        }
+                    }
+                },
+                Action {
+                    enabled: listview.selectedItems.length > 0
+                    iconName: "delete"
+                    text: i18n.tr("Delete")
+                    visible: removable
+
+                    onTriggered: {
+                        removed(listview.selectedItems)
+
+                        listview.closeSelection()
+                    }
+                }
+
+            ]
+        }
+        visible: thisPage.state === "selection"
     }
 
     property ListView listview
@@ -69,4 +75,9 @@
     property Page thisPage
 
     signal removed(var selectedItems)
+
+    PropertyChanges {
+        target: thisPage
+        header: thisHeader
+    }
 }

=== modified file 'app/ui/HomePage.qml'
--- app/ui/HomePage.qml	2016-02-28 22:53:13 +0000
+++ app/ui/HomePage.qml	2016-07-19 18:03:11 +0000
@@ -22,16 +22,29 @@
 import "../data/keys.js" as Keys
 
 
-PageWithBottomEdge {
+Page {
     // Set to null otherwise the header is shown (but blank) over the top of the listview
     id: locationPage
     objectName: "homePage"
     flickable: null
 
-    bottomEdgePageSource: Qt.resolvedUrl("LocationsPage.qml")
-    bottomEdgeTitle: i18n.tr("Locations")
-    tipColor: UbuntuColors.orange
-    tipLabelColor: "#FFF"
+    BottomEdge {
+        id: bottomEdge
+        // Note: cannot use contentUrl and preload until pad.lv/1604509
+        contentComponent: locationsPage
+        height: parent.height
+        preloadContent: true
+
+        Component {
+            id: locationsPage
+            LocationsPage {
+                height: bottomEdge.height
+                width: bottomEdge.width
+
+                onPop: bottomEdge.collapse()
+            }
+        }
+    }
 
     property var iconMap: {
         "sun": "weather-clear-symbolic",

=== modified file 'app/ui/LocationsPage.qml'
--- app/ui/LocationsPage.qml	2016-03-26 16:38:54 +0000
+++ app/ui/LocationsPage.qml	2016-07-19 18:03:11 +0000
@@ -20,33 +20,17 @@
 import Ubuntu.Components 1.3
 import Ubuntu.Components.ListItems 0.1 as ListItem
 import "../components"
+import "../components/HeadState"
 import "../components/ListItemActions"
 
 
 Page {
     id: locationsPage
     objectName: "locationsPage"
-    title: i18n.tr("Locations")
-
     state: locationsListView.state === "multiselectable" ? "selection" : "default"
     states: [
-        PageHeadState {
-            id: defaultState
-            head: locationsPage.head
-            name: "default"
-            actions: [
-                Action {
-                    iconName: "add"
-                    objectName: "addLocation"
-                    onTriggered: mainPageStack.push(Qt.resolvedUrl("AddLocationPage.qml"))
-                }
-            ]
-            backAction: Action {
-                iconName: "down"
-                onTriggered: {
-                    pageStack.pop()
-                }
-            }
+        LocationsHeadState {
+            thisPage: locationsPage
         },
         MultiSelectHeadState {
             listview: locationsListView
@@ -57,6 +41,11 @@
         }
     ]
 
+    height: units.gu(20)
+    width: units.gu(20)
+
+    signal pop()
+
     ListModel {
         id: currentLocationModel
     }
@@ -64,9 +53,10 @@
     MultiSelectListView {
         id: locationsListView
         anchors {
-            fill: parent
-            // TODO: Fix this offset
-            topMargin: -units.gu(6.125)  // FIXME: 6.125 is the header.height
+            bottom: parent.bottom
+            left: parent.left
+            right: parent.right
+            top: locationsPage.header.bottom
         }
         model: ListModel {
             id: locationsModel

=== modified file 'debian/changelog'
--- debian/changelog	2016-06-05 20:16:22 +0000
+++ debian/changelog	2016-07-19 18:03:11 +0000
@@ -1,4 +1,13 @@
-ubuntu-weather-app (3.3ubuntu1) UNRELEASED; urgency=medium
+ubuntu-weather-app (3.4ubuntu2) UNRELEASED; urgency=medium
+
+  [ Andrew Hayzen ]
+  * Release 3.3 and bump version to 3.4
+  * Migrate to use new uc1.3 page headers - also fixes topMargin on bottom edge page
+  * Migrate to use sdk bottom edge
+
+ -- Andrew Hayzen <andy@Pangolin-Performance>  Tue, 19 Jul 2016 18:59:35 +0100
+
+ubuntu-weather-app (3.3ubuntu1) xenial; urgency=medium
 
   [ Andrew Hayzen ]
   * Release 3.2 and bump version to 3.3
@@ -8,7 +17,7 @@
   * Update to use new weather API
   * Change the trimAPIKey function so it only trims the API Key
 
- -- Andrew Hayzen <ahayzen@xxxxxxxxx>  Sat, 04 Jun 2016 18:31:29 +0100
+ -- Andrew Hayzen <ahayzen@xxxxxxxxx>  Tue, 19 Jul 2016 18:59:21 +0100
 
 ubuntu-weather-app (3.2ubuntu1) vivid; urgency=medium
 

=== modified file 'manifest.json.in'
--- manifest.json.in	2016-06-05 20:16:22 +0000
+++ manifest.json.in	2016-07-19 18:03:11 +0000
@@ -12,7 +12,7 @@
     "maintainer": "Ubuntu App Cats <ubuntu-touch-coreapps@xxxxxxxxxxxxxxxxxxx>",
     "name": "@PROJECT_NAME@",
     "title": "Weather",
-    "version": "3.3.@BZR_REVNO@",
+    "version": "3.4.@BZR_REVNO@",
     "x-source": {
         "vcs-bzr": "@BZR_SOURCE@",
         "vcs-bzr-revno": "@BZR_REVNO@"

=== modified file 'po/com.ubuntu.weather.pot'
--- po/com.ubuntu.weather.pot	2016-03-26 16:48:16 +0000
+++ po/com.ubuntu.weather.pot	2016-07-19 18:03:11 +0000
@@ -1,6 +1,6 @@
 # SOME DESCRIPTIVE TITLE.
 # Copyright (C) YEAR Canonical Ltd.
-# This file is distributed under the same license as the ubuntu-weather-app package.
+# This file is distributed under the same license as the PACKAGE package.
 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
 #
 #, fuzzy
@@ -8,7 +8,7 @@
 msgstr ""
 "Project-Id-Version: ubuntu-weather-app\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2016-03-26 11:43-0500\n"
+"POT-Creation-Date: 2016-07-19 18:34+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@xxxxxx>\n"
@@ -46,6 +46,23 @@
 msgid "Sunset"
 msgstr ""
 
+#: ../app/components/HeadState/LocationsHeadState.qml:36
+#: ../app/components/HeadState/MultiSelectHeadState.qml:41
+msgid "Locations"
+msgstr ""
+
+#: ../app/components/HeadState/MultiSelectHeadState.qml:32
+msgid "Cancel selection"
+msgstr ""
+
+#: ../app/components/HeadState/MultiSelectHeadState.qml:46
+msgid "Select All"
+msgstr ""
+
+#: ../app/components/HeadState/MultiSelectHeadState.qml:58
+msgid "Delete"
+msgstr ""
+
 #: ../app/components/HomePageEmptyStateComponent.qml:51
 msgid "Searching for current location..."
 msgstr ""
@@ -70,18 +87,6 @@
 msgid "No locations found. Tap the plus icon to search for one."
 msgstr ""
 
-#: ../app/components/MultiSelectHeadState.qml:27
-msgid "Select All"
-msgstr ""
-
-#: ../app/components/MultiSelectHeadState.qml:39
-msgid "Delete"
-msgstr ""
-
-#: ../app/components/MultiSelectHeadState.qml:51
-msgid "Cancel selection"
-msgstr ""
-
 #: ../app/components/NetworkErrorStateComponent.qml:48
 msgid "Network Error"
 msgstr ""
@@ -136,11 +141,7 @@
 msgid "OK"
 msgstr ""
 
-#: ../app/ui/HomePage.qml:32 ../app/ui/LocationsPage.qml:29
-msgid "Locations"
-msgstr ""
-
-#: ../app/ui/LocationsPage.qml:109
+#: ../app/ui/LocationsPage.qml:99
 msgid "Current Location"
 msgstr ""
 


Follow ups