Merge lp:~rpadovani/telegram-app/sendByEnter into lp:telegram-app/app-dev

Proposed by Riccardo Padovani
Status: Merged
Approved by: Michał Karnicki
Approved revision: 137
Merged at revision: 140
Proposed branch: lp:~rpadovani/telegram-app/sendByEnter
Merge into: lp:telegram-app/app-dev
Diff against target: 77 lines (+37/-2)
3 files modified
telegram.qml (+7/-0)
ui/DialogPage.qml (+10/-2)
ui/SettingsPage.qml (+20/-0)
To merge this branch: bzr merge lp:~rpadovani/telegram-app/sendByEnter
Reviewer Review Type Date Requested Status
Michał Karnicki (community) Approve
Review via email: mp+239244@code.launchpad.net

Commit message

Added option to send messages using enter button

Description of the change

Added option to send messages using enter button

To post a comment you must log in.
Revision history for this message
Michał Karnicki (karni) wrote :

Minor style in-line comments. Other than that, very nice!

review: Needs Fixing
137. By Riccardo Padovani

Code style improvements

Revision history for this message
Riccardo Padovani (rpadovani) wrote :

Done

Revision history for this message
Michał Karnicki (karni) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'telegram.qml'
--- telegram.qml 2014-10-21 14:03:09 +0000
+++ telegram.qml 2014-10-23 12:28:41 +0000
@@ -227,6 +227,13 @@
227 property bool promptForPush: true227 property bool promptForPush: true
228 }228 }
229229
230 Settings {
231 id: preferencesSettings
232 category: "preferences"
233
234 property bool sendByEnter: false
235 }
236
230 Loader {237 Loader {
231 id: pushClientLoader238 id: pushClientLoader
232 active: false239 active: false
233240
=== modified file 'ui/DialogPage.qml'
--- ui/DialogPage.qml 2014-10-17 13:11:56 +0000
+++ ui/DialogPage.qml 2014-10-23 12:28:41 +0000
@@ -104,8 +104,6 @@
104104
105 color: "white"105 color: "white"
106106
107 // Add button for emoji here
108
109 TextArea {107 TextArea {
110 id: message108 id: message
111 anchors {109 anchors {
@@ -124,6 +122,16 @@
124122
125 autoSize: true123 autoSize: true
126 maximumLineCount: 4124 maximumLineCount: 4
125 Keys.onReturnPressed: {
126 if (preferencesSettings.sendByEnter && isConnected) {
127 Qt.inputMethod.commit();
128 if (message.text.length === 0) return;
129
130 sendMessage(message.text);
131 } else {
132 event.accepted = false;
133 }
134 }
127 }135 }
128136
129 Item {137 Item {
130138
=== modified file 'ui/SettingsPage.qml'
--- ui/SettingsPage.qml 2014-10-15 17:42:46 +0000
+++ ui/SettingsPage.qml 2014-10-23 12:28:41 +0000
@@ -71,6 +71,26 @@
71 }71 }
7272
73 ListItem.Header {73 ListItem.Header {
74 text: i18n.tr("Messages")
75 }
76
77 ListItem.Standard {
78 text: i18n.tr("Send by Enter")
79
80 Switch {
81 id: checkbox
82 checked: preferencesSettings.sendByEnter
83 anchors {
84 right: parent.right
85 rightMargin: units.gu(2)
86 verticalCenter: parent.verticalCenter
87 }
88
89 onCheckedChanged: preferencesSettings.sendByEnter = checked;
90 }
91 }
92
93 ListItem.Header {
74 text: i18n.tr("Support")94 text: i18n.tr("Support")
75 }95 }
7696

Subscribers

People subscribed via source and target branches