Merge lp:~vthompson/ubuntu-terminal-app/fixes-1245976 into lp:ubuntu-terminal-app

Proposed by Victor Thompson
Status: Merged
Approved by: Nicholas Skaggs
Approved revision: 31
Merged at revision: 33
Proposed branch: lp:~vthompson/ubuntu-terminal-app/fixes-1245976
Merge into: lp:ubuntu-terminal-app
Diff against target: 171 lines (+40/-41)
4 files modified
Configs.qml (+15/-11)
Terminal.qml (+3/-3)
config/JsConfig.qml (+1/-1)
tests/autopilot/ubuntu_terminal_app/tests/test_terminal.py (+21/-26)
To merge this branch: bzr merge lp:~vthompson/ubuntu-terminal-app/fixes-1245976
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Michael Hall Approve
Review via email: mp+193728@code.launchpad.net

Commit message

* Use ItemSelector and fix spelling mistakes

Description of the change

* Use ItemSelector and fix spelling mistakes

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Victor Thompson (vthompson) wrote :

Could this get a review?

Revision history for this message
Michael Hall (mhall119) wrote :

What was wrong with using ValueSelector?

review: Needs Information
Revision history for this message
Victor Thompson (vthompson) wrote :
Revision history for this message
Michael Hall (mhall119) wrote :

Good enough reason for me, approving

review: Approve
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
31. By Victor Thompson

resolve merge conflicts

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Configs.qml'
2--- Configs.qml 2013-06-28 07:27:03 +0000
3+++ Configs.qml 2013-12-22 04:54:57 +0000
4@@ -7,7 +7,8 @@
5 id: mparent
6 JsConfig{id: jsConf }
7
8- property var colorShemes;
9+ property var colorSchemes;
10+ property bool colorSchemeLoaded: false;
11 //property int headerHeight: units.gu(10);
12
13 signal configChanged (bool changed)
14@@ -18,9 +19,10 @@
15 slFont.value = jsConf.getFontSize();
16 }
17
18- onColorShemesChanged: {
19- liSchemes.values = colorShemes
20- liSchemes.selectedIndex = liSchemes.setValue(jsConf.getColorSheme())
21+ onColorSchemesChanged: {
22+ liSchemes.model = colorSchemes
23+ liSchemes.selectedIndex = liSchemes.setItem(jsConf.getColorScheme())
24+ colorSchemeLoaded = true;
25 }
26
27 Column {
28@@ -31,23 +33,25 @@
29 }
30 spacing: units.gu(1)
31
32- ListItem.ValueSelector {
33+ ListItem.ItemSelector {
34 id: liSchemes
35 objectName: "liSchemes"
36 width: parent.width
37
38- function setValue(val) {
39- for (var k in values) {
40- var v = values[k];
41+ function setItem(val) {
42+ for (var k in model) {
43+ var v = model[k];
44 if(v == val) return k;
45 }
46 }
47
48 text: i18n.tr("Color scheme") + ":"
49 onSelectedIndexChanged: {
50- var val = values[selectedIndex];
51- jsConf.setColorScheme(val);
52- configChanged(true);
53+ if(colorSchemeLoaded) {
54+ var val = model[selectedIndex];
55+ jsConf.setColorScheme(val);
56+ configChanged(true);
57+ }
58 }
59 }
60
61
62=== modified file 'Terminal.qml'
63--- Terminal.qml 2013-12-20 18:09:30 +0000
64+++ Terminal.qml 2013-12-22 04:54:57 +0000
65@@ -48,7 +48,7 @@
66 }
67
68 Component.onCompleted: {
69- pgConf.colorShemes = kterm.availableColorSchemes();
70+ pgConf.colorSchemes = kterm.availableColorSchemes();
71
72 // Change directory to $HOME
73 ksession.sendText("cd $HOME;clear;\n")
74@@ -58,7 +58,7 @@
75 target: pgConf
76 onConfigChanged: {
77 kterm.font.pointSize = jsConf.getFontSize();
78- kterm.colorScheme = jsConf.getColorSheme();
79+ kterm.colorScheme = jsConf.getColorScheme();
80 }
81 }
82
83@@ -202,7 +202,7 @@
84 font.family: "Ubuntu Mono"
85 font.pointSize: jsConf.getFontSize() //units.gu(1.5)
86
87- colorScheme: jsConf.getColorSheme() //"DarkPastels"
88+ colorScheme: jsConf.getColorScheme() //"DarkPastels"
89 width: parent.width
90 height: parent.height
91
92
93=== modified file 'config/JsConfig.qml'
94--- config/JsConfig.qml 2013-06-29 12:34:51 +0000
95+++ config/JsConfig.qml 2013-12-22 04:54:57 +0000
96@@ -5,7 +5,7 @@
97 DbEngine{id: dbEngine}
98
99 //ColorSchemes
100- function getColorSheme(){
101+ function getColorScheme(){
102 var res = dbEngine.getConfig("colorScheme");
103 if( res === "UNKNOWN" ) return "DarkPastels";
104 return res;
105
106=== modified file 'tests/autopilot/ubuntu_terminal_app/tests/test_terminal.py'
107--- tests/autopilot/ubuntu_terminal_app/tests/test_terminal.py 2013-11-12 20:31:42 +0000
108+++ tests/autopilot/ubuntu_terminal_app/tests/test_terminal.py 2013-12-22 04:54:57 +0000
109@@ -44,33 +44,28 @@
110 timeout+=1
111 panel_popover.click_button("Hide extra panel")
112
113- def click_value_selector_item(self, selector, value):
114- """Clicks value from value selector"""
115- # The value selector is assumed to be the following format
116- # ListItem.ValueSelector {
117+ def click_item_selector_item(self, selector, value):
118+ """Clicks item from item selector"""
119+ # The item selector is assumed to be the following format
120+ # ListItem.ItemSelector {
121 # objectName:
122- # values:
123- self.assertThat(lambda: self.main_view.select_single("ValueSelector", objectName=selector), Eventually(Not(Is(None))))
124- val_selector = self.main_view.select_single("ValueSelector", objectName=selector)
125- self.pointing_device.click_object(val_selector)
126+ # model:
127+ self.assertThat(lambda: self.main_view.select_single("ItemSelector", objectName=selector), Eventually(Not(Is(None))))
128+ item_selector = self.main_view.select_single("ItemSelector", objectName=selector)
129 #we need to regrab object as for some reason it can sometimes change and our ordering will be off down below
130- self.assertThat(lambda: self.main_view.select_single("ValueSelector", objectName=selector), Eventually(Not(Is(None))))
131- val_selector = self.main_view.select_single("ValueSelector", objectName=selector)
132- rows = val_selector.select_single("QQuickColumn")
133- rects = rows.select_many("QQuickRectangle")
134- for ritem in rects:
135- labelList = ritem.select_many("LabelVisual")
136- for label in labelList:
137- if label.text == value:
138- self.pointing_device.click_object(label)
139- #check to make sure update is complete
140- valState = lambda: val_selector.select_single("QQuickRepeater").state
141- self.assertThat(valState, Eventually(Equals("closed")))
142- #check label match
143- valBase = val_selector.select_single("Base")
144- #the first label is always the "color scheme"
145- valLabel = lambda: valBase.select_many("LabelVisual")[1].text
146- self.assertThat(valLabel, Eventually(Equals(value)))
147+ self.assertThat(lambda: self.main_view.select_single("ItemSelector", objectName=selector), Eventually(Not(Is(None))))
148+ item_selector = self.main_view.select_single("ItemSelector", objectName=selector)
149+ self.assertThat(lambda: item_selector.select_many("QQuickColumn"), Eventually(Not(Is(None))))
150+ rows = item_selector.select_many("QQuickColumn")
151+ self.assertThat(lambda: rows[0].select_single("QQuickListView", objectName="listView"), Eventually(Not(Is(None))))
152+ items = rows[0].select_single("QQuickListView", objectName="listView")
153+ self.pointing_device.click_object(items)
154+ for ritem in items:
155+ if ritem.text == value:
156+ self.pointing_device.click_object(ritem)
157+ #the first label is always the "color scheme"
158+ itemLabel = lambda: ritem.text
159+ self.assertThat(itemLabel, Eventually(Equals(value)))
160
161 def test_control_panel(self):
162 """Make sure that Control Keys Panel is visible
163@@ -155,7 +150,7 @@
164 )
165
166 for scheme in schemeList:
167- self.click_value_selector_item("liSchemes",scheme)
168+ self.click_item_selector_item("liSchemes",scheme)
169 # This assert uses KTerminalDisplay property (old rev)
170 self.assertThat(kterm.colorScheme, Eventually(Equals(scheme)))
171 # This assert uses localstorage (new rev)

Subscribers

People subscribed via source and target branches