Merge lp:~nataliabidart/ubuntuone-control-panel/services-improve into lp:ubuntuone-control-panel

Proposed by Natalia Bidart
Status: Merged
Approved by: Natalia Bidart
Approved revision: 139
Merged at revision: 138
Proposed branch: lp:~nataliabidart/ubuntuone-control-panel/services-improve
Merge into: lp:ubuntuone-control-panel
Diff against target: 49 lines (+11/-0)
1 file modified
ubuntuone/controlpanel/gtk/gui.py (+11/-0)
To merge this branch: bzr merge lp:~nataliabidart/ubuntuone-control-panel/services-improve
Reviewer Review Type Date Requested Status
Eric Casteleijn (community) Approve
Roberto Alsina (community) Approve
Review via email: mp+58362@code.launchpad.net

Commit message

- Hide and show replications boxes when replication list is ready and the user clicked on Services tab (hack to solve LP: #750309).

To post a comment you must log in.
Revision history for this message
Roberto Alsina (ralsina) wrote :

+1 fieldtest

review: Approve
Revision history for this message
Eric Casteleijn (thisfred) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntuone/controlpanel/gtk/gui.py'
2--- ubuntuone/controlpanel/gtk/gui.py 2011-04-13 21:00:09 +0000
3+++ ubuntuone/controlpanel/gtk/gui.py 2011-04-19 17:53:29 +0000
4@@ -1213,6 +1213,7 @@
5 self.package_manager = package_manager.PackageManager()
6 self.install_box = None
7
8+ self._replications_ready = False # hack to solve LP: #750309
9 self.backend.connect_to_signal('ReplicationsInfoReady',
10 self.on_replications_info_ready)
11 self.backend.connect_to_signal('ReplicationsInfoError',
12@@ -1278,6 +1279,7 @@
13 @log_call(logger.debug)
14 def load_replications(self, *args):
15 """Load replications info."""
16+ self._replications_ready = False # hack to solve LP: #750309
17 # ask replications to the backend
18 self.message.start()
19 self.backend.replications_info(reply_handler=NO_OP,
20@@ -1308,6 +1310,7 @@
21 check_button=check_button,
22 dependency=pkg, dependency_name=name)
23 setattr(self, '%s_service' % sid, child)
24+ self._replications_ready = True # hack to solve LP: #750309
25
26 @log_call(logger.error)
27 def on_replications_info_error(self, error_dict=None):
28@@ -1318,6 +1321,12 @@
29 else:
30 self.on_error(error_dict=error_dict)
31
32+ def refresh(self):
33+ """If replication list has been loaded, hide and show them."""
34+ if self._replications_ready: # hack to solve LP: #750309
35+ self.replications.hide()
36+ self.replications.show()
37+
38
39 class FileSyncStatus(gtk.HBox, ControlPanelMixin):
40 """A file sync status widget."""
41@@ -1576,6 +1585,8 @@
42
43 self.services_button.set_name(self.SERVICES_BUTTON_NAME)
44 self.services_button.set_tooltip_text(self.SERVICES_BUTTON_TOOLTIP)
45+ self.services_button.connect('clicked',
46+ lambda b: self.services.refresh())
47
48 self.enable_volumes = lambda: self.volumes_button.set_sensitive(True)
49 self.disable_volumes = lambda: self.volumes_button.set_sensitive(False)

Subscribers

People subscribed via source and target branches