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
=== modified file 'qml/IrcClient/ConnectPage.qml'
--- qml/IrcClient/ConnectPage.qml 2014-02-13 20:24:29 +0000
+++ qml/IrcClient/ConnectPage.qml 2014-02-14 16:53:58 +0000
@@ -1,13 +1,35 @@
1/*
2 * Copyright (C) 2014 Touch Irc Team
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Nekhelesh Ramananthan <krnekhelesh@gmail.com>
17 */
18
1import QtQuick 2.019import QtQuick 2.0
2import Ubuntu.Layouts 0.120import Communi 3.0
3import Ubuntu.Components 0.121import Ubuntu.Components 0.1
4import Communi 3.022import Ubuntu.Components.ListItems 0.1
23import "components"
524
25// Connect Page - Intial User Setup Page
6Page {26Page {
7 id: page27 id: connectPage
8 title: qsTr("Login")28
29 title: i18n.tr("Login")
30
9 property string host: hostField.text || hostField.placeholderText31 property string host: hostField.text || hostField.placeholderText
10 property int port: portField.value32 property int port: portField.text ? parseInt(portField.text) : parseInt(portField.placeholderText)
11 property bool secure: secureField.checked33 property bool secure: secureField.checked
12 property bool sasl: saslField.checked34 property bool sasl: saslField.checked
13 property string nickName: nickNameField.text || nickNameField.placeholderText35 property string nickName: nickNameField.text || nickNameField.placeholderText
@@ -15,162 +37,172 @@
15 property string userName: userNameField.text || userNameField.placeholderText37 property string userName: userNameField.text || userNameField.placeholderText
16 property string password: passwordField.text38 property string password: passwordField.text
17 property string channel: channelField.text || channelField.placeholderText39 property string channel: channelField.text || channelField.placeholderText
40
18 signal accepted()41 signal accepted()
19 signal rejected()42 signal rejected()
20 Grid{43
21 id: grid44 Column {
22 width: parent.width45 id: mainColumn
23 height: parent.height46
24 columns: 247 spacing: units.gu(1.5)
25 rowSpacing: units.gu(1.5)48 anchors {
26 columnSpacing: units.gu(1.3)49 fill: parent
2750 margins: units.gu(2)
28 anchors{51 }
29 right: parent.right52
30 left: parent.left53 EntryField {
31 leftMargin: units.gu(2)
32 bottom: parent.bottom
33 top: parent.top
34 topMargin: units.gu(0.5)
35 }
36
37 Label {
38 text: qsTr("Host:")
39 width: 10
40 }
41
42 TextField {
43 id: hostField54 id: hostField
44 focus: true55 focus: true
45 width: parent.width - channelLabel.width*1.8856 width: parent.width
57 title: i18n.tr("Host: ")
46 placeholderText: "irc.freenode.net"58 placeholderText: "irc.freenode.net"
47 }59 }
4860
49 Label { text: qsTr("Port:") }61 EntryField {
50 Row{
51 width: parent.width
52 spacing: 8
53 Slider {
54 id: portField
55 value: 6667
56 width: parent.width - channelLabel.width*2.22
57 minimumValue: 1024
58 maximumValue: 65535
59 }
60 Label{
61 text: Math.round(portField.value)
62 anchors.verticalCenter: portField.verticalCenter
63 }
64 }
65
66
67 Label { text: qsTr("SSL: ") }
68 CheckBox {
69 id: secureField
70 text: qsTr("SSL")
71 }
72 Label { text: qsTr("SASL: ") }
73 CheckBox {
74 id: saslField
75
76 text: qsTr("SASL")
77 }
78 Label { text: qsTr("Nick name:") }
79 TextField {
80
81 id: nickNameField62 id: nickNameField
82 width: parent.width - channelLabel.width*1.8863 width: parent.width
8364 title: i18n.tr("Nick Name:")
84 placeholderText: "Nick" + Math.round(Math.random() * 9999)65 placeholderText: "Nick" + Math.round(Math.random() * 9999)
85 }66 }
86 Label { text: qsTr("Real name:") }67
87 TextField {68 EntryField {
88 id: realNameField69 id: realNameField
89 width: parent.width - channelLabel.width*1.8870 width: parent.width
9071 title: i18n.tr("Real Name:")
91 placeholderText: qsTr("Your Real Name")72 placeholderText: "Your Real Name"
92 }73 }
9374
94 Label { text: qsTr("User name:") }75 EntryField {
95 TextField {
96 id: userNameField76 id: userNameField
97 width: parent.width - channelLabel.width*1.8877 width: parent.width
9878 title: i18n.tr("User Name:")
99 placeholderText: "Your UserName "79 placeholderText: "Your User Name"
100 }80 }
10181
102 Label { text: qsTr("Password:") }82 EntryField {
103 TextField {
104 id: passwordField83 id: passwordField
105 width: parent.width - channelLabel.width*1.8884 width: parent.width
85 title: i18n.tr("Password:")
86 placeholderText: "Your Password"
106 echoMode: TextInput.Password87 echoMode: TextInput.Password
107 }88 }
10889
109 Label {90 EntryField {
110 id: channelLabel
111 text: qsTr("Channel:")
112 }
113 TextField {
114 id: channelField91 id: channelField
115 width: parent.width - channelLabel.width*1.8892 width: parent.width
93 title: i18n.tr("Channel:")
116 placeholderText: "#ubuntu-app-devel"94 placeholderText: "#ubuntu-app-devel"
117 }95 }
96
97 ThinDivider {}
98
99 Standard {
100 text: i18n.tr("Show Advanced settings")
101 showDivider: false
102 anchors {
103 left: parent.left
104 right: parent.right
105 margins: units.gu(-2)
106 }
107
108 control: CheckBox {
109 id: advancedSettings
110 anchors.verticalCenter: parent.verticalCenter
111 anchors.right: parent.right
112 onClicked: {
113 if(checked)
114 advancedColumn.visible = true
115 else
116 advancedColumn.visible = false
117 }
118 }
119 }
120
121 Column {
122 id: advancedColumn
123 visible: false
124 anchors {
125 left: parent.left
126 right: parent.right
127 }
128
129 EntryField {
130 id: portField
131 width: parent.width
132 title: i18n.tr("Port:")
133 placeholderText: "6667"
134 }
135
136 Standard {
137 text: i18n.tr("SSL")
138 showDivider: false
139 anchors {
140 left: parent.left
141 right: parent.right
142 margins: units.gu(-2)
143 }
144
145 control: CheckBox {
146 id: secureField
147 anchors.verticalCenter: parent.verticalCenter
148 anchors.right: parent.right
149 }
150 }
151
152 Standard {
153 text: i18n.tr("SASL")
154 showDivider: false
155 anchors {
156 left: parent.left
157 right: parent.right
158 margins: units.gu(-2)
159 }
160
161 control: CheckBox {
162 id: saslField
163 anchors.verticalCenter: parent.verticalCenter
164 anchors.right: parent.right
165 }
166 }
167 }
118 }168 }
119 Column {169
170 Row {
120 id: row171 id: row
121 spacing: units.gu(0.5)172 spacing: units.gu(2)
122 anchors.bottom: grid.bottom173 anchors {
123 anchors.bottomMargin: units.gu(0.5)174 bottom: mainColumn.bottom
124 anchors.horizontalCenter: parent.horizontalCenter175 horizontalCenter: parent.horizontalCenter
125 width: grid.width176 margins: units.gu(0.5)
177 }
126178
127 Button {179 Button {
128 id: okButton180 id: okButton
129 text: qsTr("Ok")181 text: i18n.tr("Ok")
130 width: parent.width / 1.7182 width: units.gu(15)
131 anchors.horizontalCenter: parent.horizontalCenter183 onClicked: connectPage.accepted()
132
133 onClicked: page.accepted()
134 }184 }
135185
136 Button {186 Button {
137 id: cancelButton187 id: cancelButton
138 text: qsTr("Quit")188 text: i18n.tr("Quit")
139 width: parent.width / 1.7189 width: units.gu(15)
140 anchors.horizontalCenter: parent.horizontalCenter190 onClicked: connectPage.rejected()
141
142 onClicked: page.rejected()
143 }191 }
144 }192 }
145193
146
147 // }//Grid
148
149 Keys.onReturnPressed: {194 Keys.onReturnPressed: {
150 if (okButton.enabled)195 if (okButton.enabled)
151 page.accepted()196 connectPage.accepted()
152 }197 }
153198
154 Keys.onEnterPressed: {199 Keys.onEnterPressed: {
155 if (okButton.enabled)200 if (okButton.enabled)
156 page.accepted()201 connectPage.accepted()
157 }202 }
158203
159 Keys.onEscapePressed: {204 Keys.onEscapePressed: {
160 if (cancelButton.enabled)205 if (cancelButton.enabled)
161 page.rejected()206 connectPage.rejected()
162 }
163
164 Item {
165 id: settings
166 property alias host: hostField.text
167 property alias port: portField.value
168 property alias secure: secureField.checked
169 property alias sasl: saslField.checked
170 property alias nickName: nickNameField.text
171 property alias realName: realNameField.text
172 property alias userName: userNameField.text
173 property alias password: passwordField.text
174 property alias channel: channelField.text
175 }207 }
176}208}
177209
=== added directory 'qml/IrcClient/components'
=== added file 'qml/IrcClient/components/EntryField.qml'
--- qml/IrcClient/components/EntryField.qml 1970-01-01 00:00:00 +0000
+++ qml/IrcClient/components/EntryField.qml 2014-02-14 16:53:58 +0000
@@ -0,0 +1,15 @@
1import QtQuick 2.0
2import Ubuntu.Components 0.1
3
4TextField{
5 id: root
6
7 property alias title: label.text
8
9 primaryItem: Label{
10 id: label
11 anchors.left: parent.left
12 anchors.verticalCenter: parent.verticalCenter
13 color: root.highlighted ? "#2C001E" : Theme.palette.normal.baseText
14 }
15}
016
=== modified file 'qml/IrcClient/main.qml'
--- qml/IrcClient/main.qml 2014-02-13 20:24:29 +0000
+++ qml/IrcClient/main.qml 2014-02-14 16:53:58 +0000
@@ -18,8 +18,8 @@
18 applicationName: "irc client"18 applicationName: "irc client"
19 automaticOrientation: true19 automaticOrientation: true
20 anchorToKeyboard: true20 anchorToKeyboard: true
21 width: units.gu(40)21 width: units.gu(50)
22 height: units.gu(71)22 height: units.gu(80)
23 property bool isConnected: false23 property bool isConnected: false
24 PageStack{24 PageStack{
25 id: pageStack25 id: pageStack

Subscribers

People subscribed via source and target branches