backups: allow to select backup in old format (directory instead of file)

New backup is store in one file, but old one in a whole directory. While
selecting old backup, the user need to point 'qubes.xml' file.
This commit is contained in:
Marek Marczykowski-Górecki 2013-12-29 04:31:20 +01:00
parent 386c155dd5
commit e1e60f692c
2 changed files with 24 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

@ -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>