From f1dcc6760e6c4c139b6c6e8b21b82221797206bc Mon Sep 17 00:00:00 2001 From: Papoteur Date: Sun, 21 Mar 2021 22:22:48 +0100 Subject: Improve activation and deactivation of interface elements --- lib/isodumper.py | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/lib/isodumper.py b/lib/isodumper.py index 1b5b1b9..0d940c9 100755 --- a/lib/isodumper.py +++ b/lib/isodumper.py @@ -316,6 +316,8 @@ class IsoDumper(basedialog.BaseDialog): self.backup_cbox.setDisabled() self.partition_cbox.setDisabled() self.ima.setDisabled() + self.img_name = "" + self.ima.setLabel(self.ChooseImage) self.write_cbox.setDisabled() self.devicelist.setEnabled() self.progress.setLabel(_("Progress")) @@ -529,6 +531,7 @@ class IsoDumper(basedialog.BaseDialog): self.initial_state() else: self.emergency(message) + self.initial_state() else: self.emergency(message) self.initial_state() @@ -578,7 +581,7 @@ class IsoDumper(basedialog.BaseDialog): def final_unsensitive(self): self.ima.setDisabled() self.devicelist.setDisabled() - self.select_write.setDisabled() + self.write_cbox.setDisabled() self.backup_cbox.setDisabled() self.progress.setDisabled() self.backup_select.setDisabled() @@ -592,6 +595,11 @@ class IsoDumper(basedialog.BaseDialog): self.write_cbox.setDisabled() self.refreshbt.setDisabled() self.partition_cbox.setDisabled() + self.partition_cb.setDisabled() + self.partition_label.setDisabled() + self.cryptcb.setDisabled() + self.cryptkey.setDisabled() + self.start_bt.setDisabled() def close(self): # to exit from _handleEvents loop @@ -864,17 +872,21 @@ exFAT, NTFS or ext. You can specify a volume name and the format in a new dialog else: self.partition_cb.setDisabled() self.partition_label.setDisabled() + self.cryptcb.setDisabled() + self.cryptkey.setDisabled() 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: + self.cryptcb.setDisabled() self.cryptcb.setDisabled() self.cryptkey.setDisabled() + if self.partition_cb.value() != "": + self.start_bt.setEnabled() + else: self.start_bt.setDisabled() def check_encryt(self): @@ -890,13 +902,15 @@ exFAT, NTFS or ext. You can specify a volume name and the format in a new dialog self.backup_go() self.backup_is_selected = False else: - self.emergency(_("No image for backup is selected.")) + info = Info(_("Error"), True, _("No image for backup is selected.")) + self.ask_OK(info) if self.write_cbox.isChecked(): if self.image_is_selected: self.do_write() self.image_is_selected = False else: - self.emergency(_("No image to write is selected.")) + info = Info(_("Error"), True, _("No image to write is selected.")) + self.ask_OK(info) return if self.partition_cbox.isChecked(): # Create a partition without writing image, will use all the device space. -- cgit v1.2.1