From a6368e5c2cfe9e50051418df2ed93a2410ec6143 Mon Sep 17 00:00:00 2001 From: Papoteur Date: Fri, 1 Jan 2021 21:54:33 +0100 Subject: Improve interface, name of persistent partition is editable --- lib/isodumper.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/isodumper.py b/lib/isodumper.py index e22d793..4c3fa6b 100755 --- a/lib/isodumper.py +++ b/lib/isodumper.py @@ -293,6 +293,7 @@ class IsoDumper(basedialog.BaseDialog): self.initial_state() def initial_state(self): + self.image_is_selected = False self.backup_select.setDisabled() self.backup_cbox.setDisabled() self.partition_cbox.setDisabled() @@ -389,7 +390,7 @@ class IsoDumper(basedialog.BaseDialog): def do_write(self): self.wip_unsensitive() - self.writebt.setDisabled() + #self.writebt.setDisabled() self.devicelist.setDisabled() self.backup_select.setDisabled() self.progress.setEnabled() @@ -412,7 +413,6 @@ class IsoDumper(basedialog.BaseDialog): else: return self.ima.setDisabled() - self.writebt.setDisabled() #: don't translate source or target self.progress.setLabel(_('Writing {source} to {target}').format(source=source.split('/')[-1], target=target.split('/')[-1])) @@ -458,7 +458,7 @@ class IsoDumper(basedialog.BaseDialog): self.logger(message) logging.info(message) # Add persistent partition if asked - if self.persistencecb.isChecked(): + if self.partition_cbox.isChecked() and self.partition_cb.value() == _("Persistent partition"): self.progress.setLabel(_("Adding persistent partition")) self.progress.setValue(0) if self.cryptcb.isChecked(): @@ -467,7 +467,7 @@ class IsoDumper(basedialog.BaseDialog): self.logger(message) logging.warning(message) else: - iface.do_persistence(target, "mgalive-persist", self.cryptkey.value()) + iface.do_persistence(target, self.partition_label.value(), self.cryptkey.value()) while not iface.done: progress = iface.progress self.progress.setValue(progress) @@ -481,7 +481,7 @@ class IsoDumper(basedialog.BaseDialog): else: self.logger(iface.message) else: - iface.do_persistence(target, "mgalive-persist", "") + iface.do_persistence(target, self.partition_label.value(), "") while not iface.done: progress = iface.progress self.progress.setValue(progress) @@ -809,7 +809,10 @@ exFAT, NTFS or ext. You can specify a volume name and the format in a new dialog self.dialog.recalcLayout() self.start_bt.setEnabled() self.activate_devicelist() + self.image_is_selected = True #self.persistencecb.setEnabled() + else: + self.image_is_selected = False def select_backup(self): if self.backup_cbox.isChecked(): @@ -834,6 +837,8 @@ exFAT, NTFS or ext. You can specify a volume name and the format in a new dialog def select_partition_type(self): if self.partition_cb.value() in ("ext4" ,"Persistent partition"): self.cryptcb.setEnabled() + if self.partition_cb.value() == "Persistent partition": + self.partition_label.setValue("mgalive-persist") if self.partition_cb.value() != "": self.start_bt.setEnabled() else: -- cgit v1.2.1