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
1=== modified file 'telegram/app/qml/ProfilePage.qml'
2--- telegram/app/qml/ProfilePage.qml 2016-05-13 12:44:58 +0000
3+++ telegram/app/qml/ProfilePage.qml 2016-06-03 12:19:30 +0000
4@@ -3,8 +3,11 @@
5 import Ubuntu.Components 1.3
6 import Ubuntu.Components.ListItems 1.3 as ListItem
7 import Ubuntu.Content 1.3
8+import Ubuntu.Components.Popups 1.3 as Popups
9+import Ubuntu.Components 1.3 as UC
10
11 import TelegramQML 1.0
12+import AsemanTools 1.0
13
14 import "components"
15 import "js/avatar.js" as Avatar
16@@ -44,7 +47,13 @@
17 // TRANSLATORS: Action text to change group photo.
18 text: i18n.tr("Change photo")
19 onTriggered: changeGroupPhoto()
20- }
21+ },
22+ Action {
23+ iconName: "edit"
24+ // TRANSLATORS: Action text to change group chat title.
25+ text: i18n.tr("Change Group Title")
26+ onTriggered: changeChatTitle()
27+ }
28 ]
29
30 head.actions: isChat ? groupActions : noActions
31@@ -126,6 +135,52 @@
32 photo_importer.requestMedia();
33 }
34
35+ function changeChatTitle() {
36+ PopupUtils.open(change_Group_Title_Component);
37+ }
38+
39+ Component {
40+ //Change title component
41+ id: change_Group_Title_Component
42+ Popups.Dialog {
43+ id: change_Group_Title_Dialog
44+ title: i18n.tr("Change Group Title")
45+
46+ TextField {
47+ id: group_Title_Textfield
48+ anchors {
49+ left: parent.left
50+ leftMargin: units.gu(1)
51+ right: parent.right
52+ rightMargin: units.gu(1)
53+ }
54+ horizontalAlignment: Text.AlignLeft
55+ //inputMethodHints: Qt.ImhEmailCharactersOnly
56+ text: chat.title
57+ // TRANSLATORS: Placeholder for new group chat title
58+ placeholderText: i18n.tr("New group chat title")
59+ inputMethodHints: Qt.ImhNoPredictiveText
60+ validator: RegExpValidator {
61+ regExp: /w/
62+ }
63+ }
64+
65+ UC.Button {
66+ text: i18n.tr("Change Title")
67+ color: UbuntuColors.orange
68+ onClicked: {
69+ //console.log("CHANGE TITLE qsTr: " + qsTr(group_Title_Textfield.text));
70+ telegram.messagesEditChatTitle(dialogId, qsTr(group_Title_Textfield.text));
71+ PopupUtils.close(change_Group_Title_Dialog);
72+ }
73+ }
74+ UC.Button {
75+ text: i18n.tr("Cancel")
76+ onClicked: PopupUtils.close(change_Group_Title_Dialog)
77+ }
78+ }
79+ }
80+
81 MediaImport {
82 id: photo_importer
83 contentType: ContentType.Pictures

Subscribers

People subscribed via source and target branches

to status/vote changes: