changeset 0d48834282a9 in /home/hg/repos/gajim-plugins
author: tmolitor thilo@eightysoft.de branches: gtk3 details:gajim-plugins?cmd=changeset;node=0d48834282a9 description: added ability to do periodic plugin update checks (every 24 hours) and resized window to fit omemo plugin name properly
diffstat:
plugin_installer/config_dialog.ui | 25 ++++++++++++++++++++++--- plugin_installer/plugin_installer.py | 9 +++++++++ 2 files changed, 31 insertions(+), 3 deletions(-)
diffs (88 lines):
diff -r 2b76e17f3706 -r 0d48834282a9 plugin_installer/config_dialog.ui --- a/plugin_installer/config_dialog.ui Sun Mar 06 15:39:54 2016 +0100 +++ b/plugin_installer/config_dialog.ui Tue Jul 05 23:44:44 2016 +0200 @@ -5,8 +5,8 @@ <property name="can_focus">False</property> <child> <object class="GtkHPaned" id="hpaned2"> - <property name="width_request">600</property> - <property name="height_request">350</property> + <property name="width_request">1024</property> + <property name="height_request">480</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="position">340</property> @@ -364,6 +364,25 @@ </packing> </child> <child> + <object class="GtkCheckButton" id="check_update_periodically"> + <property name="label" translatable="yes">Check update every 24 hours</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="focus_on_click">False</property> + <property name="xalign">0.5</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="on_check_update_periodically_toggled" swapped="no"/> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + <child> <object class="GtkCheckButton" id="TLS"> <property name="label" translatable="yes">Use TLS transport</property> <property name="use_action_appearance">False</property> @@ -379,7 +398,7 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">2</property> + <property name="position">3</property> </packing> </child> </object> diff -r 2b76e17f3706 -r 0d48834282a9 plugin_installer/plugin_installer.py --- a/plugin_installer/plugin_installer.py Sun Mar 06 15:39:54 2016 +0100 +++ b/plugin_installer/plugin_installer.py Tue Jul 05 23:44:44 2016 +0200 @@ -68,6 +68,7 @@ self.config_dialog = PluginInstallerPluginConfigDialog(self) self.config_default_values = {'ftp_server': ('ftp.gajim.org', ''), 'check_update': (True, ''), + 'check_update_periodically': (True, ''), 'TLS': (True, ''),} self.window = None self.progressbar = None @@ -150,6 +151,9 @@ to_update.append(config.get('info', 'name')) con.quit() GLib.idle_add(self.warn_update, to_update) + # check for updates at least once every 24 hours + if self.config['check_update_periodically']: + self.timeout_id = GLib.timeout_add_seconds(24*3600, self.check_update) except Exception as e: log.debug('Ftp error when check updates: %s' % str(e)) ftp = Ftp(self) @@ -631,6 +635,8 @@ widget.set_text(str(self.plugin.config['ftp_server'])) self.xml.get_object('check_update').set_active( self.plugin.config['check_update']) + self.xml.get_object('check_update_periodically').set_active( + self.plugin.config['check_update_periodically']) self.xml.get_object('TLS').set_active(self.plugin.config['TLS'])
def on_hide(self, widget): @@ -640,5 +646,8 @@ def on_check_update_toggled(self, widget): self.plugin.config['check_update'] = widget.get_active()
+ def on_check_update_periodically_toggled(self, widget): + self.plugin.config['check_update_periodically'] = widget.get_active() + def on_tls_toggled(self, widget): self.plugin.config['TLS'] = widget.get_active()