Commit a9a6b048 authored by Yann Leboulanger's avatar Yann Leboulanger

set a transient_for for join groupchat dialog when needed. Fixes #8994

parent 16b8eb1f
......@@ -2364,7 +2364,8 @@ class SubscriptionRequestWindow(Gtk.ApplicationWindow):
self.destroy()
class JoinGroupchatWindow(Gtk.ApplicationWindow):
def __init__(self, account, room_jid, password=None, automatic=None):
def __init__(self, account, room_jid, password=None, automatic=None,
transient_for=None):
Gtk.ApplicationWindow.__init__(self)
self.set_name('JoinGroupchat')
self.set_application(app.app)
......@@ -2372,6 +2373,8 @@ class JoinGroupchatWindow(Gtk.ApplicationWindow):
self.set_resizable(False)
self.set_position(Gtk.WindowPosition.CENTER)
self.set_title(_('Join Groupchat'))
if transient_for:
self.set_transient_for(transient_for)
self.automatic = automatic
self.password = password
......
......@@ -1399,7 +1399,8 @@ class ToplevelAgentBrowser(AgentBrowser):
if not iter_:
return
service = model[iter_][0]
app.interface.join_gc_minimal(self.account, service)
app.interface.join_gc_minimal(self.account, service,
transient_for=self.window.window)
def update_actions(self):
if self.execute_button:
......
......@@ -1818,7 +1818,8 @@ class Interface:
ctrl.scroll_to_end()
def join_gc_minimal(self, account, room_jid, password=None):
def join_gc_minimal(self, account, room_jid, password=None,
transient_for=None):
if account is not None:
if app.in_groupchat(account, room_jid):
# If we already in the groupchat, join_gc_room will bring
......@@ -1855,7 +1856,8 @@ class Interface:
dialogs.ErrorDialog(_('JID is not a Groupchat'),
transient_for=app.app.get_active_window())
return
dialogs.JoinGroupchatWindow(account, room_jid, password=password)
dialogs.JoinGroupchatWindow(account, room_jid, password=password,
transient_for=transient_for)
disco_account = connected_accounts[0] if account is None else account
app.connections[disco_account].discoverMUC(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment