[Pkg-privacy-commits] [tails-installer] 59/210: Distinguish between DD and copying for the warning messages

Intrigeri intrigeri at moszumanska.debian.org
Wed May 24 15:26:28 UTC 2017


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

intrigeri pushed a commit to tag 3.90.0
in repository tails-installer.

commit b0f7d13006efcacfd617000e115d06188459942d
Author: Martin Briza <mbriza at redhat.com>
Date:   Wed Apr 8 11:28:42 2015 +0200

    Distinguish between DD and copying for the warning messages
---
 liveusb/components/DownloadDialog.qml | 13 +++++++------
 liveusb/gui.py                        | 15 ++++++++++++---
 2 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/liveusb/components/DownloadDialog.qml b/liveusb/components/DownloadDialog.qml
index 2c98355..46c316a 100644
--- a/liveusb/components/DownloadDialog.qml
+++ b/liveusb/components/DownloadDialog.qml
@@ -8,7 +8,7 @@ Dialog {
     id: root
     title: "Write " + liveUSBData.currentImage.name + " to USB"
 
-    height: layout.height + 48 + (group.checked ? 48 : 0)
+    height: layout.height + 48 + (optionGroup.checked ? 48 : 0)
     standardButtons: StandardButton.NoButton
 
     width: 640
@@ -41,7 +41,7 @@ Dialog {
                         width: parent.width
 
                         Repeater {
-                            model: liveUSBData.currentImage.warning
+                            model: liveUSBData.currentImage.writer.finished ? null : liveUSBData.currentImage.warning
                             RowLayout {
                                 width: infoColumn.width
                                 spacing: 8
@@ -148,10 +148,10 @@ Dialog {
                         }
                     }
                     Item {
-                        width: group.width
-                        height: group.height + group.y
+                        width: optionGroup.width
+                        height: optionGroup.height + optionGroup.y
                         GroupBox {
-                            id: group
+                            id: optionGroup
                             y: 8
                             title: "Show Advanced Options"
                             flat: true
@@ -161,7 +161,7 @@ Dialog {
                             ColumnLayout {
                                 Repeater {
                                     id: groupLayoutRepeater
-                                    model: group.checked ? liveUSBData.optionValues : null
+                                    model: optionGroup.checked ? liveUSBData.optionValues : null
                                     CheckBox {
                                         checked: liveUSBData.optionValues[index]
                                         enabled: !liveUSBData.currentImage.writer.running
@@ -225,6 +225,7 @@ Dialog {
                     if(pressedOnce || !liveUSBData.currentImage.warning || liveUSBData.currentImage.warning.length == 0) {
                         liveUSBData.currentImage.write()
                         pressedOnce = false
+                        optionGroup.checked = false
                     }
                     else {
                         pressedOnce = true
diff --git a/liveusb/gui.py b/liveusb/gui.py
index 6aca6d8..4cf06c2 100755
--- a/liveusb/gui.py
+++ b/liveusb/gui.py
@@ -264,6 +264,9 @@ class ReleaseWriterThread(QThread):
 
         self.live.extract_iso()
 
+        if self.live.blank_mbr() or self.parent.release.liveUSBData.option('resetMBR'):
+            self.live.reset_mbr()
+
         self.parent.status = _("Writing the data")
         self.live.create_persistent_overlay()
         self.live.update_configs()
@@ -490,7 +493,7 @@ class Release(QObject):
             self._running = False
             self.runningChanged.emit()
 
-        if self.live.existing_liveos():
+        if self.live.existing_liveos() and not self.parent().option('dd'):
             self.addWarning(_("Your device already contains a live OS. If you continue, it will be overwritten."))
 
         self.live.verify_filesystem()
@@ -864,8 +867,14 @@ class LiveUSBData(QObject):
 
     @pyqtSlot(int, bool)
     def setOption(self, index, value):
-        if self._optionValues[self._optionKeys[index]] != value:
-            self._optionValues[self._optionKeys[index]] = value
+        key = self._optionKeys[index]
+        if self._optionValues[key] != value:
+            # dd and resetMBR options are mutually exclusive
+            if key == 'dd' and value == True:
+                self._optionValues['resetMBR'] = False
+            if key == 'resetMBR' and value == True:
+                self._optionValues['dd'] = False
+            self._optionValues[key] = value
             self.optionsChanged.emit()
             self.currentImage.inspectDestination()
 

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