added ability to do periodic plugin update checks (every 24 hours) and resized window to fit omemo plugin name properly
This commit is contained in:
@@ -5,8 +5,8 @@
|
|||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkHPaned" id="hpaned2">
|
<object class="GtkHPaned" id="hpaned2">
|
||||||
<property name="width_request">600</property>
|
<property name="width_request">1024</property>
|
||||||
<property name="height_request">350</property>
|
<property name="height_request">480</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="position">340</property>
|
<property name="position">340</property>
|
||||||
@@ -363,6 +363,25 @@
|
|||||||
<property name="position">1</property>
|
<property name="position">1</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</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>
|
<child>
|
||||||
<object class="GtkCheckButton" id="TLS">
|
<object class="GtkCheckButton" id="TLS">
|
||||||
<property name="label" translatable="yes">Use TLS transport</property>
|
<property name="label" translatable="yes">Use TLS transport</property>
|
||||||
@@ -379,7 +398,7 @@
|
|||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
<property name="fill">True</property>
|
<property name="fill">True</property>
|
||||||
<property name="position">2</property>
|
<property name="position">3</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ class PluginInstaller(GajimPlugin):
|
|||||||
self.config_dialog = PluginInstallerPluginConfigDialog(self)
|
self.config_dialog = PluginInstallerPluginConfigDialog(self)
|
||||||
self.config_default_values = {'ftp_server': ('ftp.gajim.org', ''),
|
self.config_default_values = {'ftp_server': ('ftp.gajim.org', ''),
|
||||||
'check_update': (True, ''),
|
'check_update': (True, ''),
|
||||||
|
'check_update_periodically': (True, ''),
|
||||||
'TLS': (True, ''),}
|
'TLS': (True, ''),}
|
||||||
self.window = None
|
self.window = None
|
||||||
self.progressbar = None
|
self.progressbar = None
|
||||||
@@ -150,6 +151,9 @@ class PluginInstaller(GajimPlugin):
|
|||||||
to_update.append(config.get('info', 'name'))
|
to_update.append(config.get('info', 'name'))
|
||||||
con.quit()
|
con.quit()
|
||||||
GLib.idle_add(self.warn_update, to_update)
|
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:
|
except Exception as e:
|
||||||
log.debug('Ftp error when check updates: %s' % str(e))
|
log.debug('Ftp error when check updates: %s' % str(e))
|
||||||
ftp = Ftp(self)
|
ftp = Ftp(self)
|
||||||
@@ -631,6 +635,8 @@ class PluginInstallerPluginConfigDialog(GajimPluginConfigDialog):
|
|||||||
widget.set_text(str(self.plugin.config['ftp_server']))
|
widget.set_text(str(self.plugin.config['ftp_server']))
|
||||||
self.xml.get_object('check_update').set_active(
|
self.xml.get_object('check_update').set_active(
|
||||||
self.plugin.config['check_update'])
|
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'])
|
self.xml.get_object('TLS').set_active(self.plugin.config['TLS'])
|
||||||
|
|
||||||
def on_hide(self, widget):
|
def on_hide(self, widget):
|
||||||
@@ -640,5 +646,8 @@ class PluginInstallerPluginConfigDialog(GajimPluginConfigDialog):
|
|||||||
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()
|
||||||
|
|
||||||
|
def on_check_update_periodically_toggled(self, widget):
|
||||||
|
self.plugin.config['check_update_periodically'] = widget.get_active()
|
||||||
|
|
||||||
def on_tls_toggled(self, widget):
|
def on_tls_toggled(self, widget):
|
||||||
self.plugin.config['TLS'] = widget.get_active()
|
self.plugin.config['TLS'] = widget.get_active()
|
||||||
|
|||||||
Reference in New Issue
Block a user