Merge lp:~nik90/touch-irc/revamp-connect-page into lp:touch-irc

Proposed by Nekhelesh Ramananthan on 2014-02-14
Status: Work in progress
Proposed branch: lp:~nik90/touch-irc/revamp-connect-page
Merge into: lp:touch-irc
Diff against target: 365 lines (+166/-119)
3 files modified
qml/IrcClient/ConnectPage.qml (+149/-117)
qml/IrcClient/components/EntryField.qml (+15/-0)
qml/IrcClient/main.qml (+2/-2)
To merge this branch: bzr merge lp:~nik90/touch-irc/revamp-connect-page
Reviewer Review Type Date Requested Status
Joseph Mills 2014-02-14 Pending
Review via email: mp+206527@code.launchpad.net

Commit message

- Revamped connectPage
- Adjusted application size slightly
- Moved port, SSL, SASL options to advanced settings category which is not visible by default. It can be toggled on by the user.
- Added copyright license to connectPage.qml

Description of the change

This MP implements the following,
- Revamped connectPage
- Adjusted application size slightly
- Moved port, SSL, SASL options to advanced settings category which is not visible by default. It can be toggled on by the user.
- Added copyright license to connectPage.qml

To post a comment you must log in.

Unmerged revisions

4. By Nekhelesh Ramananthan on 2014-02-14

