[Pkg-privacy-commits] [tails-installer] 03/12: Define is_ISO_selected method as predicate. Fixes Bug #14722

Ulrike Uhlig ulrike at moszumanska.debian.org
Mon Nov 20 14:55:34 UTC 2017


This is an automated email from the git hooks/post-receive script.

ulrike pushed a commit to annotated tag tails-installer_5.0.2
in repository tails-installer.

commit 3fb380b0ffb5944f388a99a2c8bd05908698a6db
Author: kurono <andres.gomez at cern.ch>
Date:   Fri Sep 29 17:46:05 2017 +0200

    Define is_ISO_selected method as predicate. Fixes Bug #14722
---
 tails_installer/gui.py | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/tails_installer/gui.py b/tails_installer/gui.py
index ba23424..45a4b5c 100755
--- a/tails_installer/gui.py
+++ b/tails_installer/gui.py
@@ -428,7 +428,9 @@ class TailsInstallerWindow(Gtk.ApplicationWindow):
             self.__filechooserbutton_source_file.set_sensitive(True)
 
     def on_force_reinstall_clicked(self, button):
-        if not self.is_ISO_selected():
+        # If the user has chosen install from ISO, but no ISO is selected
+        if not self.live.opts.clone and not self.is_ISO_selected():
+            self.warn_ISO_not_selected()
             return
         self.force_reinstall = True
         self.opts.partition = True
@@ -471,16 +473,17 @@ class TailsInstallerWindow(Gtk.ApplicationWindow):
         return pretty_name
 
     def is_ISO_selected(self):
-        # If the user has chosen install from ISO, but no ISO is selected
-        if not self.live.opts.clone and not (self.live.source.__class__ == LocalIsoSource):
-            self.show_confirmation_dialog(_("No ISO image selected"),
-                                          _("Please select a Tails ISO image."),
-                                          True)
-            return False
-        return True
+        return (self.live.source.__class__ == LocalIsoSource)
+
+    def warn_ISO_not_selected(self):
+        self.show_confirmation_dialog(_("No ISO image selected"),
+                                      _("Please select a Tails ISO image."),
+                                        True)
 
     def on_start_clicked(self, button):
-        if not self.is_ISO_selected():
+        # If the user has chosen install from ISO, but no ISO is selected
+        if not self.live.opts.clone and not self.is_ISO_selected():
+            self.warn_ISO_not_selected()
             return
         self.begin()
 

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