fix: draw dialog outside of init

This commit is contained in:
aclist 2026-08-19 16:36:35 +09:00
parent ec004aad5d
commit e7ff025605
8 changed files with 10 additions and 3 deletions

View File

@ -263,6 +263,7 @@ class Controller(GObject.GObject):
self.open_page(NotebookPage.LOG)
except Exception as e:
dialog = ExceptionDialog(self, str(e))
dialog.show_all()
dialog.run()
def select_colorized(self) -> None:
@ -296,6 +297,7 @@ class Controller(GObject.GObject):
write_diagnostic(self.prefs.paths.config, file)
except Exception as e:
dialog = ExceptionDialog(self, str(e))
dialog.show_all()
dialog.run()
def update_steam_api_key(self, text: str) -> None:

View File

@ -178,6 +178,7 @@ class ConfigManager:
logger.critical(e)
trace = traceback.format_exc()
dialog = ExceptionDialog(self.controller, trace)
dialog.show_all()
dialog.run()
raise e

View File

@ -303,6 +303,7 @@ class ConnectionManager:
def _server_timeout(self) -> None:
dialog = ExceptionDialog(self.controller, server_timeout)
dialog.set_secondary_text(kb.DZG_006)
dialog.show_all()
dialog.run()
def get_debug_args(self) -> str:

View File

@ -20,11 +20,9 @@ from dzgui.const.constants import (
from dzgui.const.enum import Preferences
from dzgui.managers.threading import call_on_thread, StoredFunc, ThreadingManager
from dzgui.model.model_factory import FastInsertListStore, ModelFactory
from dzgui.strings import dialogs, kb
from dzgui.strings import dialogs
from dzgui.util.format import format_mods
from dzgui.util.strings import server_timeout
from dzgui.util.symlink import rebuild_symlinks
from dzgui.views.dialogs.generic import ExceptionDialog
import dzgui.api.pefile as PeFile

View File

@ -64,4 +64,5 @@ class UpdateManager:
def _on_update_failure(self, msg: str) -> None:
dialog = ExceptionDialog(self.controller, msg)
dialog.show_all()
dialog.run()

View File

@ -405,6 +405,7 @@ class ServerModelManager:
if show_dialog:
dialog = ExceptionDialog(self.controller, dialogs.load_error_lan)
dialog.show_all()
dialog.run()
def _cleanup_on_failure(self, show_dialog: bool = True) -> None:
@ -421,6 +422,7 @@ class ServerModelManager:
if show_dialog:
dialog = ExceptionDialog(self.controller, server_timeout)
dialog.set_secondary_text(kb.DZG_006)
dialog.show_all()
dialog.run()
def _push_data(self, data: list[Any]) -> None:

View File

@ -430,6 +430,7 @@ class Options(ScrollableMixin, Gtk.ScrolledWindow): # type: ignore
# NOTE: re-check in case file was removed by user between runs
if prefs.paths.config.is_file() is False:
dialog = ExceptionDialog(self.controller, strings.config_not_found)
dialog.show_all()
dialog.run()
raise OSError(f"Config file '{prefs.paths.config}' not found")

View File

@ -231,6 +231,7 @@ class PreConnectionAssistant(Gtk.Box):
def _on_debug_clicked(self, button: Gtk.Button) -> None:
args = self.controller.get_debug_args()
d = DebugDialog(self.controller, args)
d.show_all()
d.run()
def _on_ok_clicked(self, button: Gtk.Button) -> None: