PluginInstaller.prevent adding multiple 'Available' tabs.

This commit is contained in:
Denis Fomin
2012-07-22 13:31:37 +04:00
parent a815f3372e
commit e4e5935361
2 changed files with 12 additions and 6 deletions

View File

@@ -1,7 +1,7 @@
[info]
name: Plugin Installer
short_name: plugin_installer
version: 0.8
version: 0.8.1
description: Install and upgrade plugins from ftp
authors: Denis Fomin <fominde@gmail.com>
Yann Leboulanger <asterix@lagaule.org>

View File

@@ -142,8 +142,9 @@ class PluginInstaller(GajimPlugin):
self.xml.set_translation_domain('gajim_plugins')
self.xml.add_objects_from_file(self.GTK_BUILDER_FILE_PATH, ['hpaned2'])
hpaned = self.xml.get_object('hpaned2')
self.page_num = self.notebook.append_page(hpaned,
gtk.Label(_('Available')))
if not hasattr(self, 'page_num'):
self.page_num = self.notebook.append_page(hpaned,
gtk.Label(_('Available')))
widgets_to_extract = ('plugin_name_label1',
'available_treeview', 'progressbar', 'inslall_upgrade_button',
@@ -205,6 +206,8 @@ class PluginInstaller(GajimPlugin):
def on_win_destroy(self, widget):
if hasattr(self, 'ftp'):
del self.ftp
if hasattr(self, 'page_num'):
del self.page_num
def available_plugins_toggled_cb(self, cell, path):
is_active = self.available_plugins_model[path][4]
@@ -373,9 +376,12 @@ class PluginInstaller(GajimPlugin):
return plugins_found
def select_root_iter(self):
selection = self.available_treeview.get_selection()
if selection.count_selected_rows() == 0:
selection.select_iter(self.available_plugins_model.get_iter_root())
try:
selection = self.available_treeview.get_selection()
if selection.count_selected_rows() == 0:
selection.select_iter(self.available_plugins_model.get_iter_root())
except Exception, error:
pass
class Ftp(threading.Thread):