Merge lp:~flscogna/ubuntu-terminal-app/profile-selection into lp:~ubuntu-terminal-dev/ubuntu-terminal-app/reboot
- profile-selection
- Merge into reboot
Status: | Merged |
---|---|
Approved by: | Alan Pope πΊπ§π± π¦ |
Approved revision: | 77 |
Merged at revision: | 80 |
Proposed branch: | lp:~flscogna/ubuntu-terminal-app/profile-selection |
Merge into: | lp:~ubuntu-terminal-dev/ubuntu-terminal-app/reboot |
Diff against target: |
434 lines (+207/-59) 8 files modified
po/com.ubuntu.terminal.pot (+13/-8) src/app/fileio.cpp (+2/-4) src/app/qml/KeyboardBar.qml (+31/-9) src/app/qml/KeyboardRows/KeyboardLayout.qml (+2/-2) src/app/qml/LayoutsPage.qml (+47/-0) src/app/qml/SettingsPage.qml (+38/-31) src/app/qml/TerminalSettings.qml (+69/-5) src/app/qml/ubuntu-terminal-app.qml (+5/-0) |
To merge this branch: | bzr merge lp:~flscogna/ubuntu-terminal-app/profile-selection |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alan Pope πΊπ§π± π¦ (community) | Approve | ||
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Approve | |
Review via email: mp+255077@code.launchpad.net |
Commit message
Custom profile visibility in settings
Description of the change
Custom profile visibility in settings. It is possible to show only a subset of the installed layouts.
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
Alan Pope πΊπ§π± π¦ (popey) wrote : | # |
I set no profiles active, but still see the keyboard button. Can we hide that when all keyboard layouts are disabled?
http://
Other than that, looks great.
Filippo Scognamiglio (flscogna) wrote : | # |
Alan, we can theoretically hide the keyboard button, but what about the row? If we hide only the button, we would basically have a black useless rectangle at the bottom.
Let's discuss some options:
1) Leave the current situation, with a useless bar and a useless button. (quite bad but predictable)
2) Hide the keyboard bar when no profiles are selected. (might be confusing?)
3) Force at least one profiles to be active (e.g. your ubuntu layout).
What do you think?
Alan Pope πΊπ§π± π¦ (popey) wrote : | # |
I prefer 2).
If someone doesn't want to 'waste' the screen real-estate used by the layout, so switches them all off, they'll be disappointed that they don't gain space IMO.
If we force a profile to be active, we're forcing that 'waste' of space for users who don't need it.
I would default to having the layouts enabled by default, but if the user actively has chosen to disable them _all_ then they should expect the consequence that they're gone from the main UI. They've already discovered how to disable them, re-enabling them shouldn't be a stretch for them.
What do you think?
Filippo Scognamiglio (flscogna) wrote : | # |
We already have a setting to completely disable the keyboard bar (in the main page).
The state which might be confusing here is: "Show Keyboard Bar" is turned on, but all profiles are disabled.
I'd personally not mix profiles selection with bar visibility. I'm thinking some day we'll have a keyboard shortcut to show/hide the bar, and we need to preserve the state (read the profiles enabled).
I'm inclined to think the best solution is to always show the additional bar (provided "Show Keyboard Bar" is enabled), but grey out the button when no profile is selected.
If the users wants to recover the screen real-estate (temporarily or permanently) it is just a tick away, without the need to change anything about its favourites profiles.
I perfectly agree with the default choices.
Alan Pope πΊπ§π± π¦ (popey) wrote : | # |
Ok, you make a good argument. Let's go with your plan.
Alan Pope πΊπ§π± π¦ (popey) wrote : | # |
Are you planning to add the grey icon in this merge? If so, when can we expect that?
Filippo Scognamiglio (flscogna) wrote : | # |
Sorry, I completely forgot about this merge proposal. I'll work on it in
the next two days.
2015-05-19 11:22 GMT+02:00 Alan Pope ξΏ <email address hidden>:
> Are you planning to add the grey icon in this merge? If so, when can we
> expect that?
> --
>
> https:/
> You are the owner of lp:~flscogna/ubuntu-terminal-app/profile-selection.
>
- 74. By Filippo Scognamiglio
-
Set the button colour to grey when no profiles are selected.
- 75. By Filippo Scognamiglio
-
Merge the latest changes from trunk.
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:75
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Filippo Scognamiglio (flscogna) wrote : | # |
Alan, when you have some time give this a go. The colour might be tweaked a bit, but I think the result is decent.
Alan Pope πΊπ§π± π¦ (popey) wrote : | # |
There seems to be a breakage in some use cases.
Add a few layouts
Go back to the main terminal screen
Select one as the current one
Go back to layout settings, de-select the one set as current
Expected behaviour:- Switch to another layout (next in list for example), or un-set a layout
Actual behaviour can sometimes be:-
* No layout set, choosing a layout has no effect:-
http://
http://
- 76. By Filippo Scognamiglio
-
Fix unexpected behaviour when unselecting the last profile in the list.
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:76
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Filippo Scognamiglio (flscogna) wrote : | # |
Ok, there was an issue when the last profile was active and unselected from the settings. This should work fine now.
- 77. By Filippo Scognamiglio
-
Import the latest changes from trunk.
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:77
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Alan Pope πΊπ§π± π¦ (popey) wrote : | # |
That fixed it!
Preview Diff
1 | === modified file 'po/com.ubuntu.terminal.pot' | |||
2 | --- po/com.ubuntu.terminal.pot 2015-03-23 11:12:46 +0000 | |||
3 | +++ po/com.ubuntu.terminal.pot 2015-06-02 19:52:04 +0000 | |||
4 | @@ -8,7 +8,8 @@ | |||
5 | 8 | msgstr "" | 8 | msgstr "" |
6 | 9 | "Project-Id-Version: \n" | 9 | "Project-Id-Version: \n" |
7 | 10 | "Report-Msgid-Bugs-To: \n" | 10 | "Report-Msgid-Bugs-To: \n" |
9 | 11 | "POT-Creation-Date: 2015-03-21 13:11+0100\n" | 11 | |
10 | 12 | "POT-Creation-Date: 2015-04-02 14:49+0200\n" | ||
11 | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | 13 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
12 | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | 14 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
13 | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" | 15 | "Language-Team: LANGUAGE <LL@li.org>\n" |
14 | @@ -53,23 +54,27 @@ | |||
15 | 53 | msgid "Authentication failed" | 54 | msgid "Authentication failed" |
16 | 54 | msgstr "" | 55 | msgstr "" |
17 | 55 | 56 | ||
19 | 56 | #: ../src/app/qml/KeyboardBar.qml:157 | 57 | #: ../src/app/qml/KeyboardBar.qml:163 |
20 | 57 | msgid "Change Keyboard" | 58 | msgid "Change Keyboard" |
21 | 58 | msgstr "" | 59 | msgstr "" |
22 | 59 | 60 | ||
23 | 61 | #: ../src/app/qml/LayoutsPage.qml:27 ../src/app/qml/SettingsPage.qml:36 | ||
24 | 62 | msgid "Layouts" | ||
25 | 63 | msgstr "" | ||
26 | 64 | |||
27 | 60 | #: ../src/app/qml/SettingsPage.qml:27 | 65 | #: ../src/app/qml/SettingsPage.qml:27 |
28 | 61 | msgid "Settings" | 66 | msgid "Settings" |
29 | 62 | msgstr "" | 67 | msgstr "" |
30 | 63 | 68 | ||
32 | 64 | #: ../src/app/qml/SettingsPage.qml:36 | 69 | #: ../src/app/qml/SettingsPage.qml:42 |
33 | 70 | msgid "Show Keyboard Bar" | ||
34 | 71 | msgstr "" | ||
35 | 72 | |||
36 | 73 | #: ../src/app/qml/SettingsPage.qml:52 | ||
37 | 65 | msgid "Font Size:" | 74 | msgid "Font Size:" |
38 | 66 | msgstr "" | 75 | msgstr "" |
39 | 67 | 76 | ||
45 | 68 | #: ../src/app/qml/SettingsPage.qml:59 | 77 | #: ../src/app/qml/SettingsPage.qml:78 |
41 | 69 | msgid "Show Keyboard Bar" | ||
42 | 70 | msgstr "" | ||
43 | 71 | |||
44 | 72 | #: ../src/app/qml/SettingsPage.qml:73 | ||
46 | 73 | msgid "Color Scheme" | 78 | msgid "Color Scheme" |
47 | 74 | msgstr "" | 79 | msgstr "" |
48 | 75 | 80 | ||
49 | 76 | 81 | ||
50 | === modified file 'src/app/fileio.cpp' | |||
51 | --- src/app/fileio.cpp 2015-02-03 21:43:38 +0000 | |||
52 | +++ src/app/fileio.cpp 2015-06-02 19:52:04 +0000 | |||
53 | @@ -8,8 +8,7 @@ | |||
54 | 8 | if (sourceUrl.isEmpty()) | 8 | if (sourceUrl.isEmpty()) |
55 | 9 | return false; | 9 | return false; |
56 | 10 | 10 | ||
59 | 11 | QUrl url(sourceUrl); | 11 | QFile file(sourceUrl); |
58 | 12 | QFile file(url.toLocalFile()); | ||
60 | 13 | if (!file.open(QFile::WriteOnly | QFile::Truncate)) | 12 | if (!file.open(QFile::WriteOnly | QFile::Truncate)) |
61 | 14 | return false; | 13 | return false; |
62 | 15 | 14 | ||
63 | @@ -23,8 +22,7 @@ | |||
64 | 23 | if (sourceUrl.isEmpty()) | 22 | if (sourceUrl.isEmpty()) |
65 | 24 | return ""; | 23 | return ""; |
66 | 25 | 24 | ||
69 | 26 | QUrl url(sourceUrl); | 25 | QFile file(sourceUrl); |
68 | 27 | QFile file(url.toLocalFile()); | ||
70 | 28 | if (!file.open(QFile::ReadOnly)) | 26 | if (!file.open(QFile::ReadOnly)) |
71 | 29 | return ""; | 27 | return ""; |
72 | 30 | 28 | ||
73 | 31 | 29 | ||
74 | === modified file 'src/app/qml/KeyboardBar.qml' | |||
75 | --- src/app/qml/KeyboardBar.qml 2015-02-14 10:33:32 +0000 | |||
76 | +++ src/app/qml/KeyboardBar.qml 2015-06-02 19:52:04 +0000 | |||
77 | @@ -40,13 +40,16 @@ | |||
78 | 40 | } | 40 | } |
79 | 41 | } | 41 | } |
80 | 42 | 42 | ||
82 | 43 | function createLayoutObject(profileUrl) { | 43 | function createLayoutObject(profileObject) { |
83 | 44 | var object = layoutComponent.createObject(keyboardContainer); | 44 | var object = layoutComponent.createObject(keyboardContainer); |
85 | 45 | object.loadProfile(fileIO.read(profileUrl)); | 45 | object.loadProfile(profileObject); |
86 | 46 | return object; | 46 | return object; |
87 | 47 | } | 47 | } |
88 | 48 | 48 | ||
89 | 49 | function disableLayout(index) { | 49 | function disableLayout(index) { |
90 | 50 | if (!isIndexLayoutValid(index)) | ||
91 | 51 | return; | ||
92 | 52 | |||
93 | 50 | var layoutObject = layoutsList.get(index).layout; | 53 | var layoutObject = layoutsList.get(index).layout; |
94 | 51 | layoutObject.visible = false; | 54 | layoutObject.visible = false; |
95 | 52 | layoutObject.enabled = false; | 55 | layoutObject.enabled = false; |
96 | @@ -56,6 +59,9 @@ | |||
97 | 56 | } | 59 | } |
98 | 57 | 60 | ||
99 | 58 | function enableLayout(index) { | 61 | function enableLayout(index) { |
100 | 62 | if (!isIndexLayoutValid(index)) | ||
101 | 63 | return; | ||
102 | 64 | |||
103 | 59 | var layoutObject = layoutsList.get(index).layout; | 65 | var layoutObject = layoutsList.get(index).layout; |
104 | 60 | layoutObject.visible = true; | 66 | layoutObject.visible = true; |
105 | 61 | layoutObject.enabled = true; | 67 | layoutObject.enabled = true; |
106 | @@ -64,10 +70,13 @@ | |||
107 | 64 | layoutObject.simulateCommand.connect(simulateCommand); | 70 | layoutObject.simulateCommand.connect(simulateCommand); |
108 | 65 | } | 71 | } |
109 | 66 | 72 | ||
110 | 73 | function isIndexLayoutValid(index) { | ||
111 | 74 | return (index >= 0 && index < layoutsList.count); | ||
112 | 75 | } | ||
113 | 76 | |||
114 | 67 | function selectLayout(index) { | 77 | function selectLayout(index) { |
116 | 68 | if (index < 0 || index >= layoutsList.count) | 78 | if (!isIndexLayoutValid(index)) |
117 | 69 | return; | 79 | return; |
118 | 70 | |||
119 | 71 | disableLayout(selectedLayoutIndex); | 80 | disableLayout(selectedLayoutIndex); |
120 | 72 | enableLayout(index); | 81 | enableLayout(index); |
121 | 73 | selectedLayoutIndex = index; | 82 | selectedLayoutIndex = index; |
122 | @@ -97,13 +106,19 @@ | |||
123 | 97 | } | 106 | } |
124 | 98 | 107 | ||
125 | 99 | function loadProfiles() { | 108 | function loadProfiles() { |
127 | 100 | for (var i = 0; i < keyboardLayouts.length; i++) { | 109 | dropProfiles(); |
128 | 110 | |||
129 | 111 | for (var i = 0; i < settings.profilesList.count; i++) { | ||
130 | 112 | var profile = settings.profilesList.get(i); | ||
131 | 113 | if (!profile.profileVisible) | ||
132 | 114 | continue; | ||
133 | 115 | |||
134 | 101 | try { | 116 | try { |
137 | 102 | console.log("Loading Layout:", Qt.resolvedUrl(keyboardLayouts[i])); | 117 | console.log("Loading Layout:", Qt.resolvedUrl(profile.file)); |
138 | 103 | var layoutObject = createLayoutObject(Qt.resolvedUrl(keyboardLayouts[i])); | 118 | var layoutObject = createLayoutObject(profile.object); |
139 | 104 | layoutsList.append({layout: layoutObject}); | 119 | layoutsList.append({layout: layoutObject}); |
140 | 105 | } catch (e) { | 120 | } catch (e) { |
142 | 106 | console.error("Error in profile " + keyboardLayouts[i]); | 121 | console.error("Error in profile " + profile.file); |
143 | 107 | console.error(e); | 122 | console.error(e); |
144 | 108 | } | 123 | } |
145 | 109 | } | 124 | } |
146 | @@ -129,9 +144,11 @@ | |||
147 | 129 | } | 144 | } |
148 | 130 | } | 145 | } |
149 | 131 | 146 | ||
150 | 147 | enabled: layoutsList.count != 0 | ||
151 | 148 | |||
152 | 132 | Rectangle { | 149 | Rectangle { |
153 | 133 | anchors.fill: parent | 150 | anchors.fill: parent |
155 | 134 | color: UbuntuColors.orange | 151 | color: parent.enabled ? UbuntuColors.orange : UbuntuColors.warmGrey |
156 | 135 | 152 | ||
157 | 136 | Icon { | 153 | Icon { |
158 | 137 | scale: 0.5 | 154 | scale: 0.5 |
159 | @@ -187,6 +204,11 @@ | |||
160 | 187 | } | 204 | } |
161 | 188 | } | 205 | } |
162 | 189 | 206 | ||
163 | 207 | Connections { | ||
164 | 208 | target: settings | ||
165 | 209 | onProfilesChanged: rootItem.loadProfiles(); | ||
166 | 210 | } | ||
167 | 211 | |||
168 | 190 | Component.onDestruction: dropProfiles(); | 212 | Component.onDestruction: dropProfiles(); |
169 | 191 | Component.onCompleted: loadProfiles(); | 213 | Component.onCompleted: loadProfiles(); |
170 | 192 | } | 214 | } |
171 | 193 | 215 | ||
172 | === modified file 'src/app/qml/KeyboardRows/KeyboardLayout.qml' | |||
173 | --- src/app/qml/KeyboardRows/KeyboardLayout.qml 2015-02-14 10:56:28 +0000 | |||
174 | +++ src/app/qml/KeyboardRows/KeyboardLayout.qml 2015-06-02 19:52:04 +0000 | |||
175 | @@ -68,13 +68,13 @@ | |||
176 | 68 | return objectString; | 68 | return objectString; |
177 | 69 | } | 69 | } |
178 | 70 | 70 | ||
180 | 71 | function loadProfile(profileString) { | 71 | function loadProfile(profileObject) { |
181 | 72 | dropProfile(); | 72 | dropProfile(); |
182 | 73 | 73 | ||
183 | 74 | var maxWidth = 0; | 74 | var maxWidth = 0; |
184 | 75 | 75 | ||
185 | 76 | // This function might raise exceptions which are handled in KeyboardBar.qml | 76 | // This function might raise exceptions which are handled in KeyboardBar.qml |
187 | 77 | var profile = profile = Parser.parseJson(profileString); | 77 | var profile = profileObject; |
188 | 78 | 78 | ||
189 | 79 | name = profile.name; | 79 | name = profile.name; |
190 | 80 | short_name = profile.short_name; | 80 | short_name = profile.short_name; |
191 | 81 | 81 | ||
192 | === added file 'src/app/qml/LayoutsPage.qml' | |||
193 | --- src/app/qml/LayoutsPage.qml 1970-01-01 00:00:00 +0000 | |||
194 | +++ src/app/qml/LayoutsPage.qml 2015-06-02 19:52:04 +0000 | |||
195 | @@ -0,0 +1,47 @@ | |||
196 | 1 | /* | ||
197 | 2 | * Copyright (C) 2013, 2014 Canonical Ltd | ||
198 | 3 | * | ||
199 | 4 | * This program is free software: you can redistribute it and/or modify | ||
200 | 5 | * it under the terms of the GNU General Public License version 3 as | ||
201 | 6 | * published by the Free Software Foundation. | ||
202 | 7 | * | ||
203 | 8 | * This program is distributed in the hope that it will be useful, | ||
204 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
205 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
206 | 11 | * GNU General Public License for more details. | ||
207 | 12 | * | ||
208 | 13 | * You should have received a copy of the GNU General Public License | ||
209 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
210 | 15 | * | ||
211 | 16 | * Authored by: Filippo Scognamiglio <flscogna@gmail.com> | ||
212 | 17 | */ | ||
213 | 18 | |||
214 | 19 | import QtQuick 2.0 | ||
215 | 20 | import Ubuntu.Components 1.1 | ||
216 | 21 | import Ubuntu.Components.ListItems 1.0 as ListItem | ||
217 | 22 | |||
218 | 23 | Page { | ||
219 | 24 | id: rootItem | ||
220 | 25 | objectName: "layoutsPage" | ||
221 | 26 | |||
222 | 27 | title: i18n.tr("Layouts") | ||
223 | 28 | |||
224 | 29 | onVisibleChanged: { | ||
225 | 30 | if (visible === false) | ||
226 | 31 | settings.profilesChanged(); | ||
227 | 32 | } | ||
228 | 33 | |||
229 | 34 | ListView { | ||
230 | 35 | anchors.fill: parent | ||
231 | 36 | model: settings.profilesList | ||
232 | 37 | delegate: ListItem.Standard { | ||
233 | 38 | control: Switch { | ||
234 | 39 | checked: profileVisible | ||
235 | 40 | onCheckedChanged: { | ||
236 | 41 | settings.profilesList.setProperty(index, "profileVisible", checked); | ||
237 | 42 | } | ||
238 | 43 | } | ||
239 | 44 | text: name | ||
240 | 45 | } | ||
241 | 46 | } | ||
242 | 47 | } | ||
243 | 0 | 48 | ||
244 | === modified file 'src/app/qml/SettingsPage.qml' | |||
245 | --- src/app/qml/SettingsPage.qml 2015-01-17 02:02:04 +0000 | |||
246 | +++ src/app/qml/SettingsPage.qml 2015-06-02 19:52:04 +0000 | |||
247 | @@ -30,50 +30,57 @@ | |||
248 | 30 | id: mainColumn | 30 | id: mainColumn |
249 | 31 | 31 | ||
250 | 32 | spacing: units.gu(1) | 32 | spacing: units.gu(1) |
272 | 33 | anchors { margins: units.gu(2); fill: parent } | 33 | anchors.fill: parent |
273 | 34 | 34 | ||
274 | 35 | Label { | 35 | ListItem.Standard { |
275 | 36 | text: i18n.tr("Font Size:") | 36 | text: i18n.tr("Layouts") |
276 | 37 | } | 37 | progression: true |
277 | 38 | 38 | onClicked: pageStack.push(layoutsPage); | |
278 | 39 | Slider { | 39 | } |
279 | 40 | id: slFont | 40 | |
280 | 41 | objectName: "slFont" | 41 | ListItem.Standard { |
281 | 42 | anchors { left: parent.left; right: parent.right } | 42 | text: i18n.tr("Show Keyboard Bar") |
282 | 43 | minimumValue: 8; | 43 | control: Switch { |
283 | 44 | maximumValue: 32; | 44 | onCheckedChanged: settings.showKeyboardBar = checked; |
284 | 45 | onValueChanged: { | 45 | Component.onCompleted: checked = settings.showKeyboardBar; |
285 | 46 | settings.fontSize = value; | 46 | } |
286 | 47 | } | 47 | } |
266 | 48 | Component.onCompleted: { | ||
267 | 49 | value = settings.fontSize; | ||
268 | 50 | } | ||
269 | 51 | } | ||
270 | 52 | |||
271 | 53 | ListItem.ThinDivider { } | ||
287 | 54 | 48 | ||
288 | 55 | ListItem.Empty { | 49 | ListItem.Empty { |
290 | 56 | showDivider: false | 50 | height: units.gu(10) |
291 | 57 | Label { | 51 | Label { |
294 | 58 | anchors { left: parent.left; verticalCenter: parent.verticalCenter } | 52 | text: i18n.tr("Font Size:") |
295 | 59 | text: i18n.tr("Show Keyboard Bar") | 53 | x: units.gu(2) |
296 | 60 | } | 54 | } |
301 | 61 | Switch { | 55 | Slider { |
302 | 62 | anchors { right: parent.right; verticalCenter: parent.verticalCenter } | 56 | id: slFont |
303 | 63 | onCheckedChanged: settings.showKeyboardBar = checked; | 57 | objectName: "slFont" |
304 | 64 | Component.onCompleted: checked = settings.showKeyboardBar; | 58 | anchors { |
305 | 59 | left: parent.left | ||
306 | 60 | right: parent.right | ||
307 | 61 | bottom: parent.bottom | ||
308 | 62 | margins: units.gu(2) | ||
309 | 63 | } | ||
310 | 64 | minimumValue: 8; | ||
311 | 65 | maximumValue: 32; | ||
312 | 66 | onValueChanged: { | ||
313 | 67 | settings.fontSize = value; | ||
314 | 68 | } | ||
315 | 69 | Component.onCompleted: { | ||
316 | 70 | value = settings.fontSize; | ||
317 | 71 | } | ||
318 | 65 | } | 72 | } |
319 | 66 | } | 73 | } |
320 | 67 | 74 | ||
321 | 68 | ListItem.ThinDivider { } | ||
322 | 69 | |||
323 | 70 | OptionSelector { | 75 | OptionSelector { |
324 | 71 | id: colorsSchemeSelector | 76 | id: colorsSchemeSelector |
325 | 72 | objectName: "colorsSchemeSelector" | 77 | objectName: "colorsSchemeSelector" |
326 | 73 | text: i18n.tr("Color Scheme") | 78 | text: i18n.tr("Color Scheme") |
327 | 79 | width: parent.width - units.gu(4) | ||
328 | 80 | x: units.gu(2) | ||
329 | 74 | 81 | ||
330 | 75 | // TODO Hackish, but works quite well. | 82 | // TODO Hackish, but works quite well. |
332 | 76 | containerHeight: parent.height - y - units.gu(4) | 83 | containerHeight: parent.height - y - units.gu(6) |
333 | 77 | 84 | ||
334 | 78 | // TODO This is a workaround at the moment. | 85 | // TODO This is a workaround at the moment. |
335 | 79 | // The application should get them from the c++. | 86 | // The application should get them from the c++. |
336 | 80 | 87 | ||
337 | === modified file 'src/app/qml/TerminalSettings.qml' | |||
338 | --- src/app/qml/TerminalSettings.qml 2015-01-17 02:02:04 +0000 | |||
339 | +++ src/app/qml/TerminalSettings.qml 2015-06-02 19:52:04 +0000 | |||
340 | @@ -1,9 +1,73 @@ | |||
341 | 1 | import QtQuick 2.0 | 1 | import QtQuick 2.0 |
342 | 2 | import Qt.labs.settings 1.0 | 2 | import Qt.labs.settings 1.0 |
343 | 3 | 3 | ||
349 | 4 | Settings { | 4 | import "KeyboardRows/jsonParser.js" as Parser |
350 | 5 | property int fontSize: 14 | 5 | |
351 | 6 | property string fontStyle: "Ubuntu Mono" | 6 | Item { |
352 | 7 | property string colorScheme: "Ubuntu" | 7 | id: rootItem |
353 | 8 | property bool showKeyboardBar: true | 8 | property alias fontSize: innerSettings.fontSize |
354 | 9 | property alias fontStyle: innerSettings.fontStyle | ||
355 | 10 | property alias colorScheme: innerSettings.colorScheme | ||
356 | 11 | property alias showKeyboardBar: innerSettings.showKeyboardBar | ||
357 | 12 | |||
358 | 13 | property alias jsonVisibleProfiles: innerSettings.jsonVisibleProfiles | ||
359 | 14 | |||
360 | 15 | property ListModel profilesList: ListModel {} | ||
361 | 16 | |||
362 | 17 | signal profilesChanged(); | ||
363 | 18 | |||
364 | 19 | onProfilesChanged: saveProfileVisibleStrings(); | ||
365 | 20 | |||
366 | 21 | function saveProfileVisibleStrings() { | ||
367 | 22 | var result = {}; | ||
368 | 23 | |||
369 | 24 | for (var i = 0; i < profilesList.count; i++) { | ||
370 | 25 | var profileObject = profilesList.get(i); | ||
371 | 26 | result[profileObject.file] = profileObject.profileVisible; | ||
372 | 27 | } | ||
373 | 28 | |||
374 | 29 | jsonVisibleProfiles = JSON.stringify(result); | ||
375 | 30 | } | ||
376 | 31 | |||
377 | 32 | Settings { | ||
378 | 33 | id: innerSettings | ||
379 | 34 | property int fontSize: 14 | ||
380 | 35 | property string fontStyle: "Ubuntu Mono" | ||
381 | 36 | property string colorScheme: "Ubuntu" | ||
382 | 37 | property bool showKeyboardBar: true | ||
383 | 38 | property string jsonVisibleProfiles: "[]" | ||
384 | 39 | } | ||
385 | 40 | |||
386 | 41 | // Load the keyboard profiles. | ||
387 | 42 | Component.onCompleted: { | ||
388 | 43 | var visibleProfiles = undefined; | ||
389 | 44 | try { | ||
390 | 45 | visibleProfiles = JSON.parse(innerSettings.jsonVisibleProfiles); | ||
391 | 46 | } catch (e) {} | ||
392 | 47 | |||
393 | 48 | function isProfileVisible(profilePath) { | ||
394 | 49 | return !(visibleProfiles[profilePath] == false); | ||
395 | 50 | } | ||
396 | 51 | |||
397 | 52 | for (var i = 0; i < keyboardLayouts.length; i++) { | ||
398 | 53 | var filePath = keyboardLayouts[i]; | ||
399 | 54 | var isVisible = isProfileVisible(filePath); | ||
400 | 55 | |||
401 | 56 | try { | ||
402 | 57 | var profileObject = Parser.parseJson(fileIO.read(filePath)); | ||
403 | 58 | |||
404 | 59 | profilesList.append( | ||
405 | 60 | { | ||
406 | 61 | file: filePath, | ||
407 | 62 | profileVisible: isVisible, | ||
408 | 63 | object: profileObject, | ||
409 | 64 | name: profileObject.name | ||
410 | 65 | }); | ||
411 | 66 | } catch (e) { | ||
412 | 67 | console.error("Error in profile", filePath); | ||
413 | 68 | console.error(e); | ||
414 | 69 | } | ||
415 | 70 | } | ||
416 | 71 | profilesChanged(); | ||
417 | 72 | } | ||
418 | 9 | } | 73 | } |
419 | 10 | 74 | ||
420 | === modified file 'src/app/qml/ubuntu-terminal-app.qml' | |||
421 | --- src/app/qml/ubuntu-terminal-app.qml 2014-12-05 22:52:26 +0000 | |||
422 | +++ src/app/qml/ubuntu-terminal-app.qml 2015-06-02 19:52:04 +0000 | |||
423 | @@ -106,6 +106,11 @@ | |||
424 | 106 | id: settingsPage | 106 | id: settingsPage |
425 | 107 | visible: false | 107 | visible: false |
426 | 108 | } | 108 | } |
427 | 109 | |||
428 | 110 | LayoutsPage { | ||
429 | 111 | id: layoutsPage | ||
430 | 112 | visible: false | ||
431 | 113 | } | ||
432 | 109 | } | 114 | } |
433 | 110 | 115 | ||
434 | 111 | Component.onCompleted: { | 116 | Component.onCompleted: { |
PASSED: Continuous integration, rev:73 91.189. 93.70:8080/ job/ubuntu- terminal- app-ci/ 144/ 91.189. 93.70:8080/ job/generic- mediumtests- utopic/ 2481 91.189. 93.70:8080/ job/generic- mediumtests- utopic/ 2481/artifact/ work/output/ *zip*/output. zip 91.189. 93.70:8080/ job/ubuntu- terminal- app-utopic- amd64-ci/ 65 91.189. 93.70:8080/ job/ubuntu- terminal- app-vivid- amd64-ci/ 28
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: 91.189. 93.70:8080/ job/ubuntu- terminal- app-ci/ 144/rebuild
http://