Merge lp:~nik90/telegram-app/settings-listitemlayouts into lp:telegram-app

Proposed by Nekhelesh Ramananthan
Status: Needs review
Proposed branch: lp:~nik90/telegram-app/settings-listitemlayouts
Merge into: lp:telegram-app
Diff against target: 412 lines (+122/-145)
5 files modified
README.md (+1/-1)
telegram/app/qml/AccountSettings.qml (+102/-82)
telegram/app/qml/ProfilePage.qml (+2/-6)
telegram/app/qml/components/SubtitledListItem.qml (+15/-53)
telegram/manifest.json.in (+2/-3)
To merge this branch: bzr merge lp:~nik90/telegram-app/settings-listitemlayouts
Reviewer Review Type Date Requested Status
Jin (community) Needs Information
Review via email: mp+288200@code.launchpad.net

Commit message

- migrated settings listitem to listitemlayouts
- updated framework to ubuntu-sdk-15.04.3 (available since OTA-9)
- fixed chroot dependency typo in README.md
- Refactored SubtitledListItem

Description of the change

This MP,
- migrates settings listitem to listitemlayouts
- updated framework to ubuntu-sdk-15.04.3 (available since OTA-9)
- fixed chroot dependency typo in README.md
- Refactored SubtitledListItem

To post a comment you must log in.
Revision history for this message
Jin (jindallo) :
Revision history for this message
Jin (jindallo) wrote :

Hello buddy,

Please kindly feedback us what you think about the comment we left,
and feel free to contact us when you are available.

Now this merge request is on hold.

review: Needs Information
Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

Hmm I don't get email notifications when you just add diff comments without actually adding a comment in the MP. Strange.

Anyway, I updated the framework to keep up with the OTA version after all telegram is one of the core apps shipped on the phone. I would expect it to be up to date when it comes to framework versions.

Revision history for this message
Tim Peeters (tpeeters) wrote :

IF this goes in first: https://code.launchpad.net/~tpeeters/telegram-app/new-header/+merge/297787 (it is urgent because we don't want to show the red outline to warn for using the deprecated header to the users), then there will be a merge conflict in this branch. Should not be too hard to solve, but if there are issues (or you want more information), feel free to ask me :)

Unmerged revisions

160. By Nekhelesh Ramananthan

Refactored SubtitledListItem and reverted back to ListItem.Header

159. By Nekhelesh Ramananthan

Updated framework to ubuntu-sdk-15.04.3

158. By Nekhelesh Ramananthan

Converted settings page listitems to ListItemLayout

157. By Nekhelesh Ramananthan

