Merge lp:~renatofilho/address-book-app/fix-1199122-phase2 into lp:address-book-app

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Approved by: Gustavo Pichorim Boiko
Approved revision: 41
Merged at revision: 42
Proposed branch: lp:~renatofilho/address-book-app/fix-1199122-phase2
Merge into: lp:address-book-app
Diff against target: 131 lines (+84/-13)
3 files modified
src/imports/ContactEdit/CMakeLists.txt (+1/-0)
src/imports/ContactEdit/ContactEditor.qml (+24/-13)
src/imports/ContactEdit/EditToolbar.qml (+59/-0)
To merge this branch: bzr merge lp:~renatofilho/address-book-app/fix-1199122-phase2
Reviewer Review Type Date Requested Status
Gustavo Pichorim Boiko (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+178352@code.launchpad.net

Commit message

Replaced contact edit toolbar to a sheet component.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Gustavo Pichorim Boiko (boiko) wrote :

Looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/imports/ContactEdit/CMakeLists.txt'
2--- src/imports/ContactEdit/CMakeLists.txt 2013-07-16 18:05:26 +0000
3+++ src/imports/ContactEdit/CMakeLists.txt 2013-08-02 17:47:26 +0000
4@@ -8,6 +8,7 @@
5 ContactDetailPhoneNumbersEditor.qml
6 ContactDetailWithTypeEditor.qml
7 ContactEditor.qml
8+ EditToolbar.qml
9 TextInputDetail.qml
10 ValueSelector.qml
11 )
12
13=== modified file 'src/imports/ContactEdit/ContactEditor.qml'
14--- src/imports/ContactEdit/ContactEditor.qml 2013-08-01 18:44:51 +0000
15+++ src/imports/ContactEdit/ContactEditor.qml 2013-08-02 17:47:26 +0000
16@@ -76,7 +76,12 @@
17 id: scrollArea
18
19 flickableDirection: Flickable.VerticalFlick
20- anchors.fill: parent
21+ anchors {
22+ left: parent.left
23+ right: parent.right
24+ top: parent.top
25+ bottom: toolbar.top
26+ }
27 contentHeight: contents.height
28 contentWidth: parent.width
29 visible: !busyIndicator.visible
30@@ -181,19 +186,25 @@
31 }
32 }
33
34- tools: ToolbarItems {
35- locked: true
36- opened: true
37- ToolbarButton {
38- action: Action {
39- text: i18n.tr("Done")
40- iconSource: "artwork:/save.png"
41- onTriggered: {
42- // wait for contact to be saved or cause a error
43- contactSaveLock.saving = true
44- contactEditor.save()
45- }
46+ EditToolbar {
47+ id: toolbar
48+ anchors {
49+ left: parent.left
50+ right: parent.right
51+ bottom: parent.bottom
52+ }
53+ height: units.gu(6)
54+ acceptAction: Action {
55+ text: i18n.tr("Save")
56+ onTriggered: {
57+ // wait for contact to be saved or cause a error
58+ contactSaveLock.saving = true
59+ contactEditor.save()
60 }
61 }
62+ rejectAction: Action {
63+ text: i18n.tr("Cancel")
64+ onTriggered: pageStack.pop()
65+ }
66 }
67 }
68
69=== added file 'src/imports/ContactEdit/EditToolbar.qml'
70--- src/imports/ContactEdit/EditToolbar.qml 1970-01-01 00:00:00 +0000
71+++ src/imports/ContactEdit/EditToolbar.qml 2013-08-02 17:47:26 +0000
72@@ -0,0 +1,59 @@
73+/*
74+ * Copyright (C) 2012-2013 Canonical, Ltd.
75+ *
76+ * This program is free software; you can redistribute it and/or modify
77+ * it under the terms of the GNU General Public License as published by
78+ * the Free Software Foundation; version 3.
79+ *
80+ * This program is distributed in the hope that it will be useful,
81+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
82+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
83+ * GNU General Public License for more details.
84+ *
85+ * You should have received a copy of the GNU General Public License
86+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
87+ */
88+
89+import QtQuick 2.0
90+import Ubuntu.Components 0.1
91+import Ubuntu.Components.ListItems 0.1 as ListItem
92+
93+Rectangle {
94+ id: root
95+
96+ signal reject()
97+ signal accept()
98+
99+ property alias acceptAction: accept.action
100+ property alias rejectAction: reject.action
101+
102+ color: "gray"
103+
104+ Button {
105+ id: reject
106+
107+ action: Action {
108+ text: i18n.tr("Cancel")
109+ }
110+ anchors {
111+ left: parent.left
112+ leftMargin: units.gu(1)
113+ verticalCenter: parent.verticalCenter
114+ }
115+ onClicked: root.reject()
116+ }
117+
118+ Button {
119+ id: accept
120+
121+ action: Action {
122+ text: i18n.tr("Done")
123+ }
124+ anchors {
125+ right: parent.right
126+ rightMargin: units.gu(1)
127+ verticalCenter: parent.verticalCenter
128+ }
129+ onClicked: root.accept()
130+ }
131+}

Subscribers

People subscribed via source and target branches