From 9837284df3bb8310cb9988b8f31ccf7a98dbfa04 Mon Sep 17 00:00:00 2001 From: Papoteur Date: Sun, 14 May 2023 18:11:55 +0200 Subject: Init DBus interface later. This avoid to wait in some cases with GTK interface --- lib/isodumper.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/isodumper.py b/lib/isodumper.py index 0f71d95..da79323 100755 --- a/lib/isodumper.py +++ b/lib/isodumper.py @@ -452,6 +452,7 @@ class IsoDumper(basedialog.BaseDialog): return rc def backup_go(self): + self.init_iface() self.wip_unsensitive() self.progress.setEnabled() self.progress.setLabel("Backup") @@ -505,6 +506,7 @@ class IsoDumper(basedialog.BaseDialog): return True def do_write(self): + self.init_iface() self.wip_unsensitive() self.progress.setEnabled() self.progress.setLabel("Writing") @@ -743,6 +745,14 @@ exFAT, NTFS or ext. You can specify a volume name and the format in a new dialog if self.ask_OK(info): return + def init_iface(self): + # Prepare interface on DBus + try: + self.iface + except: + self.bus = SystemBus() + self.iface = self.bus.get("org.mageia.Magiback", "Isodumper") + def __init__(self, debug=False): APP = "isodumper" # Call translation catalog @@ -774,10 +784,6 @@ exFAT, NTFS or ext. You can specify a volume name and the format in a new dialog # Operation running self.operation = False - # Prepare interface on DBus - self.bus = SystemBus() - self.iface = self.bus.get("org.mageia.Magiback", "Isodumper") - self.ChooseImage = _("Choose an image") self.warning = _("Warning\nThis will destroy all data on the target device,\n\ are you sure you want to proceed?\n\ @@ -786,6 +792,7 @@ exFAT, NTFS or ext. You can specify a volume name and the format in a new dialog """ Init/Constructor for the 'widgets' """ + self.dialog = basedialog.BaseDialog.__init__(self, _("Isodumper {}").format(version.RELEASE), "", basedialog.DialogType.POPUP, 100, 10) yui.YUI.app().setApplicationIcon("/usr/share/icons/isodumper.png") @@ -1166,7 +1173,6 @@ exFAT, NTFS or ext. You can specify a volume name and the format in a new dialog pass def run(self, debug=False): - self.backupTitle = yui.YUI.app().applicationTitle() yui.YUI.app().setApplicationTitle(self._title) try: -- cgit v1.2.1