changeset 5103d04fb24e in /home/hg/repos/gajim
branches: gtk3
details:http://hg.gajim.org/gajim?cmd=changeset;node=5103d04fb24e
description: fix transient for windows. Fixes #7185
diffstat:
src/chat_control.py | 12 +++++++-----
src/dialogs.py | 33 ++++++++++++++++++++++-----------
src/disco.py | 8 +++++---
src/groupchat_control.py | 12 ++++++++----
src/session.py | 3 ++-
5 files changed, 44 insertions(+), 24 deletions(-)
diffs (205 lines):
diff -r a11bca1a96ac -r 5103d04fb24e src/chat_control.py
--- a/src/chat_control.py Thu Aug 15 22:20:13 2013 +0200
+++ b/src/chat_control.py Thu Aug 15 23:14:42 2013 +0200
@@ -2834,11 +2834,13 @@
on_no(self)
dialogs.ConfirmationDialog(
- # %s is being replaced in the code with JID
- _('You just received a new message from "%s"') %
self.contact.jid,
- _('If you close this tab and you have history disabled, '\
- 'this message will be lost.'), on_response_ok=on_ok,
- on_response_cancel=on_cancel)
+ #%s is being replaced in the code with JID
+ _('You just received a new message from "%s"') % \
+ self.contact.jid,
+ _('If you close this tab and you have history disabled, '\
+ 'this message will be lost.'), on_response_ok=on_ok,
+ on_response_cancel=on_cancel,
+ transient_for=self.parent_win.window)
return
on_yes(self)
diff -r a11bca1a96ac -r 5103d04fb24e src/dialogs.py
--- a/src/dialogs.py Thu Aug 15 22:20:13 2013 +0200
+++ b/src/dialogs.py Thu Aug 15 23:14:42 2013 +0200
@@ -1531,10 +1531,10 @@
"""
def __init__(self, pritext, sectext='', on_response_ok=None,
- on_response_cancel=None):
+ on_response_cancel=None, transient_for=None):
self.user_response_ok = on_response_ok
self.user_response_cancel = on_response_cancel
- HigDialog.__init__(self, None,
+ HigDialog.__init__(self, transient_for,
Gtk.MessageType.QUESTION, Gtk.ButtonsType.OK_CANCEL, pritext,
sectext,
self.on_response_ok, self.on_response_cancel)
self.popup()
@@ -1612,8 +1612,10 @@
HIG compliant info dialog
"""
- def __init__(self, pritext, sectext=''):
- if hasattr(gajim.interface, 'roster') and gajim.interface.roster:
+ def __init__(self, pritext, sectext='', transient_for=None):
+ if transient_for:
+ parent = transient_for
+ elif hasattr(gajim.interface, 'roster') and gajim.interface.roster:
parent = gajim.interface.roster.window
else:
parent = None
@@ -1735,11 +1737,13 @@
"""
def __init__(self, pritext, sectext='', checktext='', on_response_ok=None,
- on_response_cancel=None, is_modal=True):
+ on_response_cancel=None, is_modal=True, transient_for=None):
self.user_response_ok = on_response_ok
self.user_response_cancel = on_response_cancel
- if hasattr(gajim.interface, 'roster') and gajim.interface.roster:
+ if transient_for:
+ parent = transient_for
+ elif hasattr(gajim.interface, 'roster') and gajim.interface.roster:
parent = gajim.interface.roster.window
else:
parent = None
@@ -1995,13 +1999,16 @@
Common Class for Input dialogs
"""
- def __init__(self, title, label_str, is_modal, ok_handler, cancel_handler):
+ def __init__(self, title, label_str, is_modal, ok_handler, cancel_handler,
+ transient_for=None):
self.dialog = self.xml.get_object('input_dialog')
label = self.xml.get_object('label')
self.dialog.set_title(title)
label.set_markup(label_str)
self.cancel_handler = cancel_handler
self.vbox = self.xml.get_object('vbox')
+ if transient_for:
+ self.dialog.set_transient_for(transient_for)
self.ok_handler = ok_handler
okbutton = self.xml.get_object('okbutton')
@@ -2038,10 +2045,10 @@
"""
def __init__(self, title, label_str, input_str=None, is_modal=True,
- ok_handler=None, cancel_handler=None):
+ ok_handler=None, cancel_handler=None, transient_for=None):
self.xml = gtkgui_helpers.get_gtk_builder('input_dialog.ui')
CommonInputDialog.__init__(self, title, label_str, is_modal,
ok_handler,
- cancel_handler)
+ cancel_handler, transient_for=transient_for)
self.input_entry = self.xml.get_object('input_entry')
if input_str:
self.set_entry(input_str)
@@ -2221,7 +2228,8 @@
"""
def __init__(self, title, label_str1, label_str2, input_str1=None,
- input_str2=None, is_modal=True, ok_handler=None,
cancel_handler=None):
+ input_str2=None, is_modal=True, ok_handler=None, cancel_handler=None,
+ transient_for=None):
self.xml = gtkgui_helpers.get_gtk_builder('dubbleinput_dialog.ui')
self.dialog = self.xml.get_object('dubbleinput_dialog')
label1 = self.xml.get_object('label1')
@@ -2238,6 +2246,8 @@
if input_str2:
self.input_entry2.set_text(input_str2)
self.input_entry2.select_region(0, -1) # select all
+ if transient_for:
+ self.dialog.set_transient_for(transient_for)
self.dialog.set_modal(is_modal)
@@ -4574,7 +4584,8 @@
name = self.new_privacy_list_entry.get_text()
if not name:
ErrorDialog(_('Invalid List Name'),
- _('You must enter a name to create a privacy list.'))
+ _('You must enter a name to create a privacy list.'),
+ transient_for=self.window)
return
key_name = 'privacy_list_%s' % name
if key_name in gajim.interface.instances[self.account]:
diff -r a11bca1a96ac -r 5103d04fb24e src/disco.py
--- a/src/disco.py Thu Aug 15 22:20:13 2013 +0200
+++ b/src/disco.py Thu Aug 15 23:14:42 2013 +0200
@@ -765,13 +765,15 @@
# We can't travel anywhere else.
self.destroy()
dialogs.ErrorDialog(_('The service could not be found'),
-_('There is no service at the address you entered, or it is not responding. '
- 'Check the address and try again.'))
+ _('There is no service at the address you entered, or it is '
+ 'not responding. Check the address and try again.'),
+ transient_for=self.window)
return
klass = self.cache.get_browser(identities, features)
if not klass:
dialogs.ErrorDialog(_('The service is not browsable'),
-_('This type of service does not contain any items to browse.'))
+ _('This type of service does not contain any items to
browse.'),
+ transient_for=self.window)
return
elif klass is None:
klass = AgentBrowser
diff -r a11bca1a96ac -r 5103d04fb24e src/groupchat_control.py
--- a/src/groupchat_control.py Thu Aug 15 22:20:13 2013 +0200
+++ b/src/groupchat_control.py Thu Aug 15 23:14:42 2013 +0200
@@ -2139,7 +2139,8 @@
dialogs.ConfirmationDialogCheck(pritext, sectext,
_('_Do not ask me again'), on_response_ok=on_ok,
- on_response_cancel=on_cancel)
+ on_response_cancel=on_cancel,
+ transient_for=self.parent_win.window)
return
on_yes(self)
@@ -2215,7 +2216,8 @@
dialogs.DoubleInputDialog(_('Destroying %s') % '\u200E' + \
self.room_jid, _('You are going to definitively destroy this '
'room.\nYou may specify a reason below:'),
- _('You may also enter an alternate venue:'), ok_handler=on_ok)
+ _('You may also enter an alternate venue:'), ok_handler=on_ok,
+ transient_for=self.parent_win.window)
def _on_bookmark_room_menuitem_activate(self, widget):
"""
@@ -2415,7 +2417,8 @@
# ask for reason
dialogs.InputDialog(_('Kicking %s') % nick,
- _('You may specify a reason below:'), ok_handler=on_ok)
+ _('You may specify a reason below:'), ok_handler=on_ok,
+ transient_for=self.parent_win.window)
def mk_menu(self, event, iter_):
"""
@@ -2754,7 +2757,8 @@
nick = gajim.get_nick_from_jid(jid)
# ask for reason
dialogs.InputDialog(_('Banning %s') % nick,
- _('You may specify a reason below:'), ok_handler=on_ok)
+ _('You may specify a reason below:'), ok_handler=on_ok,
+ transient_for=self.parent_win.window)
def grant_membership(self, widget, jid):
"""
diff -r a11bca1a96ac -r 5103d04fb24e src/session.py
--- a/src/session.py Thu Aug 15 22:20:13 2013 +0200
+++ b/src/session.py Thu Aug 15 23:14:42 2013 +0200
@@ -413,7 +413,8 @@
'acceptable?''') % (
negotiation.describe_features(ask_user)),
on_response_yes=accept_nondefault_options,
- on_response_no=reject_nondefault_options)
+ on_response_no=reject_nondefault_options,
+ transient_for=self.control.parent_win.window)
else:
self.respond_e2e_bob(form, negotiated, not_acceptable)
_______________________________________________
Commits mailing list
[email protected]
http://lists.gajim.org/cgi-bin/listinfo/commits