diff options
author | Martin Abente <mabente@paraguayeduca.org> | 2010-08-06 18:59:42 (GMT) |
---|---|---|
committer | Anish Mangal <anish@sugarlabs.org> | 2011-08-26 05:55:55 (GMT) |
commit | 142e10410811ea60827381ed850fe3995f4f4759 (patch) | |
tree | 1691c7fead44e3bfe5a50b24a6079cb2bb45edbd | |
parent | 8e6d5af06356034da5720774566eee1d53021b46 (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>
Signed-off-by: Anish Mangal <anish@sugarlabs.org>
-rw-r--r-- | src/jarabe/journal/volumestoolbar.py | 9 |
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) |