Merge lp:~renatofilho/address-book-app/buteo-qml into lp:address-book-app

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Approved by: Michael Sheldon
Approved revision: 460
Merged at revision: 477
Proposed branch: lp:~renatofilho/address-book-app/buteo-qml
Merge into: lp:address-book-app
Diff against target: 211 lines (+45/-13)
8 files modified
debian/control (+2/-2)
src/app/addressbookapp.cpp (+10/-0)
src/app/addressbookapp.h (+6/-2)
src/imports/ABContactListPage.qml (+1/-1)
src/imports/Ubuntu/AddressBook/ContactEditor/ContactDetailSyncTargetEditor.qml (+14/-0)
src/imports/Ubuntu/Contacts/ContactListView.qml (+11/-6)
src/imports/Ubuntu/Contacts/OnlineAccountsHelper.qml (+1/-1)
src/imports/Ubuntu/Contacts/simcardcontacts.cpp (+0/-1)
To merge this branch: bzr merge lp:~renatofilho/address-book-app/buteo-qml
Reviewer Review Type Date Requested Status
Ken VanDine packaging Approve
Michael Sheldon (community) Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+264294@code.launchpad.net

Commit message

Replace sync-monitor with buteo qml component.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
457. By Renato Araujo Oliveira Filho

Show Address book icon if available.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
458. By Renato Araujo Oliveira Filho

Use iconSource property on OptionSelectorDelegate instead of icon.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
459. By Renato Araujo Oliveira Filho

Hide sync button if the device goes offline.

460. By Renato Araujo Oliveira Filho

Removed ununsed include.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

Are there any related MPs required for this MP to build/function as expected?
 - https://code.launchpad.net/~renatofilho/address-book-app/buteo-qml/+merge/264294

Is your branch in sync with latest trunk?
YES

Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator?
YES

Did you successfully run all tests found in your component's Test Plan on device or emulator?
YES

If you changed the UI, was the change specified/approved by design?
NO UI CHANGED

If you changed UI labels, did you update the pot file?
NO LABEL CHANGED

If you changed the packaging (debian), did you add a core-dev as a reviewer to this MP?
YES

Revision history for this message
Michael Sheldon (michael-sheldon) wrote :

Code looks good to me

review: Approve
Revision history for this message
Ken VanDine (ken-vandine) wrote :

Packaging changes look fine

