[plugin_installer] Set xml to _ui, Fix one config checkbox on_run
This commit is contained in:
@@ -180,7 +180,7 @@ class PluginInstaller(GajimPlugin):
|
|||||||
id_ = self.window.connect('destroy', self.on_win_destroy)
|
id_ = self.window.connect('destroy', self.on_win_destroy)
|
||||||
self.connected_ids[id_] = self.window
|
self.connected_ids[id_] = self.window
|
||||||
path = self.local_file_path('installer.ui')
|
path = self.local_file_path('installer.ui')
|
||||||
self.xml = get_builder(
|
self._ui = get_builder(
|
||||||
path, widgets=['refresh', 'available_plugins_box', 'plugin_store'])
|
path, widgets=['refresh', 'available_plugins_box', 'plugin_store'])
|
||||||
|
|
||||||
widgets_to_extract = (
|
widgets_to_extract = (
|
||||||
@@ -190,16 +190,16 @@ class PluginInstaller(GajimPlugin):
|
|||||||
'available_text', 'available_text_label')
|
'available_text', 'available_text_label')
|
||||||
|
|
||||||
for widget_name in widgets_to_extract:
|
for widget_name in widgets_to_extract:
|
||||||
setattr(self, widget_name, self.xml.get_object(widget_name))
|
setattr(self, widget_name, self._ui.get_object(widget_name))
|
||||||
|
|
||||||
self.available_page = self.notebook.append_page(
|
self.available_page = self.notebook.append_page(
|
||||||
self.available_plugins_box, Gtk.Label.new(_('Available')))
|
self.available_plugins_box, Gtk.Label.new(_('Available')))
|
||||||
|
|
||||||
self.available_plugins_model = self.xml.get_object('plugin_store')
|
self.available_plugins_model = self._ui.plugin_store
|
||||||
self.available_plugins_model.set_sort_column_id(
|
self.available_plugins_model.set_sort_column_id(
|
||||||
2, Gtk.SortType.ASCENDING)
|
2, Gtk.SortType.ASCENDING)
|
||||||
|
|
||||||
self.xml.connect_signals(self)
|
self._ui.connect_signals(self)
|
||||||
self.window.show_all()
|
self.window.show_all()
|
||||||
|
|
||||||
def on_win_destroy(self, widget):
|
def on_win_destroy(self, widget):
|
||||||
@@ -554,30 +554,30 @@ class DownloadAsync(threading.Thread):
|
|||||||
class PluginInstallerPluginConfigDialog(GajimPluginConfigDialog):
|
class PluginInstallerPluginConfigDialog(GajimPluginConfigDialog):
|
||||||
def init(self):
|
def init(self):
|
||||||
glade_file_path = self.plugin.local_file_path('config.ui')
|
glade_file_path = self.plugin.local_file_path('config.ui')
|
||||||
self.xml = get_builder(glade_file_path)
|
self._ui = get_builder(glade_file_path)
|
||||||
self.get_child().pack_start(self.xml.config_grid, True, True, 0)
|
self.get_child().pack_start(self._ui.config_grid, True, True, 0)
|
||||||
|
|
||||||
self.xml.connect_signals(self)
|
self._ui.connect_signals(self)
|
||||||
|
|
||||||
def on_run(self):
|
def on_run(self):
|
||||||
self.xml.check_update.set_active(self.plugin.config['check_update'])
|
self._ui.check_update.set_active(self.plugin.config['check_update'])
|
||||||
self.xml.auto_update.set_sensitive(self.plugin.config['check_update'])
|
self._ui.auto_update.set_sensitive(self.plugin.config['check_update'])
|
||||||
self.xml.auto_update.set_active(self.plugin.config['auto_update'])
|
self._ui.auto_update.set_active(self.plugin.config['auto_update'])
|
||||||
self.xml.auto_update_feedback.set_sensitive(self.plugin.config['check_update'])
|
self._ui.auto_update_feedback.set_sensitive(self.plugin.config['auto_update'])
|
||||||
self.xml.auto_update_feedback.set_active(self.plugin.config['auto_update_feedback'])
|
self._ui.auto_update_feedback.set_active(self.plugin.config['auto_update_feedback'])
|
||||||
|
|
||||||
def on_check_update_toggled(self, widget):
|
def on_check_update_toggled(self, widget):
|
||||||
self.plugin.config['check_update'] = widget.get_active()
|
self.plugin.config['check_update'] = widget.get_active()
|
||||||
if not self.plugin.config['check_update']:
|
if not self.plugin.config['check_update']:
|
||||||
self.plugin.config['auto_update'] = False
|
self.plugin.config['auto_update'] = False
|
||||||
self.xml.auto_update.set_sensitive(self.plugin.config['check_update'])
|
self._ui.auto_update.set_sensitive(self.plugin.config['check_update'])
|
||||||
self.xml.auto_update.set_active(self.plugin.config['auto_update'])
|
self._ui.auto_update.set_active(self.plugin.config['auto_update'])
|
||||||
self.xml.auto_update_feedback.set_sensitive(self.plugin.config['auto_update'])
|
self._ui.auto_update_feedback.set_sensitive(self.plugin.config['auto_update'])
|
||||||
self.xml.auto_update_feedback.set_active(self.plugin.config['auto_update_feedback'])
|
self._ui.auto_update_feedback.set_active(self.plugin.config['auto_update_feedback'])
|
||||||
|
|
||||||
def on_auto_update_toggled(self, widget):
|
def on_auto_update_toggled(self, widget):
|
||||||
self.plugin.config['auto_update'] = widget.get_active()
|
self.plugin.config['auto_update'] = widget.get_active()
|
||||||
self.xml.auto_update_feedback.set_sensitive(self.plugin.config['auto_update'])
|
self._ui.auto_update_feedback.set_sensitive(self.plugin.config['auto_update'])
|
||||||
|
|
||||||
def on_auto_update_feedback_toggled(self, widget):
|
def on_auto_update_feedback_toggled(self, widget):
|
||||||
self.plugin.config['auto_update_feedback'] = widget.get_active()
|
self.plugin.config['auto_update_feedback'] = widget.get_active()
|
||||||
|
|||||||
Reference in New Issue
Block a user