Merge branch 'master' of git://git.qubes-os.org/marmarek/qubes-manager

This commit is contained in:
Joanna Rutkowska 2014-01-06 21:42:39 +01:00
commit 49282de660
3 changed files with 33 additions and 3 deletions

View File

@ -186,8 +186,11 @@ def select_path_button_clicked(dialog, select_file = False):
new_path = file_dialog_function(dialog, "Select backup location.", "~")
if new_path != None:
dialog.dir_line_edit.setText(new_path)
dialog.backup_location = new_path
if os.path.basename(new_path) == 'qubes.xml':
dialog.backup_location = os.path.dirname(str(new_path))
else:
dialog.backup_location = str(new_path)
dialog.dir_line_edit.setText(dialog.backup_location)
if (new_path or new_appvm) and len(dialog.backup_location) > 0:
dialog.select_dir_page.emit(SIGNAL("completeChanged()"))

View File

@ -86,6 +86,7 @@ class RestoreVMsWindow(Ui_Restore, QWizard):
self.connect(self.dev_combobox, SIGNAL("activated(int)"), self.dev_combobox_activated)
self.connect(self, SIGNAL("restore_progress(QString)"), self.commit_text_edit.append)
self.connect(self, SIGNAL("backup_progress(int)"), self.progress_bar.setValue)
self.dir_line_edit.connect(self.dir_line_edit, SIGNAL("textChanged(QString)"), self.backup_location_changed)
self.select_dir_page.isComplete = self.has_selected_dir
self.select_vms_page.isComplete = self.has_selected_vms
@ -274,6 +275,14 @@ class RestoreVMsWindow(Ui_Restore, QWizard):
def has_selected_vms(self):
return self.select_vms_widget.selected_list.count() > 0
def backup_location_changed(self, new_dir = None):
if self.appvm_combobox.currentText() != "dom0" or \
os.path.isfile(str(self.dir_line_edit.text())) or \
os.path.isfile(os.path.join(str(self.dir_line_edit.text()), 'qubes.xml')):
self.backup_location = str(self.dir_line_edit.text())
else:
self.backup_location = None
self.select_dir_page.emit(SIGNAL("completeChanged()"))
# Bases on the original code by:

View File

@ -78,6 +78,12 @@
</item>
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox_2">
<property name="minimumSize">
<size>
<width>0</width>
<height>132</height>
</size>
</property>
<property name="font">
<font>
<weight>50</weight>
@ -130,8 +136,20 @@
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_2">
<property name="minimumSize">
<size>
<width>0</width>
<height>41</height>
</size>
</property>
<property name="text">
<string>Backup directory:</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Backup directory:&lt;br&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;(for old backup format select qubes.xml file)&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>