← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~rpadovani/ubuntu-calculator-app/bumpToolkit into lp:ubuntu-calculator-app

 

Riccardo Padovani has proposed merging lp:~rpadovani/ubuntu-calculator-app/bumpToolkit into lp:ubuntu-calculator-app.

Commit message:
Update QtQuick and ubuntu-ui-toolkit

Requested reviews:
  Jenkins Bot (ubuntu-core-apps-jenkins-bot): continuous-integration
  Ubuntu Calculator Developers (ubuntu-calculator-dev)
Related bugs:
  Bug #1413789 in Ubuntu Calculator App: "Calculator should use MainView and Page instead of Headers"
  https://bugs.launchpad.net/ubuntu-calculator-app/+bug/1413789

For more details, see:
https://code.launchpad.net/~rpadovani/ubuntu-calculator-app/bumpToolkit/+merge/277012

## PLEASE WAIT UNTIL UI-TOOLKIT 1.3 LANDS ON DEVICES TO MERGE ##

- Update all QtQuick to 2.4 and toolkit to 1.3
- Drop custom header in favour of standard one
- Fix bug #1413789
-- 
Your team Ubuntu Calculator Developers is requested to review the proposed merge of lp:~rpadovani/ubuntu-calculator-app/bumpToolkit into lp:ubuntu-calculator-app.
=== modified file 'app/ubuntu-calculator-app.qml'
--- app/ubuntu-calculator-app.qml	2015-10-28 20:56:47 +0000
+++ app/ubuntu-calculator-app.qml	2015-11-09 14:34:26 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Canonical Ltd
+ * Copyright (C) 2014-2015 Canonical Ltd
  *
  * This file is part of Ubuntu Calculator App
  *
@@ -15,9 +15,9 @@
  * 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.3
-import Ubuntu.Components 1.1
-import Ubuntu.Components.Themes.Ambiance 0.1
+import QtQuick 2.4
+import Ubuntu.Components 1.3
+import Ubuntu.Components.Themes.Ambiance 1.3
 
 import "ui"
 import "upstreamcomponents"
@@ -31,8 +31,6 @@
     objectName: "calculator";
     applicationName: "com.ubuntu.calculator";
 
-    // Removes the old toolbar and enables new features of the new header.
-    useDeprecatedToolbar: false;
     automaticOrientation: true
     anchorToKeyboard: textInputField.visible ? false : true
 
@@ -124,7 +122,7 @@
                 return bigNumberToFormat.toExponential();
             }
         } else {
-            // exponential: Object An object containing two parameters, {Number} lower and {Number} upper, 
+            // exponential: Object An object containing two parameters, {Number} lower and {Number} upper,
             // used by notation 'auto' to determine when to return exponential notation.
             return mathJs.format(bigNumberToFormat, {exponential: {lower: 1e-10, upper: 1e10}});
         }
@@ -248,7 +246,6 @@
         id: mainStack
 
         Component.onCompleted: {
-
             push(calculatorPage);
             calculatorPage.forceActiveFocus();
         }
