Skip to content
Snippets Groups Projects
Commit f9be8b99 authored by Daniel Brötzmann's avatar Daniel Brötzmann
Browse files

fix: AccountsWindow: Use get_app_window to reliably access window's methods

Fixes #10911
parent 41d6387c
No related branches found
No related tags found
No related merge requests found
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
from .settings import SettingsDialog from .settings import SettingsDialog
from .settings import SettingsBox from .settings import SettingsBox
from .settings import PopoverSetting from .settings import PopoverSetting
from .util import get_app_window
from .util import open_window from .util import open_window
log = logging.getLogger('gajim.gui.accounts') log = logging.getLogger('gajim.gui.accounts')
...@@ -564,7 +565,8 @@ def _disable() -> None: ...@@ -564,7 +565,8 @@ def _disable() -> None:
if (account in app.connections and if (account in app.connections and
not app.connections[account].state.is_disconnected): not app.connections[account].state.is_disconnected):
# Connecting or connected # Connecting or connected
window = cast(Gtk.Window, self.get_toplevel()) window = get_app_window('AccountsWindow')
assert window is not None
ConfirmationDialog( ConfirmationDialog(
_('Disable Account'), _('Disable Account'),
_('Account %s is still connected') % account, _('Account %s is still connected') % account,
...@@ -705,7 +707,8 @@ def __init__(self, account: str) -> None: ...@@ -705,7 +707,8 @@ def __init__(self, account: str) -> None:
GenericSettingPage.__init__(self, account, settings) GenericSettingPage.__init__(self, account, settings)
def _on_account_name_change(self, *args: Any) -> None: def _on_account_name_change(self, *args: Any) -> None:
window = cast(AccountsWindow, self.get_toplevel()) window = get_app_window('AccountsWindow')
assert window is not None
window.update_account_label(self.account) window.update_account_label(self.account)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment