Merge lp:~nataliabidart/ubuntuone-control-panel/fix-buttons into lp:ubuntuone-control-panel
- fix-buttons
- Merge into trunk
Proposed by
Natalia Bidart
Status: | Merged | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Approved by: | Natalia Bidart | ||||||||||||||||
Approved revision: | 82 | ||||||||||||||||
Merged at revision: | 81 | ||||||||||||||||
Proposed branch: | lp:~nataliabidart/ubuntuone-control-panel/fix-buttons | ||||||||||||||||
Merge into: | lp:ubuntuone-control-panel | ||||||||||||||||
Diff against target: |
564 lines (+100/-148) 5 files modified
data/dashboard.ui (+70/-78) ubuntuone/controlpanel/gtk/gui.py (+17/-25) ubuntuone/controlpanel/gtk/tests/test_gui.py (+13/-23) ubuntuone/controlpanel/gtk/tests/test_widgets.py (+0/-16) ubuntuone/controlpanel/gtk/widgets.py (+0/-6) |
||||||||||||||||
To merge this branch: | bzr merge lp:~nataliabidart/ubuntuone-control-panel/fix-buttons | ||||||||||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Martin Albisetti (community) | Approve | ||
Roberto Alsina (community) | Approve | ||
Review via email: mp+51012@code.launchpad.net |
Description of the change
To post a comment you must log in.
- 82. By Natalia Bidart
-
Removing old styling code (theme is already in place).
Revision history for this message
Martin Albisetti (beuno) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'data/banner.png' |
2 | Binary files data/banner.png 2011-01-25 16:31:07 +0000 and data/banner.png 2011-02-24 12:27:12 +0000 differ |
3 | === modified file 'data/dashboard.ui' |
4 | --- data/dashboard.ui 2011-02-20 08:08:36 +0000 |
5 | +++ data/dashboard.ui 2011-02-24 12:27:12 +0000 |
6 | @@ -4,76 +4,72 @@ |
7 | <!-- interface-naming-policy project-wide --> |
8 | <object class="GtkVBox" id="itself"> |
9 | <property name="visible">True</property> |
10 | + <property name="can_focus">False</property> |
11 | <property name="border_width">10</property> |
12 | <property name="spacing">10</property> |
13 | <child> |
14 | <object class="GtkHBox" id="account"> |
15 | <property name="visible">True</property> |
16 | + <property name="can_focus">False</property> |
17 | <property name="spacing">10</property> |
18 | + <property name="homogeneous">True</property> |
19 | <child> |
20 | <object class="GtkFrame" id="frame2"> |
21 | <property name="visible">True</property> |
22 | + <property name="can_focus">False</property> |
23 | <property name="label_xalign">0</property> |
24 | - <property name="shadow_type">in</property> |
25 | + <property name="shadow_type">none</property> |
26 | <child> |
27 | <object class="GtkAlignment" id="alignment2"> |
28 | <property name="visible">True</property> |
29 | - <property name="xscale">0</property> |
30 | - <property name="top_padding">10</property> |
31 | - <property name="bottom_padding">10</property> |
32 | + <property name="can_focus">False</property> |
33 | + <property name="top_padding">12</property> |
34 | <property name="left_padding">12</property> |
35 | - <property name="right_padding">10</property> |
36 | <child> |
37 | <object class="GtkVBox" id="vbox5"> |
38 | <property name="visible">True</property> |
39 | + <property name="can_focus">False</property> |
40 | <property name="spacing">10</property> |
41 | <child> |
42 | <object class="GtkLabel" id="name_label"> |
43 | <property name="visible">True</property> |
44 | + <property name="can_focus">False</property> |
45 | <property name="xalign">0</property> |
46 | <property name="label">tester name</property> |
47 | <property name="use_markup">True</property> |
48 | </object> |
49 | <packing> |
50 | <property name="expand">False</property> |
51 | + <property name="fill">True</property> |
52 | <property name="position">0</property> |
53 | </packing> |
54 | </child> |
55 | <child> |
56 | <object class="GtkLabel" id="email_label"> |
57 | <property name="visible">True</property> |
58 | + <property name="can_focus">False</property> |
59 | <property name="xalign">0</property> |
60 | <property name="label">a@example.com</property> |
61 | </object> |
62 | <packing> |
63 | <property name="expand">False</property> |
64 | + <property name="fill">True</property> |
65 | <property name="position">1</property> |
66 | </packing> |
67 | </child> |
68 | <child> |
69 | - <object class="GtkHButtonBox" id="hbuttonbox1"> |
70 | + <object class="GtkLinkButton" id="linkbutton3"> |
71 | + <property name="label" translatable="yes">Edit</property> |
72 | <property name="visible">True</property> |
73 | - <property name="layout_style">center</property> |
74 | - <child> |
75 | - <object class="GtkLinkButton" id="linkbutton3"> |
76 | - <property name="label" translatable="yes">Edit</property> |
77 | - <property name="visible">True</property> |
78 | - <property name="can_focus">True</property> |
79 | - <property name="receives_default">True</property> |
80 | - <property name="has_tooltip">True</property> |
81 | - <property name="relief">none</property> |
82 | - <property name="uri">http://login.ubuntu.com</property> |
83 | - </object> |
84 | - <packing> |
85 | - <property name="expand">False</property> |
86 | - <property name="fill">False</property> |
87 | - <property name="position">0</property> |
88 | - </packing> |
89 | - </child> |
90 | + <property name="can_focus">True</property> |
91 | + <property name="receives_default">True</property> |
92 | + <property name="use_action_appearance">False</property> |
93 | + <property name="relief">none</property> |
94 | + <property name="uri">http://login.ubuntu.com</property> |
95 | </object> |
96 | <packing> |
97 | <property name="expand">False</property> |
98 | - <property name="padding">10</property> |
99 | + <property name="fill">False</property> |
100 | <property name="pack_type">end</property> |
101 | <property name="position">2</property> |
102 | </packing> |
103 | @@ -85,35 +81,39 @@ |
104 | <child type="label"> |
105 | <object class="GtkLabel" id="label1"> |
106 | <property name="visible">True</property> |
107 | + <property name="can_focus">False</property> |
108 | <property name="label" translatable="yes"><b>Personal details</b></property> |
109 | <property name="use_markup">True</property> |
110 | </object> |
111 | </child> |
112 | </object> |
113 | <packing> |
114 | + <property name="expand">True</property> |
115 | + <property name="fill">True</property> |
116 | <property name="position">0</property> |
117 | </packing> |
118 | </child> |
119 | <child> |
120 | <object class="GtkFrame" id="frame1"> |
121 | <property name="visible">True</property> |
122 | + <property name="can_focus">False</property> |
123 | <property name="label_xalign">0</property> |
124 | - <property name="shadow_type">in</property> |
125 | + <property name="shadow_type">none</property> |
126 | <child> |
127 | <object class="GtkAlignment" id="alignment1"> |
128 | <property name="visible">True</property> |
129 | - <property name="xscale">0</property> |
130 | - <property name="top_padding">10</property> |
131 | - <property name="bottom_padding">10</property> |
132 | + <property name="can_focus">False</property> |
133 | + <property name="top_padding">12</property> |
134 | <property name="left_padding">12</property> |
135 | - <property name="right_padding">10</property> |
136 | <child> |
137 | <object class="GtkVBox" id="vbox4"> |
138 | <property name="visible">True</property> |
139 | + <property name="can_focus">False</property> |
140 | <property name="spacing">10</property> |
141 | <child> |
142 | <object class="GtkLabel" id="type_label"> |
143 | <property name="visible">True</property> |
144 | + <property name="can_focus">False</property> |
145 | <property name="xalign">0</property> |
146 | <property name="label">Ubuntu One Basic (2 GB) |
147 | 22GB of awesomeness |
148 | @@ -121,32 +121,23 @@ |
149 | </object> |
150 | <packing> |
151 | <property name="expand">False</property> |
152 | + <property name="fill">True</property> |
153 | <property name="position">0</property> |
154 | </packing> |
155 | </child> |
156 | <child> |
157 | - <object class="GtkHButtonBox" id="hbuttonbox2"> |
158 | + <object class="GtkLinkButton" id="linkbutton1"> |
159 | + <property name="label" translatable="yes">Buy more storage and new plans</property> |
160 | <property name="visible">True</property> |
161 | - <property name="layout_style">center</property> |
162 | - <child> |
163 | - <object class="GtkLinkButton" id="linkbutton1"> |
164 | - <property name="label" translatable="yes">Buy more storage and new plans</property> |
165 | - <property name="visible">True</property> |
166 | - <property name="can_focus">True</property> |
167 | - <property name="receives_default">True</property> |
168 | - <property name="relief">none</property> |
169 | - <property name="uri">https://one.ubuntu.com/plans/</property> |
170 | - </object> |
171 | - <packing> |
172 | - <property name="expand">False</property> |
173 | - <property name="fill">False</property> |
174 | - <property name="position">0</property> |
175 | - </packing> |
176 | - </child> |
177 | + <property name="can_focus">True</property> |
178 | + <property name="receives_default">True</property> |
179 | + <property name="use_action_appearance">False</property> |
180 | + <property name="relief">none</property> |
181 | + <property name="uri">https://one.ubuntu.com/plans/</property> |
182 | </object> |
183 | <packing> |
184 | <property name="expand">False</property> |
185 | - <property name="padding">10</property> |
186 | + <property name="fill">False</property> |
187 | <property name="pack_type">end</property> |
188 | <property name="position">1</property> |
189 | </packing> |
190 | @@ -158,12 +149,15 @@ |
191 | <child type="label"> |
192 | <object class="GtkLabel" id="label3"> |
193 | <property name="visible">True</property> |
194 | + <property name="can_focus">False</property> |
195 | <property name="label" translatable="yes"><b>Your services</b></property> |
196 | <property name="use_markup">True</property> |
197 | </object> |
198 | </child> |
199 | </object> |
200 | <packing> |
201 | + <property name="expand">True</property> |
202 | + <property name="fill">True</property> |
203 | <property name="pack_type">end</property> |
204 | <property name="position">1</property> |
205 | </packing> |
206 | @@ -171,87 +165,76 @@ |
207 | </object> |
208 | <packing> |
209 | <property name="expand">False</property> |
210 | + <property name="fill">True</property> |
211 | <property name="position">0</property> |
212 | </packing> |
213 | </child> |
214 | <child> |
215 | <object class="GtkAlignment" id="alignment5"> |
216 | <property name="visible">True</property> |
217 | - <property name="xscale">0</property> |
218 | - <property name="yscale">0</property> |
219 | + <property name="can_focus">False</property> |
220 | <child> |
221 | <object class="GtkHBox" id="hbox1"> |
222 | <property name="visible">True</property> |
223 | + <property name="can_focus">False</property> |
224 | <property name="spacing">20</property> |
225 | <child> |
226 | - <object class="GtkHBox" id="hbox3"> |
227 | + <object class="GtkHButtonBox" id="hbuttonbox3"> |
228 | <property name="visible">True</property> |
229 | - <child> |
230 | - <object class="GtkLabel" id="label2"> |
231 | - <property name="visible">True</property> |
232 | - <property name="label" translatable="yes">Ubuntu One support:</property> |
233 | - </object> |
234 | - <packing> |
235 | - <property name="position">0</property> |
236 | - </packing> |
237 | - </child> |
238 | + <property name="can_focus">False</property> |
239 | + <property name="spacing">5</property> |
240 | <child> |
241 | <object class="GtkLinkButton" id="linkbutton2"> |
242 | + <property name="label" translatable="yes">Official Support</property> |
243 | <property name="visible">True</property> |
244 | <property name="can_focus">True</property> |
245 | <property name="receives_default">True</property> |
246 | - <property name="relief">none</property> |
247 | + <property name="tooltip_text" translatable="yes">Get official Ubuntu One support online</property> |
248 | + <property name="use_action_appearance">False</property> |
249 | <property name="uri">https://one.ubuntu.com/support/</property> |
250 | - <child> |
251 | - <object class="GtkImage" id="support"> |
252 | - <property name="visible">True</property> |
253 | - <property name="tooltip_text" translatable="yes">https://one.ubuntu.com/support/</property> |
254 | - <property name="pixbuf">support.png</property> |
255 | - </object> |
256 | - </child> |
257 | </object> |
258 | <packing> |
259 | <property name="expand">False</property> |
260 | <property name="fill">False</property> |
261 | - <property name="position">1</property> |
262 | + <property name="position">0</property> |
263 | </packing> |
264 | </child> |
265 | <child> |
266 | <object class="GtkLinkButton" id="linkbutton4"> |
267 | + <property name="label" translatable="yes">Community Support</property> |
268 | <property name="visible">True</property> |
269 | <property name="can_focus">True</property> |
270 | <property name="receives_default">True</property> |
271 | - <property name="relief">none</property> |
272 | + <property name="tooltip_text" translatable="yes">View and ask Ubuntu One related questions at AskUbuntu.com</property> |
273 | + <property name="use_action_appearance">False</property> |
274 | <property name="uri">http://askubuntu.com/questions/tagged/ubuntu-one</property> |
275 | - <child> |
276 | - <object class="GtkImage" id="askubuntu"> |
277 | - <property name="visible">True</property> |
278 | - <property name="tooltip_text" translatable="yes">View and ask Ubuntu One related questions at AskUbuntu.com</property> |
279 | - <property name="pixbuf">ask-ubuntu-small.png</property> |
280 | - </object> |
281 | - </child> |
282 | </object> |
283 | <packing> |
284 | <property name="expand">False</property> |
285 | <property name="fill">False</property> |
286 | - <property name="position">2</property> |
287 | + <property name="position">1</property> |
288 | </packing> |
289 | </child> |
290 | </object> |
291 | <packing> |
292 | <property name="expand">False</property> |
293 | + <property name="fill">True</property> |
294 | <property name="position">0</property> |
295 | </packing> |
296 | </child> |
297 | <child> |
298 | <object class="GtkHBox" id="hbox2"> |
299 | <property name="visible">True</property> |
300 | + <property name="can_focus">False</property> |
301 | <child> |
302 | <object class="GtkLabel" id="label4"> |
303 | <property name="visible">True</property> |
304 | - <property name="label" translatable="yes">Follow us!</property> |
305 | + <property name="can_focus">False</property> |
306 | + <property name="label" translatable="yes">Talk to us on:</property> |
307 | </object> |
308 | <packing> |
309 | + <property name="expand">True</property> |
310 | + <property name="fill">True</property> |
311 | <property name="position">0</property> |
312 | </packing> |
313 | </child> |
314 | @@ -260,11 +243,13 @@ |
315 | <property name="visible">True</property> |
316 | <property name="can_focus">True</property> |
317 | <property name="receives_default">True</property> |
318 | + <property name="use_action_appearance">False</property> |
319 | <property name="relief">none</property> |
320 | <property name="uri">http://twitter.com/ubuntuone</property> |
321 | <child> |
322 | <object class="GtkImage" id="twitter"> |
323 | <property name="visible">True</property> |
324 | + <property name="can_focus">False</property> |
325 | <property name="tooltip_text" translatable="yes">http://twitter.com/ubuntuone</property> |
326 | <property name="pixbuf">twitter.png</property> |
327 | </object> |
328 | @@ -281,23 +266,29 @@ |
329 | <property name="visible">True</property> |
330 | <property name="can_focus">True</property> |
331 | <property name="receives_default">True</property> |
332 | + <property name="use_action_appearance">False</property> |
333 | <property name="relief">none</property> |
334 | <property name="uri">http://www.facebook.com/ubuntuone</property> |
335 | <child> |
336 | <object class="GtkImage" id="facebook"> |
337 | <property name="visible">True</property> |
338 | + <property name="can_focus">False</property> |
339 | <property name="tooltip_text" translatable="yes">http://www.facebook.com/ubuntuone</property> |
340 | <property name="pixbuf">facebook.png</property> |
341 | </object> |
342 | </child> |
343 | </object> |
344 | <packing> |
345 | + <property name="expand">True</property> |
346 | + <property name="fill">True</property> |
347 | <property name="position">2</property> |
348 | </packing> |
349 | </child> |
350 | </object> |
351 | <packing> |
352 | <property name="expand">False</property> |
353 | + <property name="fill">True</property> |
354 | + <property name="pack_type">end</property> |
355 | <property name="position">1</property> |
356 | </packing> |
357 | </child> |
358 | @@ -306,6 +297,7 @@ |
359 | </object> |
360 | <packing> |
361 | <property name="expand">False</property> |
362 | + <property name="fill">True</property> |
363 | <property name="pack_type">end</property> |
364 | <property name="position">1</property> |
365 | </packing> |
366 | |
367 | === modified file 'ubuntuone/controlpanel/gtk/gui.py' |
368 | --- ubuntuone/controlpanel/gtk/gui.py 2011-02-23 20:02:14 +0000 |
369 | +++ ubuntuone/controlpanel/gtk/gui.py 2011-02-24 12:27:12 +0000 |
370 | @@ -225,9 +225,6 @@ |
371 | self.warning_label.set_text('') |
372 | self.warning_label.set_property('xalign', 0.5) |
373 | |
374 | - # Removing theming so UX team can build proper .rc file (LP: #715717) |
375 | - #self.header.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(DEFAULT_BG)) |
376 | - |
377 | self.connect_button.set_uri(self.CONNECT) |
378 | |
379 | self.main_window = main_window |
380 | @@ -1145,8 +1142,6 @@ |
381 | gtk.HBox.__init__(self) |
382 | ControlPanelMixin.__init__(self) |
383 | |
384 | - # Removing theming so UX team can build proper .rc file (LP: #715717) |
385 | - #self.label = LabelLoading(LOADING, fg_color=DEFAULT_FG) |
386 | self.label = LabelLoading(LOADING) |
387 | self.pack_start(self.label, expand=False) |
388 | |
389 | @@ -1298,12 +1293,15 @@ |
390 | |
391 | QUOTA_LABEL = _('Using %(used)s of %(total)s (%(percentage).1f%%)') |
392 | DASHBOARD_BUTTON_NAME = 'Account' |
393 | - DEVICES_BUTTON_NAME = 'Devices' |
394 | - DASHBOARD_BUTTON_TOOLTIP = _('View your personal details ' |
395 | - 'and service summary.') |
396 | - DEVICES_BUTTON_TOOLTIP = _('Manage devices registered ' |
397 | - 'with your personal cloud.') |
398 | - VOLUMES_BUTTON_TOOLTIP = _('Manage your cloud folders.') |
399 | + SERVICES_BUTTON_NAME = 'Devices' # Intentional until the theme is fixed |
400 | + |
401 | + DASHBOARD_BUTTON_TOOLTIP = _('View your personal details and service ' |
402 | + 'summary') |
403 | + VOLUMES_BUTTON_TOOLTIP = _('Manage your cloud folders') |
404 | + SHARES_BUTTON_TOOLTIP = _('Manage the shares offered to others') |
405 | + DEVICES_BUTTON_TOOLTIP = _('Manage devices registered with your personal ' |
406 | + 'cloud') |
407 | + SERVICES_BUTTON_TOOLTIP = _('Manage the sync services') |
408 | |
409 | def __init__(self, main_window=None): |
410 | gtk.VBox.__init__(self) |
411 | @@ -1316,13 +1314,8 @@ |
412 | self.backend.connect_to_signal('AccountInfoError', |
413 | self.on_account_info_error) |
414 | |
415 | - # Removing theming so UX team can build proper .rc file (LP: #715717) |
416 | - #self.header.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(DEFAULT_BG)) |
417 | - |
418 | self.quota_progressbar.set_sensitive(False) |
419 | |
420 | - # Removing theming so UX team can build proper .rc file (LP: #715717) |
421 | - #self.quota_label = LabelLoading(LOADING, fg_color=DEFAULT_FG) |
422 | self.quota_label = LabelLoading(LOADING) |
423 | self.quota_box.pack_start(self.quota_label, expand=False) |
424 | self.quota_box.reorder_child(self.quota_label, 0) |
425 | @@ -1343,26 +1336,25 @@ |
426 | setattr(self, ('%s_page' % tab).upper(), page_num) |
427 | button = getattr(self, '%s_button' % tab) |
428 | button.connect('clicked', cb, page_num) |
429 | - # Removing theming so UX team can build proper .rc file |
430 | - # (LP: #715717) |
431 | - #button.modify_bg(gtk.STATE_ACTIVE, gtk.gdk.Color(DEFAULT_BG)) |
432 | - #button.get_child().modify_fg(gtk.STATE_ACTIVE, |
433 | - # gtk.gdk.Color(DEFAULT_FG)) |
434 | self.notebook.insert_page(getattr(self, tab), position=page_num) |
435 | |
436 | self.dashboard_button.set_name(self.DASHBOARD_BUTTON_NAME) |
437 | self.dashboard_button.set_tooltip_text(self.DASHBOARD_BUTTON_TOOLTIP) |
438 | |
439 | + self.volumes_button.set_tooltip_text(self.VOLUMES_BUTTON_TOOLTIP) |
440 | self.volumes_button.connect('clicked', lambda b: self.volumes.load()) |
441 | - self.services_button.connect('clicked', lambda b: self.services.load()) |
442 | - self.volumes_button.set_tooltip_text(self.VOLUMES_BUTTON_TOOLTIP) |
443 | - |
444 | - self.devices_button.set_name(self.DEVICES_BUTTON_NAME) |
445 | + |
446 | + self.shares_button.set_tooltip_text(self.SHARES_BUTTON_TOOLTIP) |
447 | + |
448 | self.devices_button.set_tooltip_text(self.DEVICES_BUTTON_TOOLTIP) |
449 | self.devices_button.connect('clicked', lambda b: self.devices.load()) |
450 | self.devices.connect('local-device-removed', |
451 | lambda widget: self.emit('local-device-removed')) |
452 | |
453 | + self.services_button.set_name(self.SERVICES_BUTTON_NAME) |
454 | + self.services_button.connect('clicked', lambda b: self.services.load()) |
455 | + self.services_button.set_tooltip_text(self.SERVICES_BUTTON_TOOLTIP) |
456 | + |
457 | def _update_quota(self, msg, data=None): |
458 | """Update the quota info.""" |
459 | self.quota_label.set_markup(msg) |
460 | |
461 | === modified file 'ubuntuone/controlpanel/gtk/tests/test_gui.py' |
462 | --- ubuntuone/controlpanel/gtk/tests/test_gui.py 2011-02-23 20:02:14 +0000 |
463 | +++ ubuntuone/controlpanel/gtk/tests/test_gui.py 2011-02-24 12:27:12 +0000 |
464 | @@ -2442,30 +2442,20 @@ |
465 | |
466 | self.assertEqual(self._called, ((self.ui,), {})) |
467 | |
468 | - def test_dashboard_button_name(self): |
469 | + def test_button_names(self): |
470 | """The dashboard_button widget has the proper name.""" |
471 | - self.assertEqual(self.ui.dashboard_button.get_name(), |
472 | - self.ui.DASHBOARD_BUTTON_NAME) |
473 | - |
474 | - def test_devices_button_name(self): |
475 | - """The devices_button widget has the proper name.""" |
476 | - self.assertEqual(self.ui.devices_button.get_name(), |
477 | - self.ui.DEVICES_BUTTON_NAME) |
478 | + for tab in (u'dashboard', u'services'): |
479 | + actual = getattr(self.ui, '%s_button' % tab).get_name() |
480 | + expected = getattr(self.ui, '%s_BUTTON_NAME' % tab.upper()) |
481 | + self.assertEqual(actual, expected) |
482 | |
483 | def test_devices_button_tooltip(self): |
484 | """The devices button widget has the proper tooltip.""" |
485 | - self.assertTrue(self.ui.devices_button.get_has_tooltip()) |
486 | - self.assertEqual(self.ui.devices_button.get_tooltip_text(), |
487 | - self.ui.DEVICES_BUTTON_TOOLTIP) |
488 | - |
489 | - def test_dashboard_button_tooltip(self): |
490 | - """The dashboard button widget has the proper tooltip.""" |
491 | - self.assertTrue(self.ui.dashboard_button.get_has_tooltip()) |
492 | - self.assertEqual(self.ui.dashboard_button.get_tooltip_text(), |
493 | - self.ui.DASHBOARD_BUTTON_TOOLTIP) |
494 | - |
495 | - def test_volumes_button_tooltip(self): |
496 | - """The volumes button widget has the proper tooltip.""" |
497 | - self.assertTrue(self.ui.volumes_button.get_has_tooltip()) |
498 | - self.assertEqual(self.ui.volumes_button.get_tooltip_text(), |
499 | - self.ui.VOLUMES_BUTTON_TOOLTIP) |
500 | + for tab in self.ui.tabs: |
501 | + has_tooltip = getattr(self.ui, '%s_button' % tab).get_has_tooltip() |
502 | + self.assertTrue(has_tooltip, |
503 | + '%s_button should have a tooltip set' % tab) |
504 | + |
505 | + actual = getattr(self.ui, '%s_button' % tab).get_tooltip_text() |
506 | + expected = getattr(self.ui, '%s_BUTTON_TOOLTIP' % tab.upper()) |
507 | + self.assertEqual(actual, expected) |
508 | |
509 | === modified file 'ubuntuone/controlpanel/gtk/tests/test_widgets.py' |
510 | --- ubuntuone/controlpanel/gtk/tests/test_widgets.py 2011-02-16 19:14:19 +0000 |
511 | +++ ubuntuone/controlpanel/gtk/tests/test_widgets.py 2011-02-24 12:27:12 +0000 |
512 | @@ -170,14 +170,6 @@ |
513 | for child in self.widget.get_children(): |
514 | self.assertTrue(child.get_visible()) |
515 | |
516 | - def test_background_color(self): |
517 | - """The background color is correct.""" |
518 | - self.assertEqual(self.widget.style.bg[widgets.gtk.STATE_NORMAL], |
519 | - widgets.gtk.gdk.Color(widgets.DEFAULT_BG)) |
520 | - |
521 | - test_background_color.skip = 'Removing theming so UX team can build ' \ |
522 | - 'proper .rc file (LP: #715717)' |
523 | - |
524 | def test_label_is_packed(self): |
525 | """The label is packed in the widget.""" |
526 | self.assertIn(self.widget.label, self.widget.get_children()) |
527 | @@ -186,14 +178,6 @@ |
528 | """The label markup is correct.""" |
529 | self.assertEqual(self.widget.label.get_label(), self.TITLE) |
530 | |
531 | - def test_label_color(self): |
532 | - """The label foreground color is correct.""" |
533 | - self.assertEqual(self.widget.label.style.fg[widgets.gtk.STATE_NORMAL], |
534 | - widgets.gtk.gdk.Color(widgets.DEFAULT_FG)) |
535 | - |
536 | - test_label_color.skip = 'Removing theming so UX team can build ' \ |
537 | - 'proper .rc file (LP: #715717)' |
538 | - |
539 | def test_label_xalign(self): |
540 | """The label is left aligned.""" |
541 | self.assertEqual(self.widget.label.get_property('xalign'), 0.0) |
542 | |
543 | === modified file 'ubuntuone/controlpanel/gtk/widgets.py' |
544 | --- ubuntuone/controlpanel/gtk/widgets.py 2011-02-16 22:45:39 +0000 |
545 | +++ ubuntuone/controlpanel/gtk/widgets.py 2011-02-24 12:27:12 +0000 |
546 | @@ -24,8 +24,6 @@ |
547 | import gobject |
548 | import pango |
549 | |
550 | -DEFAULT_BG = '#393834' |
551 | -DEFAULT_FG = '#FFFFFF' |
552 | DEFAULT_PADDING = (10, 10) |
553 | |
554 | |
555 | @@ -116,10 +114,6 @@ |
556 | self.label.set_property('xalign', 0.0) |
557 | self.label.set_line_wrap(True) |
558 | self.label.set_line_wrap_mode(pango.WRAP_WORD) |
559 | - # Removing theming so UX team can build proper .rc file (LP: #715717) |
560 | - #if change_bg: |
561 | - # self.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(DEFAULT_BG)) |
562 | - # self.label.modify_fg(gtk.STATE_NORMAL, gtk.gdk.Color(DEFAULT_FG)) |
563 | self.add(self.label) |
564 | self.show_all() |
565 |
+1