@@ -256,6 +253,8 @@
         PageWithBottomEdge {
             id: calculatorPage
 
+            title: i18n.tr("Calculator")
+
             bottomEdgeTitle: i18n.tr("Favorite")
 
             bottomEdgePageComponent: FavouritePage {
@@ -268,25 +267,30 @@
 
             state: visualModel.isInSelectionMode ? "selection" : "default"
             states: [
+
                 State {
                     name: "default"
-                    StateChangeScript {
-                        script: header.hide()
-                    }
                     PropertyChanges {
                         target: scrollableView
                         clip: false
                     }
+                    PropertyChanges {
+                        target: calculatorPage.head
+                        visible: false
+                        preset: ""
+                    }
                 },
                 State {
                     name: "selection"
-                    StateChangeScript {
-                        script: header.show()
-                    }
                     PropertyChanges {
                         target: scrollableView
                         clip: true
                     }
+                    PropertyChanges {
+                        target: calculatorPage.head
+                        visible: true
+                        preset: "select"
+                    }
                 }
             ]
 
@@ -299,52 +303,45 @@
             Keys.onPressed: textInputField.keyPress(event)
             Keys.onReleased: textInputField.keyRelease(event)
 
-            Header {
-                id: header
-                visible: true
-                useDeprecatedToolbar: false
-                property color dividerColor: "#babbbc"
-                property color panelColor: "white"
-                config: PageHeadConfiguration {
-                    backAction: Action {
-                        objectName: "cancelSelectionAction"
-                        iconName: "close"
-                        text: i18n.tr("Cancel")
-                        onTriggered: visualModel.cancelSelection()
-                    }
-                    actions: [
-                        Action {
-                            id: selectAllAction
-                            objectName: "selectAllAction"
-                            iconName: "select"
-                            // Until a select none icon  will be added to the theme we have to use
-                            // our own
-                            iconSource: visualModel.selectedItems.count < visualModel.items.count ?
-                                    Qt.resolvedUrl("graphics/select.svg") :
-                                    Qt.resolvedUrl("graphics/select_none.svg")
-                            text: visualModel.selectedItems.count < visualModel.items.count ?
-                                    i18n.tr("Select All") : i18n.tr("Select None")
-                            onTriggered: visualModel.selectAll()
-                        },
-                        Action {
-                            id: copySelectedAction
-                            objectName: "copySelectedAction"
-                            iconName: "edit-copy"
-                            text: i18n.tr("Copy")
-                            onTriggered: calculatorPage.copySelectedCalculations()
-                            enabled: visualModel.selectedItems.count > 0
-                        },
-                        Action {
-                            id: multiDeleteAction
-                            objectName: "multiDeleteAction"
-                            iconName: "delete"
-                            text: i18n.tr("Delete")
-                            onTriggered: calculatorPage.deleteSelectedCalculations()
-                            enabled: visualModel.selectedItems.count > 0
-                        }
-                    ]
+            head.visible: false
+            head.locked: true
+            head.backAction: Action {
+                objectName: "cancelSelectionAction"
+                iconName: "close"
+                text: i18n.tr("Cancel")
+                onTriggered: visualModel.cancelSelection()
+            }
+            head.actions: [
+                Action {
+                    id: selectAllAction
+                    objectName: "selectAllAction"
+                    iconName: "select"
+                    // Until a select none icon  will be added to the theme we have to use
+                    // our own
+                    iconSource: visualModel.selectedItems.count < visualModel.items.count ?
+                            Qt.resolvedUrl("graphics/select.svg") :
+                            Qt.resolvedUrl("graphics/select_none.svg")
+                    text: visualModel.selectedItems.count < visualModel.items.count ?
+                            i18n.tr("Select All") : i18n.tr("Select None")
+                    onTriggered: visualModel.selectAll()
+                },
+                Action {
+                    id: copySelectedAction
+                    objectName: "copySelectedAction"
+                    iconName: "edit-copy"
+                    text: i18n.tr("Copy")
+                    onTriggered: calculatorPage.copySelectedCalculations()
+                    enabled: visualModel.selectedItems.count > 0
+                },
+                Action {
+                    id: multiDeleteAction
+                    objectName: "multiDeleteAction"
+                    iconName: "delete"
+                    text: i18n.tr("Delete")
+                    onTriggered: calculatorPage.deleteSelectedCalculations()
+                    enabled: visualModel.selectedItems.count > 0
                 }
-            }
+            ]
 
             Component {
                 id: emptyDelegate
@@ -428,7 +425,7 @@
                     Loader {
                         id: screenDelegateFavouriteAction
                         sourceComponent: Action {
-                            iconName: (editedCalculationIndex == model.index || model.isFavourite) ? "starred" : "non-starred"
+                            iconName: (mainView.editedCalculationIndex == model.index || model.isFavourite) ? "starred" : "non-starred"
 
                             text: i18n.tr("Add to favorites")
                             onTriggered: {
@@ -540,11 +537,8 @@
 
             ScrollableView {
                 anchors {
-                    top: header.bottom
-                    bottom: parent.bottom
+                    fill: parent
                     bottomMargin: textInputField.visible ? 0 : -keyboardLoader.height
-                    left: parent.left
-                    right: parent.right
                 }
                 id: scrollableView
                 objectName: "scrollableView"
@@ -748,4 +742,3 @@
         }
     }
 }
-

=== modified file 'app/ui/CalcKeyboard.qml'
--- app/ui/CalcKeyboard.qml	2015-06-21 22:59:38 +0000
+++ app/ui/CalcKeyboard.qml	2015-11-09 14:34:26 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Canonical Ltd
+ * Copyright (C) 2014-2015 Canonical Ltd
  *
  * This file is part of Ubuntu Calculator App
  *
@@ -15,8 +15,8 @@
  * 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.3
-import Ubuntu.Components 1.1
+import QtQuick 2.4
+import Ubuntu.Components 1.3
 
 Rectangle {
     id: virtualKeyboard

=== modified file 'app/ui/FavouritePage.qml'
--- app/ui/FavouritePage.qml	2015-06-12 01:55:49 +0000
+++ app/ui/FavouritePage.qml	2015-11-09 14:34:26 +0000
@@ -15,10 +15,10 @@
  * 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.3
+import QtQuick 2.4
 import QtQuick.Layouts 1.1
-import Ubuntu.Components 1.1
-import Ubuntu.Components.ListItems 1.0 as ListItem
+import Ubuntu.Components 1.3
+import Ubuntu.Components.ListItems 1.3 as ListItem
 
 import "../engine"
 import "../upstreamcomponents"

=== modified file 'app/ui/KeyboardButton.qml'
--- app/ui/KeyboardButton.qml	2015-05-27 23:55:16 +0000
+++ app/ui/KeyboardButton.qml	2015-11-09 14:34:26 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright 2013 Canonical Ltd.
+ * Copyright 2013, 2015 Canonical Ltd.
  *
  * This file is part of ubuntu-calculator-app.
  *
@@ -16,8 +16,8 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-import QtQuick 2.3
-import Ubuntu.Components 1.1
+import QtQuick 2.4
+import Ubuntu.Components 1.3
 
 AbstractButton {
     id: buttonRect

=== modified file 'app/ui/KeyboardPage.qml'
--- app/ui/KeyboardPage.qml	2015-03-06 21:13:52 +0000
+++ app/ui/KeyboardPage.qml	2015-11-09 14:34:26 +0000
@@ -1,5 +1,22 @@
-import QtQuick 2.3
-import Ubuntu.Components 1.1
+/*
+ * Copyright (C) 2015 Canonical Ltd
+ *
+ * This file is part of Ubuntu Calculator App
+ *
+ * Ubuntu Calculator App is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 3 as
+ * published by the Free Software Foundation.
+ *
+ * Ubuntu Calculator App 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
 
 Grid {
     id: keyboardRoot

=== modified file 'app/ui/LandscapeKeyboard.qml'
--- app/ui/LandscapeKeyboard.qml	2015-06-11 15:40:14 +0000
+++ app/ui/LandscapeKeyboard.qml	2015-11-09 14:34:26 +0000
@@ -1,5 +1,23 @@
-import QtQuick 2.3
-import Ubuntu.Components 1.1
+/*
+ * Copyright (C) 2015 Canonical Ltd
+ *
+ * This file is part of Ubuntu Calculator App
+ *
+ * Ubuntu Calculator App is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 3 as
+ * published by the Free Software Foundation.
+ *
+ * Ubuntu Calculator App 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
 
 CalcKeyboard {
     id: calcKeyboard

=== modified file 'app/ui/PortraitKeyboard.qml'
--- app/ui/PortraitKeyboard.qml	2015-06-16 10:26:39 +0000
+++ app/ui/PortraitKeyboard.qml	2015-11-09 14:34:26 +0000
@@ -1,5 +1,22 @@
-import QtQuick 2.3
-import Ubuntu.Components 1.1
+/*
+ * Copyright (C) 2015 Canonical Ltd
+ *
+ * This file is part of Ubuntu Calculator App
+ *
+ * Ubuntu Calculator App is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 3 as
+ * published by the Free Software Foundation.
+ *
+ * Ubuntu Calculator App 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
 
 CalcKeyboard {
     id: calcKeyboard

=== modified file 'app/ui/Screen.qml'
--- app/ui/Screen.qml	2015-06-16 12:39:11 +0000
+++ app/ui/Screen.qml	2015-11-09 14:34:26 +0000
@@ -15,8 +15,8 @@
  * 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.3
-import Ubuntu.Components 1.1
+import QtQuick 2.4
+import Ubuntu.Components 1.3
 
 import "../upstreamcomponents"
 import "../engine/formula.js" as Formula

=== modified file 'app/ui/ScrollableView.qml'
--- app/ui/ScrollableView.qml	2015-02-13 22:20:01 +0000
+++ app/ui/ScrollableView.qml	2015-11-09 14:34:26 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Canonical Ltd
+ * Copyright (C) 2014-2015 Canonical Ltd
  *
  * This file is part of Ubuntu Calculator App
  *
@@ -15,7 +15,7 @@
  * 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.3
+import QtQuick 2.4
 
 Flickable {
     id: flickableHistory

=== modified file 'app/upstreamcomponents/EmptyState.qml'
--- app/upstreamcomponents/EmptyState.qml	2015-03-06 18:09:49 +0000
+++ app/upstreamcomponents/EmptyState.qml	2015-11-09 14:34:26 +0000
@@ -1,5 +1,5 @@
-import QtQuick 2.0
-import Ubuntu.Components 1.1
+import QtQuick 2.4
+import Ubuntu.Components 1.3
 
 /*
  Component which displays an empty state (approved by design). It offers an

=== modified file 'app/upstreamcomponents/ListItemWithActions.qml'
--- app/upstreamcomponents/ListItemWithActions.qml	2015-02-02 20:35:38 +0000
+++ app/upstreamcomponents/ListItemWithActions.qml	2015-11-09 14:34:26 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012-2014 Canonical, Ltd.
+ * Copyright (C) 2012-2015 Canonical, Ltd.
  *
  * 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
@@ -14,8 +14,8 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-import QtQuick 2.2
-import Ubuntu.Components 1.1
+import QtQuick 2.4
+import Ubuntu.Components 1.3
 
 Item {
     id: root

=== modified file 'app/upstreamcomponents/ListItemWithActionsCheckBox.qml'
--- app/upstreamcomponents/ListItemWithActionsCheckBox.qml	2014-12-03 22:54:49 +0000
+++ app/upstreamcomponents/ListItemWithActionsCheckBox.qml	2015-11-09 14:34:26 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012-2014 Canonical, Ltd.
+ * Copyright (C) 2012-2015 Canonical, Ltd.
  *
  * 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
@@ -14,8 +14,8 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-import QtQuick 2.2
-import Ubuntu.Components 1.1
+import QtQuick 2.4
+import Ubuntu.Components 1.3
 
 CheckBox {
     checked: root.selected

=== modified file 'app/upstreamcomponents/MultipleSelectionVisualModel.qml'
--- app/upstreamcomponents/MultipleSelectionVisualModel.qml	2015-01-09 17:32:44 +0000
+++ app/upstreamcomponents/MultipleSelectionVisualModel.qml	2015-11-09 14:34:26 +0000
@@ -14,7 +14,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-import QtQuick 2.2
+import QtQuick 2.4
 
 VisualDataModel {
     id: visualModel

=== modified file 'app/upstreamcomponents/PageWithBottomEdge.qml'
--- app/upstreamcomponents/PageWithBottomEdge.qml	2015-01-28 21:32:05 +0000
+++ app/upstreamcomponents/PageWithBottomEdge.qml	2015-11-09 14:34:26 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Canonical, Ltd.
+ * Copyright (C) 2014-2015 Canonical, Ltd.
  *
  * 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
@@ -62,8 +62,8 @@
 
 */
 
-import QtQuick 2.2
-import Ubuntu.Components 1.1
+import QtQuick 2.4
+import Ubuntu.Components 1.3
 
 Page {
     id: page
@@ -105,7 +105,7 @@
             edgeLoader.item.active = true
             page.pageStack.push(edgeLoader.item)
             if (edgeLoader.item.flickable) {
-                edgeLoader.item.flickable.contentY = -page.header.height
+                //edgeLoader.item.flickable.contentY = -page.header.height
                 edgeLoader.item.flickable.returnToBounds()
             }
             if (edgeLoader.item.ready)