Merge lp:~nikwen/ubuntu-terminal-app/layout-i18n into lp:~ubuntu-terminal-dev/ubuntu-terminal-app/reboot
- layout-i18n
- Merge into reboot
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Alan Pope πΊπ§π± π¦ | ||||
Approved revision: | 106 | ||||
Merged at revision: | 112 | ||||
Proposed branch: | lp:~nikwen/ubuntu-terminal-app/layout-i18n | ||||
Merge into: | lp:~ubuntu-terminal-dev/ubuntu-terminal-app/reboot | ||||
Diff against target: |
776 lines (+298/-75) 11 files modified
po/com.ubuntu.terminal.pot (+93/-1) src/app/qml/KeyboardRows/JsonTranslator.qml (+115/-0) src/app/qml/KeyboardRows/KeyboardLayout.qml (+31/-9) src/app/qml/KeyboardRows/Layouts/ControlKeys.json (+1/-7) src/app/qml/KeyboardRows/Layouts/FunctionKeys.json (+14/-27) src/app/qml/KeyboardRows/Layouts/Nano.json (+0/-12) src/app/qml/KeyboardRows/Layouts/ScrollKeys.json (+8/-9) src/app/qml/KeyboardRows/Layouts/SimpleCommands.json (+1/-2) src/app/qml/KeyboardRows/jsonParser.js (+22/-6) src/app/qml/TerminalSettings.qml (+8/-2) src/app/qml/ubuntu-terminal-app.qml (+5/-0) |
||||
To merge this branch: | bzr merge lp:~nikwen/ubuntu-terminal-app/layout-i18n | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Approve | |
Alan Pope πΊπ§π± π¦ (community) | Approve | ||
Review via email: mp+264620@code.launchpad.net |
Commit message
Add the ability to translate strings from json profiles
Description of the change
Add the ability to translate strings from json profiles
Niklas Wenzel (nikwen) wrote : | # |
Niklas Wenzel (nikwen) wrote : | # |
Should be fixed now. :)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:102
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:103
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Alan Pope πΊπ§π± π¦ (popey) wrote : | # |
Looks good, thanks Niklas!
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Alan Pope πΊπ§π± π¦ (popey) wrote : | # |
Looks like a couple of merge conflicts.
Niklas Wenzel (nikwen) wrote : | # |
I'll get to them. Thank you for reviewing this one as well. :)
- 104. By Niklas Wenzel
-
Merge master
- 105. By Niklas Wenzel
-
Update JsonTranslator to the new UITK as well
Niklas Wenzel (nikwen) wrote : | # |
I resolved the conflicts. Should be ready for merging now. :)
Niklas Wenzel (nikwen) wrote : | # |
Oh no! I found a bug!
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:105
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 106. By Niklas Wenzel
-
Fix error due to which the layout descriptions would not appear in the KeyboardBar
Niklas Wenzel (nikwen) wrote : | # |
Fixed now. :)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:106
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Niklas Wenzel (nikwen) wrote : | # |
Thanks for merging. :)
Preview Diff
1 | === modified file 'po/com.ubuntu.terminal.pot' | |||
2 | --- po/com.ubuntu.terminal.pot 2015-08-02 13:04:57 +0000 | |||
3 | +++ po/com.ubuntu.terminal.pot 2015-08-09 14:25:46 +0000 | |||
4 | @@ -8,7 +8,7 @@ | |||
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-08-02 15:04+0200\n" | 11 | "POT-Creation-Date: 2015-08-09 16:01+0200\n" |
10 | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
11 | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
12 | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" |
13 | @@ -57,6 +57,98 @@ | |||
14 | 57 | msgid "Change Keyboard" | 57 | msgid "Change Keyboard" |
15 | 58 | msgstr "" | 58 | msgstr "" |
16 | 59 | 59 | ||
17 | 60 | #. TRANSLATORS: This a keyboard layout name | ||
18 | 61 | #: ../src/app/qml/KeyboardRows/JsonTranslator.qml:18 | ||
19 | 62 | msgid "Control Keys" | ||
20 | 63 | msgstr "" | ||
21 | 64 | |||
22 | 65 | #. TRANSLATORS: This a keyboard layout name | ||
23 | 66 | #: ../src/app/qml/KeyboardRows/JsonTranslator.qml:21 | ||
24 | 67 | msgid "Function Keys" | ||
25 | 68 | msgstr "" | ||
26 | 69 | |||
27 | 70 | #. TRANSLATORS: This a keyboard layout name | ||
28 | 71 | #: ../src/app/qml/KeyboardRows/JsonTranslator.qml:24 | ||
29 | 72 | msgid "Scroll Keys" | ||
30 | 73 | msgstr "" | ||
31 | 74 | |||
32 | 75 | #. TRANSLATORS: This a keyboard layout name | ||
33 | 76 | #: ../src/app/qml/KeyboardRows/JsonTranslator.qml:27 | ||
34 | 77 | msgid "Command Keys" | ||
35 | 78 | msgstr "" | ||
36 | 79 | |||
37 | 80 | #. TRANSLATORS: This the short display name of a keyboard layout. It should be no longer than 4 characters! | ||
38 | 81 | #. TRANSLATORS: This is the name of the Control key. All letters should be uppercase! | ||
39 | 82 | #: ../src/app/qml/KeyboardRows/JsonTranslator.qml:35 | ||
40 | 83 | #: ../src/app/qml/KeyboardRows/JsonTranslator.qml:61 | ||
41 | 84 | msgid "CTRL" | ||
42 | 85 | msgstr "" | ||
43 | 86 | |||
44 | 87 | #. TRANSLATORS: This the short display name of a keyboard layout. It should be no longer than 4 characters! | ||
45 | 88 | #: ../src/app/qml/KeyboardRows/JsonTranslator.qml:38 | ||
46 | 89 | msgid "FNS" | ||
47 | 90 | msgstr "" | ||
48 | 91 | |||
49 | 92 | #. TRANSLATORS: This the short display name of a keyboard layout. It should be no longer than 4 characters! | ||
50 | 93 | #: ../src/app/qml/KeyboardRows/JsonTranslator.qml:41 | ||
51 | 94 | msgid "SCR" | ||
52 | 95 | msgstr "" | ||
53 | 96 | |||
54 | 97 | #. TRANSLATORS: This the short display name of a keyboard layout. It should be no longer than 4 characters! | ||
55 | 98 | #: ../src/app/qml/KeyboardRows/JsonTranslator.qml:44 | ||
56 | 99 | msgid "CMD" | ||
57 | 100 | msgstr "" | ||
58 | 101 | |||
59 | 102 | #. TRANSLATORS: This is the name of the Alt key. All letters should be uppercase! | ||
60 | 103 | #: ../src/app/qml/KeyboardRows/JsonTranslator.qml:64 | ||
61 | 104 | msgid "ALT" | ||
62 | 105 | msgstr "" | ||
63 | 106 | |||
64 | 107 | #. TRANSLATORS: This is the name of the Shift key. All letters should be uppercase! | ||
65 | 108 | #: ../src/app/qml/KeyboardRows/JsonTranslator.qml:67 | ||
66 | 109 | msgid "SHIFT" | ||
67 | 110 | msgstr "" | ||
68 | 111 | |||
69 | 112 | #. TRANSLATORS: This is the name of the Escape key. All letters should be uppercase! | ||
70 | 113 | #: ../src/app/qml/KeyboardRows/JsonTranslator.qml:80 | ||
71 | 114 | msgid "ESC" | ||
72 | 115 | msgstr "" | ||
73 | 116 | |||
74 | 117 | #. TRANSLATORS: This is the name of the Page Up key. All letters should be uppercase! | ||
75 | 118 | #: ../src/app/qml/KeyboardRows/JsonTranslator.qml:83 | ||
76 | 119 | msgid "PG_UP" | ||
77 | 120 | msgstr "" | ||
78 | 121 | |||
79 | 122 | #. TRANSLATORS: This is the name of the Page Down key. All letters should be uppercase! | ||
80 | 123 | #: ../src/app/qml/KeyboardRows/JsonTranslator.qml:86 | ||
81 | 124 | msgid "PG_DN" | ||
82 | 125 | msgstr "" | ||
83 | 126 | |||
84 | 127 | #. TRANSLATORS: This is the name of the Delete key. All letters should be uppercase! | ||
85 | 128 | #: ../src/app/qml/KeyboardRows/JsonTranslator.qml:89 | ||
86 | 129 | msgid "DEL" | ||
87 | 130 | msgstr "" | ||
88 | 131 | |||
89 | 132 | #. TRANSLATORS: This is the name of the Home key. All letters should be uppercase! | ||
90 | 133 | #: ../src/app/qml/KeyboardRows/JsonTranslator.qml:92 | ||
91 | 134 | msgid "HOME" | ||
92 | 135 | msgstr "" | ||
93 | 136 | |||
94 | 137 | #. TRANSLATORS: This is the name of the End key. All letters should be uppercase! | ||
95 | 138 | #: ../src/app/qml/KeyboardRows/JsonTranslator.qml:95 | ||
96 | 139 | msgid "END" | ||
97 | 140 | msgstr "" | ||
98 | 141 | |||
99 | 142 | #. TRANSLATORS: This is the name of the Tab key. All letters should be uppercase! | ||
100 | 143 | #: ../src/app/qml/KeyboardRows/JsonTranslator.qml:98 | ||
101 | 144 | msgid "TAB" | ||
102 | 145 | msgstr "" | ||
103 | 146 | |||
104 | 147 | #. TRANSLATORS: This is the name of the Enter key. All letters should be uppercase! | ||
105 | 148 | #: ../src/app/qml/KeyboardRows/JsonTranslator.qml:101 | ||
106 | 149 | msgid "ENTER" | ||
107 | 150 | msgstr "" | ||
108 | 151 | |||
109 | 60 | #: ../src/app/qml/LayoutsPage.qml:27 ../src/app/qml/SettingsPage.qml:36 | 152 | #: ../src/app/qml/LayoutsPage.qml:27 ../src/app/qml/SettingsPage.qml:36 |
110 | 61 | msgid "Layouts" | 153 | msgid "Layouts" |
111 | 62 | msgstr "" | 154 | msgstr "" |
112 | 63 | 155 | ||
113 | === added file 'src/app/qml/KeyboardRows/JsonTranslator.qml' | |||
114 | --- src/app/qml/KeyboardRows/JsonTranslator.qml 1970-01-01 00:00:00 +0000 | |||
115 | +++ src/app/qml/KeyboardRows/JsonTranslator.qml 2015-08-09 14:25:46 +0000 | |||
116 | @@ -0,0 +1,115 @@ | |||
117 | 1 | import QtQuick 2.4 | ||
118 | 2 | import Ubuntu.Components 1.2 | ||
119 | 3 | |||
120 | 4 | Item { | ||
121 | 5 | |||
122 | 6 | // Enum for translation types | ||
123 | 7 | readonly property int name: 0 | ||
124 | 8 | readonly property int shortName: 1 | ||
125 | 9 | readonly property int modifier: 2 | ||
126 | 10 | readonly property int key: 3 | ||
127 | 11 | |||
128 | 12 | // The first parameter has to be one of the readonly properties above | ||
129 | 13 | function getTranslatedNameById(type, id) { | ||
130 | 14 | switch(type) { | ||
131 | 15 | case name: | ||
132 | 16 | if (id === "ctrl_keys") { | ||
133 | 17 | // TRANSLATORS: This a keyboard layout name | ||
134 | 18 | return i18n.tr("Control Keys"); | ||
135 | 19 | } else if (id === "fn_keys") { | ||
136 | 20 | // TRANSLATORS: This a keyboard layout name | ||
137 | 21 | return i18n.tr("Function Keys"); | ||
138 | 22 | } else if (id === "scroll_keys") { | ||
139 | 23 | // TRANSLATORS: This a keyboard layout name | ||
140 | 24 | return i18n.tr("Scroll Keys"); | ||
141 | 25 | } else if (id === "simple_cmds") { | ||
142 | 26 | // TRANSLATORS: This a keyboard layout name | ||
143 | 27 | return i18n.tr("Command Keys"); | ||
144 | 28 | } | ||
145 | 29 | |||
146 | 30 | return ""; | ||
147 | 31 | case shortName: | ||
148 | 32 | var translation = ""; | ||
149 | 33 | if (id === "ctrl_keys") { | ||
150 | 34 | // TRANSLATORS: This the short display name of a keyboard layout. It should be no longer than 4 characters! | ||
151 | 35 | translation = i18n.tr("CTRL"); | ||
152 | 36 | } else if (id === "fn_keys") { | ||
153 | 37 | // TRANSLATORS: This the short display name of a keyboard layout. It should be no longer than 4 characters! | ||
154 | 38 | translation = i18n.tr("FNS"); | ||
155 | 39 | } else if (id === "scroll_keys") { | ||
156 | 40 | // TRANSLATORS: This the short display name of a keyboard layout. It should be no longer than 4 characters! | ||
157 | 41 | translation = i18n.tr("SCR"); | ||
158 | 42 | } else if (id === "simple_cmds") { | ||
159 | 43 | // TRANSLATORS: This the short display name of a keyboard layout. It should be no longer than 4 characters! | ||
160 | 44 | translation = i18n.tr("CMD"); | ||
161 | 45 | } | ||
162 | 46 | |||
163 | 47 | if (translation !== "") { | ||
164 | 48 | // Shorten the string if the translation is longer than 4 characters | ||
165 | 49 | if (translation.length <= 4) { | ||
166 | 50 | return translation; | ||
167 | 51 | } else { | ||
168 | 52 | return translation.substring(0, 4); | ||
169 | 53 | } | ||
170 | 54 | } | ||
171 | 55 | |||
172 | 56 | return ""; | ||
173 | 57 | case modifier: | ||
174 | 58 | var translation = ""; | ||
175 | 59 | if (id === "Control") { | ||
176 | 60 | // TRANSLATORS: This is the name of the Control key. All letters should be uppercase! | ||
177 | 61 | translation = i18n.tr("CTRL"); | ||
178 | 62 | } else if (id === "Alt") { | ||
179 | 63 | // TRANSLATORS: This is the name of the Alt key. All letters should be uppercase! | ||
180 | 64 | translation = i18n.tr("ALT"); | ||
181 | 65 | } else if (id === "Shift") { | ||
182 | 66 | // TRANSLATORS: This is the name of the Shift key. All letters should be uppercase! | ||
183 | 67 | translation = i18n.tr("SHIFT"); | ||
184 | 68 | } | ||
185 | 69 | |||
186 | 70 | if (translation !== "") { | ||
187 | 71 | // Always return the translation in uppercase letters | ||
188 | 72 | return translation.toUpperCase(); | ||
189 | 73 | } | ||
190 | 74 | |||
191 | 75 | return id; | ||
192 | 76 | case key: | ||
193 | 77 | var translation = ""; | ||
194 | 78 | if (id === "esc_key") { | ||
195 | 79 | // TRANSLATORS: This is the name of the Escape key. All letters should be uppercase! | ||
196 | 80 | translation = i18n.tr("ESC"); | ||
197 | 81 | } else if (id === "pg_up_key") { | ||
198 | 82 | // TRANSLATORS: This is the name of the Page Up key. All letters should be uppercase! | ||
199 | 83 | translation = i18n.tr("PG_UP"); | ||
200 | 84 | } else if (id === "pg_dn_key") { | ||
201 | 85 | // TRANSLATORS: This is the name of the Page Down key. All letters should be uppercase! | ||
202 | 86 | translation = i18n.tr("PG_DN"); | ||
203 | 87 | } else if (id === "del_key") { | ||
204 | 88 | // TRANSLATORS: This is the name of the Delete key. All letters should be uppercase! | ||
205 | 89 | translation = i18n.tr("DEL"); | ||
206 | 90 | } else if (id === "home_key") { | ||
207 | 91 | // TRANSLATORS: This is the name of the Home key. All letters should be uppercase! | ||
208 | 92 | translation = i18n.tr("HOME"); | ||
209 | 93 | } else if (id === "end_key") { | ||
210 | 94 | // TRANSLATORS: This is the name of the End key. All letters should be uppercase! | ||
211 | 95 | translation = i18n.tr("END"); | ||
212 | 96 | } else if (id === "tab_key") { | ||
213 | 97 | // TRANSLATORS: This is the name of the Tab key. All letters should be uppercase! | ||
214 | 98 | translation = i18n.tr("TAB"); | ||
215 | 99 | } else if (id === "enter_key") { | ||
216 | 100 | // TRANSLATORS: This is the name of the Enter key. All letters should be uppercase! | ||
217 | 101 | translation = i18n.tr("ENTER"); | ||
218 | 102 | } | ||
219 | 103 | |||
220 | 104 | if (translation !== "") { | ||
221 | 105 | // Always return the translation in uppercase letters | ||
222 | 106 | return translation.toUpperCase(); | ||
223 | 107 | } | ||
224 | 108 | |||
225 | 109 | return id; | ||
226 | 110 | default: | ||
227 | 111 | return ""; | ||
228 | 112 | } | ||
229 | 113 | } | ||
230 | 114 | |||
231 | 115 | } | ||
232 | 0 | 116 | ||
233 | === modified file 'src/app/qml/KeyboardRows/KeyboardLayout.qml' | |||
234 | --- src/app/qml/KeyboardRows/KeyboardLayout.qml 2015-07-13 20:25:21 +0000 | |||
235 | +++ src/app/qml/KeyboardRows/KeyboardLayout.qml 2015-08-09 14:25:46 +0000 | |||
236 | @@ -7,6 +7,8 @@ | |||
237 | 7 | id: keyboardRow | 7 | id: keyboardRow |
238 | 8 | keyWidth: units.gu(5) | 8 | keyWidth: units.gu(5) |
239 | 9 | 9 | ||
240 | 10 | readonly property variant modifiers: ["Control", "Alt", "Shift"] | ||
241 | 11 | |||
242 | 10 | // This label is used to compute the maximum width of all the controls. | 12 | // This label is used to compute the maximum width of all the controls. |
243 | 11 | Label { | 13 | Label { |
244 | 12 | id: hiddenLabel | 14 | id: hiddenLabel |
245 | @@ -23,7 +25,7 @@ | |||
246 | 23 | function createActionString(action) { | 25 | function createActionString(action) { |
247 | 24 | switch(action.type){ | 26 | switch(action.type){ |
248 | 25 | case "key": | 27 | case "key": |
250 | 26 | return createKeyActionString(action.key, action.mod, action.text); | 28 | return createKeyActionString(action.key, action.mod, action.text, action.id); |
251 | 27 | case "string": | 29 | case "string": |
252 | 28 | return createStringActionString(action.string, action.text); | 30 | return createStringActionString(action.string, action.text); |
253 | 29 | } | 31 | } |
254 | @@ -42,12 +44,11 @@ | |||
255 | 42 | return result + "]"; | 44 | return result + "]"; |
256 | 43 | } | 45 | } |
257 | 44 | 46 | ||
260 | 45 | function createKeyActionString(key, mod, text) { | 47 | function createKeyActionString(key, mod, text, id) { |
261 | 46 | if (["Control", "Alt", "Shift"].indexOf(mod) === -1) | 48 | if (modifiers.indexOf(mod) === -1) |
262 | 47 | mod = "No"; | 49 | mod = "No"; |
263 | 48 | 50 | ||
266 | 49 | var textString = text ? "text: \"" + text + "\";" : ""; | 51 | return "Action { text: \"" + createKeyText(key, mod, text, id) + "\"; onTriggered: simulateKey(Qt.Key_"+ key + ", Qt." + mod + "Modifier); }"; |
265 | 50 | return "Action { " + textString + " onTriggered: simulateKey(Qt.Key_"+ key + ", Qt." + mod + "Modifier); }"; | ||
267 | 51 | } | 52 | } |
268 | 52 | 53 | ||
269 | 53 | function createStringActionString(string, text) { | 54 | function createStringActionString(string, text) { |
270 | @@ -68,6 +69,17 @@ | |||
271 | 68 | return objectString; | 69 | return objectString; |
272 | 69 | } | 70 | } |
273 | 70 | 71 | ||
274 | 72 | function createKeyText(key, mod, text, id) { | ||
275 | 73 | if (id) { | ||
276 | 74 | return translator.getTranslatedNameById(translator.key, id); | ||
277 | 75 | } else if (text) { | ||
278 | 76 | return text; | ||
279 | 77 | } else if (key) { | ||
280 | 78 | return ((mod && modifiers.indexOf(mod) !== -1) ? translator.getTranslatedNameById(translator.modifier, mod) + "+" : "") + key; | ||
281 | 79 | } else | ||
282 | 80 | return ""; | ||
283 | 81 | } | ||
284 | 82 | |||
285 | 71 | function loadProfile(profileObject) { | 83 | function loadProfile(profileObject) { |
286 | 72 | dropProfile(); | 84 | dropProfile(); |
287 | 73 | 85 | ||
288 | @@ -76,28 +88,38 @@ | |||
289 | 76 | // This function might raise exceptions which are handled in KeyboardBar.qml | 88 | // This function might raise exceptions which are handled in KeyboardBar.qml |
290 | 77 | var profile = profileObject; | 89 | var profile = profileObject; |
291 | 78 | 90 | ||
294 | 79 | name = profile.name; | 91 | name = ""; |
295 | 80 | short_name = profile.short_name; | 92 | short_name = ""; |
296 | 93 | if (profile.id) { | ||
297 | 94 | name = translator.getTranslatedNameById(translator.name, profile.id); | ||
298 | 95 | short_name = translator.getTranslatedNameById(translator.shortName, profile.id); | ||
299 | 96 | } | ||
300 | 97 | if (name === "") | ||
301 | 98 | name = profile.name; | ||
302 | 99 | if (short_name === "") | ||
303 | 100 | short_name = profile.short_name; | ||
304 | 81 | 101 | ||
305 | 82 | var layoutModel = [] | 102 | var layoutModel = [] |
306 | 83 | for (var i = 0; i < profile.buttons.length; i++) { | 103 | for (var i = 0; i < profile.buttons.length; i++) { |
307 | 84 | var button = profile.buttons[i]; | 104 | var button = profile.buttons[i]; |
308 | 105 | var keyText = createKeyText(button.main_action.key, button.main_action.mod, button.main_action.text, button.main_action.id); | ||
309 | 85 | var mainActionString = createActionString(button.main_action); | 106 | var mainActionString = createActionString(button.main_action); |
310 | 86 | 107 | ||
311 | 87 | var otherActionsString = button.other_actions | 108 | var otherActionsString = button.other_actions |
312 | 88 | ? createOtherActionsString(button.other_actions) | 109 | ? createOtherActionsString(button.other_actions) |
313 | 89 | : "[]"; | 110 | : "[]"; |
314 | 90 | 111 | ||
316 | 91 | var entryString = createEntryString(button.main_action.text, mainActionString, otherActionsString); | 112 | var entryString = createEntryString(keyText, mainActionString, otherActionsString); |
317 | 92 | 113 | ||
318 | 93 | layoutModel.push(Qt.createQmlObject(entryString, keyboardRow)); | 114 | layoutModel.push(Qt.createQmlObject(entryString, keyboardRow)); |
319 | 94 | 115 | ||
321 | 95 | hiddenLabel.text = button.main_action.text; | 116 | hiddenLabel.text = keyText; |
322 | 96 | maxWidth = Math.max(hiddenLabel.width, maxWidth); | 117 | maxWidth = Math.max(hiddenLabel.width, maxWidth); |
323 | 97 | } | 118 | } |
324 | 98 | 119 | ||
325 | 99 | keyWidth = maxWidth + units.gu(3); | 120 | keyWidth = maxWidth + units.gu(3); |
326 | 100 | model = layoutModel; | 121 | model = layoutModel; |
327 | 101 | } | 122 | } |
328 | 123 | |||
329 | 102 | Component.onDestruction: dropProfile(); | 124 | Component.onDestruction: dropProfile(); |
330 | 103 | } | 125 | } |
331 | 104 | 126 | ||
332 | === modified file 'src/app/qml/KeyboardRows/Layouts/ControlKeys.json' | |||
333 | --- src/app/qml/KeyboardRows/Layouts/ControlKeys.json 2015-04-21 09:44:54 +0000 | |||
334 | +++ src/app/qml/KeyboardRows/Layouts/ControlKeys.json 2015-08-09 14:25:46 +0000 | |||
335 | @@ -1,12 +1,10 @@ | |||
336 | 1 | { | 1 | { |
339 | 2 | "name" : "Control Keys", | 2 | "id" : "ctrl_keys", |
338 | 3 | "short_name" : "CTRL", | ||
340 | 4 | 3 | ||
341 | 5 | "buttons": [ | 4 | "buttons": [ |
342 | 6 | { | 5 | { |
343 | 7 | "main_action" : { | 6 | "main_action" : { |
344 | 8 | "type": "key", | 7 | "type": "key", |
345 | 9 | "text" : "CTRL+R", | ||
346 | 10 | "key" : "R", | 8 | "key" : "R", |
347 | 11 | "mod" : "Control" | 9 | "mod" : "Control" |
348 | 12 | } | 10 | } |
349 | @@ -14,7 +12,6 @@ | |||
350 | 14 | { | 12 | { |
351 | 15 | "main_action" : { | 13 | "main_action" : { |
352 | 16 | "type": "key", | 14 | "type": "key", |
353 | 17 | "text" : "CTRL+C", | ||
354 | 18 | "key" : "C", | 15 | "key" : "C", |
355 | 19 | "mod" : "Control" | 16 | "mod" : "Control" |
356 | 20 | } | 17 | } |
357 | @@ -22,7 +19,6 @@ | |||
358 | 22 | { | 19 | { |
359 | 23 | "main_action" : { | 20 | "main_action" : { |
360 | 24 | "type": "key", | 21 | "type": "key", |
361 | 25 | "text" : "CTRL+A", | ||
362 | 26 | "key" : "A", | 22 | "key" : "A", |
363 | 27 | "mod" : "Control" | 23 | "mod" : "Control" |
364 | 28 | } | 24 | } |
365 | @@ -30,7 +26,6 @@ | |||
366 | 30 | { | 26 | { |
367 | 31 | "main_action" : { | 27 | "main_action" : { |
368 | 32 | "type": "key", | 28 | "type": "key", |
369 | 33 | "text" : "CTRL+Z", | ||
370 | 34 | "key" : "Z", | 29 | "key" : "Z", |
371 | 35 | "mod" : "Control" | 30 | "mod" : "Control" |
372 | 36 | } | 31 | } |
373 | @@ -38,7 +33,6 @@ | |||
374 | 38 | { | 33 | { |
375 | 39 | "main_action" : { | 34 | "main_action" : { |
376 | 40 | "type": "key", | 35 | "type": "key", |
377 | 41 | "text" : "CTRL+D", | ||
378 | 42 | "key" : "D", | 36 | "key" : "D", |
379 | 43 | "mod" : "Control" | 37 | "mod" : "Control" |
380 | 44 | } | 38 | } |
381 | 45 | 39 | ||
382 | === modified file 'src/app/qml/KeyboardRows/Layouts/FunctionKeys.json' | |||
383 | --- src/app/qml/KeyboardRows/Layouts/FunctionKeys.json 2015-02-03 21:43:38 +0000 | |||
384 | +++ src/app/qml/KeyboardRows/Layouts/FunctionKeys.json 2015-08-09 14:25:46 +0000 | |||
385 | @@ -1,96 +1,83 @@ | |||
386 | 1 | { | 1 | { |
389 | 2 | "name" : "Function Keys", | 2 | "id" : "fn_keys", |
388 | 3 | "short_name" : "FNS", | ||
390 | 4 | 3 | ||
391 | 5 | "buttons": [ | 4 | "buttons": [ |
392 | 6 | { | 5 | { |
393 | 7 | "main_action" : { | 6 | "main_action" : { |
394 | 8 | "type": "key", | 7 | "type": "key", |
396 | 9 | "text" : "ESC", | 8 | "id" : "esc_key", |
397 | 10 | "key" : "Escape" | 9 | "key" : "Escape" |
398 | 11 | } | 10 | } |
399 | 12 | }, | 11 | }, |
400 | 13 | { | 12 | { |
401 | 14 | "main_action" : { | 13 | "main_action" : { |
402 | 15 | "type": "key", | 14 | "type": "key", |
403 | 16 | "text" : "F1", | ||
404 | 17 | "key" : "F1" | 15 | "key" : "F1" |
405 | 18 | } | 16 | } |
406 | 19 | }, | 17 | }, |
407 | 20 | { | 18 | { |
408 | 21 | "main_action" : { | 19 | "main_action" : { |
409 | 22 | "type": "key", | 20 | "type": "key", |
410 | 23 | "text" : "F2", | ||
411 | 24 | "key" : "F2" | 21 | "key" : "F2" |
412 | 25 | } | 22 | } |
413 | 26 | }, | 23 | }, |
414 | 27 | { | 24 | { |
415 | 28 | "main_action" : { | 25 | "main_action" : { |
416 | 29 | "type": "key", | 26 | "type": "key", |
417 | 30 | "text" : "F3", | ||
418 | 31 | "key" : "F3" | 27 | "key" : "F3" |
419 | 32 | } | 28 | } |
420 | 33 | }, | 29 | }, |
421 | 34 | { | 30 | { |
422 | 35 | "main_action" : { | 31 | "main_action" : { |
423 | 36 | "type": "key", | 32 | "type": "key", |
424 | 37 | "text" : "F4", | ||
425 | 38 | "key" : "F4" | 33 | "key" : "F4" |
426 | 39 | } | 34 | } |
427 | 40 | }, | 35 | }, |
428 | 41 | { | 36 | { |
429 | 42 | "main_action" : { | 37 | "main_action" : { |
430 | 43 | "type": "key", | 38 | "type": "key", |
431 | 44 | "text" : "F5", | ||
432 | 45 | "key" : "F5" | 39 | "key" : "F5" |
433 | 46 | } | 40 | } |
434 | 47 | }, | 41 | }, |
435 | 48 | { | 42 | { |
436 | 49 | "main_action" : { | 43 | "main_action" : { |
437 | 50 | "type": "key", | 44 | "type": "key", |
438 | 51 | "text" : "F6", | ||
439 | 52 | "key" : "F6" | 45 | "key" : "F6" |
440 | 53 | } | 46 | } |
441 | 54 | }, | 47 | }, |
442 | 55 | { | 48 | { |
443 | 56 | "main_action" : { | 49 | "main_action" : { |
444 | 57 | "type": "key", | 50 | "type": "key", |
445 | 58 | "text" : "F7", | ||
446 | 59 | "key" : "F7" | 51 | "key" : "F7" |
447 | 60 | } | 52 | } |
448 | 61 | }, | 53 | }, |
449 | 62 | { | 54 | { |
450 | 63 | "main_action" : { | 55 | "main_action" : { |
451 | 64 | "type": "key", | 56 | "type": "key", |
452 | 65 | "text" : "F8", | ||
453 | 66 | "key" : "F8" | 57 | "key" : "F8" |
454 | 67 | } | 58 | } |
455 | 68 | }, | 59 | }, |
456 | 69 | { | 60 | { |
457 | 70 | "main_action" : { | 61 | "main_action" : { |
458 | 71 | "type": "key", | 62 | "type": "key", |
459 | 72 | "text" : "F9", | ||
460 | 73 | "key" : "F9" | 63 | "key" : "F9" |
461 | 74 | } | 64 | } |
462 | 75 | }, | 65 | }, |
463 | 76 | { | 66 | { |
464 | 77 | "main_action" : { | 67 | "main_action" : { |
465 | 78 | "type": "key", | 68 | "type": "key", |
481 | 79 | "text" : "F10", | 69 | "key" : "F10" |
482 | 80 | "key" : "F10" | 70 | } |
483 | 81 | } | 71 | }, |
484 | 82 | }, | 72 | { |
485 | 83 | { | 73 | "main_action" : { |
486 | 84 | "main_action" : { | 74 | "type": "key", |
487 | 85 | "type": "key", | 75 | "key" : "F10" |
488 | 86 | "text" : "F10", | 76 | } |
489 | 87 | "key" : "F10" | 77 | }, |
490 | 88 | } | 78 | { |
491 | 89 | }, | 79 | "main_action" : { |
492 | 90 | { | 80 | "type": "key", |
478 | 91 | "main_action" : { | ||
479 | 92 | "type": "key", | ||
480 | 93 | "text" : "F11", | ||
493 | 94 | "key" : "F11" | 81 | "key" : "F11" |
494 | 95 | } | 82 | } |
495 | 96 | } | 83 | } |
496 | 97 | 84 | ||
497 | === modified file 'src/app/qml/KeyboardRows/Layouts/Nano.json' | |||
498 | --- src/app/qml/KeyboardRows/Layouts/Nano.json 2015-03-25 21:08:22 +0000 | |||
499 | +++ src/app/qml/KeyboardRows/Layouts/Nano.json 2015-08-09 14:25:46 +0000 | |||
500 | @@ -6,7 +6,6 @@ | |||
501 | 6 | { | 6 | { |
502 | 7 | "main_action" : { | 7 | "main_action" : { |
503 | 8 | "type": "key", | 8 | "type": "key", |
504 | 9 | "text" : "CTRL+G", | ||
505 | 10 | "key" : "G", | 9 | "key" : "G", |
506 | 11 | "mod" : "Control" | 10 | "mod" : "Control" |
507 | 12 | } | 11 | } |
508 | @@ -14,7 +13,6 @@ | |||
509 | 14 | { | 13 | { |
510 | 15 | "main_action" : { | 14 | "main_action" : { |
511 | 16 | "type": "key", | 15 | "type": "key", |
512 | 17 | "text" : "CTRL+O", | ||
513 | 18 | "key" : "O", | 16 | "key" : "O", |
514 | 19 | "mod" : "Control" | 17 | "mod" : "Control" |
515 | 20 | } | 18 | } |
516 | @@ -22,7 +20,6 @@ | |||
517 | 22 | { | 20 | { |
518 | 23 | "main_action" : { | 21 | "main_action" : { |
519 | 24 | "type": "key", | 22 | "type": "key", |
520 | 25 | "text" : "CTRL+R", | ||
521 | 26 | "key" : "R", | 23 | "key" : "R", |
522 | 27 | "mod" : "Control" | 24 | "mod" : "Control" |
523 | 28 | } | 25 | } |
524 | @@ -30,7 +27,6 @@ | |||
525 | 30 | { | 27 | { |
526 | 31 | "main_action" : { | 28 | "main_action" : { |
527 | 32 | "type": "key", | 29 | "type": "key", |
528 | 33 | "text" : "CTRL+Y", | ||
529 | 34 | "key" : "Y", | 30 | "key" : "Y", |
530 | 35 | "mod" : "Control" | 31 | "mod" : "Control" |
531 | 36 | } | 32 | } |
532 | @@ -38,7 +34,6 @@ | |||
533 | 38 | { | 34 | { |
534 | 39 | "main_action" : { | 35 | "main_action" : { |
535 | 40 | "type": "key", | 36 | "type": "key", |
536 | 41 | "text" : "CTRL+K", | ||
537 | 42 | "key" : "K", | 37 | "key" : "K", |
538 | 43 | "mod" : "Control" | 38 | "mod" : "Control" |
539 | 44 | } | 39 | } |
540 | @@ -46,7 +41,6 @@ | |||
541 | 46 | { | 41 | { |
542 | 47 | "main_action" : { | 42 | "main_action" : { |
543 | 48 | "type": "key", | 43 | "type": "key", |
544 | 49 | "text" : "CTRL+C", | ||
545 | 50 | "key" : "C", | 44 | "key" : "C", |
546 | 51 | "mod" : "Control" | 45 | "mod" : "Control" |
547 | 52 | } | 46 | } |
548 | @@ -55,7 +49,6 @@ | |||
549 | 55 | { | 49 | { |
550 | 56 | "main_action" : { | 50 | "main_action" : { |
551 | 57 | "type": "key", | 51 | "type": "key", |
552 | 58 | "text" : "CTRL+X", | ||
553 | 59 | "key" : "X", | 52 | "key" : "X", |
554 | 60 | "mod" : "Control" | 53 | "mod" : "Control" |
555 | 61 | } | 54 | } |
556 | @@ -63,7 +56,6 @@ | |||
557 | 63 | { | 56 | { |
558 | 64 | "main_action" : { | 57 | "main_action" : { |
559 | 65 | "type": "key", | 58 | "type": "key", |
560 | 66 | "text" : "CTRL+J", | ||
561 | 67 | "key" : "J", | 59 | "key" : "J", |
562 | 68 | "mod" : "Control" | 60 | "mod" : "Control" |
563 | 69 | } | 61 | } |
564 | @@ -71,7 +63,6 @@ | |||
565 | 71 | { | 63 | { |
566 | 72 | "main_action" : { | 64 | "main_action" : { |
567 | 73 | "type": "key", | 65 | "type": "key", |
568 | 74 | "text" : "CTRL+W", | ||
569 | 75 | "key" : "W", | 66 | "key" : "W", |
570 | 76 | "mod" : "Control" | 67 | "mod" : "Control" |
571 | 77 | } | 68 | } |
572 | @@ -79,7 +70,6 @@ | |||
573 | 79 | { | 70 | { |
574 | 80 | "main_action" : { | 71 | "main_action" : { |
575 | 81 | "type": "key", | 72 | "type": "key", |
576 | 82 | "text" : "CTRL+V", | ||
577 | 83 | "key" : "V", | 73 | "key" : "V", |
578 | 84 | "mod" : "Control" | 74 | "mod" : "Control" |
579 | 85 | } | 75 | } |
580 | @@ -87,7 +77,6 @@ | |||
581 | 87 | { | 77 | { |
582 | 88 | "main_action" : { | 78 | "main_action" : { |
583 | 89 | "type": "key", | 79 | "type": "key", |
584 | 90 | "text" : "CTRL+U", | ||
585 | 91 | "key" : "U", | 80 | "key" : "U", |
586 | 92 | "mod" : "Control" | 81 | "mod" : "Control" |
587 | 93 | } | 82 | } |
588 | @@ -95,7 +84,6 @@ | |||
589 | 95 | { | 84 | { |
590 | 96 | "main_action" : { | 85 | "main_action" : { |
591 | 97 | "type": "key", | 86 | "type": "key", |
592 | 98 | "text" : "CTRL+T", | ||
593 | 99 | "key" : "T", | 87 | "key" : "T", |
594 | 100 | "mod" : "Control" | 88 | "mod" : "Control" |
595 | 101 | } | 89 | } |
596 | 102 | 90 | ||
597 | === modified file 'src/app/qml/KeyboardRows/Layouts/ScrollKeys.json' | |||
598 | --- src/app/qml/KeyboardRows/Layouts/ScrollKeys.json 2015-06-02 09:49:00 +0000 | |||
599 | +++ src/app/qml/KeyboardRows/Layouts/ScrollKeys.json 2015-08-09 14:25:46 +0000 | |||
600 | @@ -1,54 +1,53 @@ | |||
601 | 1 | { | 1 | { |
604 | 2 | "name" : "Scroll Keys", | 2 | "id" : "scroll_keys", |
603 | 3 | "short_name" : "SCR", | ||
605 | 4 | 3 | ||
606 | 5 | "buttons": [ | 4 | "buttons": [ |
607 | 6 | { | 5 | { |
608 | 7 | "main_action" : { | 6 | "main_action" : { |
609 | 8 | "type": "key", | 7 | "type": "key", |
611 | 9 | "text" : "PG_UP", | 8 | "id" : "pg_up_key", |
612 | 10 | "key" : "PageUp" | 9 | "key" : "PageUp" |
613 | 11 | } | 10 | } |
614 | 12 | }, | 11 | }, |
615 | 13 | { | 12 | { |
616 | 14 | "main_action" : { | 13 | "main_action" : { |
617 | 15 | "type": "key", | 14 | "type": "key", |
619 | 16 | "text" : "PG_DN", | 15 | "id" : "pg_dn_key", |
620 | 17 | "key" : "PageDown" | 16 | "key" : "PageDown" |
621 | 18 | } | 17 | } |
622 | 19 | }, | 18 | }, |
623 | 20 | { | 19 | { |
624 | 21 | "main_action" : { | 20 | "main_action" : { |
625 | 22 | "type": "key", | 21 | "type": "key", |
627 | 23 | "text" : "DEL", | 22 | "id" : "del_key", |
628 | 24 | "key" : "Delete" | 23 | "key" : "Delete" |
629 | 25 | } | 24 | } |
630 | 26 | }, | 25 | }, |
631 | 27 | { | 26 | { |
632 | 28 | "main_action" : { | 27 | "main_action" : { |
633 | 29 | "type": "key", | 28 | "type": "key", |
635 | 30 | "text" : "HOME", | 29 | "id" : "home_key", |
636 | 31 | "key" : "Home" | 30 | "key" : "Home" |
637 | 32 | } | 31 | } |
638 | 33 | }, | 32 | }, |
639 | 34 | { | 33 | { |
640 | 35 | "main_action" : { | 34 | "main_action" : { |
641 | 36 | "type": "key", | 35 | "type": "key", |
643 | 37 | "text" : "END", | 36 | "id" : "end_key", |
644 | 38 | "key" : "End" | 37 | "key" : "End" |
645 | 39 | } | 38 | } |
646 | 40 | }, | 39 | }, |
647 | 41 | { | 40 | { |
648 | 42 | "main_action" : { | 41 | "main_action" : { |
649 | 43 | "type": "key", | 42 | "type": "key", |
651 | 44 | "text" : "TAB", | 43 | "id" : "tab_key", |
652 | 45 | "key" : "Tab" | 44 | "key" : "Tab" |
653 | 46 | } | 45 | } |
654 | 47 | }, | 46 | }, |
655 | 48 | { | 47 | { |
656 | 49 | "main_action" : { | 48 | "main_action" : { |
657 | 50 | "type": "key", | 49 | "type": "key", |
659 | 51 | "text" : "ENTER", | 50 | "id" : "enter_key", |
660 | 52 | "key" : "Enter" | 51 | "key" : "Enter" |
661 | 53 | } | 52 | } |
662 | 54 | }, | 53 | }, |
663 | 55 | 54 | ||
664 | === modified file 'src/app/qml/KeyboardRows/Layouts/SimpleCommands.json' | |||
665 | --- src/app/qml/KeyboardRows/Layouts/SimpleCommands.json 2015-03-06 11:05:22 +0000 | |||
666 | +++ src/app/qml/KeyboardRows/Layouts/SimpleCommands.json 2015-08-09 14:25:46 +0000 | |||
667 | @@ -1,6 +1,5 @@ | |||
668 | 1 | { | 1 | { |
671 | 2 | "name" : "Commands Key", | 2 | "id" : "simple_cmds", |
670 | 3 | "short_name" : "CMD", | ||
672 | 4 | 3 | ||
673 | 5 | "buttons": [ | 4 | "buttons": [ |
674 | 6 | { | 5 | { |
675 | 7 | 6 | ||
676 | === modified file 'src/app/qml/KeyboardRows/jsonParser.js' | |||
677 | --- src/app/qml/KeyboardRows/jsonParser.js 2015-02-14 12:46:38 +0000 | |||
678 | +++ src/app/qml/KeyboardRows/jsonParser.js 2015-08-09 14:25:46 +0000 | |||
679 | @@ -27,8 +27,16 @@ | |||
680 | 27 | raiseException("type is missing in", actionObject); | 27 | raiseException("type is missing in", actionObject); |
681 | 28 | if (!isAllowed(actionObject.type, ["key", "string"])) | 28 | if (!isAllowed(actionObject.type, ["key", "string"])) |
682 | 29 | raiseException("type must be either key or string in", actionObject); | 29 | raiseException("type must be either key or string in", actionObject); |
685 | 30 | if (!actionObject.text) | 30 | if (!(actionObject.type === "key" ? actionObject.key : actionObject.string)) |
686 | 31 | raiseException("text is missing in", actionObject); | 31 | raiseException(actionObject.type + " is missing in", actionObject); |
687 | 32 | if (actionObject.id && actionObject.text) | ||
688 | 33 | raiseException("Should not define id and text together in", actionObject); | ||
689 | 34 | if (!actionObject.id && !actionObject.text && !(actionObject.type === "key" && actionObject.key)) // We can also build the text from the key | ||
690 | 35 | raiseException("text or id is missing in", actionObject); | ||
691 | 36 | |||
692 | 37 | |||
693 | 38 | // No need to check for "if (!actionObject.id && !actionObject.text)" as we will | ||
694 | 39 | // build the displayed text from the keys in that case | ||
695 | 32 | 40 | ||
696 | 33 | switch (actionObject.type) { | 41 | switch (actionObject.type) { |
697 | 34 | case "key": | 42 | case "key": |
698 | @@ -58,10 +66,18 @@ | |||
699 | 58 | } | 66 | } |
700 | 59 | 67 | ||
701 | 60 | function validateLayout(layoutObject) { | 68 | function validateLayout(layoutObject) { |
706 | 61 | if (!layoutObject.name) | 69 | if (!layoutObject.id) { |
707 | 62 | raiseException("name is missing in ", layoutObject); | 70 | if (!layoutObject.name) |
708 | 63 | if (!layoutObject.short_name) | 71 | raiseException("name or id is missing in", layoutObject); |
709 | 64 | raiseException("short_name is missing in", layoutObject); | 72 | if (!layoutObject.short_name) |
710 | 73 | raiseException("short_name or id is missing in", layoutObject); | ||
711 | 74 | } else { | ||
712 | 75 | if (layoutObject.name) | ||
713 | 76 | raiseException("Should not define id and name together in", layoutObject); | ||
714 | 77 | if (layoutObject.short_name) | ||
715 | 78 | raiseException("Should not define id and short_name together in", layoutObject); | ||
716 | 79 | } | ||
717 | 80 | |||
718 | 65 | if (!layoutObject.buttons) | 81 | if (!layoutObject.buttons) |
719 | 66 | raiseException("buttons is missing in", layoutObject); | 82 | raiseException("buttons is missing in", layoutObject); |
720 | 67 | 83 | ||
721 | 68 | 84 | ||
722 | === modified file 'src/app/qml/TerminalSettings.qml' | |||
723 | --- src/app/qml/TerminalSettings.qml 2015-07-13 20:25:21 +0000 | |||
724 | +++ src/app/qml/TerminalSettings.qml 2015-08-09 14:25:46 +0000 | |||
725 | @@ -50,7 +50,7 @@ | |||
726 | 50 | } catch (e) {} | 50 | } catch (e) {} |
727 | 51 | 51 | ||
728 | 52 | function isProfileVisible(profilePath) { | 52 | function isProfileVisible(profilePath) { |
730 | 53 | return !(visibleProfiles[profilePath] == false); | 53 | return !(visibleProfiles[profilePath] === false); |
731 | 54 | } | 54 | } |
732 | 55 | 55 | ||
733 | 56 | for (var i = 0; i < keyboardLayouts.length; i++) { | 56 | for (var i = 0; i < keyboardLayouts.length; i++) { |
734 | @@ -60,12 +60,18 @@ | |||
735 | 60 | try { | 60 | try { |
736 | 61 | var profileObject = Parser.parseJson(fileIO.read(filePath)); | 61 | var profileObject = Parser.parseJson(fileIO.read(filePath)); |
737 | 62 | 62 | ||
738 | 63 | var name = ""; | ||
739 | 64 | if (profileObject.id) | ||
740 | 65 | name = translator.getTranslatedNameById(translator.name, profileObject.id); | ||
741 | 66 | if (name === "") | ||
742 | 67 | name = profileObject.name; | ||
743 | 68 | |||
744 | 63 | profilesList.append( | 69 | profilesList.append( |
745 | 64 | { | 70 | { |
746 | 65 | file: filePath, | 71 | file: filePath, |
747 | 66 | profileVisible: isVisible, | 72 | profileVisible: isVisible, |
748 | 67 | object: profileObject, | 73 | object: profileObject, |
750 | 68 | name: profileObject.name | 74 | name: name |
751 | 69 | }); | 75 | }); |
752 | 70 | } catch (e) { | 76 | } catch (e) { |
753 | 71 | console.error("Error in profile", filePath); | 77 | console.error("Error in profile", filePath); |
754 | 72 | 78 | ||
755 | === modified file 'src/app/qml/ubuntu-terminal-app.qml' | |||
756 | --- src/app/qml/ubuntu-terminal-app.qml 2015-07-13 20:25:21 +0000 | |||
757 | +++ src/app/qml/ubuntu-terminal-app.qml 2015-08-09 14:25:46 +0000 | |||
758 | @@ -1,6 +1,7 @@ | |||
759 | 1 | import QtQuick 2.4 | 1 | import QtQuick 2.4 |
760 | 2 | import QtGraphicalEffects 1.0 | 2 | import QtGraphicalEffects 1.0 |
761 | 3 | import Ubuntu.Components 1.2 | 3 | import Ubuntu.Components 1.2 |
762 | 4 | import "KeyboardRows" | ||
763 | 4 | 5 | ||
764 | 5 | import QMLTermWidget 1.0 | 6 | import QMLTermWidget 1.0 |
765 | 6 | 7 | ||
766 | @@ -31,6 +32,10 @@ | |||
767 | 31 | Component.onCompleted: addTab(); | 32 | Component.onCompleted: addTab(); |
768 | 32 | } | 33 | } |
769 | 33 | 34 | ||
770 | 35 | JsonTranslator { | ||
771 | 36 | id: translator | ||
772 | 37 | } | ||
773 | 38 | |||
774 | 34 | PageStack { | 39 | PageStack { |
775 | 35 | id: pageStack | 40 | id: pageStack |
776 | 36 | Component.onCompleted: push(terminalPage) | 41 | Component.onCompleted: push(terminalPage) |
Just found something while looking through the diff. Will fix it. :)