[Pkg-privacy-commits] [tails-installer] 26/70: Feature 9005: Add a checkbox to allow the user formating the device even if it has a valida tails partition or persistence.
Ulrike Uhlig
ulrike at moszumanska.debian.org
Mon Nov 20 14:54:54 UTC 2017
This is an automated email from the git hooks/post-receive script.
ulrike pushed a commit to annotated tag tails-installer_4.20
in repository tails-installer.
commit 0d9e884175b38d256ffc4d3a94630aab70bf95c5
Author: Tails developers <amnesia at boum.org>
Date: Tue May 10 17:55:05 2016 +0200
Feature 9005: Add a checkbox to allow the user formating the device
even if it has a valida tails partition or persistence.
---
data/tails-installer.ui | 20 +++++++++++++++++++-
tails_installer/gui.py | 33 +++++++++++++++++++--------------
2 files changed, 38 insertions(+), 15 deletions(-)
diff --git a/data/tails-installer.ui b/data/tails-installer.ui
index 59bcf42..f9a2f5a 100644
--- a/data/tails-installer.ui
+++ b/data/tails-installer.ui
@@ -344,6 +344,24 @@
</packing>
</child>
<child>
+ <object class="GtkCheckButton" id="check_force_reinstall">
+ <property name="label" translatable="yes">Force reinstall</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="margin_left">18</property>
+ <property name="margin_right">18</property>
+ <property name="margin_bottom">18</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="on_check_force_reinstall_toggled" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">6</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkButton" id="button_start">
<property name="label" translatable="yes">Install Tails</property>
<property name="name">1</property>
@@ -359,7 +377,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">6</property>
+ <property name="position">7</property>
</packing>
</child>
</object>
diff --git a/tails_installer/gui.py b/tails_installer/gui.py
index efd4ce0..c16313e 100755
--- a/tails_installer/gui.py
+++ b/tails_installer/gui.py
@@ -193,7 +193,7 @@ class TailsInstallerThread(threading.Thread):
if not self.live.can_read_partition_table():
self.live.log.info('Clearing unreadable partition table.')
self.live.clear_all_partition_tables()
- if self.parent.reinstall_device:
+ if self.parent.force_reinstall:
parent = _to_unicode(self.live.drive['parent'])
self.rescan_devices(force_partitions=False)
self.live.drive = self.live.drives[parent]['device']
@@ -302,7 +302,8 @@ class TailsInstallerWindow(Gtk.ApplicationWindow):
self.target_available = False
self.target_selected = False
self.device_with_persistence = []
- self.reinstall_device = False
+ self.user_force_reinstall = False
+ self.force_reinstall = False
if self.opts.unprivileged == None:
self.opts.unprivileged = True
@@ -423,30 +424,34 @@ class TailsInstallerWindow(Gtk.ApplicationWindow):
elif active_radio.get_label() == "Use an ISO:":
self.opts.clone = False
+ def on_check_force_reinstall_toggled(self, check_button):
+ self.user_force_reinstall = check_button.get_active()
+ self.on_target_changed(None)
+
def on_source_file_set(self, filechooserbutton):
self.select_source_iso(filechooserbutton.get_filename())
def on_target_changed(self, combobox_target):
- if self.opts.clone == None:
- self.opts.clone = True
-
# get selected device
drive = self.get_selected_drive()
+ if drive == None:
+ return
device = self.live.drives[drive]
# If device has not any valid recognized Tails partition
+ # Just crate a new installation from scratch
if not self.live.device_can_be_upgraded(device):
self.opts.partition = True
+ # If there is valid Tails partition
+ elif self.user_force_reinstall:
+ self.opts.partition = True
+ self.force_reinstall = True
+ self.__button_start.set_label('Upgrade Tails device (Force reinstall)')
+ # elif device['parent'] in self.device_with_persistence:
else:
- # If there is persistence upgrade without deleting it
- if device['parent'] in self.device_with_persistence:
- self.opts.partition = False
- self.reinstall_device = False
- self.__button_start.set_label('Upgrade Tails device: keep data')
- else:
- self.opts.partition = True
- self.reinstall_device = True
- self.__button_start.set_label('Upgrade Tails device: not keep data')
+ self.opts.partition = False
+ self.force_reinstall = False
+ self.__button_start.set_label('Upgrade Tails device (Keep data)')
def get_device_pretty_name(self, device):
size = _format_bytes_in_gb(device['parent_size']
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/tails-installer.git
More information about the Pkg-privacy-commits
mailing list