Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Abente <mabente@paraguayeduca.org>2010-08-06 18:59:42 (GMT)
committer Sascha Silbe <sascha-pgp@silbe.org>2010-11-01 16:53:51 (GMT)
commit907593204817bee02a460d698fd9665f1254b0cf (patch)
treebd60362c7b37931ead653d91e5d969aa0c4f9646
parent277128a91bcd232fec5efb4462890a140af97856 (diff)
Prevent multiple XS icon when re register
Re register patch did not consider the XS button option logic. This patch makes sure previous icon will be removed before adding the new one. Signed-off-by: Martin Abente <mabente@paraguayeduca.org>
-rw-r--r--src/jarabe/journal/volumestoolbar.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/jarabe/journal/volumestoolbar.py b/src/jarabe/journal/volumestoolbar.py
index f019687..36e22d7 100644
--- a/src/jarabe/journal/volumestoolbar.py
+++ b/src/jarabe/journal/volumestoolbar.py
@@ -69,10 +69,15 @@ class VolumesToolbar(gtk.Toolbar):
client = gconf.client_get_default()
backup_url = client.get_string('/desktop/sugar/backup_url')
+ for button in self._volume_buttons:
+ if button.__class__ == XSButton:
+ self._volume_buttons.remove(button)
+ self.remove(button)
+ break
+
if backup_url:
xs_button = XSButton()
xs_button.set_palette(JournalXSPalette(backup_url))
- #xs_button.props.group = self._volume_buttons[0]
xs_button.show()
self._volume_buttons.append(xs_button)
@@ -129,7 +134,7 @@ class VolumesToolbar(gtk.Toolbar):
def _get_button_for_mount(self, mount):
mount_point = mount.get_root().get_path()
for button in self.get_children():
- if type(button) == VolumeButton and \
+ if button.__class__ == VolumeButton and \
button.mount_point == mount_point:
return button
logging.error('Couldnt find button with mount_point %r', mount_point)