Added 'compression' checkbox to backup GUI

Added 'compress the backup' checkbox to the backup GUI.

fixes QubesOS/qubes-issues#943
This commit is contained in:
Marta Marczykowska-Górecka 2017-12-11 02:34:31 +01:00
parent 7fd0c58303
commit 67a32b5748
No known key found for this signature in database
GPG Key ID: 9A752C30B26FD04B
3 changed files with 15 additions and 3 deletions

View File

@ -139,6 +139,9 @@ class BackupVMsWindow(ui_backupdlg.Ui_Backup, multiselectwidget.QtGui.QWizard):
self.passphrase_line_edit_verify.setText(
profile_data['passphrase_text'])
if 'compression' in profile_data:
self.compress_checkbox.setChecked(profile_data['compression'])
if 'include' in profile_data:
return profile_data['include']
@ -148,8 +151,8 @@ class BackupVMsWindow(ui_backupdlg.Ui_Backup, multiselectwidget.QtGui.QWizard):
settings = {'destination_vm': self.appvm_combobox.currentText(),
'destination_path': self.dir_line_edit.text(),
'include': [vm.name for vm in self.selected_vms],
'passphrase_text': self.passphrase_line_edit.text()}
# TODO: add compression when it is added
'passphrase_text': self.passphrase_line_edit.text(),
'compression': self.compress_checkbox.isChecked()}
backup_utils.write_backup_profile(settings, use_temp)

View File

@ -100,7 +100,6 @@ def write_backup_profile(args, use_temp=False):
path = get_profile_path(use_temp)
# TODO add compression parameter to GUI issue#943
with open(path, 'w') as profile_file:
yaml.safe_dump(profile_data, profile_file)

View File

@ -80,6 +80,16 @@
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="compress_checkbox">
<property name="text">
<string>Compress the backup</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="unrecognized_config_label">
<property name="palette">