Merge lp:~libqtelegram-team/telegram-app/converged into lp:telegram-app

Proposed by Michał Karnicki on 2016-02-23
Status: Merged
Approved by: Jin on 2016-03-14
Approved revision: 158
Merged at revision: 163
Proposed branch: lp:~libqtelegram-team/telegram-app/converged
Merge into: lp:telegram-app
Diff against target: 1014 lines (+258/-209)
22 files modified
telegram/app/asemantools/qml/AsemanTools/Button.qml (+0/-1)
telegram/app/qml/AccountAddContactHeader.qml (+1/-1)
telegram/app/qml/AccountContactsPage.qml (+5/-5)
telegram/app/qml/AccountDialogList.qml (+3/-0)
telegram/app/qml/AccountDialogPage.qml (+3/-6)
telegram/app/qml/AccountListItem.qml (+4/-10)
telegram/app/qml/AccountLoading.qml (+0/-3)
telegram/app/qml/AccountMessageList.qml (+4/-4)
telegram/app/qml/AccountNamePage.qml (+1/-1)
telegram/app/qml/AccountPage.qml (+19/-21)
telegram/app/qml/AccountSendMessage.qml (+0/-2)
telegram/app/qml/AccountSettings.qml (+6/-6)
telegram/app/qml/AccountUsernamePage.qml (+1/-1)
telegram/app/qml/AddContactPage.qml (+2/-2)
telegram/app/qml/IntroPage.qml (+156/-121)
telegram/app/qml/PickerPage.qml (+2/-2)
telegram/app/qml/PreviewPage.qml (+4/-4)
telegram/app/qml/ProfilePage.qml (+4/-5)
telegram/app/qml/components/DialogsListItem.qml (+3/-1)
telegram/app/qml/components/TelegramContactsListItem.qml (+1/-1)
telegram/app/qml/telegram.qml (+39/-10)
telegram/app/telegram.desktop (+0/-2)
To merge this branch: bzr merge lp:~libqtelegram-team/telegram-app/converged
Reviewer Review Type Date Requested Status
Roberto Mier Escandón  2016-02-23 Approve on 2016-03-11
Review via email: mp+286861@code.launchpad.net
To post a comment you must log in.

There are conflicts... Also I see there are 64755 modified lines, most of them are related with the .po files. Is that right?

review: Needs Fixing
Jin (jindallo) wrote :

Hello Roberto,

Yes, since Karni and I folk this branch from 2.0.5.0 to develop this feature,
the conflicts need to be resolved is expected..

And for the huge amount of modified lines,
we don't have modification on .po files actually,
I will bzr ignore that so that make this clean.

Jin (jindallo) wrote :

Hello Roberto,

After checked,
the .po files need an update from karni -> jin,
in the path I think that will be acceptable,
since I will build out the click package for releasing,
from main trunk so this make sense to me.
What do you think?

And for the version indicated files: version.js/manifest.json.in,
I will bump that after merge this branch into trunk.

For MessageReplyItem.qml,
there is one conflict from the modification by Michael with trunk:r158,
I will resolve this one later, thanks!

For en_GB.po, I will check this as well,
since I always rebuild the .po from main trunk to release this application,
that is not a big problem at the moment I think,
anyway, any questions from you is very helpful, thanks!

Jin (jindallo) wrote :

A newer commit is ongoing,
to merge trunk into the branch.

157. By Jin on 2016-03-11

Merge trunk

Jin (jindallo) wrote :

Hello Roberto,

I just submitted the r157: "Merge trunk" to this branch,
code rebased successfully, no conflicts now.

As I stated this change also includes the minor .po changes,
to modify the moderator from karni -> jin in the path,
since I will release main trunk with that after review pass.

Only reviewed code, not tested, but lgtm

review: Approve
Jin (jindallo) :
158. By Jin on 2016-03-11

Review patch 01 - comment removed

Jin (jindallo) wrote :

Merge proposal had been patched according to Roberto's comment,
please have a look there and thanks for his feedback.

David Planella (dpm) wrote :

Please note that as translations are done in Launchpad and that no
translators modify the .po files directly, I think the best thing would be
to ignore the .po file changes. Especially as we've got LP set up *not* to
import .po file translations.

So translations go only in one direction Translator -> LP web UI -> bzr

Cheers,
David.

On Fri, Mar 11, 2016 at 9:59 AM, Jin <email address hidden> wrote:

> Merge proposal had been patched according to Roberto's comment,
> please have a look there and thanks for his feedback.
> --
>
> https://code.launchpad.net/~libqtelegram-team/telegram-app/converged/+merge/286861
> Your team libqtelegram team is subscribed to branch lp:telegram-app.
>

Jin (jindallo) wrote :

Hello David,

Thanks for your reminder,
I just had a merge proposal for doing this according to your comment,
please help me to approve that if no any concerns/problems from you,
really thanks.
    https://code.launchpad.net/~libqtelegram-team/telegram-app/remove-po-files-from-version-control/+merge/288883

159. By Jin on 2016-03-14

Review patch 02 - leave .po files alone

160. By Jin on 2016-03-14

Review patch 03 - .po files sync with main trunk

161. By Jin on 2016-03-14