review: Approve (packaging)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2015-05-14 21:23:43 +0000
3+++ debian/control 2015-07-21 18:04:28 +0000
4@@ -18,7 +18,7 @@
5 qtdeclarative5-ubuntu-content1 [i386 amd64 armhf],
6 qtdeclarative5-ubuntu-history0.1 [i386 amd64 armhf],
7 qtdeclarative5-ubuntu-keyboard-extensions0.1 [i386 amd64 armhf],
8- qtdeclarative5-ubuntu-syncmonitor0.1 [i386 amd64 armhf],
9+ qtdeclarative5-buteo-syncfw0.1 [i386 amd64 armhf],
10 qtdeclarative5-ubuntu-telephony-phonenumber0.1 [i386 amd64 armhf],
11 qtdeclarative5-ubuntu-ui-toolkit-plugin [i386 amd64 armhf],
12 qt5-default,
13@@ -62,7 +62,7 @@
14 Depends: qtdeclarative5-accounts-plugin,
15 qtdeclarative5-online-accounts-client0.1,
16 qtdeclarative5-qtquick2-plugin,
17- qtdeclarative5-ubuntu-syncmonitor0.1,
18+ qtdeclarative5-buteo-syncfw0.1,
19 qtdeclarative5-ubuntu-ui-toolkit-plugin (>= 0.1.46+14.10.20140527) | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles,
20 qtdeclarative5-qtcontacts-plugin,
21 suru-icon-theme,
22
23=== modified file 'src/app/addressbookapp.cpp'
24--- src/app/addressbookapp.cpp 2015-06-08 15:59:22 +0000
25+++ src/app/addressbookapp.cpp 2015-07-21 18:04:28 +0000
26@@ -100,6 +100,7 @@
27 AddressBookApp::AddressBookApp(int &argc, char **argv)
28 : QGuiApplication(argc, argv),
29 m_view(0),
30+ m_netManager(new QNetworkConfigurationManager),
31 m_pickingMode(false),
32 m_testMode(false),
33 m_withArgs(false)
34@@ -107,6 +108,10 @@
35 s_elapsed.start();
36 setOrganizationName("com.ubuntu.address-book");
37 setApplicationName("AddressBookApp");
38+ connect(m_netManager.data(),
39+ SIGNAL(onlineStateChanged(bool)),
40+ SIGNAL(isOnlineChanged()),
41+ Qt::QueuedConnection);
42 }
43
44 bool AddressBookApp::setup()
45@@ -414,3 +419,8 @@
46 Q_EMIT callbackApplicationChanged();
47 }
48 }
49+
50+bool AddressBookApp::isOnline() const
51+{
52+ return m_netManager->isOnline();
53+}
54
55=== modified file 'src/app/addressbookapp.h'
56--- src/app/addressbookapp.h 2015-06-08 15:59:22 +0000
57+++ src/app/addressbookapp.h 2015-07-21 18:04:28 +0000
58@@ -21,12 +21,14 @@
59 #include <QtDBus/QDBusInterface>
60 #include <QtGui/QGuiApplication>
61 #include <QtQuick/QQuickView>
62+#include <QtNetwork/QNetworkConfigurationManager>
63
64 class AddressBookApp : public QGuiApplication
65 {
66 Q_OBJECT
67 Q_PROPERTY(bool firstRun READ isFirstRun CONSTANT)
68 Q_PROPERTY(QString callbackApplication READ callbackApplication WRITE setCallbackApplication NOTIFY callbackApplicationChanged)
69+ Q_PROPERTY(bool isOnline READ isOnline NOTIFY isOnlineChanged)
70
71 public:
72 AddressBookApp(int &argc, char **argv);
73@@ -37,10 +39,11 @@
74 QString callbackApplication() const;
75 void setCallbackApplication(const QString &application);
76
77+ bool isOnline() const;
78+
79 Q_SIGNALS:
80- void syncingChanged();
81- void syncEnabledChanged();
82 void callbackApplicationChanged();
83+ void isOnlineChanged();
84
85 public Q_SLOTS:
86 void activateWindow();
87@@ -59,6 +62,7 @@
88
89 private:
90 QQuickView *m_view;
91+ QScopedPointer<QNetworkConfigurationManager> m_netManager;
92 QString m_initialArg;
93 QString m_callbackApplication;
94 bool m_viewReady;
95
96=== modified file 'src/imports/ABContactListPage.qml'
97--- src/imports/ABContactListPage.qml 2015-06-10 17:24:55 +0000
98+++ src/imports/ABContactListPage.qml 2015-07-21 18:04:28 +0000
99@@ -226,7 +226,7 @@
100 }
101 },
102 Action {
103- visible: contactList.syncEnabled
104+ visible: (application.isOnline && contactList.syncEnabled)
105 text: contactList.syncing ? i18n.tr("Syncing") : i18n.tr("Sync")
106 iconName: "reload"
107 enabled: !contactList.syncing
108
109=== modified file 'src/imports/Ubuntu/AddressBook/ContactEditor/ContactDetailSyncTargetEditor.qml'
110--- src/imports/Ubuntu/AddressBook/ContactEditor/ContactDetailSyncTargetEditor.qml 2015-05-07 17:27:16 +0000
111+++ src/imports/Ubuntu/AddressBook/ContactEditor/ContactDetailSyncTargetEditor.qml 2015-07-21 18:04:28 +0000
112@@ -108,6 +108,20 @@
113
114 delegate: OptionSelectorDelegate {
115 text: contact.displayLabel.label
116+ constrainImage: true
117+ iconSource: {
118+ var details = contact.details(ContactDetail.ExtendedDetail)
119+ for(var i in details) {
120+ if (details[i].name === "PROVIDER") {
121+ if (details[i].data === "") {
122+ return "image://theme/address-book-app-symbolic"
123+ } else {
124+ return "image://theme/online-accounts-%1".arg(details[i].data)
125+ }
126+ }
127+ }
128+ return "image://theme/address-book-app-symbolic"
129+ }
130 height: units.gu(4)
131 }
132
133
134=== modified file 'src/imports/Ubuntu/Contacts/ContactListView.qml'
135--- src/imports/Ubuntu/Contacts/ContactListView.qml 2015-06-01 22:13:47 +0000
136+++ src/imports/Ubuntu/Contacts/ContactListView.qml 2015-07-21 18:04:28 +0000
137@@ -19,7 +19,7 @@
138
139 import Ubuntu.Components 1.1
140 import Ubuntu.Components.ListItems 1.0 as ListItem
141-import Ubuntu.SyncMonitor 0.1
142+import Buteo 0.1
143
144 /*!
145 \qmltype ContactListView
146@@ -204,13 +204,18 @@
147
148 This property holds if the list is running a sync with online accounts or not
149 */
150- readonly property bool syncing: (syncMonitor.state === "syncing")
151+ readonly property alias syncing: buteoSync.syncing
152 /*!
153 \qmlproperty bool syncEnabled
154
155 This property holds if there is online account to sync or not
156 */
157- readonly property bool syncEnabled: syncMonitor.enabledServices ? syncMonitor.serviceIsEnabled("contacts") : false
158+ // we are using 'buteoSync.visibleSyncProfiles because' it is a property
159+ // and will re-check if the property changes.
160+ // Using only '(buteoSync.syncProfilesByCategory("contacts").length > 0)'
161+ // the value will be checked only on app startup
162+ readonly property bool syncEnabled: buteoSync.visibleSyncProfiles &&
163+ (buteoSync.syncProfilesByCategory("contacts").length > 0)
164 /*!
165 \qmlproperty bool busy
166
167@@ -340,7 +345,7 @@
168 */
169 function sync()
170 {
171- syncMonitor.sync(["contacts"])
172+ buteoSync.startSyncByCategory("contacts")
173 }
174
175 ContactSimpleListView {
176@@ -538,8 +543,8 @@
177 }
178 }
179
180- SyncMonitor {
181- id: syncMonitor
182+ ButeoSync {
183+ id: buteoSync
184 }
185
186 SIMList {
187
188=== modified file 'src/imports/Ubuntu/Contacts/OnlineAccountsHelper.qml'
189--- src/imports/Ubuntu/Contacts/OnlineAccountsHelper.qml 2015-02-09 13:25:01 +0000
190+++ src/imports/Ubuntu/Contacts/OnlineAccountsHelper.qml 2015-07-21 18:04:28 +0000
191@@ -33,7 +33,7 @@
192 }
193 Setup {
194 id: setup
195- applicationId: "contacts-sync"
196+ applicationId: "address-book-app"
197 providerId: "google"
198 onFinished: {
199 root.running = false
200
201=== modified file 'src/imports/Ubuntu/Contacts/simcardcontacts.cpp'
202--- src/imports/Ubuntu/Contacts/simcardcontacts.cpp 2015-05-27 22:49:00 +0000
203+++ src/imports/Ubuntu/Contacts/simcardcontacts.cpp 2015-07-21 18:04:28 +0000
204@@ -19,7 +19,6 @@
205 #include <QDebug>
206 #include <QDBusConnection>
207 #include <qofonophonebook.h>
208-#include <qofono-qt5/dbus/ofonophonebook.h>
209
210 SimCardContacts::SimCardContacts(QObject *parent)
211 : QObject(parent),

Subscribers

People subscribed via source and target branches