[guilhem].PluginInstallerPlugin.Add configuration option for FTP TLS.Fixes #34

This commit is contained in:
Denis Fomin
2012-09-04 00:15:53 +04:00
parent 3117b6d1ec
commit 24fbcb1d81
3 changed files with 26 additions and 4 deletions

View File

@@ -301,8 +301,9 @@
<object class="GtkCheckButton" id="check_update">
<property name="label" translatable="yes">Check update after start</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_focus">False</property>
<property name="receives_default">False</property>
<property name="focus_on_click">False</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_check_update_toggled"/>
</object>
@@ -311,6 +312,21 @@
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="TLS">
<property name="label" translatable="yes">Use TLS transport</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="receives_default">False</property>
<property name="focus_on_click">False</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_tls_toggled"/>
</object>
<packing>
<property name="expand">False</property>
<property name="position">2</property>
</packing>
</child>
</object>
</child>
</object>

View File

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

View File

@@ -63,7 +63,8 @@ class PluginInstaller(GajimPlugin):
self.description = _('Install and upgrade plugins from ftp')
self.config_dialog = PluginInstallerPluginConfigDialog(self)
self.config_default_values = {'ftp_server': ('ftp.gajim.org', ''),
'check_update': (True, ''),}
'check_update': (True, ''),
'TLS': (True, ''),}
self.window = None
self.progressbar = None
self.available_plugins_model = None
@@ -98,7 +99,7 @@ class PluginInstaller(GajimPlugin):
'\n%s') % plugins_str, on_response_yes=open_update)
def ftp_connect(self):
if sys.version_info[:2] > (2, 6):
if sys.version_info[:2] > (2, 6) and self.config['TLS'] :
con = ftplib.FTP_TLS(self.config['ftp_server'])
con.login()
con.prot_p()
@@ -620,6 +621,8 @@ class PluginInstallerPluginConfigDialog(GajimPluginConfigDialog):
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('TLS').set_active(
self.plugin.config['TLS'])
def on_hide(self, widget):
widget = self.xml.get_object('ftp_server')
@@ -627,3 +630,6 @@ class PluginInstallerPluginConfigDialog(GajimPluginConfigDialog):
def on_check_update_toggled(self, widget):
self.plugin.config['check_update'] = widget.get_active()
def on_tls_toggled(self, widget):
self.plugin.config['TLS'] = widget.get_active()