Merge lp:~chrismcginlay/ubuntuone-control-panel/fixes_715820 into lp:ubuntuone-control-panel
- fixes_715820
- Merge into trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Natalia Bidart | ||||
Approved revision: | 73 | ||||
Merged at revision: | 80 | ||||
Proposed branch: | lp:~chrismcginlay/ubuntuone-control-panel/fixes_715820 | ||||
Merge into: | lp:ubuntuone-control-panel | ||||
Diff against target: |
290 lines (+107/-22) 2 files modified
ubuntuone/controlpanel/gtk/gui.py (+29/-8) ubuntuone/controlpanel/gtk/tests/test_gui.py (+78/-14) |
||||
To merge this branch: | bzr merge lp:~chrismcginlay/ubuntuone-control-panel/fixes_715820 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Roberto Alsina (community) | Approve | ||
Natalia Bidart (community) | Approve | ||
Review via email: mp+50417@code.launchpad.net |
Commit message
- Implement tooltips for Connect/Disconnect and Account/
Description of the change
Implement tooltips for Connect/Disconnect and Account/
Modified _update_status(), adding tooltip-None argument after callback argument
Modified ManagementPanel
Set up corresponding tests, asserting existence and validity of tooltips.
- 73. By Chris McGinlay
-
Added tooltip strings for enable/
disable/ start/stop sync states along with testcases
Moved tooltip argument in _update_status to end of argument list
Introduced tooltip=None argument in assert_status_ correct to streamline assertion tests.
Fixed docstrings for tooltip testcases.
Chris McGinlay (chrismcginlay) wrote : | # |
Hi Naty, thank you for suggestions and advice. I hope these are implemented correctly and have updated branch to be reviewed. On running my latest control panel tonight it seems a little slow when manually testing disconnect/
Natalia Bidart (nataliabidart) wrote : | # |
Very good! Thanks for working on this.
Roberto Alsina (ralsina) wrote : | # |
+1, great work Chris!
Preview Diff
1 | === modified file 'ubuntuone/controlpanel/gtk/gui.py' | |||
2 | --- ubuntuone/controlpanel/gtk/gui.py 2011-02-22 19:28:14 +0000 | |||
3 | +++ ubuntuone/controlpanel/gtk/gui.py 2011-02-22 23:51:33 +0000 | |||
4 | @@ -1132,6 +1132,15 @@ | |||
5 | 1132 | START = _('Start') | 1132 | START = _('Start') |
6 | 1133 | STOP = _('Stop') | 1133 | STOP = _('Stop') |
7 | 1134 | 1134 | ||
8 | 1135 | CONNECT_TOOLTIP = _('Connect the file sync service ' | ||
9 | 1136 | 'with your personal cloud') | ||
10 | 1137 | DISCONNECT_TOOLTIP = _('Disconnect the file sync service ' | ||
11 | 1138 | 'from your personal cloud') | ||
12 | 1139 | ENABLE_TOOLTIP = _('Enable the file sync service') | ||
13 | 1140 | RESTART_TOOLTIP = _('Restart the file sync service') | ||
14 | 1141 | START_TOOLTIP = _('Start the file sync service') | ||
15 | 1142 | STOP_TOOLTIP = _('Stop the file sync service') | ||
16 | 1143 | |||
17 | 1135 | def __init__(self): | 1144 | def __init__(self): |
18 | 1136 | gtk.HBox.__init__(self) | 1145 | gtk.HBox.__init__(self) |
19 | 1137 | ControlPanelMixin.__init__(self) | 1146 | ControlPanelMixin.__init__(self) |
20 | @@ -1166,7 +1175,8 @@ | |||
21 | 1166 | error_handler=error_handler) | 1175 | error_handler=error_handler) |
22 | 1167 | self.show_all() | 1176 | self.show_all() |
23 | 1168 | 1177 | ||
25 | 1169 | def _update_status(self, msg, action, callback, icon=None, color=None): | 1178 | def _update_status(self, msg, action, callback, |
26 | 1179 | icon=None, color=None, tooltip=None): | ||
27 | 1170 | """Update the status info.""" | 1180 | """Update the status info.""" |
28 | 1171 | if icon is not None: | 1181 | if icon is not None: |
29 | 1172 | foreground = '' if color is None else 'foreground="%s"' % color | 1182 | foreground = '' if color is None else 'foreground="%s"' % color |
30 | @@ -1178,6 +1188,8 @@ | |||
31 | 1178 | self.button.set_uri(action) | 1188 | self.button.set_uri(action) |
32 | 1179 | self.button.set_sensitive(True) | 1189 | self.button.set_sensitive(True) |
33 | 1180 | self.button.set_data('callback', callback) | 1190 | self.button.set_data('callback', callback) |
34 | 1191 | if tooltip is not None: | ||
35 | 1192 | self.button.set_tooltip_text(tooltip) | ||
36 | 1181 | 1193 | ||
37 | 1182 | def _on_button_clicked(self, button): | 1194 | def _on_button_clicked(self, button): |
38 | 1183 | """Button was clicked, act accordingly the label.""" | 1195 | """Button was clicked, act accordingly the label.""" |
39 | @@ -1190,48 +1202,49 @@ | |||
40 | 1190 | """Backend notifies of file sync status being disabled.""" | 1202 | """Backend notifies of file sync status being disabled.""" |
41 | 1191 | self._update_status(self.FILE_SYNC_DISABLED, | 1203 | self._update_status(self.FILE_SYNC_DISABLED, |
42 | 1192 | self.ENABLE, self.on_enable_clicked, | 1204 | self.ENABLE, self.on_enable_clicked, |
44 | 1193 | '✘', 'red') | 1205 | '✘', 'red', self.ENABLE_TOOLTIP) |
45 | 1194 | 1206 | ||
46 | 1195 | @log_call(logger.info) | 1207 | @log_call(logger.info) |
47 | 1196 | def on_file_sync_status_starting(self, msg): | 1208 | def on_file_sync_status_starting(self, msg): |
48 | 1197 | """Backend notifies of file sync status being starting.""" | 1209 | """Backend notifies of file sync status being starting.""" |
49 | 1198 | self._update_status(self.FILE_SYNC_STARTING, | 1210 | self._update_status(self.FILE_SYNC_STARTING, |
50 | 1199 | self.STOP, self.on_stop_clicked, | 1211 | self.STOP, self.on_stop_clicked, |
52 | 1200 | '⇅', ORANGE) | 1212 | '⇅', ORANGE, self.STOP_TOOLTIP) |
53 | 1201 | 1213 | ||
54 | 1202 | @log_call(logger.info) | 1214 | @log_call(logger.info) |
55 | 1203 | def on_file_sync_status_stopped(self, msg): | 1215 | def on_file_sync_status_stopped(self, msg): |
56 | 1204 | """Backend notifies of file sync being stopped.""" | 1216 | """Backend notifies of file sync being stopped.""" |
57 | 1205 | self._update_status(self.FILE_SYNC_STOPPED, | 1217 | self._update_status(self.FILE_SYNC_STOPPED, |
58 | 1206 | self.START, self.on_start_clicked, | 1218 | self.START, self.on_start_clicked, |
60 | 1207 | '✘', 'red') | 1219 | '✘', 'red', self.START_TOOLTIP) |
61 | 1208 | 1220 | ||
62 | 1209 | @log_call(logger.info) | 1221 | @log_call(logger.info) |
63 | 1210 | def on_file_sync_status_disconnected(self, msg): | 1222 | def on_file_sync_status_disconnected(self, msg): |
64 | 1211 | """Backend notifies of file sync status being ready.""" | 1223 | """Backend notifies of file sync status being ready.""" |
65 | 1212 | self._update_status(self.FILE_SYNC_DISCONNECTED, | 1224 | self._update_status(self.FILE_SYNC_DISCONNECTED, |
66 | 1213 | self.CONNECT, self.on_connect_clicked, | 1225 | self.CONNECT, self.on_connect_clicked, |
68 | 1214 | '✘', 'red') | 1226 | '✘', 'red', self.CONNECT_TOOLTIP,) |
69 | 1215 | 1227 | ||
70 | 1216 | @log_call(logger.info) | 1228 | @log_call(logger.info) |
71 | 1217 | def on_file_sync_status_syncing(self, msg): | 1229 | def on_file_sync_status_syncing(self, msg): |
72 | 1218 | """Backend notifies of file sync status being syncing.""" | 1230 | """Backend notifies of file sync status being syncing.""" |
73 | 1219 | self._update_status(self.FILE_SYNC_SYNCING, | 1231 | self._update_status(self.FILE_SYNC_SYNCING, |
74 | 1220 | self.DISCONNECT, self.on_disconnect_clicked, | 1232 | self.DISCONNECT, self.on_disconnect_clicked, |
76 | 1221 | '⇅', ORANGE) | 1233 | '⇅', ORANGE, self.DISCONNECT_TOOLTIP) |
77 | 1222 | 1234 | ||
78 | 1223 | @log_call(logger.info) | 1235 | @log_call(logger.info) |
79 | 1224 | def on_file_sync_status_idle(self, msg): | 1236 | def on_file_sync_status_idle(self, msg): |
80 | 1225 | """Backend notifies of file sync status being idle.""" | 1237 | """Backend notifies of file sync status being idle.""" |
81 | 1226 | self._update_status(self.FILE_SYNC_IDLE, | 1238 | self._update_status(self.FILE_SYNC_IDLE, |
82 | 1227 | self.DISCONNECT, self.on_disconnect_clicked, | 1239 | self.DISCONNECT, self.on_disconnect_clicked, |
84 | 1228 | '✔', 'green') | 1240 | '✔', 'green', self.DISCONNECT_TOOLTIP) |
85 | 1229 | 1241 | ||
86 | 1230 | @log_call(logger.error) | 1242 | @log_call(logger.error) |
87 | 1231 | def on_file_sync_status_error(self, error_dict=None): | 1243 | def on_file_sync_status_error(self, error_dict=None): |
88 | 1232 | """Backend notifies of an error when fetching file sync status.""" | 1244 | """Backend notifies of an error when fetching file sync status.""" |
89 | 1233 | self._update_status(WARNING_MARKUP % self.FILE_SYNC_ERROR, | 1245 | self._update_status(WARNING_MARKUP % self.FILE_SYNC_ERROR, |
91 | 1234 | self.RESTART, self.on_restart_clicked) | 1246 | self.RESTART, self.on_restart_clicked, |
92 | 1247 | tooltip=self.RESTART_TOOLTIP) | ||
93 | 1235 | 1248 | ||
94 | 1236 | @log_call(logger.error) | 1249 | @log_call(logger.error) |
95 | 1237 | def on_files_start_error(self, error_dict=None): | 1250 | def on_files_start_error(self, error_dict=None): |
96 | @@ -1286,6 +1299,11 @@ | |||
97 | 1286 | QUOTA_LABEL = _('Using %(used)s of %(total)s (%(percentage).1f%%)') | 1299 | QUOTA_LABEL = _('Using %(used)s of %(total)s (%(percentage).1f%%)') |
98 | 1287 | DASHBOARD_BUTTON_NAME = 'Account' | 1300 | DASHBOARD_BUTTON_NAME = 'Account' |
99 | 1288 | DEVICES_BUTTON_NAME = 'Devices' | 1301 | DEVICES_BUTTON_NAME = 'Devices' |
100 | 1302 | DASHBOARD_BUTTON_TOOLTIP = _('View your personal details ' | ||
101 | 1303 | 'and service summary.') | ||
102 | 1304 | DEVICES_BUTTON_TOOLTIP = _('Manage devices registered ' | ||
103 | 1305 | 'with your personal cloud.') | ||
104 | 1306 | VOLUMES_BUTTON_TOOLTIP = _('Manage your cloud folders.') | ||
105 | 1289 | 1307 | ||
106 | 1290 | def __init__(self, main_window=None): | 1308 | def __init__(self, main_window=None): |
107 | 1291 | gtk.VBox.__init__(self) | 1309 | gtk.VBox.__init__(self) |
108 | @@ -1333,11 +1351,14 @@ | |||
109 | 1333 | self.notebook.insert_page(getattr(self, tab), position=page_num) | 1351 | self.notebook.insert_page(getattr(self, tab), position=page_num) |
110 | 1334 | 1352 | ||
111 | 1335 | self.dashboard_button.set_name(self.DASHBOARD_BUTTON_NAME) | 1353 | self.dashboard_button.set_name(self.DASHBOARD_BUTTON_NAME) |
112 | 1354 | self.dashboard_button.set_tooltip_text(self.DASHBOARD_BUTTON_TOOLTIP) | ||
113 | 1336 | 1355 | ||
114 | 1337 | self.volumes_button.connect('clicked', lambda b: self.volumes.load()) | 1356 | self.volumes_button.connect('clicked', lambda b: self.volumes.load()) |
115 | 1338 | self.services_button.connect('clicked', lambda b: self.services.load()) | 1357 | self.services_button.connect('clicked', lambda b: self.services.load()) |
116 | 1358 | self.volumes_button.set_tooltip_text(self.VOLUMES_BUTTON_TOOLTIP) | ||
117 | 1339 | 1359 | ||
118 | 1340 | self.devices_button.set_name(self.DEVICES_BUTTON_NAME) | 1360 | self.devices_button.set_name(self.DEVICES_BUTTON_NAME) |
119 | 1361 | self.devices_button.set_tooltip_text(self.DEVICES_BUTTON_TOOLTIP) | ||
120 | 1341 | self.devices_button.connect('clicked', lambda b: self.devices.load()) | 1362 | self.devices_button.connect('clicked', lambda b: self.devices.load()) |
121 | 1342 | self.devices.connect('local-device-removed', | 1363 | self.devices.connect('local-device-removed', |
122 | 1343 | lambda widget: self.emit('local-device-removed')) | 1364 | lambda widget: self.emit('local-device-removed')) |
123 | 1344 | 1365 | ||
124 | === modified file 'ubuntuone/controlpanel/gtk/tests/test_gui.py' | |||
125 | --- ubuntuone/controlpanel/gtk/tests/test_gui.py 2011-02-22 19:28:14 +0000 | |||
126 | +++ ubuntuone/controlpanel/gtk/tests/test_gui.py 2011-02-22 23:51:33 +0000 | |||
127 | @@ -2052,13 +2052,15 @@ | |||
128 | 2052 | 2052 | ||
129 | 2053 | klass = gui.FileSyncStatus | 2053 | klass = gui.FileSyncStatus |
130 | 2054 | 2054 | ||
132 | 2055 | def assert_status_correct(self, status, action=None, callback=None): | 2055 | def assert_status_correct(self, status, action=None, |
133 | 2056 | callback=None, tooltip=None): | ||
134 | 2056 | """The shown status is correct. | 2057 | """The shown status is correct. |
135 | 2057 | 2058 | ||
136 | 2058 | * The ui's label shows 'status'. | 2059 | * The ui's label shows 'status'. |
137 | 2059 | * If action is not None, the ui's button shows that 'action' as label | 2060 | * If action is not None, the ui's button shows that 'action' as label |
138 | 2060 | and when clicking it, 'self._set_called' gets executed. | 2061 | and when clicking it, 'self._set_called' gets executed. |
139 | 2061 | * If action is None, the ui's button should be hidden. | 2062 | * If action is None, the ui's button should be hidden. |
140 | 2063 | * If a tooltip is required, then it exists with correct text. | ||
141 | 2062 | 2064 | ||
142 | 2063 | """ | 2065 | """ |
143 | 2064 | self.assertTrue(self.ui.label.get_visible()) | 2066 | self.assertTrue(self.ui.label.get_visible()) |
144 | @@ -2080,6 +2082,12 @@ | |||
145 | 2080 | else: | 2082 | else: |
146 | 2081 | self.assertFalse(self.ui.button.get_visible()) | 2083 | self.assertFalse(self.ui.button.get_visible()) |
147 | 2082 | 2084 | ||
148 | 2085 | if tooltip is not None: | ||
149 | 2086 | self.assertTrue(self.ui.button.get_has_tooltip()) | ||
150 | 2087 | self.assertEqual(self.ui.button.get_tooltip_text(), tooltip) | ||
151 | 2088 | else: | ||
152 | 2089 | self.assertFalse(self.ui.button.get_has_tooltip()) | ||
153 | 2090 | |||
154 | 2083 | def test_is_a_box(self): | 2091 | def test_is_a_box(self): |
155 | 2084 | """Inherits from gtk.Box.""" | 2092 | """Inherits from gtk.Box.""" |
156 | 2085 | self.assertIsInstance(self.ui, gui.gtk.Box) | 2093 | self.assertIsInstance(self.ui, gui.gtk.Box) |
157 | @@ -2121,52 +2129,88 @@ | |||
158 | 2121 | self.assert_backend_called('file_sync_status', ()) | 2129 | self.assert_backend_called('file_sync_status', ()) |
159 | 2122 | 2130 | ||
160 | 2123 | def test_on_file_sync_status_disabled(self): | 2131 | def test_on_file_sync_status_disabled(self): |
162 | 2124 | """The file sync is disabled.""" | 2132 | """The file sync is disabled. |
163 | 2133 | |||
164 | 2134 | * The correct connection status is displayed. | ||
165 | 2135 | * The button has a tooltip with correct text. | ||
166 | 2136 | |||
167 | 2137 | """ | ||
168 | 2125 | self.patch(self.ui, 'on_enable_clicked', self._set_called) | 2138 | self.patch(self.ui, 'on_enable_clicked', self._set_called) |
169 | 2126 | self.ui.on_file_sync_status_disabled('msg') | 2139 | self.ui.on_file_sync_status_disabled('msg') |
170 | 2127 | 2140 | ||
171 | 2128 | self.assert_status_correct(self.ui.FILE_SYNC_DISABLED, | 2141 | self.assert_status_correct(self.ui.FILE_SYNC_DISABLED, |
173 | 2129 | action=self.ui.ENABLE) | 2142 | action=self.ui.ENABLE, |
174 | 2143 | tooltip=self.ui.ENABLE_TOOLTIP) | ||
175 | 2130 | 2144 | ||
176 | 2131 | def test_on_file_sync_status_starting(self): | 2145 | def test_on_file_sync_status_starting(self): |
178 | 2132 | """The file sync status is starting.""" | 2146 | """The file sync status is starting. |
179 | 2147 | |||
180 | 2148 | * The correct connection status is displayed. | ||
181 | 2149 | * The button has a tooltip with correct text. | ||
182 | 2150 | |||
183 | 2151 | """ | ||
184 | 2133 | self.patch(self.ui, 'on_stop_clicked', self._set_called) | 2152 | self.patch(self.ui, 'on_stop_clicked', self._set_called) |
185 | 2134 | self.ui.on_file_sync_status_starting('msg') | 2153 | self.ui.on_file_sync_status_starting('msg') |
186 | 2135 | 2154 | ||
187 | 2136 | self.assert_status_correct(self.ui.FILE_SYNC_STARTING, | 2155 | self.assert_status_correct(self.ui.FILE_SYNC_STARTING, |
189 | 2137 | action=self.ui.STOP) | 2156 | action=self.ui.STOP, |
190 | 2157 | tooltip=self.ui.STOP_TOOLTIP) | ||
191 | 2138 | 2158 | ||
192 | 2139 | def test_on_file_sync_status_stopped(self): | 2159 | def test_on_file_sync_status_stopped(self): |
194 | 2140 | """The file sync is stopped.""" | 2160 | """The file sync is stopped. |
195 | 2161 | |||
196 | 2162 | * The correct connection status is displayed. | ||
197 | 2163 | * The button has a tooltip with correct text. | ||
198 | 2164 | |||
199 | 2165 | """ | ||
200 | 2141 | self.patch(self.ui, 'on_start_clicked', self._set_called) | 2166 | self.patch(self.ui, 'on_start_clicked', self._set_called) |
201 | 2142 | self.ui.on_file_sync_status_stopped('msg') | 2167 | self.ui.on_file_sync_status_stopped('msg') |
202 | 2143 | 2168 | ||
203 | 2144 | self.assert_status_correct(self.ui.FILE_SYNC_STOPPED, | 2169 | self.assert_status_correct(self.ui.FILE_SYNC_STOPPED, |
205 | 2145 | action=self.ui.START) | 2170 | action=self.ui.START, |
206 | 2171 | tooltip=self.ui.START_TOOLTIP) | ||
207 | 2146 | 2172 | ||
208 | 2147 | def test_on_file_sync_status_disconnected(self): | 2173 | def test_on_file_sync_status_disconnected(self): |
210 | 2148 | """The file sync status is disconnected.""" | 2174 | """The file sync status is disconnected. |
211 | 2175 | |||
212 | 2176 | * The correct connection status is displayed. | ||
213 | 2177 | * The button has a tooltip with correct text. | ||
214 | 2178 | |||
215 | 2179 | """ | ||
216 | 2149 | self.patch(self.ui, 'on_connect_clicked', self._set_called) | 2180 | self.patch(self.ui, 'on_connect_clicked', self._set_called) |
217 | 2150 | self.ui.on_file_sync_status_disconnected('msg') | 2181 | self.ui.on_file_sync_status_disconnected('msg') |
218 | 2151 | 2182 | ||
219 | 2152 | self.assert_status_correct(self.ui.FILE_SYNC_DISCONNECTED, | 2183 | self.assert_status_correct(self.ui.FILE_SYNC_DISCONNECTED, |
221 | 2153 | action=self.ui.CONNECT) | 2184 | action=self.ui.CONNECT, |
222 | 2185 | tooltip=self.ui.CONNECT_TOOLTIP) | ||
223 | 2154 | 2186 | ||
224 | 2155 | def test_on_file_sync_status_syncing(self): | 2187 | def test_on_file_sync_status_syncing(self): |
226 | 2156 | """The file sync status is syncing.""" | 2188 | """The file sync status is syncing. |
227 | 2189 | |||
228 | 2190 | * The correct connection status is displayed. | ||
229 | 2191 | * The button has a tooltip with correct text. | ||
230 | 2192 | |||
231 | 2193 | """ | ||
232 | 2157 | self.patch(self.ui, 'on_disconnect_clicked', self._set_called) | 2194 | self.patch(self.ui, 'on_disconnect_clicked', self._set_called) |
233 | 2158 | self.ui.on_file_sync_status_syncing('msg') | 2195 | self.ui.on_file_sync_status_syncing('msg') |
234 | 2159 | 2196 | ||
235 | 2160 | self.assert_status_correct(self.ui.FILE_SYNC_SYNCING, | 2197 | self.assert_status_correct(self.ui.FILE_SYNC_SYNCING, |
237 | 2161 | action=self.ui.DISCONNECT) | 2198 | action=self.ui.DISCONNECT, |
238 | 2199 | tooltip=self.ui.DISCONNECT_TOOLTIP) | ||
239 | 2162 | 2200 | ||
240 | 2163 | def test_on_file_sync_status_idle(self): | 2201 | def test_on_file_sync_status_idle(self): |
242 | 2164 | """The file sync status is idle.""" | 2202 | """The file sync status is idle. |
243 | 2203 | |||
244 | 2204 | * The correct connection status is displayed. | ||
245 | 2205 | * The button has a tooltip with correct text. | ||
246 | 2206 | |||
247 | 2207 | """ | ||
248 | 2165 | self.patch(self.ui, 'on_disconnect_clicked', self._set_called) | 2208 | self.patch(self.ui, 'on_disconnect_clicked', self._set_called) |
249 | 2166 | self.ui.on_file_sync_status_idle('msg') | 2209 | self.ui.on_file_sync_status_idle('msg') |
250 | 2167 | 2210 | ||
251 | 2168 | self.assert_status_correct(self.ui.FILE_SYNC_IDLE, | 2211 | self.assert_status_correct(self.ui.FILE_SYNC_IDLE, |
253 | 2169 | action=self.ui.DISCONNECT) | 2212 | action=self.ui.DISCONNECT, |
254 | 2213 | tooltip=self.ui.DISCONNECT_TOOLTIP) | ||
255 | 2170 | 2214 | ||
256 | 2171 | def test_on_file_sync_status_error(self): | 2215 | def test_on_file_sync_status_error(self): |
257 | 2172 | """The file sync status couldn't be retrieved.""" | 2216 | """The file sync status couldn't be retrieved.""" |
258 | @@ -2174,7 +2218,9 @@ | |||
259 | 2174 | self.ui.on_file_sync_status_error({'error_msg': 'error msg'}) | 2218 | self.ui.on_file_sync_status_error({'error_msg': 'error msg'}) |
260 | 2175 | 2219 | ||
261 | 2176 | msg = gui.WARNING_MARKUP % self.ui.FILE_SYNC_ERROR | 2220 | msg = gui.WARNING_MARKUP % self.ui.FILE_SYNC_ERROR |
263 | 2177 | self.assert_status_correct(msg, action=self.ui.RESTART) | 2221 | self.assert_status_correct(msg, |
264 | 2222 | action=self.ui.RESTART, | ||
265 | 2223 | tooltip=self.ui.RESTART_TOOLTIP) | ||
266 | 2178 | 2224 | ||
267 | 2179 | def test_on_files_start_error(self): | 2225 | def test_on_files_start_error(self): |
268 | 2180 | """The files service could not be started.""" | 2226 | """The files service could not be started.""" |
269 | @@ -2405,3 +2451,21 @@ | |||
270 | 2405 | """The devices_button widget has the proper name.""" | 2451 | """The devices_button widget has the proper name.""" |
271 | 2406 | self.assertEqual(self.ui.devices_button.get_name(), | 2452 | self.assertEqual(self.ui.devices_button.get_name(), |
272 | 2407 | self.ui.DEVICES_BUTTON_NAME) | 2453 | self.ui.DEVICES_BUTTON_NAME) |
273 | 2454 | |||
274 | 2455 | def test_devices_button_tooltip(self): | ||
275 | 2456 | """The devices button widget has the proper tooltip.""" | ||
276 | 2457 | self.assertTrue(self.ui.devices_button.get_has_tooltip()) | ||
277 | 2458 | self.assertEqual(self.ui.devices_button.get_tooltip_text(), | ||
278 | 2459 | self.ui.DEVICES_BUTTON_TOOLTIP) | ||
279 | 2460 | |||
280 | 2461 | def test_dashboard_button_tooltip(self): | ||
281 | 2462 | """The dashboard button widget has the proper tooltip.""" | ||
282 | 2463 | self.assertTrue(self.ui.dashboard_button.get_has_tooltip()) | ||
283 | 2464 | self.assertEqual(self.ui.dashboard_button.get_tooltip_text(), | ||
284 | 2465 | self.ui.DASHBOARD_BUTTON_TOOLTIP) | ||
285 | 2466 | |||
286 | 2467 | def test_volumes_button_tooltip(self): | ||
287 | 2468 | """The volumes button widget has the proper tooltip.""" | ||
288 | 2469 | self.assertTrue(self.ui.volumes_button.get_has_tooltip()) | ||
289 | 2470 | self.assertEqual(self.ui.volumes_button.get_tooltip_text(), | ||
290 | 2471 | self.ui.VOLUMES_BUTTON_TOOLTIP) |
Chris,
Thanks for working on this! The branch is good to go except for a few things that need fixing:
* the adding of tooltip=None in _update_status should be the last argument, to maintain compatibility of the function API.
* for completeness sake, you should add tooltips (and the matching tests) for the rest of the buttons (ENABLE, RESTART, START, STOP). See below for proper strings to use as tooltips.
* tooltip strings should be (always start with an action since is a button tooltip):
CONNECT_TOOLTIP = _('Connect the file sync service with your personal cloud.') TOOLTIP = _('Disconnect the file sync service from your personal cloud.')
DISCONNECT_
ENABLE_TOOLTIP = _('Enable the file sync service.')
RESTART_TOOLTIP = _('Restart the file sync service.')
START_TOOLTIP = _('Start the file sync service.')
STOP_TOOLTIP = _('Stop the file sync service.')
DASHBOARD_ BUTTON_ TOOLTIP = _('View your personal details and service summary.') BUTTON_ TOOLTIP = _('Manage devices registered with your personal cloud.') BUTTON_ TOOLTIP = _('Manage your cloud folders.')
DEVICES_
VOLUMES_
* fix a couple of docstrings to be PEP-257 compliant:
"""The file sync status is disconnected.
* The correct connection status is displayed.
* The button has a tooltip.
* The correct connect tooltip is set.
"""
should be
"""The file sync status is disconnected.
* The correct connection status is displayed.
* The button has a tooltip.
* The correct connect tooltip is set.
"""
(same for docstring in test_on_ file_sync_ status_ syncing) .
* Instead of duplicate the adding of the assertions
modify assert_ status_ correct to receive the tooltip and assert over it in only one place.
One again, thanks a lot! This is pretty close to be landed.