Revamped the connect page

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/IrcClient/ConnectPage.qml'
2--- qml/IrcClient/ConnectPage.qml 2014-02-13 20:24:29 +0000
3+++ qml/IrcClient/ConnectPage.qml 2014-02-14 16:53:58 +0000
4@@ -1,13 +1,35 @@
5+/*
6+ * Copyright (C) 2014 Touch Irc Team
7+ *
8+ * This program is free software: you can redistribute it and/or modify
9+ * it under the terms of the GNU General Public License version 3 as
10+ * published by the Free Software Foundation.
11+ *
12+ * This program is distributed in the hope that it will be useful,
13+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+ * GNU General Public License for more details.
16+ *
17+ * You should have received a copy of the GNU General Public License
18+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
19+ *
20+ * Authored by: Nekhelesh Ramananthan <krnekhelesh@gmail.com>
21+ */
22+
23 import QtQuick 2.0
24-import Ubuntu.Layouts 0.1
25+import Communi 3.0
26 import Ubuntu.Components 0.1
27-import Communi 3.0
28+import Ubuntu.Components.ListItems 0.1
29+import "components"
30
31+// Connect Page - Intial User Setup Page
32 Page {
33- id: page
34- title: qsTr("Login")
35+ id: connectPage
36+
37+ title: i18n.tr("Login")
38+
39 property string host: hostField.text || hostField.placeholderText
40- property int port: portField.value
41+ property int port: portField.text ? parseInt(portField.text) : parseInt(portField.placeholderText)
42 property bool secure: secureField.checked
43 property bool sasl: saslField.checked
44 property string nickName: nickNameField.text || nickNameField.placeholderText
45@@ -15,162 +37,172 @@
46 property string userName: userNameField.text || userNameField.placeholderText
47 property string password: passwordField.text
48 property string channel: channelField.text || channelField.placeholderText
49+
50 signal accepted()
51 signal rejected()
52- Grid{
53- id: grid
54- width: parent.width
55- height: parent.height
56- columns: 2
57- rowSpacing: units.gu(1.5)
58- columnSpacing: units.gu(1.3)
59-
60- anchors{
61- right: parent.right
62- left: parent.left
63- leftMargin: units.gu(2)
64- bottom: parent.bottom
65- top: parent.top
66- topMargin: units.gu(0.5)
67- }
68-
69- Label {
70- text: qsTr("Host:")
71- width: 10
72- }
73-
74- TextField {
75+
76+ Column {
77+ id: mainColumn
78+
79+ spacing: units.gu(1.5)
80+ anchors {
81+ fill: parent
82+ margins: units.gu(2)
83+ }
84+
85+ EntryField {
86 id: hostField
87 focus: true
88- width: parent.width - channelLabel.width*1.88
89+ width: parent.width
90+ title: i18n.tr("Host: ")
91 placeholderText: "irc.freenode.net"
92 }
93
94- Label { text: qsTr("Port:") }
95- Row{
96- width: parent.width
97- spacing: 8
98- Slider {
99- id: portField
100- value: 6667
101- width: parent.width - channelLabel.width*2.22
102- minimumValue: 1024
103- maximumValue: 65535
104- }
105- Label{
106- text: Math.round(portField.value)
107- anchors.verticalCenter: portField.verticalCenter
108- }
109- }
110-
111-
112- Label { text: qsTr("SSL: ") }
113- CheckBox {
114- id: secureField
115- text: qsTr("SSL")
116- }
117- Label { text: qsTr("SASL: ") }
118- CheckBox {
119- id: saslField
120-
121- text: qsTr("SASL")
122- }
123- Label { text: qsTr("Nick name:") }
124- TextField {
125-
126+ EntryField {
127 id: nickNameField
128- width: parent.width - channelLabel.width*1.88
129-
130+ width: parent.width
131+ title: i18n.tr("Nick Name:")
132 placeholderText: "Nick" + Math.round(Math.random() * 9999)
133 }
134- Label { text: qsTr("Real name:") }
135- TextField {
136+
137+ EntryField {
138 id: realNameField
139- width: parent.width - channelLabel.width*1.88
140-
141- placeholderText: qsTr("Your Real Name")
142+ width: parent.width
143+ title: i18n.tr("Real Name:")
144+ placeholderText: "Your Real Name"
145 }
146
147- Label { text: qsTr("User name:") }
148- TextField {
149+ EntryField {
150 id: userNameField
151- width: parent.width - channelLabel.width*1.88
152-
153- placeholderText: "Your UserName "
154+ width: parent.width
155+ title: i18n.tr("User Name:")
156+ placeholderText: "Your User Name"
157 }
158
159- Label { text: qsTr("Password:") }
160- TextField {
161+ EntryField {
162 id: passwordField
163- width: parent.width - channelLabel.width*1.88
164+ width: parent.width
165+ title: i18n.tr("Password:")
166+ placeholderText: "Your Password"
167 echoMode: TextInput.Password
168 }
169
170- Label {
171- id: channelLabel
172- text: qsTr("Channel:")
173- }
174- TextField {
175+ EntryField {
176 id: channelField
177- width: parent.width - channelLabel.width*1.88
178+ width: parent.width
179+ title: i18n.tr("Channel:")
180 placeholderText: "#ubuntu-app-devel"
181 }
182+
183+ ThinDivider {}
184+
185+ Standard {
186+ text: i18n.tr("Show Advanced settings")
187+ showDivider: false
188+ anchors {
189+ left: parent.left
190+ right: parent.right
191+ margins: units.gu(-2)
192+ }
193+
194+ control: CheckBox {
195+ id: advancedSettings
196+ anchors.verticalCenter: parent.verticalCenter
197+ anchors.right: parent.right
198+ onClicked: {
199+ if(checked)
200+ advancedColumn.visible = true
201+ else
202+ advancedColumn.visible = false
203+ }
204+ }
205+ }
206+
207+ Column {
208+ id: advancedColumn
209+ visible: false
210+ anchors {
211+ left: parent.left
212+ right: parent.right
213+ }
214+
215+ EntryField {
216+ id: portField
217+ width: parent.width
218+ title: i18n.tr("Port:")
219+ placeholderText: "6667"
220+ }
221+
222+ Standard {
223+ text: i18n.tr("SSL")
224+ showDivider: false
225+ anchors {
226+ left: parent.left
227+ right: parent.right
228+ margins: units.gu(-2)
229+ }
230+
231+ control: CheckBox {
232+ id: secureField
233+ anchors.verticalCenter: parent.verticalCenter
234+ anchors.right: parent.right
235+ }
236+ }
237+
238+ Standard {
239+ text: i18n.tr("SASL")
240+ showDivider: false
241+ anchors {
242+ left: parent.left
243+ right: parent.right
244+ margins: units.gu(-2)
245+ }
246+
247+ control: CheckBox {
248+ id: saslField
249+ anchors.verticalCenter: parent.verticalCenter
250+ anchors.right: parent.right
251+ }
252+ }
253+ }
254 }
255- Column {
256+
257+ Row {
258 id: row
259- spacing: units.gu(0.5)
260- anchors.bottom: grid.bottom
261- anchors.bottomMargin: units.gu(0.5)
262- anchors.horizontalCenter: parent.horizontalCenter
263- width: grid.width
264+ spacing: units.gu(2)
265+ anchors {
266+ bottom: mainColumn.bottom
267+ horizontalCenter: parent.horizontalCenter
268+ margins: units.gu(0.5)
269+ }
270
271 Button {
272 id: okButton
273- text: qsTr("Ok")
274- width: parent.width / 1.7
275- anchors.horizontalCenter: parent.horizontalCenter
276-
277- onClicked: page.accepted()
278+ text: i18n.tr("Ok")
279+ width: units.gu(15)
280+ onClicked: connectPage.accepted()
281 }
282
283 Button {
284 id: cancelButton
285- text: qsTr("Quit")
286- width: parent.width / 1.7
287- anchors.horizontalCenter: parent.horizontalCenter
288-
289- onClicked: page.rejected()
290+ text: i18n.tr("Quit")
291+ width: units.gu(15)
292+ onClicked: connectPage.rejected()
293 }
294 }
295
296-
297- // }//Grid
298-
299 Keys.onReturnPressed: {
300 if (okButton.enabled)
301- page.accepted()
302+ connectPage.accepted()
303 }
304
305 Keys.onEnterPressed: {
306 if (okButton.enabled)
307- page.accepted()
308+ connectPage.accepted()
309 }
310
311 Keys.onEscapePressed: {
312 if (cancelButton.enabled)
313- page.rejected()
314- }
315-
316- Item {
317- id: settings
318- property alias host: hostField.text
319- property alias port: portField.value
320- property alias secure: secureField.checked
321- property alias sasl: saslField.checked
322- property alias nickName: nickNameField.text
323- property alias realName: realNameField.text
324- property alias userName: userNameField.text
325- property alias password: passwordField.text
326- property alias channel: channelField.text
327+ connectPage.rejected()
328 }
329 }
330
331=== added directory 'qml/IrcClient/components'
332=== added file 'qml/IrcClient/components/EntryField.qml'
333--- qml/IrcClient/components/EntryField.qml 1970-01-01 00:00:00 +0000
334+++ qml/IrcClient/components/EntryField.qml 2014-02-14 16:53:58 +0000
335@@ -0,0 +1,15 @@
336+import QtQuick 2.0
337+import Ubuntu.Components 0.1
338+
339+TextField{
340+ id: root
341+
342+ property alias title: label.text
343+
344+ primaryItem: Label{
345+ id: label
346+ anchors.left: parent.left
347+ anchors.verticalCenter: parent.verticalCenter
348+ color: root.highlighted ? "#2C001E" : Theme.palette.normal.baseText
349+ }
350+}
351
352=== modified file 'qml/IrcClient/main.qml'
353--- qml/IrcClient/main.qml 2014-02-13 20:24:29 +0000
354+++ qml/IrcClient/main.qml 2014-02-14 16:53:58 +0000
355@@ -18,8 +18,8 @@
356 applicationName: "irc client"
357 automaticOrientation: true
358 anchorToKeyboard: true
359- width: units.gu(40)
360- height: units.gu(71)
361+ width: units.gu(50)
362+ height: units.gu(80)
363 property bool isConnected: false
364 PageStack{
365 id: pageStack

Subscribers

People subscribed via source and target branches