diff options
author | Papoteur <papoteur@mageia.org> | 2021-01-01 11:52:00 +0100 |
---|---|---|
committer | Papoteur <papoteur@mageia.org> | 2021-01-01 11:52:00 +0100 |
commit | 480cf4c812d8b24839f7ac361b2c70433b9bd049 (patch) | |
tree | 2d23b925e4bdb2cf8f8ad239cf0d65dfa4274606 /lib | |
parent | 6a39813ec92b528182b064e6792f2f1b1694d0f9 (diff) | |
download | isodumper-480cf4c812d8b24839f7ac361b2c70433b9bd049.tar isodumper-480cf4c812d8b24839f7ac361b2c70433b9bd049.tar.gz isodumper-480cf4c812d8b24839f7ac361b2c70433b9bd049.tar.bz2 isodumper-480cf4c812d8b24839f7ac361b2c70433b9bd049.tar.xz isodumper-480cf4c812d8b24839f7ac361b2c70433b9bd049.zip |
Manage enabling/disabling widgets, first level"
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/isodumper.py | 48 |
1 files changed, 37 insertions, 11 deletions
diff --git a/lib/isodumper.py b/lib/isodumper.py index b4ab9e0..d3c6076 100755 --- a/lib/isodumper.py +++ b/lib/isodumper.py @@ -233,9 +233,9 @@ class IsoDumper(basedialog.BaseDialog): message = _('Target Device: {}').format(self.dev) self.logger(message) logging.info(message) - #self.formatbt.setEnabled() - self.ima.setEnabled() - self.backup_select.setEnabled() + self.partition_cbox.setEnabled() + self.backup_cbox.setEnabled() + self.write_cbox.setEnabled() break @staticmethod @@ -257,7 +257,7 @@ class IsoDumper(basedialog.BaseDialog): self.backup_dest = self.backup_img_name self.backup_select.setLabel(tail) self.dialog.recalcLayout() - self.backupbt.setEnabled() + self.start_bt.setEnabled() def do_format(self): code, format_type, name = self.ask_format() @@ -286,10 +286,10 @@ class IsoDumper(basedialog.BaseDialog): def initial_state(self): self.backup_select.setDisabled() - #self.backupbt.setDisabled() - #self.formatbt.setDisabled() + self.backup_cbox.setDisabled() + self.partition_cbox.setDisabled() self.ima.setDisabled() - #self.writebt.setDisabled() + self.write_cbox.setDisabled() self.devicelist.setEnabled() self.progress.setLabel(_("Progress")) self.progress.setValue(0) @@ -691,20 +691,23 @@ exFAT, NTFS or ext. You can specify a volume name and the format in a new dialog self.labelbox.setStretchable(0, True) self.factory.createLabel(self.labelbox, "The selected operations will be executed in order from top to bottom.\nIf both write image and create partition are selected, the partition\nwill be created in the free space after the image.").setStretchable(0, True) self.backupbox = self.factory.createHBox(self.operationbox) - self.factory.createCheckBox(self.backupbox, _("Backup the device to:")) + self.backup_cbox = self.factory.createCheckBox(self.backupbox, _("Backup the device to:")) + self.backup_cbox.setNotify() # add file picker for backup file name self.backup_select = self.factory.createPushButton(self.backupbox, self.ChooseImage) self.backup_select.setStretchable(0, True) self.factory.createHStretch(self.backupbox) self.writebox = self.factory.createHBox(self.operationbox) - self.factory.createCheckBox(self.writebox, _("Write Image from:")) + self.write_cbox = self.factory.createCheckBox(self.writebox, _("Write Image from:")) + self.write_cbox.setNotify() # add file picker for image file self.ima = self.factory.createPushButton(self.writebox, self.ChooseImage) self.ima.setStretchable(0, True) self.factory.createHStretch(self.writebox) #self.writebt = self.factory.createPushButton(self.writebox, _("&Write to device")) self.partitionbox = self.factory.createHBox(self.operationbox) - self.factory.createCheckBox(self.partitionbox, _("Create partition of type:")) + self.partition_cbox = self.factory.createCheckBox(self.partitionbox, _("Create partition of type:")) + self.partition_cbox.setNotify() self.partition_cb = self.factory.createComboBox(self.partitionbox, _("Type:")) self.partition_cb.addItem(_("FAT 32"), False) self.partition_cb.addItem(_("ext4"), False) @@ -752,6 +755,9 @@ exFAT, NTFS or ext. You can specify a volume name and the format in a new dialog #self.eventManager.addWidgetEvent(self.backupbt, self.backup_go) self.eventManager.addWidgetEvent(self.backup_select, self.backup_choosed) #self.eventManager.addWidgetEvent(self.formatbt, self.do_format) + self.eventManager.addWidgetEvent(self.backup_cbox, self.select_backup) + self.eventManager.addWidgetEvent(self.write_cbox, self.select_write) + self.eventManager.addWidgetEvent(self.partition_cbox, self.select_partition) self.eventManager.addWidgetEvent(self.devicelist, self.device_selected) self.eventManager.addWidgetEvent(self.refreshbt, self.update_list) self.eventManager.addWidgetEvent(self.helpbt, self.help_dialog) @@ -792,10 +798,30 @@ exFAT, NTFS or ext. You can specify a volume name and the format in a new dialog if self.img_name != "": self.ima.setLabel(os.path.basename(self.img_name)) self.dialog.recalcLayout() - self.writebt.setEnabled() + self.start_bt.setEnabled() self.activate_devicelist() #self.persistencecb.setEnabled() + def select_backup(self): + if self.backup_cbox.isChecked(): + self.backup_select.setEnabled() + else: + self.backup_select.setDisabled() + + def select_write(self): + if self.write_cbox.isChecked(): + self.ima.setEnabled() + else: + self.ima.setDisabled() + + def select_partition(self): + if self.partition_cbox.isChecked(): + self.partition_cb.setEnabled() + self.partition_label.setEnabled() + else: + self.partition_cb.setDisabled() + self.partition_label.setDisabled() + def check_persistence(self): pass #if self.persistencecb.isChecked(): |