[Pkg-privacy-commits] [tails-installer] 39/70: Implements feature 9005: Fix minor errors and add warning message when iso is not selected.

Ulrike Uhlig ulrike at moszumanska.debian.org
Mon Nov 20 14:54:58 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 04538e8540115f4b75518cfa55e38177a5dfd8b8
Author: Tails Developers <tails at boum.org>
Date:   Tue Jan 31 17:03:40 2017 +0100

    Implements feature 9005: Fix minor errors and add warning message
    when iso is not selected.
---
 data/tails-installer.ui |  2 +-
 tails_installer/gui.py  | 37 +++++++++++++++++++++++++++----------
 2 files changed, 28 insertions(+), 11 deletions(-)

diff --git a/data/tails-installer.ui b/data/tails-installer.ui
index d626e27..410470d 100644
--- a/data/tails-installer.ui
+++ b/data/tails-installer.ui
@@ -375,7 +375,7 @@
     <child>
       <object class="GtkLinkButton" id="check_force_reinstall">
         <property name="label" translatable="yes">Reinstall (delete all data)</property>
-        <property name="visible">False</property>
+        <property name="visible">True</property>
         <property name="can_focus">True</property>
         <property name="receives_default">False</property>
         <property name="margin_left">18</property>
diff --git a/tails_installer/gui.py b/tails_installer/gui.py
index 69c3b15..8539b61 100755
--- a/tails_installer/gui.py
+++ b/tails_installer/gui.py
@@ -317,6 +317,8 @@ class TailsInstallerWindow(Gtk.ApplicationWindow):
         # Inside tails
         if is_running_from_tails():
             self.opts.clone = True
+            self.__radio_button_source_device.set_active(True)
+            self.__filechooserbutton_source_file.set_sensitive(False)
         # Outside
         else:
             self.opts.clone = False
@@ -419,15 +421,16 @@ class TailsInstallerWindow(Gtk.ApplicationWindow):
 
     def on_radio_changed(self, radio_button):
         active_radio = [r for r in radio_button.get_group() if r.get_active()][0]
-        if active_radio.get_label() == "Clone current Tails":
+        if active_radio.get_label() == "Clone the current Tails":
             self.opts.clone = True
-            #self.__box_source_file.set_visible(False)
             self.__filechooserbutton_source_file.set_sensitive(False)
-        elif active_radio.get_label() == "Use downloaded Tails ISO image":
+        elif active_radio.get_label() == "Use a downloaded Tails ISO image":
             self.opts.clone = False
-            self.__filechooserbutton_source_file.set_sensitive(False)
+            self.__filechooserbutton_source_file.set_sensitive(True)
 
     def on_force_reinstall_clicked(self, button):
+        if not self.is_ISO_selected():
+            return
         self.force_reinstall = True
         self.opts.partition = True
         self.__button_force_reinstall.set_visible(False)
@@ -454,7 +457,6 @@ class TailsInstallerWindow(Gtk.ApplicationWindow):
             self.opts.partition = True
             self.force_reinstall = True
             self.__button_start.set_label('Upgrade')
-        # elif device['parent'] in self.device_with_persistence:
         else:
             self.opts.partition = False
             self.force_reinstall = False
@@ -478,7 +480,18 @@ 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(_("ISO image not selected!"),
+                                          _("Please choose a downloaded Tails ISO image."),
+                                          True)
+            return False
+        return True
+
     def on_start_clicked(self, button):
+        if not self.is_ISO_selected():
+            return
         self.begin()
 
     def on_infobar_response(self, infobar, response):
@@ -500,7 +513,6 @@ class TailsInstallerWindow(Gtk.ApplicationWindow):
                 self.__button_force_reinstall.set_visible(True)
         else:
             self.__button_start.set_sensitive(False)
-            self.__button_force_reinstall.set_visible(False)
 
     def populate_devices(self, *args, **kw):
         if self.in_process or self.target_selected:
@@ -635,11 +647,15 @@ class TailsInstallerWindow(Gtk.ApplicationWindow):
         dialog.run()
         self.close()
 
-    def show_confirmation_dialog(self, title, message):
+    def show_confirmation_dialog(self, title, message, warning):
+        if (warning):
+            buttons=Gtk.ButtonsType.OK
+        else:
+            buttons=Gtk.ButtonsType.YES_NO
         dialog = Gtk.MessageDialog(parent=self,
                                    flags=Gtk.DialogFlags.DESTROY_WITH_PARENT,
                                    message_type=Gtk.MessageType.QUESTION,
-                                   buttons=Gtk.ButtonsType.YES_NO,
+                                   buttons=buttons,
                                    message_format=title)
         dialog.format_secondary_text(message)
         reply = dialog.run()
@@ -692,7 +708,8 @@ class TailsInstallerWindow(Gtk.ApplicationWindow):
                            'model':  self.live.drive['model'],
                            'device': self.live.drive['device'],
                            'size':   _format_bytes_in_gb(self.live.drive['size'])
-                          }):
+                          },
+                          False):
                     self.confirmed = True
                 else:
                     return
@@ -711,7 +728,7 @@ class TailsInstallerWindow(Gtk.ApplicationWindow):
                          'parent_size': _format_bytes_in_gb(self.live.drive['parent_size'])
                      }
                   )
-            if self.show_confirmation_dialog(_("Please confirm your device selection"), msg):
+            if self.show_confirmation_dialog(_("Please confirm your device selection"), msg, False):
                 # The user has confirmed that they wish to overwrite their
                 # existing Live OS.  Here we delete it first, in order to
                 # accurately calculate progress.

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