proxy gui better. also checks for ports existance. gajim did not check very well and it ended up unlaunchable. this is now fixed

This commit is contained in:
Nikos Kouremenos 2005-04-08 22:40:27 +00:00
parent b1c89d4a6a
commit b71e2de1ba
2 changed files with 54 additions and 76 deletions

View File

@ -868,6 +868,11 @@ class Account_modification_window:
for w in widgets: for w in widgets:
w.set_sensitive(widget.get_active()) w.set_sensitive(widget.get_active())
def on_use_proxy_checkbutton_toggled(self, widget):
proxyhost_entry = self.xml.get_widget('proxyhost_entry')
proxyport_entry = self.xml.get_widget('proxyport_entry')
self.on_checkbutton_toggled(widget, [proxyhost_entry, proxyport_entry])
def init_account(self, infos): def init_account(self, infos):
"""Initialize window with defaults values""" """Initialize window with defaults values"""
if infos.has_key('accname'): if infos.has_key('accname'):
@ -886,14 +891,25 @@ class Account_modification_window:
self.xml.get_widget('resource_entry').set_text(infos['resource']) self.xml.get_widget('resource_entry').set_text(infos['resource'])
if infos.has_key('priority'): if infos.has_key('priority'):
self.xml.get_widget('priority_spinbutton').set_value(infos['priority']) self.xml.get_widget('priority_spinbutton').set_value(infos['priority'])
use_proxy = False
if infos.has_key('use_proxy'): if infos.has_key('use_proxy'):
if infos['use_proxy'] != 0:
use_proxy = True
self.xml.get_widget('use_proxy_checkbutton').\ self.xml.get_widget('use_proxy_checkbutton').\
set_active(infos['use_proxy']) set_active(infos['use_proxy'])
self.xml.get_widget('proxyhost_entry').set_sensitive(use_proxy)
self.xml.get_widget('proxyport_entry').set_sensitive(use_proxy)
if infos.has_key('proxyhost'): if infos.has_key('proxyhost'):
self.xml.get_widget('proxyhost_entry').set_text(infos['proxyhost']) self.xml.get_widget('proxyhost_entry').set_text(infos['proxyhost'])
if infos.has_key('proxyport'): if infos.has_key('proxyport'):
self.xml.get_widget('proxyport_entry').set_text(str(\ self.xml.get_widget('proxyport_entry').set_text(str(\
infos['proxyport'])) infos['proxyport']))
gpg_key_label = self.xml.get_widget('gpg_key_label') gpg_key_label = self.xml.get_widget('gpg_key_label')
if not self.plugin.config.has_key('usegpg'): if not self.plugin.config.has_key('usegpg'):
gpg_key_label.set_text('GPG is not usable on this computer') gpg_key_label.set_text('GPG is not usable on this computer')
@ -925,7 +941,7 @@ class Account_modification_window:
self.xml.get_widget('log_history_checkbutton').set_active(0) self.xml.get_widget('log_history_checkbutton').set_active(0)
def on_save_button_clicked(self, widget): def on_save_button_clicked(self, widget):
"""When save button is clicked : Save informations in config file""" """When save button is clicked: Save information in config file"""
save_password = 0 save_password = 0
if self.xml.get_widget('save_password_checkbutton').get_active(): if self.xml.get_widget('save_password_checkbutton').get_active():
save_password = 1 save_password = 1
@ -981,8 +997,12 @@ class Account_modification_window:
except ValueError: except ValueError:
Error_dialog(_('Proxy Port must be a port number')) Error_dialog(_('Proxy Port must be a port number'))
return return
else:
Error_dialog(_('You must enter a proxy port to use proxy'))
return
if proxyhost == '': if proxyhost == '':
Error_dialog(_('You must enter a proxy host to use proxy')) Error_dialog(_('You must enter a proxy host to use proxy'))
return
(login, hostname) = jid.split('@') (login, hostname) = jid.split('@')
key_name = self.xml.get_widget('gpg_name_label').get_text() key_name = self.xml.get_widget('gpg_name_label').get_text()
@ -1217,6 +1237,7 @@ class Account_modification_window:
self.xml.get_widget('gpg_password_entry').set_sensitive(False) self.xml.get_widget('gpg_password_entry').set_sensitive(False)
self.xml.get_widget('password_entry').set_sensitive(False) self.xml.get_widget('password_entry').set_sensitive(False)
self.xml.get_widget('log_history_checkbutton').set_active(1) self.xml.get_widget('log_history_checkbutton').set_active(1)
#default is checked #default is checked
self.xml.get_widget('sync_with_global_status_checkbutton').set_active(1) self.xml.get_widget('sync_with_global_status_checkbutton').set_active(1)
self.xml.signal_autoconnect(self) self.xml.signal_autoconnect(self)

View File

@ -835,6 +835,7 @@
<child> <child>
<widget class="GtkEntry" id="resource_entry"> <widget class="GtkEntry" id="resource_entry">
<property name="visible">True</property> <property name="visible">True</property>
<property name="tooltip" translatable="yes">Resource is sent to the jabber server in order to 'seperate' the same JID in two or more parts depending on the number of the clients connected in the same server with the same account. So you might be connected in the same account with resource 'Home' and 'Work' at the same time. The resource which has the highest priority will get the messages. (see below)</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="editable">True</property> <property name="editable">True</property>
<property name="visibility">True</property> <property name="visibility">True</property>
@ -884,6 +885,7 @@
<child> <child>
<widget class="GtkSpinButton" id="priority_spinbutton"> <widget class="GtkSpinButton" id="priority_spinbutton">
<property name="visible">True</property> <property name="visible">True</property>
<property name="tooltip" translatable="yes">Priority is used in Jabber to determine who gets the events from the jabber server when two or more clients are connected using the same account; The client with the highest priority gets the events</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="climb_rate">1</property> <property name="climb_rate">1</property>
<property name="digits">0</property> <property name="digits">0</property>
@ -940,6 +942,7 @@
<child> <child>
<widget class="GtkVBox" id="vbox38"> <widget class="GtkVBox" id="vbox38">
<property name="border_width">5</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">False</property> <property name="homogeneous">False</property>
<property name="spacing">5</property> <property name="spacing">5</property>
@ -1040,6 +1043,7 @@
<child> <child>
<widget class="GtkVBox" id="vbox31"> <widget class="GtkVBox" id="vbox31">
<property name="border_width">5</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">False</property> <property name="homogeneous">False</property>
<property name="spacing">0</property> <property name="spacing">0</property>
@ -1049,7 +1053,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="label_xalign">0</property> <property name="label_xalign">0</property>
<property name="label_yalign">0.5</property> <property name="label_yalign">0.5</property>
<property name="shadow_type">GTK_SHADOW_NONE</property> <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
<child> <child>
<widget class="GtkAlignment" id="alignment26"> <widget class="GtkAlignment" id="alignment26">
@ -1158,6 +1162,7 @@
<child> <child>
<widget class="GtkCheckButton" id="gpg_save_password_checkbutton"> <widget class="GtkCheckButton" id="gpg_save_password_checkbutton">
<property name="visible">True</property> <property name="visible">True</property>
<property name="tooltip" translatable="yes">If checked Gajim will store the password in ~/.gajim/config with 'read' permission only for only you and of course the superuser</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="label" translatable="yes">Save passphrase (insecure)</property> <property name="label" translatable="yes">Save passphrase (insecure)</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
@ -1236,58 +1241,7 @@
</child> </child>
<child> <child>
<widget class="GtkFrame" id="frame15"> <placeholder/>
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="label_yalign">0.5</property>
<property name="shadow_type">GTK_SHADOW_NONE</property>
<child>
<widget class="GtkAlignment" id="alignment27">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xscale">1</property>
<property name="yscale">1</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">12</property>
<property name="right_padding">0</property>
<child>
<placeholder/>
</child>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label151">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;SSL&lt;/b&gt;</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="type">label_item</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child> </child>
</widget> </widget>
<packing> <packing>
@ -1327,10 +1281,11 @@
<child> <child>
<widget class="GtkFrame" id="frame23"> <widget class="GtkFrame" id="frame23">
<property name="border_width">5</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="label_xalign">0</property> <property name="label_xalign">0</property>
<property name="label_yalign">0.5</property> <property name="label_yalign">0.5</property>
<property name="shadow_type">GTK_SHADOW_NONE</property> <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
<child> <child>
<widget class="GtkAlignment" id="alignment51"> <widget class="GtkAlignment" id="alignment51">
@ -1354,27 +1309,6 @@
<property name="row_spacing">5</property> <property name="row_spacing">5</property>
<property name="column_spacing">5</property> <property name="column_spacing">5</property>
<child>
<widget class="GtkEntry" id="proxyport_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char">*</property>
<property name="activates_default">False</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="y_options"></property>
</packing>
</child>
<child> <child>
<widget class="GtkLabel" id="label136"> <widget class="GtkLabel" id="label136">
<property name="visible">True</property> <property name="visible">True</property>
@ -1463,6 +1397,7 @@
<property name="active">False</property> <property name="active">False</property>
<property name="inconsistent">False</property> <property name="inconsistent">False</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
<signal name="toggled" handler="on_use_proxy_checkbutton_toggled" last_modification_time="Fri, 08 Apr 2005 21:12:47 GMT"/>
</widget> </widget>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
@ -1473,6 +1408,27 @@
<property name="y_options"></property> <property name="y_options"></property>
</packing> </packing>
</child> </child>
<child>
<widget class="GtkEntry" id="proxyport_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes">3128</property>
<property name="has_frame">True</property>
<property name="invisible_char">*</property>
<property name="activates_default">False</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="y_options"></property>
</packing>
</child>
</widget> </widget>
</child> </child>
</widget> </widget>
@ -1539,6 +1495,7 @@
<child> <child>
<widget class="GtkVBox" id="vbox61"> <widget class="GtkVBox" id="vbox61">
<property name="border_width">5</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">False</property> <property name="homogeneous">False</property>
<property name="spacing">5</property> <property name="spacing">5</property>