Fixed dependency typo in README.md

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'README.md'
--- README.md 2015-10-12 14:07:59 +0000
+++ README.md 2016-03-05 12:47:04 +0000
@@ -11,7 +11,7 @@
11#### Get and build dependencies.11#### Get and build dependencies.
1212
13In the above click chroot, install:13In the above click chroot, install:
14 libthumbnailer-qt-dev libthumbnailer-qt1.0:armhf thumbnailer-service:armhf14 libthumbnailer-qt-dev:armhf libthumbnailer-qt1.0:armhf thumbnailer-service:armhf
1515
16This app requires:16This app requires:
17- libqtelegram-aseman-edition library and17- libqtelegram-aseman-edition library and
1818
=== modified file 'telegram/app/qml/AccountSettings.qml'
--- telegram/app/qml/AccountSettings.qml 2015-11-16 11:26:36 +0000
+++ telegram/app/qml/AccountSettings.qml 2016-03-05 12:47:04 +0000
@@ -1,9 +1,8 @@
1import QtQuick 2.41import QtQuick 2.4
2import Ubuntu.Components 1.32import Ubuntu.Components 1.3
3import Ubuntu.Components.ListItems 0.1 as ListItem3import Ubuntu.Components.Popups 1.3 as Popup
4import Ubuntu.Components.Popups 1.0 as Popup
5import Ubuntu.Content 1.04import Ubuntu.Content 1.0
65import Ubuntu.Components.ListItems 1.3 as ListItems
7import TelegramQML 1.06import TelegramQML 1.0
87
9import "components"8import "components"
@@ -33,8 +32,10 @@
33 ]32 ]
3433
35 objectName: "settingsPage"34 objectName: "settingsPage"
36 title: i18n.tr("Settings")35 header: PageHeader {
37 head.actions: actions36 title: i18n.tr("Settings")
37 trailingActionBar.actions: actions
38 }
3839
39 function changeFullName() {40 function changeFullName() {
40 var properties = { "telegram": telegram, "firstName": user.firstName, "lastName": user.lastName };41 var properties = { "telegram": telegram, "firstName": user.firstName, "lastName": user.lastName };
@@ -89,119 +90,142 @@
89 VisualItemModel {90 VisualItemModel {
90 id: model91 id: model
9192
92 ListItem.Header {93 ListItems.Header {
93 // TRANSLATORS: Settings section header, visible above phone and username fields.94 // TRANSLATORS: Settings section header, visible above phone and username fields.
94 text: i18n.tr("Info")95 text: i18n.tr("Info")
95 }96 }
9697
97 ListItem.Subtitled {98 ListItem {
98 text: telegram.phoneNumber99 divider.visible: false
99 // TRANSLATORS: Visible right under phone number in settings page.100 height: units.gu(6)
100 subText: i18n.tr("Phone")101 ListItemLayout {
101 showDivider: false102 id: phoneNumberLayout
102 highlightWhenPressed: false103 title.text: telegram.phoneNumber
104 // TRANSLATORS: Visible right under phone number in settings page.
105 subtitle.text: i18n.tr("Phone")
106 padding.bottom: units.gu(1)
107 padding.top: units.gu(1)
108 }
103 }109 }
104110
105 ListItem.Subtitled {111 ListItem {
106 text: user.username112 divider.visible: false
107 // TRANSLATORS: Visible right under username in settings page.113 height: units.gu(6)
108 subText: i18n.tr("Username")114 ListItemLayout {
109 showDivider: false115 id: usernameLayout
116 title.text: user.username
117 // TRANSLATORS: Visible right under username in settings page.
118 subtitle.text: i18n.tr("Username")
119 padding.bottom: units.gu(1)
120 padding.top: units.gu(1)
121 }
110 onClicked: changeUsername()122 onClicked: changeUsername()
111 }123 }
112124
113 ListItem.Header {125 ListItems.Header {
114 // TRANSLATORS: Settings section header.126 // TRANSLATORS: Settings section header.
115 text: i18n.tr("Messages")127 text: i18n.tr("Messages")
116 }128 }
117129
118 ListItem.Standard {130 ListItem {
119 // TRANSLATORS: Text of notifications switch in settings.131 divider.visible: false
120 text: i18n.tr("Notifications")132 height: visible ? units.gu(6) : 0
121 height: visible ? implicitHeight : 0133 visible: (Cutegram.pushNumber === telegram.phoneNumber)
122 visible: (Cutegram.pushNumber == telegram.phoneNumber)134
123 showDivider: false135 ListItemLayout {
124136 id: notificationLayout
125 Switch {137 // TRANSLATORS: Text of notifications switch in settings.
126 checked: Cutegram.pushNotifications138 title.text: i18n.tr("Notifications")
127 anchors {139
128 right: parent.right140 Switch {
129 rightMargin: units.gu(2)141 checked: Cutegram.pushNotifications
130 verticalCenter: parent.verticalCenter142 SlotsLayout.position: SlotsLayout.Last
131 }143
132144 onCheckedChanged: {
133 onCheckedChanged: {145 Cutegram.pushNotifications = checked;
134 Cutegram.pushNotifications = checked;146
135147 if (pushClient.token == "") {
136 if (pushClient.token == "") {148 if (checked) {
137 if (checked) {149 Cutegram.pushNotifications = false;
138 Cutegram.pushNotifications = false;150 mainView.openPushDialog();
139 mainView.openPushDialog();151 }
140 }
141 } else {
142 if (checked) {
143 pushClient.registerForPush();
144 } else {152 } else {
145 pushClient.unregisterFromPush();153 if (checked) {
154 pushClient.registerForPush();
155 } else {
156 pushClient.unregisterFromPush();
157 }
146 }158 }
147 }159 }
148 }160 }
149 }161 }
150 }162 }
151163
152 ListItem.Standard {164 ListItem {
153 text: i18n.tr("Send by Enter")165 divider.visible: false
154 showDivider: false166 height: units.gu(6)
167 ListItemLayout {
168 title.text: i18n.tr("Send by Enter")
155169
156 Switch {170 Switch {
157 checked: Cutegram.sendWithEnter171 checked: Cutegram.sendWithEnter
158 anchors {172 SlotsLayout.position: SlotsLayout.Last
159 right: parent.right173 onCheckedChanged: Cutegram.sendWithEnter = checked
160 rightMargin: units.gu(2)
161 verticalCenter: parent.verticalCenter
162 }174 }
163
164 onCheckedChanged: Cutegram.sendWithEnter = checked
165 }175 }
166 }176 }
167177
168 // TODO Terminate all sessions178 // TODO Terminate all sessions
169179
170 ListItem.Header {180 ListItems.Header {
171 // TRANSLATORS: Settings section header.181 // TRANSLATORS: Settings section header.
172 text: i18n.tr("Support")182 text: i18n.tr("Support")
173 }183 }
174184
175 ListItem.Standard {185 ListItem {
176 showDivider: false186 height: units.gu(6)
177 // TRANSLATORS: Text of settings item visible in the Support section.187 divider.visible: false
178 text: i18n.tr("Ask a Question")188 ListItemLayout {
189 // TRANSLATORS: Text of settings item visible in the Support section.
190 title.text: i18n.tr("Ask a Question")
191 }
179 onClicked: Qt.openUrlExternally("http://askubuntu.com/search?q=telegram")192 onClicked: Qt.openUrlExternally("http://askubuntu.com/search?q=telegram")
180 }193 }
181194
182 ListItem.Standard {195 ListItem {
183 showDivider: false196 height: units.gu(6)
184 // TRANSLATORS: Text of settings item visible in the Support section197 divider.visible: false
185 text: i18n.tr("Telegram FAQ")198 ListItemLayout {
199 // TRANSLATORS: Text of settings item visible in the Support section
200 title.text: i18n.tr("Telegram FAQ")
201 }
186 onClicked: Qt.openUrlExternally("https://telegram.org/faq")202 onClicked: Qt.openUrlExternally("https://telegram.org/faq")
187 }203 }
188204
189 ListItem.Header {205 ListItem {
190 // TRANSLATORS: Settings section header.206 height: units.gu(4)
191 text: i18n.tr("Account")207 ListItemLayout {
208 // TRANSLATORS: Settings section header.
209 title.text: i18n.tr("Account")
210 title.font.weight: Font.DemiBold
211 padding.bottom: units.gu(1)
212 padding.top: units.gu(1)
213 }
192 }214 }
193215
194 ListItem.Standard {216 ListItem {
195 showDivider: true217 height: units.gu(6)
196 text: i18n.tr("Log out") + " | " + telegram.phoneNumber218 ListItemLayout {
219 title.text: i18n.tr("Log out") + " | " + telegram.phoneNumber
220 }
197 onClicked: PopupUtils.open(logout_dialog_component)221 onClicked: PopupUtils.open(logout_dialog_component)
198 }222 }
199223
200 ListItem.SingleControl {224 ListItem {
201 showDivider: false225 divider.visible: false
202 control: Label {226 Label {
203 width: parent.width227 width: parent.width
204 height: units.gu(5)228 height: units.gu(6)
205 horizontalAlignment: Text.AlignHCenter229 horizontalAlignment: Text.AlignHCenter
206 verticalAlignment: Text.AlignVCenter230 verticalAlignment: Text.AlignVCenter
207 // TRANSLATORS: Visible at bottom of settings screen. The argument is application version.231 // TRANSLATORS: Visible at bottom of settings screen. The argument is application version.
@@ -222,7 +246,7 @@
222 ClickableContactImage {246 ClickableContactImage {
223 id: profile_image247 id: profile_image
224 anchors {248 anchors {
225 top: parent.top249 top: page.header.bottom
226 topMargin: units.gu(2)250 topMargin: units.gu(2)
227 left: parent.left251 left: parent.left
228 leftMargin: units.gu(2)252 leftMargin: units.gu(2)
@@ -247,13 +271,9 @@
247 right: parent.right271 right: parent.right
248 verticalCenter: profile_image.verticalCenter272 verticalCenter: profile_image.verticalCenter
249 }273 }
250 highlightWhenPressed: false
251 divider.visible: false
252274
253 title: user.firstName + " " + user.lastName275 title.text: user.firstName + " " + user.lastName
254 titleIsBold: true276 subtitle.text: {
255 titleMaxLineCount: 2
256 subtitle: {
257 var result = "";277 var result = "";
258 switch(user.status.classType)278 switch(user.status.classType)
259 {279 {
260280
=== modified file 'telegram/app/qml/ProfilePage.qml'
--- telegram/app/qml/ProfilePage.qml 2015-11-16 11:26:59 +0000
+++ telegram/app/qml/ProfilePage.qml 2016-03-05 12:47:04 +0000
@@ -202,10 +202,8 @@
202 right: parent.right202 right: parent.right
203 verticalCenter: profile_image.verticalCenter203 verticalCenter: profile_image.verticalCenter
204 }204 }
205 highlightWhenPressed: false
206 divider.visible: false
207205
208 title: {206 title.text: {
209 if (!dialog) return "";207 if (!dialog) return "";
210208
211 if (isChat)209 if (isChat)
@@ -214,9 +212,7 @@
214 return user ? user.firstName + " " + user.lastName : ""//emojis.textToEmojiText(user ? user.firstName + " " + user.lastName : "", 18, true);212 return user ? user.firstName + " " + user.lastName : ""//emojis.textToEmojiText(user ? user.firstName + " " + user.lastName : "", 18, true);
215 }213 }
216214
217 titleIsBold: true215 subtitle.text: {
218 titleMaxLineCount: 2
219 subtitle: {
220 //groupModel.count + " " + i18n.tr("members")216 //groupModel.count + " " + i18n.tr("members")
221217
222 var result = ""218 var result = ""
223219
=== modified file 'telegram/app/qml/components/SubtitledListItem.qml'
--- telegram/app/qml/components/SubtitledListItem.qml 2015-09-30 14:55:01 +0000
+++ telegram/app/qml/components/SubtitledListItem.qml 2016-03-05 12:47:04 +0000
@@ -1,59 +1,21 @@
1import QtQuick 2.41import QtQuick 2.4
2import Ubuntu.Components 1.32import Ubuntu.Components 1.3
3import Ubuntu.Components.ListItems 1.0 as ListItem
43
5ListItem.Empty {4ListItem {
6 id: item5 id: item
7 width: parent.width6
8 height: units.gu(8)7 property alias title: itemLayout.title
98 property alias subtitle: itemLayout.subtitle
10 property string title: ""9
11 property string titleColor: UbuntuColors.darkGrey10 height: itemLayout.height
12 property bool titleIsBold: false11 divider.visible: false
13 property int titleMaxLineCount: 112
14 property string subtitle: ""13 ListItemLayout {
15 property string subtitleColor: UbuntuColors.lightGrey14 id: itemLayout
16 property bool subtitleIsBold: false15
1716 title.font.bold: true
18 Text {17 title.wrapMode: Text.Wrap
19 id: title18 title.textSize: Label.Large
20 anchors {19 title.maximumLineCount: 2
21 top: parent.top
22 topMargin: units.gu(1)
23 left: parent.left
24 leftMargin: units.gu(2)
25 right: parent.right
26 rightMargin: units.gu(2)
27 }
28 width: parent.width
29 verticalAlignment: TextInput.AlignVCenter
30
31 maximumLineCount: item.titleMaxLineCount
32 wrapMode: Text.Wrap
33 elide: Text.ElideRight
34 font.pixelSize: FontUtils.sizeToPixels("large")
35 font.weight: item.titleIsBold ? Font.Bold : Font.Light
36 color: item.titleColor
37 text: item.title
38 }
39
40 Text {
41 id: subtitle
42 anchors {
43 top: title.bottom
44 topMargin: units.dp(4)
45 left: title.left
46 bottom: parent.bottom
47 bottomMargin: units.gu(1)
48 right: title.right
49 }
50 width: parent.width
51 verticalAlignment: TextInput.AlignVCenter
52
53 elide: Text.ElideRight
54 font.pixelSize: FontUtils.sizeToPixels("medium")
55 font.weight: item.subtitleIsBold ? Font.Bold : Font.Light
56 color: item.subtitleColor
57 text: item.subtitle
58 }20 }
59}21}
6022
=== modified file 'telegram/manifest.json.in'
--- telegram/manifest.json.in 2016-03-03 04:17:25 +0000
+++ telegram/manifest.json.in 2016-03-05 12:47:04 +0000
@@ -1,7 +1,7 @@
1{1{
2 "name": "com.ubuntu.telegram",2 "name": "com.ubuntu.telegram",
3 "description": "Telegram for Ubuntu Phone",3 "description": "Telegram for Ubuntu Phone",
4 "framework" : "ubuntu-sdk-15.04.1",4 "framework": "ubuntu-sdk-15.04.3",
5 "architecture": "@CLICK_ARCH@",5 "architecture": "@CLICK_ARCH@",
6 "title": "Telegram",6 "title": "Telegram",
7 "hooks": {7 "hooks": {
@@ -9,7 +9,7 @@
9 "account-application": "telegram.application",9 "account-application": "telegram.application",
10 "apparmor": "apparmor-telegram.json",10 "apparmor": "apparmor-telegram.json",
11 "content-hub": "content-hub.json",11 "content-hub": "content-hub.json",
12 "desktop": "telegram.desktop",12 "desktop": "telegram.desktop",
13 "urls": "urls.json"13 "urls": "urls.json"
14 },14 },
15 "push": {15 "push": {
@@ -24,4 +24,3 @@
24 "version": "2.0.8.1",24 "version": "2.0.8.1",
25 "maintainer": "Ubuntu Telegram team <libqtelegram-team@lists.launchpad.net>"25 "maintainer": "Ubuntu Telegram team <libqtelegram-team@lists.launchpad.net>"
26}26}
27

Subscribers

People subscribed via source and target branches

to status/vote changes: