changeset 82361155ce35 in /home/hg/repos/gajim
branches: gtk3
details:http://hg.gajim.org/gajim?cmd=changeset;node=82361155ce35
description: make the Ok button of Insecure connection dialog insensitive when yes checkbox is not checked. Fixes #7373
diffstat:
src/dialogs.py | 25 +++++++++++++++++++++++++
src/gui_interface.py | 14 +-------------
2 files changed, 26 insertions(+), 13 deletions(-)
diffs (63 lines):
diff -r d8baf3b488b7 -r 82361155ce35 src/dialogs.py
--- a/src/dialogs.py Thu Jul 18 17:04:59 2013 +0200
+++ b/src/dialogs.py Thu Jul 18 20:32:45 2013 +0200
@@ -1848,6 +1848,31 @@
is_checked_2 = False
return [is_checked_1, is_checked_2]
+class PlainConnectionDialog(ConfirmationDialogDoubleCheck):
+ """
+ Dialog that is shown when using an insecure connection
+ """
+ def __init__(self, account, on_ok, on_cancel):
+ pritext = _('Insecure connection')
+ sectext = _('You are about to connect to the account %(account)s '
+ '(%(server)s) with an insecure connection. This means all your '
+ 'conversations will be exchanged unencrypted. This type of '
+ 'connection is really discouraged.\nAre you sure you want to do '
+ 'that?') % {'account': account,
+ 'server': gajim.get_hostname_from_account(account)}
+ checktext1 = _('Yes, I really want to connect insecurely')
+ tooltip1 = _('Gajim will NOT connect unless you check this box')
+ checktext2 = _('_Do not ask me again')
+ ConfirmationDialogDoubleCheck.__init__(self, pritext, sectext,
+ checktext1, checktext2, tooltip1=tooltip1, on_response_ok=on_ok,
+ on_response_cancel=on_cancel, is_modal=False)
+ self.ok_button = self.action_area.get_children()[0] # right to left
+ self.ok_button.set_sensitive(False)
+ self.checkbutton1.connect('clicked', self.on_checkbutton_clicked)
+
+ def on_checkbutton_clicked(self, widget):
+ self.ok_button.set_sensitive(widget.get_active())
+
class ConfirmationDialogDoubleRadio(ConfirmationDialog):
"""
HIG compliant confirmation dialog with 2 radios
diff -r d8baf3b488b7 -r 82361155ce35 src/gui_interface.py
--- a/src/gui_interface.py Thu Jul 18 17:04:59 2013 +0200
+++ b/src/gui_interface.py Thu Jul 18 20:32:45 2013 +0200
@@ -1409,23 +1409,11 @@
gajim.nec.push_incoming_event(OurShowEvent(None, conn=obj.conn,
show='offline'))
- pritext = _('Insecure connection')
- sectext = _('You are about to connect to the account %(account)s '
- '(%(server)s) with an insecure connection. This means all your '
- 'conversations will be exchanged unencrypted. This type of '
- 'connection is really discouraged.\nAre you sure you want to do '
- 'that?') % {'account': obj.conn.name,
- 'server': gajim.get_hostname_from_account(obj.conn.name)}
- checktext1 = _('Yes, I really want to connect insecurely')
- tooltip1 = _('Gajim will NOT connect unless you check this box')
- checktext2 = _('_Do not ask me again')
if 'plain_connection' in self.instances[obj.conn.name]['online_dialog']:
self.instances[obj.conn.name]['online_dialog']['plain_connection'].\
destroy()
self.instances[obj.conn.name]['online_dialog']['plain_connection'] = \
- dialogs.ConfirmationDialogDoubleCheck(pritext, sectext, checktext1,
- checktext2, tooltip1=tooltip1, on_response_ok=on_ok,
- on_response_cancel=on_cancel, is_modal=False)
+ dialogs.PlainConnectionDialog(obj.conn.name, on_ok, on_cancel)
def handle_event_insecure_ssl_connection(self, obj):
# ('INSECURE_SSL_CONNECTION', account, (connection, connection_type))