diff options
author | Papoteur <papoteur@mageia.org> | 2021-01-01 10:01:59 +0100 |
---|---|---|
committer | Papoteur <papoteur@mageia.org> | 2021-01-01 10:01:59 +0100 |
commit | 620ab666448987d0c5c6e0e664af610d3b5a803d (patch) | |
tree | 7d5ffe6ef0e3c72e7ab7fcd8b3c926b186217328 | |
parent | 96dad00d94118cb52234b9e486edb5a85a9f8d04 (diff) | |
download | isodumper-620ab666448987d0c5c6e0e664af610d3b5a803d.tar isodumper-620ab666448987d0c5c6e0e664af610d3b5a803d.tar.gz isodumper-620ab666448987d0c5c6e0e664af610d3b5a803d.tar.bz2 isodumper-620ab666448987d0c5c6e0e664af610d3b5a803d.tar.xz isodumper-620ab666448987d0c5c6e0e664af610d3b5a803d.zip |
Change UI layout (mga#27744)
-rwxr-xr-x | lib/isodumper.py | 117 |
1 files changed, 67 insertions, 50 deletions
diff --git a/lib/isodumper.py b/lib/isodumper.py index bea003a..42d83c8 100755 --- a/lib/isodumper.py +++ b/lib/isodumper.py @@ -295,8 +295,8 @@ class IsoDumper(basedialog.BaseDialog): self.progress.setValue(0) self.progress.setDisabled() self.refreshbt.setEnabled() - self.persistencecb.setChecked(False) - self.persistencecb.setDisabled() + #self.persistencecb.setChecked(False) + #self.persistencecb.setDisabled() self.cryptcb.setChecked(False) self.cryptcb.setDisabled() self.cryptkey.setDisabled() @@ -548,7 +548,7 @@ class IsoDumper(basedialog.BaseDialog): self.writebt.setDisabled() self.progress.setDisabled() self.backup_select.setDisabled() - self.persistencecb.setDisabled() + #self.persistencecb.setDisabled() def wip_unsensitive(self): self.ima.setDisabled() @@ -557,7 +557,7 @@ class IsoDumper(basedialog.BaseDialog): self.backup_select.setDisabled() self.backupbt.setDisabled() self.refreshbt.setDisabled() - self.persistencecb.setDisabled() + #elf.persistencecb.setDisabled() def close(self): self.dialog.destroy() @@ -655,10 +655,10 @@ exFAT, NTFS or ext. You can specify a volume name and the format in a new dialog def UIlayout(self, layout): # create the main gui - # +---+-----------------+ + # +---------------------+ # + banner + - # +---+-----------------+ - # | devicelist | + # +---------------------+ + # | devicebox | # +---+-----+------+----+ # + L | ima | writebt | # +---+-----+------+----+ @@ -677,46 +677,64 @@ exFAT, NTFS or ext. You can specify a volume name and the format in a new dialog self.bannerbox = self.factory.createHBox(self.box) self.banner = self.factory.createImage(self.bannerbox, "/usr/share/isodumper/header.svg") self.devicebox = self.factory.createHBox(self.box) - self.devicelist = self.factory.createComboBox(self.devicebox, _("Device to work on:"), False) + self.devicelist = self.factory.createComboBox(self.devicebox, _("Select the device to work on:"), False) self.devicelist.setNotify() self.devicelist.setStretchable(0, True) - self.writebox = self.factory.createHBox(self.box) - self.factory.createLabel(self.writebox, _("Write Image:")) + self.refreshbt = self.factory.createPushButton(self.devicebox, _("Update list")) + self.refreshbt.setStretchable(0, True) + self.operation_frame = self.factory.createFrame(self.box, _("Select operations")) + self.operationbox = self.factory.createVBox(self.operation_frame) + self.labelbox = self.factory.createHBox(self.operationbox) + 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:")) + # add file picker for backup file name + self.backup_select = self.factory.createPushButton(self.backupbox, self.ChooseImage) + self.backup_select.setStretchable(0, True) + self.backup_select.setDisabled() + self.factory.createHStretch(self.backupbox) + self.writebox = self.factory.createHBox(self.operationbox) + self.factory.createCheckBox(self.writebox, _("Write Image from:")) # add file picker for image file self.ima = self.factory.createPushButton(self.writebox, self.ChooseImage) self.ima.setStretchable(0, True) self.ima.setDisabled() self.factory.createHStretch(self.writebox) - self.writebt = self.factory.createPushButton(self.writebox, _("&Write to device")) - self.writebt.setDisabled() - self.persistencebox = self.factory.createHBox(self.box) - self.persistencecol1 = self.factory.createVBox(self.persistencebox) - self.persistencecol2 = self.factory.createVBox(self.persistencebox) - self.persistencecb = self.factory.createCheckBox(self.persistencecol1, - _("Add a persistent partition in the remaining space")) - self.persistencebox2 = self.factory.createHBox(self.box) - self.cryptcb = self.factory.createCheckBox(self.persistencecol1, _("Encrypt partition")) - self.cryptkey = self.factory.createInputField(self.persistencecol2, _("Key:"), passwordMode=True) - self.persistencecb.setDisabled() - self.persistencecb.setNotify() + #self.writebt = self.factory.createPushButton(self.writebox, _("&Write to device")) + #self.writebt.setDisabled() + self.partitionbox = self.factory.createHBox(self.operationbox) + self.factory.createCheckBox(self.partitionbox, _("Create partition of type:")) + self.partition_cb = self.factory.createComboBox(self.partitionbox, _("Type:")) + self.partition_cb.addItem(_("FAT 32"), False) + self.partition_cb.addItem(_("ext4"), False) + self.partition_cb.addItem(_("NTFS"), False) + self.partition_cb.addItem(_("exFAT"), False) + self.partition_cb.addItem(_("Persistent partition"), False) + self.partition_label = self.factory.createInputField(self.partitionbox, _("Label:")) + self.partition_label.setStretchable(0, True) + self.persistencebox = self.factory.createHBox(self.operationbox) + #self.persistencecb = self.factory.createCheckBox(self.persistencecol1, + # _("Add a persistent partition in the remaining space")) + self.cryptcb = self.factory.createCheckBox(self.persistencebox, _("Encrypt partition using LUKS, with key:")) + self.cryptkey = self.factory.createInputField(self.persistencebox, _("Key:"), passwordMode=True) + self.cryptkey.setStretchable(0, True) + self.revealcb = self.factory.createCheckBox(self.persistencebox, _("Reveal key")) + #self.persistencecb.setDisabled() + #self.persistencecb.setNotify() self.cryptcb.setDisabled() self.cryptcb.setNotify() self.cryptkey.setDisabled() - self.backupbox = self.factory.createHBox(self.box) - self.factory.createLabel(self.backupbox, _("Backup to:")) - # add file picker for backup file name - self.backup_select = self.factory.createPushButton(self.backupbox, self.ChooseImage) - self.backup_select.setStretchable(0, True) - self.backup_select.setDisabled() - self.factory.createHStretch(self.backupbox) - self.backupbt = self.factory.createPushButton(self.backupbox, _("Backup the device")) - self.backupbt.setDisabled() - self.formatbox = self.factory.createHBox(self.box) - self.factory.createLabel(self.formatbox, _("Format the device in FAT, exFAT, NTFS or ext:")) - self.factory.createHStretch(self.formatbox) - self.formatbt = self.factory.createPushButton(self.formatbox, _("Format the device")) - self.formatbt.setDisabled() - self.progressbox = self.factory.createHBox(self.box) + #self.formatbox = self.factory.createHBox(self.box) + #self.factory.createLabel(self.formatbox, _("Format the device in FAT, exFAT, NTFS or ext:")) + #self.factory.createHStretch(self.formatbox) + #self.formatbt = self.factory.createPushButton(self.formatbox, _("Format the device")) + #self.formatbt.setDisabled() + self.execute_frame = self.factory.createFrame(self.box, _("Execution")) + self.execute_framevb = self.factory.createVBox(self.execute_frame) + self.execute_label = self.factory.createLabel(self.execute_framevb, _("When you are sure all options are correct, start:")) + self.start_bt = self.factory.createPushButton(self.execute_framevb, _("Execute")) + self.progressbox = self.factory.createHBox(self.execute_framevb) self.progress = self.factory.createProgressBar(self.progressbox, _("Progress"), 100) self.progress.setStretchable(0, True) self.reportbox = self.factory.createHBox(self.box) @@ -724,8 +742,6 @@ exFAT, NTFS or ext. You can specify a volume name and the format in a new dialog self.logview = self.factory.createLogView(self.reportbox, _("Report"), 10) self.logview.setStretchable(0, True) self.buttonsbox = self.factory.createHBox(self.box) - self.refreshbt = self.factory.createPushButton(self.devicebox, _("Refresh")) - self.refreshbt.setStretchable(0, True) self.aboutbt = self.factory.createPushButton(self.buttonsbox, _("About")) self.aboutbt.setStretchable(0, True) self.helpbt = self.factory.createPushButton(self.buttonsbox, _("Help")) @@ -735,12 +751,12 @@ exFAT, NTFS or ext. You can specify a volume name and the format in a new dialog # Connect events self.eventManager.addWidgetEvent(self.quitbt, self.confirm_close) self.eventManager.addWidgetEvent(self.ima, self.ask_image) - self.eventManager.addWidgetEvent(self.persistencecb, self.check_persistence) - self.eventManager.addWidgetEvent(self.writebt, self.do_write) + #self.eventManager.addWidgetEvent(self.persistencecb, self.check_persistence) + #self.eventManager.addWidgetEvent(self.writebt, self.do_write) self.eventManager.addWidgetEvent(self.cryptcb, self.check_encryt) - self.eventManager.addWidgetEvent(self.backupbt, self.backup_go) + #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.formatbt, self.do_format) self.eventManager.addWidgetEvent(self.devicelist, self.device_selected) self.eventManager.addWidgetEvent(self.refreshbt, self.update_list) self.eventManager.addWidgetEvent(self.helpbt, self.help_dialog) @@ -783,15 +799,16 @@ exFAT, NTFS or ext. You can specify a volume name and the format in a new dialog self.dialog.recalcLayout() self.writebt.setEnabled() self.activate_devicelist() - self.persistencecb.setEnabled() + #self.persistencecb.setEnabled() def check_persistence(self): - if self.persistencecb.isChecked(): - self.cryptcb.setEnabled() - else: - self.cryptcb.setDisabled() - self.cryptkey.setDisabled() - self.cryptcb.setChecked(False) + pass + #if self.persistencecb.isChecked(): + #self.cryptcb.setEnabled() + #else: + #self.cryptcb.setDisabled() + #self.cryptkey.setDisabled() + #self.cryptcb.setChecked(False) def check_encryt(self): if self.cryptcb.isChecked(): |