Review patch 04 - .pot file sync with main trunk

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'telegram/app/asemantools/qml/AsemanTools/Button.qml'
2--- telegram/app/asemantools/qml/AsemanTools/Button.qml 2015-09-22 09:57:07 +0000
3+++ telegram/app/asemantools/qml/AsemanTools/Button.qml 2016-03-14 17:04:41 +0000
4@@ -39,7 +39,6 @@
5 property bool press: marea.pressed
6 property bool enter: marea.containsMouse
7
8- property color highlightColor: masterPalette.highlight
9 property string normalColor: "#00000000"
10 property string hoverColor: normalColor
11
12
13=== modified file 'telegram/app/qml/AccountAddContactHeader.qml'
14--- telegram/app/qml/AccountAddContactHeader.qml 2015-11-02 19:05:09 +0000
15+++ telegram/app/qml/AccountAddContactHeader.qml 2016-03-14 17:04:41 +0000
16@@ -22,7 +22,7 @@
17 property bool isForeign: user == telegramObject.nullUser ? false : user.classType == typeUserForeign
18
19 function addContact() {
20- pageStack.push(add_contact_page_component, {
21+ pageStack.addPageToNextColumn(page, add_contact_page_component, {
22 "telegram": telegramObject,
23 "user": user
24 });
25
26=== modified file 'telegram/app/qml/AccountContactsPage.qml'
27--- telegram/app/qml/AccountContactsPage.qml 2015-09-30 14:55:01 +0000
28+++ telegram/app/qml/AccountContactsPage.qml 2016-03-14 17:04:41 +0000
29@@ -128,7 +128,6 @@
30 text: i18n.tr("Back")
31 onTriggered: {
32 page.state = "default"
33- pageStack.pop();
34 }
35 }
36 }
37@@ -265,7 +264,7 @@
38 // refreshSubtitle();
39 } else if (newSecretChatMode) {
40 telegramObject.messagesCreateEncryptedChat(model.id);
41- pageStack.pop();
42+ pageStack.clear();
43 } else if (addToGroupMode) {
44 var dialog = PopupUtils.open(add_contact_to_group_chat_component);
45 dialog.setData(user.id, user.fullName, groupChatTitle);
46@@ -280,8 +279,9 @@
47 }
48
49 onSelectionCanceled: {
50- groupChatMode = false;
51+ list.clear();
52 state = "default";
53+ pageStack.clear();
54 }
55
56 onSelectionDone: {
57@@ -289,7 +289,7 @@
58 telegram.messagesCreateChat(list.list, groupChatTitle);
59 state = "default";
60 groupChatTitle = "";
61- pageStack.pop();
62+ pageStack.clear();
63 }
64
65 function refreshSubtitle() {
66@@ -490,7 +490,7 @@
67 if (contacts.length === 1) {
68 var singleContact = parseContact(contacts[0]);
69 importedContactCount = 1;
70- pageStack.push(add_contact_page_component, {
71+ pageStack.addPageToNextColumn(page, add_contact_page_component, {
72 "telegram": telegram,
73 "addManually": true,
74 "contact": singleContact
75
76=== modified file 'telegram/app/qml/AccountDialogList.qml'
77--- telegram/app/qml/AccountDialogList.qml 2015-10-07 13:46:58 +0000
78+++ telegram/app/qml/AccountDialogList.qml 2016-03-14 17:04:41 +0000
79@@ -84,6 +84,9 @@
80 }
81
82 onCurrentDialogChanged: {
83+ if (list_item.width > units.gu(35)) {
84+ currentDialog = telegramObject.nullDialog;
85+ }
86 currentDialog = dialog;
87 }
88
89
90=== modified file 'telegram/app/qml/AccountDialogPage.qml'
91--- telegram/app/qml/AccountDialogPage.qml 2016-02-20 22:08:02 +0000
92+++ telegram/app/qml/AccountDialogPage.qml 2016-03-14 17:04:41 +0000
93@@ -83,7 +83,7 @@
94 if (message_list.inSelectionMode) {
95 message_list.cancelSelection()
96 } else {
97- pageStack.pop();
98+ pageStack.removePages(pageStack.primaryPage);
99 }
100 }
101 }
102@@ -106,7 +106,7 @@
103
104 onHeaderClicked: {
105 Qt.inputMethod.hide();
106- pageStack.push(profile_page_component, {
107+ pageStack.addPageToNextColumn(dialog_page, profile_page_component, {
108 telegram: dialog_page.telegramObject,
109 dialog: dialog_page.currentDialog
110 });
111@@ -127,8 +127,6 @@
112 Item {
113 id: message_box
114 anchors {
115- // FIXME message_list sills under Page header! :/
116- topMargin: units.gu(6)
117 fill: parent
118 }
119
120@@ -185,7 +183,6 @@
121 }
122
123 function closeChat() {
124- pageStack.pop()
125+ pageStack.clear();
126 }
127 }
128-
129
130=== modified file 'telegram/app/qml/AccountListItem.qml'
131--- telegram/app/qml/AccountListItem.qml 2016-02-08 14:48:02 +0000
132+++ telegram/app/qml/AccountListItem.qml 2016-03-14 17:04:41 +0000
133@@ -27,8 +27,8 @@
134 }
135
136 function show() {
137- pageStack.clear();
138- dialogsPage = pageStack.push(dialogs_page_component);
139+ console.log("calling show");
140+ pageStack.primaryPageSource = dialogs_page_component;
141 }
142
143 QtObject {
144@@ -92,7 +92,7 @@
145 }
146 onAuthCodeRequested: {
147 console.log("authCodeRequested");
148- var page = pageStack.push(account_code_page_component, {
149+ pageStack.addPageToCurrentColumn(pageStack.primaryPage, account_code_page_component, {
150 "phoneRegistered": telegram.authPhoneRegistered,
151 "timeOut": sendCallTimeout
152 });
153@@ -102,13 +102,7 @@
154
155 if (authLoggedIn) {
156 console.log("authLoggedIn true");
157- if (pageStack.currentPage &&
158- pageStack.currentPage.objectName === "auth_code_page") {
159- pageStack.clear();
160- }
161- if (pageStack.depth === 0) {
162- account_list_item.show();
163- }
164+ account_list_item.show();
165
166 if (Cutegram.pushNumber == "") {
167 Cutegram.pushNumber = phoneNumber;
168
169=== modified file 'telegram/app/qml/AccountLoading.qml'
170--- telegram/app/qml/AccountLoading.qml 2015-09-22 09:57:07 +0000
171+++ telegram/app/qml/AccountLoading.qml 2016-03-14 17:04:41 +0000
172@@ -4,7 +4,6 @@
173 Rectangle {
174 width: 100
175 height: 62
176- color: backColor0
177 visible: active
178
179 property bool active: false
180@@ -40,7 +39,6 @@
181 anchors.horizontalCenter: parent.horizontalCenter
182 font.family: AsemanApp.globalFont.family
183 font.pixelSize: Math.floor(11*Devices.fontDensity)
184- color: textColor0
185 text: qsTr("Loading...")
186 }
187 }
188@@ -53,7 +51,6 @@
189 font.family: AsemanApp.globalFont.family
190 font.pixelSize: 10*Devices.fontDensity
191 font.underline: true
192- color: masterPalette.highlight
193 text: qsTr("Login again")
194 visible: false
195
196
197=== modified file 'telegram/app/qml/AccountMessageList.qml'
198--- telegram/app/qml/AccountMessageList.qml 2016-03-01 00:35:51 +0000
199+++ telegram/app/qml/AccountMessageList.qml 2016-03-14 17:04:41 +0000
200@@ -318,7 +318,7 @@
201 break;
202 case FileHandler.TypeTargetMediaDocument:
203 // TODO export document
204- pageStack.push(picker_page_component, {
205+ pageStack.addPageToCurrentColumn(dialog_page, picker_page_component, {
206 "url": path,
207 "handler": ContentHandler.Destination,
208 "contentType": ContentType.All
209@@ -327,7 +327,7 @@
210 case FileHandler.TypeTargetMediaAudio:
211 return;
212 }
213- pageStack.push(preview_page_component, properties);
214+ pageStack.addPageToCurrentColumn(dialog_page, preview_page_component, properties);
215 }
216 }
217
218@@ -357,7 +357,7 @@
219
220 PhysicalScrollBar {
221 scrollArea: mlist; height: mlist.height-bottomMargin-topMargin; width: 6*Devices.density
222- anchors.right: mlist.right; anchors.top: mlist.top; color: textColor0
223+ anchors.right: mlist.right; anchors.top: mlist.top;
224 anchors.topMargin: topMargin; reverse: true
225 }
226
227@@ -541,7 +541,7 @@
228
229 function forwardMessages(messageIds) {
230 forwardRequest(messageIds);
231- pageStack.pop();
232+ pageStack.clear();
233 }
234
235 function sendMessage( txt, inReplyTo ) {
236
237=== modified file 'telegram/app/qml/AccountNamePage.qml'
238--- telegram/app/qml/AccountNamePage.qml 2015-09-30 14:55:01 +0000
239+++ telegram/app/qml/AccountNamePage.qml 2016-03-14 17:04:41 +0000
240@@ -28,7 +28,7 @@
241 error = "";
242 if (firstName.length > 0) {
243 telegram.accountUpdateProfile(firstName, lastName);
244- pageStack.pop();
245+ pageStack.removePages(page);
246 } else {
247 // TRANSLATORS: Error message when first name was not provided.
248 error = i18n.tr("First name is required.");
249
250=== modified file 'telegram/app/qml/AccountPage.qml'
251--- telegram/app/qml/AccountPage.qml 2015-11-02 19:05:09 +0000
252+++ telegram/app/qml/AccountPage.qml 2016-03-14 17:04:41 +0000
253@@ -15,7 +15,7 @@
254 id: account_page
255
256 property int profileCount: 0
257- property AccountDialogPage dialogPage;
258+ property var dialogPage;
259
260 property alias telegramObject: dialogs.telegramObject
261 property alias currentDialog: dialogs.currentDialog
262@@ -24,12 +24,7 @@
263 signal addParticipantRequest()
264
265 onOpenDialog: {
266- // while (pageStack.currentPage && pageStack.currentPage.objectName != "accountPage") {
267- // console.log("popping: " + pageStack.currentPage.objectName);
268- // pageStack.pop();
269- // }
270-
271- pageStack.pop();
272+ pageStack.clear();
273 account_page.currentDialog = telegramObject.fakeDialogObject(dialogId, false);
274 }
275
276@@ -45,7 +40,7 @@
277 // acc_frame.activeRequest()
278 // Cutegram.active()
279
280- pageStack.push(account_dialog_page, {
281+ pageStack.addPageToNextColumn(pageStack.primaryPage, account_dialog_page, {
282 "telegramObject": telegramObject,
283 "currentDialog": currentDialog
284 });
285@@ -90,27 +85,27 @@
286 z: 10
287
288 onNewSecretChatClicked: {
289- pageStack.push(contacts_page_component, {
290+ pageStack.addPageToCurrentColumn(pageStack.primaryPage, contacts_page_component, {
291 "telegram": telegramObject,
292 "state": "new-secret-chat"
293 });
294 }
295
296 onNewGroupClicked: {
297- pageStack.push(contacts_page_component, {
298+ pageStack.addPageToCurrentColumn(pageStack.primaryPage, contacts_page_component, {
299 "telegram": telegramObject,
300 "state": "new-group-chat"
301 });
302 }
303
304 onContactsClicked: {
305- pageStack.push(contacts_page_component, {
306+ pageStack.addPageToCurrentColumn(pageStack.primaryPage, contacts_page_component, {
307 "telegram": telegramObject
308 });
309 }
310
311 onSettingsClicked: {
312- pageStack.push(settings_page_component, {
313+ pageStack.addPageToNextColumn(pageStack.primaryPage, settings_page_component, {
314 "telegram": telegramObject
315 });
316 }
317@@ -120,7 +115,7 @@
318 }
319
320 onAddAccountClicked: {
321- pageStack.push(auth_countries_page_component);
322+ pageStack.addPageToCurrentColumn(pageStack.primaryPage, auth_countries_page_component);
323 }
324
325 onAccountClicked: {
326@@ -180,8 +175,15 @@
327
328 onCurrentDialogChanged: {
329 if (currentDialog && currentDialog != telegramObject.nullDialog) {
330- if (pageStack.currentPage && pageStack.currentPage.objectName != "dialogPage")
331- dialogPage = pageStack.push(account_dialog_page, {"maxId": 0});
332+ pageStack.clear();
333+ var incubator = pageStack.addPageToNextColumn(pageStack.primaryPage, account_dialog_page, {"maxId": 0});
334+ if (incubator && incubator.status == Component.Loading) {
335+ incubator.onStatusChanged = function(status) {
336+ if (status == Component.Ready) {
337+ dialogPage = incubator.object;
338+ }
339+ }
340+ }
341
342 var tag = currentDialog.peer.chatId ? currentDialog.peer.chatId : currentDialog.peer.userId;
343 pushClient.clearPersistent([tag]);
344@@ -239,10 +241,6 @@
345 onForwardRequest: {
346 dialogs.messageIdsToForward = messageIds;
347 }
348-
349- Component.onDestruction: {
350- dialogs.currentDialog = telegramObject.nullDialog;
351- }
352 }
353 }
354
355@@ -251,12 +249,12 @@
356
357 AccountContactsPage {
358 onSelected: {
359- pageStack.pop(); // remove self
360+ pageStack.clear();
361 account_page.currentDialog = telegramObject.fakeDialogObject(cid, false);
362 }
363
364 onAddContactManually: {
365- pageStack.push(add_contact_page_component, {
366+ pageStack.addPageToNextColumn(pageStack.primaryPage, add_contact_page_component, {
367 "telegram": telegramObject,
368 "addManually": true
369 });
370
371=== modified file 'telegram/app/qml/AccountSendMessage.qml'
372--- telegram/app/qml/AccountSendMessage.qml 2016-03-01 00:24:36 +0000
373+++ telegram/app/qml/AccountSendMessage.qml 2016-03-14 17:04:41 +0000
374@@ -21,8 +21,6 @@
375 color: "white"
376
377 property Dialog currentDialog
378- property real minimumHeight: Cutegram.currentTheme.sendFrameHeight*Devices.density
379-
380 property bool isChat: currentDialog != telegramObject.nullDialog ? currentDialog.peer.chatId != 0 : false
381
382 signal accepted( string text, int inReplyTo )
383
384=== modified file 'telegram/app/qml/AccountSettings.qml'
385--- telegram/app/qml/AccountSettings.qml 2015-11-16 11:26:36 +0000
386+++ telegram/app/qml/AccountSettings.qml 2016-03-14 17:04:41 +0000
387@@ -11,7 +11,7 @@
388 import "js/version.js" as Version
389
390 Page {
391- id: page
392+ id: settings_page
393
394 property Telegram telegram
395 property User user: telegram.user(telegram.me)
396@@ -38,12 +38,12 @@
397
398 function changeFullName() {
399 var properties = { "telegram": telegram, "firstName": user.firstName, "lastName": user.lastName };
400- pageStack.push(name_page_component, properties);
401+ pageStack.addPageToNextColumn(settings_page, name_page_component, properties);
402 }
403
404 function changeUsername() {
405 var properties = { "telegram": telegram };
406- pageStack.push(username_page_component, properties);
407+ pageStack.addPageToNextColumn(settings_page, username_page_component, properties);
408 }
409
410 function changeUserPhoto() {
411@@ -229,11 +229,11 @@
412 }
413 width: units.gu(9)
414 height: width
415- telegram: page.telegram
416- user: page.user
417+ telegram: settings_page.telegram
418+ user: settings_page.user
419
420 onClicked: {
421- pageStack.push(preview_page_component, {
422+ pageStack.addPageToNextColumn(settings_page, preview_page_component, {
423 "title": details_item.title,
424 "photoPreviewSource": path
425 });
426
427=== modified file 'telegram/app/qml/AccountUsernamePage.qml'
428--- telegram/app/qml/AccountUsernamePage.qml 2015-09-30 14:55:01 +0000
429+++ telegram/app/qml/AccountUsernamePage.qml 2016-03-14 17:04:41 +0000
430@@ -68,7 +68,7 @@
431
432 function updateUsername() {
433 telegram.accountUpdateUsername(username);
434- pageStack.pop();
435+ pageStack.removePages(page);
436 }
437
438 function updateProfile() {
439
440=== modified file 'telegram/app/qml/AddContactPage.qml'
441--- telegram/app/qml/AddContactPage.qml 2015-11-02 15:40:32 +0000
442+++ telegram/app/qml/AddContactPage.qml 2016-03-14 17:04:41 +0000
443@@ -237,7 +237,7 @@
444 } else if (importedCount === 1) {
445 console.log("contacts: imported 1")
446 errorText = "";
447- pageStack.pop();
448+ pageStack.removePages(page);
449 }
450 }
451
452@@ -248,7 +248,7 @@
453 message = message.replace("\u000A", " ");
454
455 Qt.openUrlExternally("message:///" + phone + "?text=" + message);
456- pageStack.pop();
457+ pageStack.clear();
458 }
459
460 onError: {
461
462=== modified file 'telegram/app/qml/IntroPage.qml'
463--- telegram/app/qml/IntroPage.qml 2015-09-30 14:55:01 +0000
464+++ telegram/app/qml/IntroPage.qml 2016-03-14 17:04:41 +0000
465@@ -1,5 +1,6 @@
466 import QtQuick 2.4
467 import Ubuntu.Components 1.3
468+import Ubuntu.Layouts 1.0
469
470 import "components"
471 import "js/colors.js" as Colors
472@@ -7,6 +8,7 @@
473 TelegramPage {
474 id: page
475
476+ property bool isWide: page.width > units.gu(70)
477 property alias startMessagingButton: startMessagingButton
478 property alias currentIndex: slider.currentIndex
479
480@@ -16,131 +18,164 @@
481 id: introModel
482 }
483
484- Rectangle {
485+ Layouts {
486+ id: layouts
487 anchors.fill: parent
488- color: Colors.intro_background
489-
490- CrossFadeImage {
491- id: icon
492-
493- anchors {
494- bottom: parent.verticalCenter
495- bottomMargin: units.gu(2)
496- horizontalCenter: parent.horizontalCenter
497- }
498- width: units.gu(16)
499- height: width
500- z: 2
501-
502- fadeDuration: 250
503- fillMode: Image.PreserveAspectFit
504- }
505-
506- ListView {
507- id: slider
508-
509+
510+ Item {
511 anchors.fill: parent
512- z: 1
513-
514- orientation: ListView.Horizontal
515- snapMode: ListView.SnapOneItem
516- boundsBehavior: Flickable.StopAtBounds
517- cacheBuffer: width
518- clip: true
519- highlightFollowsCurrentItem: true
520- highlightRangeMode: ListView.StrictlyEnforceRange
521-
522- model: introModel
523- delegate: Rectangle {
524- id: delegateRect
525- width: slider.width
526- height: slider.height
527-
528- Rectangle {
529- width: parent.width
530- height: units.gu(10)
531- anchors.horizontalCenter: delegateRect.horizontalCenter
532- y: icon.y + icon.height + units.gu(3)
533-
534- // Problem changing Label color. Hence, using Text instead.
535- Text {
536- id: titleText
537- anchors.top: parent.top
538- width: parent.width
539-
540- horizontalAlignment: TextInput.AlignHCenter
541- font.pixelSize: FontUtils.sizeToPixels("large")
542- color: "#000000"
543- text: title
544- }
545- // Not using Ubuntu font color, because it's affected by background color.
546- Text {
547- id: bodyText
548- anchors {
549- top: titleText.bottom
550- topMargin: units.gu(1.5)
551- // Why don't these work?
552- leftMargin: units.gu(15)
553- rightMargin: units.gu(3)
554- }
555- width: parent.width
556-
557- horizontalAlignment: TextInput.AlignHCenter
558- font.pixelSize: FontUtils.sizeToPixels("medium")
559- wrapMode: Text.WordWrap
560- // Using Ubuntu Theme color.
561- color: "#777777"
562- text: body
563- }
564+
565+ Rectangle {
566+ anchors {
567+ top: parent.top
568+ left: parent.left
569+ right: parent.right
570+ bottom: parent.bottom
571+ bottomMargin: page.isWide ? units.gu(2) : 0
572 }
573- }
574-
575- onCurrentIndexChanged: {
576- icon.source = "files/intro" + (currentIndex + 1) + ".png";
577- }
578- }
579-
580- Row {
581- id: indicator
582- height: units.gu(6)
583- spacing: units.dp(8)
584- anchors {
585- bottom: parent.bottom
586- horizontalCenter: parent.horizontalCenter
587- }
588- z: 2
589-
590- Repeater {
591- model: introModel.count
592- delegate: Rectangle {
593+ color: Colors.intro_background
594+
595+ Layouts.item: "item_body"
596+
597+ CrossFadeImage {
598+ id: icon
599+
600+ anchors {
601+ bottom: parent.verticalCenter
602+ bottomMargin: units.gu(2)
603+ horizontalCenter: parent.horizontalCenter
604+ }
605+ width: units.gu(16)
606 height: width
607- width: units.dp(6)
608- antialiasing: true
609- color: slider.currentIndex == index ? "#2ca5e0" : "#bbbbbb"
610- Behavior on color {
611- ColorAnimation {
612- duration: UbuntuAnimation.FastDuration
613- }
614- }
615- }
616- }
617- }
618-
619- // TODO karni: Perhaps replace with styled Button. This doesn't work in Button, though:
620- // font: Qt.font({family: "Ubuntu", pixelSize: FontUtils.sizeToPixels("medium"), color: "#000000"})
621- TelegramButton {
622- id: startMessagingButton
623-
624- anchors {
625- bottom: indicator.top
626- bottomMargin: units.gu(8)
627- horizontalCenter: parent.horizontalCenter
628- }
629- z: 2
630-
631- // TRANSLATORS: Text of the button visible on the intro pages.
632- text: i18n.tr("Start Messaging")
633- onClicked: startMessaging()
634+ z: 2
635+
636+ fadeDuration: 250
637+ fillMode: Image.PreserveAspectFit
638+ }
639+
640+ ListView {
641+ id: slider
642+
643+ anchors.fill: parent
644+ z: 1
645+
646+ orientation: ListView.Horizontal
647+ snapMode: ListView.SnapOneItem
648+ boundsBehavior: Flickable.StopAtBounds
649+ cacheBuffer: width
650+ clip: true
651+ highlightFollowsCurrentItem: true
652+ highlightRangeMode: ListView.StrictlyEnforceRange
653+
654+ model: introModel
655+ delegate: Rectangle {
656+ id: delegateRect
657+ width: slider.width
658+ height: slider.height
659+
660+ Rectangle {
661+ width: parent.width
662+ height: units.gu(10)
663+ anchors.horizontalCenter: delegateRect.horizontalCenter
664+ y: icon.y + icon.height + units.gu(3)
665+
666+ // Problem changing Label color. Hence, using Text instead.
667+ Text {
668+ id: titleText
669+ anchors.top: parent.top
670+ width: parent.width
671+
672+ horizontalAlignment: TextInput.AlignHCenter
673+ font.pixelSize: FontUtils.sizeToPixels("large")
674+ color: "#000000"
675+ text: title
676+ }
677+ // Not using Ubuntu font color, because it's affected by background color.
678+ Text {
679+ id: bodyText
680+ anchors {
681+ top: titleText.bottom
682+ topMargin: units.gu(1.5)
683+ // Why don't these work?
684+ leftMargin: units.gu(15)
685+ rightMargin: units.gu(3)
686+ }
687+ width: parent.width
688+
689+ horizontalAlignment: TextInput.AlignHCenter
690+ font.pixelSize: FontUtils.sizeToPixels("medium")
691+ wrapMode: Text.WordWrap
692+ // Using Ubuntu Theme color.
693+ color: "#777777"
694+ text: body
695+ }
696+ }
697+ }
698+
699+ onCurrentIndexChanged: {
700+ icon.source = "files/intro" + (currentIndex + 1) + ".png";
701+ }
702+ }
703+
704+ Row {
705+ id: indicator
706+ height: units.gu(6)
707+ spacing: units.dp(8)
708+ anchors {
709+ bottom: parent.bottom
710+ bottomMargin: isWide
711+ ? 0 : page.height - (startMessagingButton.parent.y - units.gu(4))
712+ horizontalCenter: parent.horizontalCenter
713+ }
714+ z: 2
715+
716+ Repeater {
717+ model: introModel.count
718+ delegate: Rectangle {
719+ height: width
720+ width: units.dp(6)
721+ antialiasing: true
722+ color: slider.currentIndex == index ? "#2ca5e0" : "#bbbbbb"
723+ Behavior on color {
724+ ColorAnimation {
725+ duration: UbuntuAnimation.FastDuration
726+ }
727+ }
728+ }
729+ }
730+ }
731+
732+ }
733+
734+ Item {
735+ Layouts.item: "item_button"
736+ anchors {
737+ top: undefined
738+ left: parent.left
739+ right: parent.right
740+ bottom: parent.bottom
741+ bottomMargin: page.isWide ? units.gu(1) : units.gu(4)
742+ }
743+ width: page.width
744+ height: startMessagingButton.height
745+
746+ // TODO karni: Perhaps replace with styled Button. This doesn't work in Button, though:
747+ // font: Qt.font({family: "Ubuntu", pixelSize: FontUtils.sizeToPixels("medium"), color: "#000000"})
748+ TelegramButton {
749+ id: startMessagingButton
750+ z: 2
751+ anchors {
752+ horizontalCenter: parent.horizontalCenter
753+ verticalCenter: page.isWide ? parent.verticalCenter : undefined
754+ }
755+ // TRANSLATORS: Text of the button visible on the intro pages.
756+ text: i18n.tr("Start Messaging")
757+
758+ onClicked: startMessaging()
759+ }
760+ }
761+
762+
763 }
764 }
765 }
766
767=== modified file 'telegram/app/qml/PickerPage.qml'
768--- telegram/app/qml/PickerPage.qml 2015-09-30 14:55:01 +0000
769+++ telegram/app/qml/PickerPage.qml 2016-03-14 17:04:41 +0000
770@@ -34,12 +34,12 @@
771 showTitle: false
772 onPeerSelected: {
773 picker.curTransfer = peer.request();
774- pageStack.pop();
775+ pageStack.removePages(picker);
776 if (picker.curTransfer.state === ContentTransfer.InProgress)
777 picker.__exportItems(picker.url);
778 }
779 onCancelPressed: {
780- pageStack.pop();
781+ pageStack.removePages(picker);
782 }
783 }
784
785
786=== modified file 'telegram/app/qml/PreviewPage.qml'
787--- telegram/app/qml/PreviewPage.qml 2015-09-30 14:55:01 +0000
788+++ telegram/app/qml/PreviewPage.qml 2016-03-14 17:04:41 +0000
789@@ -87,13 +87,13 @@
790 singleMediaViewer.reset();
791
792 if (photoPreviewSource !== "") {
793- pageStack.push(picker_page_component, {
794+ pageStack.addPageToCurrentColumn(preview_page, picker_page_component, {
795 "url": photoPreviewSource,
796 "handler": ContentHandler.Destination,
797 "contentType": ContentType.Pictures
798 });
799 } else if (videoPreviewSource !== "") {
800- pageStack.push(picker_page_component, {
801+ pageStack.addPageToCurrentColumn(preview_page, picker_page_component, {
802 "url": videoPreviewSource,
803 "handler": ContentHandler.Destination,
804 "contentType": ContentType.Videos
805@@ -105,13 +105,13 @@
806 singleMediaViewer.reset();
807
808 if (photoPreviewSource !== "") {
809- pageStack.push(picker_page_component, {
810+ pageStack.addPageToCurrentColumn(preview_page, picker_page_component, {
811 "url": photoPreviewSource,
812 "handler": ContentHandler.Share,
813 "contentType": ContentType.Pictures
814 });
815 } else if (videoPreviewSource !== "") {
816- pageStack.push(picker_page_component, {
817+ pageStack.addPageToCurrentColumn(preview_page, picker_page_component, {
818 "url": videoPreviewSource,
819 "handler": ContentHandler.Share,
820 "contentType": ContentType.Videos
821
822=== modified file 'telegram/app/qml/ProfilePage.qml'
823--- telegram/app/qml/ProfilePage.qml 2015-11-16 11:26:59 +0000
824+++ telegram/app/qml/ProfilePage.qml 2016-03-14 17:04:41 +0000
825@@ -113,13 +113,12 @@
826 }
827
828 function addMember() {
829- var properties = {
830+ pageStack.addPageToNextColumn(pageStack.primaryPage, contacts_page_component, {
831 telegram: telegram,
832 state: "add-to-group",
833 groupChatId: dialogId,
834 groupChatTitle: details_item.text
835- };
836- pageStack.push(contacts_page_component, properties);
837+ });
838 }
839
840 function changeGroupPhoto() {
841@@ -190,7 +189,7 @@
842 dialog: profile_page.dialog
843
844 onClicked: {
845- pageStack.push(preview_page_component,
846+ pageStack.addPageToNextColumn(profile_page, preview_page_component,
847 { "title": details_item.title, "photoPreviewSource": path });
848 }
849 }
850@@ -642,7 +641,7 @@
851 text: i18n.tr("Info")
852 visible: (user.id != telegram.me)
853 onTriggered: {
854- pageStack.push(profile_page_component, {
855+ pageStack.addPageToNextColumn(profile_page, profile_page_component, {
856 telegram: profile_page.telegram,
857 dialog: telegramObject.fakeDialogObject(user.id, false)
858 });
859
860=== modified file 'telegram/app/qml/components/DialogsListItem.qml'
861--- telegram/app/qml/components/DialogsListItem.qml 2016-03-01 00:24:36 +0000
862+++ telegram/app/qml/components/DialogsListItem.qml 2016-03-14 17:04:41 +0000
863@@ -18,6 +18,7 @@
864 property Telegram telegram
865 property bool connected: true
866
867+ property var dialogPage
868 property Dialog dialog
869 property int dialogId: isChat ? dialog.peer.chatId : dialog.peer.userId
870 property bool isChat: dialog.peer.chatId !== 0
871@@ -55,6 +56,7 @@
872 list_item, {
873 text: i18n.tr("Are you sure you want to leave this chat?"),
874 onAccept: function() {
875+ pageStack.clear()
876 telegram.messagesDeleteHistory(dialogId, true)
877 }
878 }
879@@ -86,7 +88,7 @@
880 iconName: "info"
881 text: i18n.tr("Info")
882 onTriggered: {
883- pageStack.push(profile_page_component, {
884+ pageStack.addPageToNextColumn(account_page, profile_page_component, {
885 telegram: list_item.telegram,
886 dialog: list_item.dialog
887 });
888
889=== modified file 'telegram/app/qml/components/TelegramContactsListItem.qml'
890--- telegram/app/qml/components/TelegramContactsListItem.qml 2015-09-30 14:55:01 +0000
891+++ telegram/app/qml/components/TelegramContactsListItem.qml 2016-03-14 17:04:41 +0000
892@@ -65,7 +65,7 @@
893 iconName: "info"
894 text: i18n.tr("Info")
895 onTriggered: {
896- pageStack.push(profile_page_component, {
897+ pageStack.addPageToNextColumn(dialog_page, profile_page_component, {
898 telegram: contact_item.telegram,
899 dialog: contact_item.telegram.fakeDialogObject(user.id, false)
900 });
901
902=== modified file 'telegram/app/qml/telegram.qml'
903--- telegram/app/qml/telegram.qml 2015-11-09 11:59:10 +0000
904+++ telegram/app/qml/telegram.qml 2016-03-14 17:04:41 +0000
905@@ -37,7 +37,7 @@
906
907 applicationName: "com.ubuntu.telegram"
908 anchorToKeyboard: true
909- automaticOrientation: false
910+ automaticOrientation: true
911
912 property string appId: "com.ubuntu.telegram_telegram" // no-i18n
913
914@@ -87,17 +87,14 @@
915 }
916
917 function showIntro() {
918+ pageStack.forceSinglePage = (profiles.count == 0);
919 if (profiles.count == 0) {
920- pageStack.clear();
921- pageStack.push(intro_page_component);
922+ pageStack.primaryPageSource = intro_page_component;
923 }
924 }
925
926 function backToDialogsPage() {
927- while (pageStack.depth > 0 &&
928- pageStack.currentPage.objectName !== "accountPage") {
929- pageStack.pop();
930- }
931+ pageStack.removePages(pageStack.primaryPage);
932 }
933
934 function openPushDialog() {
935@@ -156,6 +153,7 @@
936 onLoggedOut: {
937 pageStack.clear()
938 profiles.remove(phone)
939+ showIntro();
940 }
941 }
942
943@@ -229,15 +227,46 @@
944 }
945 }
946
947- PageStack {
948+ AdaptivePageLayout {
949 id: pageStack
950
951+ property bool forceSinglePage: false
952+
953+ anchors.fill: parent
954+ layouts: [
955+ PageColumnsLayout {
956+ // gu(80) is standard value. Would prefer not to type it in,
957+ // but can't have !forceSinglePage as the only value here.
958+ when: width > units.gu(80) && !pageStack.forceSinglePage
959+ PageColumn {
960+ minimumWidth: units.gu(35)
961+ maximumWidth: units.gu(35)
962+ preferredWidth: units.gu(35)
963+ }
964+ PageColumn {
965+ fillWidth: true
966+ }
967+ },
968+ PageColumnsLayout {
969+ when: true
970+ PageColumn {
971+ fillWidth: true
972+ minimumWidth: units.gu(30)
973+ }
974+ }
975+ ]
976+
977+ function clear() {
978+ pageStack.removePages(pageStack.primaryPage);
979+ }
980+
981 Component {
982 id: intro_page_component
983
984 IntroPage {
985 onStartMessaging: {
986- pageStack.push(auth_countries_page_component);
987+ pageStack.forceSinglePage = false;
988+ pageStack.addPageToCurrentColumn(pageStack.primaryPage, auth_countries_page_component);
989 }
990 }
991 }
992@@ -247,7 +276,7 @@
993
994 AuthCountriesPage {
995 onCountryEntered: {
996- pageStack.push(auth_number_page_component, {
997+ pageStack.addPageToNextColumn(pageStack.primaryPage, auth_number_page_component, {
998 "countryCode": code
999 });
1000 }
1001
1002=== modified file 'telegram/app/telegram.desktop'
1003--- telegram/app/telegram.desktop 2016-03-10 08:40:41 +0000
1004+++ telegram/app/telegram.desktop 2016-03-14 17:04:41 +0000
1005@@ -7,9 +7,7 @@
1006 Icon=icons/telegram.png
1007 X-Ubuntu-Touch=true
1008 X-Ubuntu-Default-Department-ID=communication
1009-X-Ubuntu-Supported-Orientations=portrait
1010 X-Ubuntu-Splash-Show-Header=false
1011 X-Ubuntu-Splash-Color=White
1012-X-Ubuntu-StageHint=SideStage
1013 _X-Ubuntu-Splash-Title=Telegram
1014 X-Ubuntu-SymbolicIcon=./icons/telegram_symbolic.svg

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: