[Pkg-privacy-commits] [tails-installer] 18/70: Fix feature: 9005
Ulrike Uhlig
ulrike at moszumanska.debian.org
Mon Nov 20 14:54:53 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 ac9f61e73fd51be57babda43ac212fce191931d3
Author: kurono <andres.gomez at cern.ch>
Date: Fri Feb 5 16:26:53 2016 +0100
Fix feature: 9005
Initial implementation of required methods.
---
data/tails-installer.ui | 1 +
tails_installer/gui.py | 104 ++++++++++++++++++++++++++++++++++--------------
2 files changed, 75 insertions(+), 30 deletions(-)
diff --git a/data/tails-installer.ui b/data/tails-installer.ui
index 9b08493..9983582 100644
--- a/data/tails-installer.ui
+++ b/data/tails-installer.ui
@@ -256,6 +256,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="model">liststore_target</property>
+ <signal name="changed" handler="on_target_changed" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
diff --git a/tails_installer/gui.py b/tails_installer/gui.py
index 8c9c445..b801439 100755
--- a/tails_installer/gui.py
+++ b/tails_installer/gui.py
@@ -407,6 +407,79 @@ class TailsInstallerWindow(Gtk.ApplicationWindow):
def on_source_file_set(self, filechooserbutton):
self.select_source_iso(filechooserbutton.get_filename())
+ def on_target_changed(self, combobox_target):
+ print("Implement me")
+ # get selected device
+ #drive = get_selected_drive()
+ #device = self.live.drives[drive]
+ #### Inside tails
+ #if is_running_from_tails():
+ # If check box "Clone from ISO"
+ #source = ISO
+ # else if check box "Clone from current device"
+ #source = device
+
+ # If device has not a valid recognized Tails partition
+ #if not is_device_tails_intallation(self, device):
+ # Install.
+ # else If tails is already there?
+ #else:
+ # If not persistence
+ # Upgrade deleting persistence.
+
+ # else If persistence is there?
+ # Is this a new requirement?
+ # Well yes, this makes a big difference on wether install,
+ # upgrade or etc. hmm, check how difficult is to do it.
+
+ # Upgrade without deleting persistence.
+
+ def is_device_tails_intallation(self, device):
+ # Check if the device has a valid Tails partition
+ if not self.opts.partition and not self.live.device_can_be_upgraded(device):
+ if is_running_from_tails():
+ action = _('\"Clone & Install\"')
+ else:
+ action = _('\"Install from ISO\"')
+ pretty_name = self.get_device_pretty_name(info)
+ message = _('It is impossible to upgrade the device %(pretty_name)s'
+ ' because it was not created using Tails Installer.'
+ ' You should instead use %(action)s to upgrade Tails'
+ ' on this device.') % {
+ 'pretty_name' : pretty_name,
+ 'action' : action
+ }
+ self.status(message)
+ return False
+ else:
+ return True
+
+ def get_device_pretty_name(self, device):
+ size = _format_bytes_in_gb(device['parent_size']
+ if device['parent_size']
+ else device['size'])
+ details = (_("%(size)s %(label)s") % {
+ 'label': device['label'],
+ 'size': size
+ }
+ if device['label']
+ else size)
+ pretty_name = _("%(vendor)s %(model)s (%(details)s) - %(device)s") % {
+ 'device': device['device'],
+ 'vendor': device['vendor'],
+ 'model': device['model'],
+ 'details': details
+ }
+ return pretty_name
+
+ def is_device_persistence(self, device):
+ # Skip LUKS-encrypted partitions
+ if device['fstype'] and device['fstype'] == 'crypto_LUKS':
+ self.live.log.debug('Skipping LUKS-encrypted partition: %s' % info['device'])
+ return True
+ else:
+ return False
+
def on_start_clicked(self, button):
self.begin()
@@ -468,21 +541,7 @@ class TailsInstallerWindow(Gtk.ApplicationWindow):
if info['fstype'] and info['fstype'] == 'crypto_LUKS':
self.live.log.debug('Skipping LUKS-encrypted partition: %s' % info['device'])
continue
- size = _format_bytes_in_gb(info['parent_size']
- if info['parent_size']
- else info['size'])
- details = (_("%(size)s %(label)s") % {
- 'label': info['label'],
- 'size': size
- }
- if info['label']
- else size)
- pretty_name = _("%(vendor)s %(model)s (%(details)s) - %(device)s") % {
- 'device': info['device'],
- 'vendor': info['vendor'],
- 'model': info['model'],
- 'details': details
- }
+ pretty_name = self.get_device_pretty_name(info)
# Skip too small devices, but inform the user
if not info['is_device_big_enough']:
message =_('The device "%(pretty_name)s"'
@@ -495,21 +554,6 @@ class TailsInstallerWindow(Gtk.ApplicationWindow):
}
self.status(message)
continue
- # Skip devices without a Tails installation
- if not self.opts.partition and not self.live.device_can_be_upgraded(info):
- if is_running_from_tails():
- action = _('\"Clone & Install\"')
- else:
- action = _('\"Install from ISO\"')
- message = _('It is impossible to upgrade the device %(pretty_name)s'
- ' because it was not created using Tails Installer.'
- ' You should instead use %(action)s to upgrade Tails'
- ' on this device.') % {
- 'pretty_name' : pretty_name,
- 'action' : action
- }
- self.status(message)
- continue
self.__liststore_target.append([pretty_name, device])
self.target_available = True
self.__combobox_target.set_active(0)
--
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