add an ui option to disable the use of FT proxies. Fixes #1751
This commit is contained in:
parent
186d69931e
commit
88730b1ea1
4 changed files with 40 additions and 3 deletions
|
@ -230,6 +230,7 @@ class Config:
|
||||||
# proxy65 for FT
|
# proxy65 for FT
|
||||||
'file_transfer_proxies': [opt_str,
|
'file_transfer_proxies': [opt_str,
|
||||||
'proxy.jabber.org, proxy.netlab.cz, transfer.jabber.freenet.de'],
|
'proxy.jabber.org, proxy.netlab.cz, transfer.jabber.freenet.de'],
|
||||||
|
'use_ft_proxies': [opt_bool, True, _('If checked, Gajim will use your IP and proxies defined in file_transfer_proxies option for file transfer.'), True],
|
||||||
'msgwin-x-position': [opt_int, -1], # Default is to let the window manager decide
|
'msgwin-x-position': [opt_int, -1], # Default is to let the window manager decide
|
||||||
'msgwin-y-position': [opt_int, -1], # Default is to let the window manager decide
|
'msgwin-y-position': [opt_int, -1], # Default is to let the window manager decide
|
||||||
'msgwin-width': [opt_int, 480],
|
'msgwin-width': [opt_int, 480],
|
||||||
|
|
|
@ -189,7 +189,8 @@ class ConnectionBytestream:
|
||||||
streamhost.setAttr('port', unicode(port))
|
streamhost.setAttr('port', unicode(port))
|
||||||
streamhost.setAttr('host', ft_override_host_to_send)
|
streamhost.setAttr('host', ft_override_host_to_send)
|
||||||
streamhost.setAttr('jid', sender)
|
streamhost.setAttr('jid', sender)
|
||||||
if fast and proxyhosts != []:
|
if fast and proxyhosts != [] and gajim.config.get_per('accounts',
|
||||||
|
self.name, 'use_ft_proxies'):
|
||||||
file_props['proxy_receiver'] = unicode(receiver)
|
file_props['proxy_receiver'] = unicode(receiver)
|
||||||
file_props['proxy_sender'] = unicode(sender)
|
file_props['proxy_sender'] = unicode(sender)
|
||||||
file_props['proxyhosts'] = proxyhosts
|
file_props['proxyhosts'] = proxyhosts
|
||||||
|
@ -1533,6 +1534,10 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco)
|
||||||
if not self.connection:
|
if not self.connection:
|
||||||
return
|
return
|
||||||
self.connection.getRoster(self._on_roster_set)
|
self.connection.getRoster(self._on_roster_set)
|
||||||
|
if gajim.config.get_per('accounts', self.name, 'use_ft_proxies'):
|
||||||
|
self.discover_ft_proxies()
|
||||||
|
|
||||||
|
def discover_ft_proxies(self):
|
||||||
cfg_proxies = gajim.config.get_per('accounts', self.name,
|
cfg_proxies = gajim.config.get_per('accounts', self.name,
|
||||||
'file_transfer_proxies')
|
'file_transfer_proxies')
|
||||||
if cfg_proxies:
|
if cfg_proxies:
|
||||||
|
|
|
@ -1086,6 +1086,8 @@ class AccountModificationWindow:
|
||||||
'sync_with_global_status'))
|
'sync_with_global_status'))
|
||||||
self.xml.get_widget('autoconnect_checkbutton').set_active(
|
self.xml.get_widget('autoconnect_checkbutton').set_active(
|
||||||
gajim.config.get_per('accounts', self.account, 'autoconnect'))
|
gajim.config.get_per('accounts', self.account, 'autoconnect'))
|
||||||
|
self.xml.get_widget('use_ft_proxies_checkbutton').set_active(
|
||||||
|
gajim.config.get_per('accounts', self.account, 'use_ft_proxies'))
|
||||||
list_no_log_for = gajim.config.get_per('accounts', self.account,
|
list_no_log_for = gajim.config.get_per('accounts', self.account,
|
||||||
'no_log_for').split()
|
'no_log_for').split()
|
||||||
if self.account in list_no_log_for:
|
if self.account in list_no_log_for:
|
||||||
|
@ -1174,6 +1176,8 @@ class AccountModificationWindow:
|
||||||
|
|
||||||
config['sync_with_global_status'] = self.xml.get_widget(
|
config['sync_with_global_status'] = self.xml.get_widget(
|
||||||
'sync_with_global_status_checkbutton').get_active()
|
'sync_with_global_status_checkbutton').get_active()
|
||||||
|
config['use_ft_proxies'] = self.xml.get_widget(
|
||||||
|
'use_ft_proxies_checkbutton').get_active()
|
||||||
|
|
||||||
active = self.proxy_combobox.get_active()
|
active = self.proxy_combobox.get_active()
|
||||||
proxy = self.proxy_combobox.get_model()[active][0].decode('utf-8')
|
proxy = self.proxy_combobox.get_model()[active][0].decode('utf-8')
|
||||||
|
@ -1272,6 +1276,10 @@ class AccountModificationWindow:
|
||||||
'custom_host') or self.option_changed(config, 'custom_port')):
|
'custom_host') or self.option_changed(config, 'custom_port')):
|
||||||
relogin_needed = True
|
relogin_needed = True
|
||||||
|
|
||||||
|
if self.option_changed(config, 'use_ft_proxies') and \
|
||||||
|
config['use_ft_proxies']:
|
||||||
|
gajim.connections[self.account].discover_ft_proxies()
|
||||||
|
|
||||||
if relogin_needed:
|
if relogin_needed:
|
||||||
dialog = dialogs.YesNoDialog(_('Relogin now?'),
|
dialog = dialogs.YesNoDialog(_('Relogin now?'),
|
||||||
_('If you want all the changes to apply instantly, '
|
_('If you want all the changes to apply instantly, '
|
||||||
|
|
|
@ -1117,6 +1117,25 @@
|
||||||
<property name="fill">False</property>
|
<property name="fill">False</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
|
<child>
|
||||||
|
<widget class="GtkCheckButton" id="use_ft_proxies_checkbutton">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="label" translatable="yes">Use file transfer proxies</property>
|
||||||
|
<property name="use_underline">True</property>
|
||||||
|
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||||
|
<property name="focus_on_click">True</property>
|
||||||
|
<property name="active">False</property>
|
||||||
|
<property name="inconsistent">False</property>
|
||||||
|
<property name="draw_indicator">True</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="padding">0</property>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">False</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="tab_expand">False</property>
|
<property name="tab_expand">False</property>
|
||||||
|
@ -1684,6 +1703,10 @@
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkFrame" id="frame37">
|
<widget class="GtkFrame" id="frame37">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
|
|
Loading…
Add table
Reference in a new issue