Merge lp:~cellsoftware/telegram-app/1528352 into lp:telegram-app

Proposed by Ash
Status: Merged
Approved by: Jin
Approved revision: 202
Merged at revision: 200
Proposed branch: lp:~cellsoftware/telegram-app/1528352
Merge into: lp:telegram-app
Diff against target: 83 lines (+56/-1)
1 file modified
telegram/app/qml/ProfilePage.qml (+56/-1)
To merge this branch: bzr merge lp:~cellsoftware/telegram-app/1528352
Reviewer Review Type Date Requested Status
Jin (community) Approve
Review via email: mp+295495@code.launchpad.net

Description of the change

Added functionality to change group title.

To post a comment you must log in.
200. By Ash

Fixed chat title not working when added umlaut. Translated placeholder

201. By Ash

Fixed chat title not able to include symbols

202. By Ash

Fixed chat title validator not allowing spaces

Revision history for this message
Jin (jindallo) wrote :

Code looks good to me,
verified pass locally, I approve.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'telegram/app/qml/ProfilePage.qml'
--- telegram/app/qml/ProfilePage.qml 2016-05-13 12:44:58 +0000
+++ telegram/app/qml/ProfilePage.qml 2016-06-03 12:19:30 +0000
@@ -3,8 +3,11 @@
3import Ubuntu.Components 1.33import Ubuntu.Components 1.3
4import Ubuntu.Components.ListItems 1.3 as ListItem4import Ubuntu.Components.ListItems 1.3 as ListItem
5import Ubuntu.Content 1.35import Ubuntu.Content 1.3
6import Ubuntu.Components.Popups 1.3 as Popups
7import Ubuntu.Components 1.3 as UC
68
7import TelegramQML 1.09import TelegramQML 1.0
10import AsemanTools 1.0
811
9import "components"12import "components"
10import "js/avatar.js" as Avatar13import "js/avatar.js" as Avatar
@@ -44,7 +47,13 @@
44 // TRANSLATORS: Action text to change group photo.47 // TRANSLATORS: Action text to change group photo.
45 text: i18n.tr("Change photo")48 text: i18n.tr("Change photo")
46 onTriggered: changeGroupPhoto()49 onTriggered: changeGroupPhoto()
47 }50 },
51 Action {
52 iconName: "edit"
53 // TRANSLATORS: Action text to change group chat title.
54 text: i18n.tr("Change Group Title")
55 onTriggered: changeChatTitle()
56 }
48 ]57 ]
4958
50 head.actions: isChat ? groupActions : noActions59 head.actions: isChat ? groupActions : noActions
@@ -126,6 +135,52 @@
126 photo_importer.requestMedia();135 photo_importer.requestMedia();
127 }136 }
128137
138 function changeChatTitle() {
139 PopupUtils.open(change_Group_Title_Component);
140 }
141
142 Component {
143 //Change title component
144 id: change_Group_Title_Component
145 Popups.Dialog {
146 id: change_Group_Title_Dialog
147 title: i18n.tr("Change Group Title")
148
149 TextField {
150 id: group_Title_Textfield
151 anchors {
152 left: parent.left
153 leftMargin: units.gu(1)
154 right: parent.right
155 rightMargin: units.gu(1)
156 }
157 horizontalAlignment: Text.AlignLeft
158 //inputMethodHints: Qt.ImhEmailCharactersOnly
159 text: chat.title
160 // TRANSLATORS: Placeholder for new group chat title
161 placeholderText: i18n.tr("New group chat title")
162 inputMethodHints: Qt.ImhNoPredictiveText
163 validator: RegExpValidator {
164 regExp: /w/
165 }
166 }
167
168 UC.Button {
169 text: i18n.tr("Change Title")
170 color: UbuntuColors.orange
171 onClicked: {
172 //console.log("CHANGE TITLE qsTr: " + qsTr(group_Title_Textfield.text));
173 telegram.messagesEditChatTitle(dialogId, qsTr(group_Title_Textfield.text));
174 PopupUtils.close(change_Group_Title_Dialog);
175 }
176 }
177 UC.Button {
178 text: i18n.tr("Cancel")
179 onClicked: PopupUtils.close(change_Group_Title_Dialog)
180 }
181 }
182 }
183
129 MediaImport {184 MediaImport {
130 id: photo_importer185 id: photo_importer
131 contentType: ContentType.Pictures186 contentType: ContentType.Pictures

Subscribers

People subscribed via source and target branches

to status/vote changes: