[Pkg-privacy-commits] [tails-installer] 69/210: Better handling of on immediate writing

Intrigeri intrigeri at moszumanska.debian.org
Wed May 24 15:26:29 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 db81d9a14b460854bad7700256c18ffaf5115ad5
Author: Martin Briza <mbriza at redhat.com>
Date:   Fri Apr 10 14:41:32 2015 +0200

    Better handling of on immediate writing
---
 liveusb/components/DownloadDialog.qml |  67 ++++++++++++++--
 liveusb/gui.py                        |   7 +-
 liveusb/liveusb.qmlproject.user       | 146 ++++++++++++++++++++++++++++++++++
 3 files changed, 209 insertions(+), 11 deletions(-)

diff --git a/liveusb/components/DownloadDialog.qml b/liveusb/components/DownloadDialog.qml
index 72d7cc2..3629da9 100644
--- a/liveusb/components/DownloadDialog.qml
+++ b/liveusb/components/DownloadDialog.qml
@@ -13,6 +13,14 @@ Dialog {
 
     width: 640
 
+    Connections {
+        target: liveUSBData
+        onCurrentImageChanged: {
+            writeImmediately.confirmed = false
+            acceptButton.pressedOnce = false
+        }
+    }
+
     contentItem: Rectangle {
         id: contentWrapper
         anchors.fill: parent
@@ -26,7 +34,6 @@ Dialog {
                 Column {
                     id: layout
                     spacing: 24
-                    clip: true
                     anchors {
                         top: parent.top
                         left: parent.left
@@ -232,7 +239,7 @@ Dialog {
                             Text {
                                 Layout.fillHeight: true
                                 verticalAlignment: Text.AlignVCenter
-                                text: "Advanced options"
+                                text: "Options"
                                 enabled: optionGroup.enabled
                                 MouseArea {
                                     anchors.fill: parent
@@ -272,22 +279,60 @@ Dialog {
                                 property bool pressedOnce: false
                                 color: "red"
                                 textColor: enabled ? "white" : palette.text
-                                enabled: liveUSBData.currentImage.readyToWrite && !liveUSBData.currentImage.writer.running
+                                transformOrigin: Item.Center
+                                enabled: pressedOnce || (liveUSBData.currentImage.readyToWrite && !liveUSBData.currentImage.writer.running && liveUSBData.usbDrives.length > 0)
                                 text: pressedOnce ? "Are you sure?" : "Write to disk"
                                 onClicked: {
                                     if(pressedOnce || !liveUSBData.currentImage.warning || liveUSBData.currentImage.warning.length == 0) {
-                                        liveUSBData.currentImage.write()
+                                        if (!liveUSBData.currentImage.readyToWrite) {
+                                            writeImmediately.confirmed = true
+                                        }
+                                        else {
+                                            liveUSBData.currentImage.write()
+                                            optionGroup.checked = false
+                                        }
                                         pressedOnce = false
-                                        optionGroup.checked = false
                                     }
                                     else {
                                         pressedOnce = true
                                     }
                                 }
+                                Connections {
+                                    id: downloadWait
+                                    target: liveUSBData.currentImage
+                                    onReadyToWriteChanged: {
+                                        if (liveUSBData.currentImage.readyToWrite && writeImmediately.confirmed) {
+                                            liveUSBData.currentImage.write()
+                                            optionGroup.checked = false
+                                        }
+                                    }
+                                }
+
+                                onPressedOnceChanged: {
+                                    if (pressedOnce)
+                                        acceptButtonBounce.start()
+                                }
+                                SequentialAnimation {
+                                    id: acceptButtonBounce
+                                    NumberAnimation {
+                                        target: acceptButton
+                                        property: "scale"
+                                        duration: 80
+                                        from: 1
+                                        to: 1.2
+                                    }
+                                    NumberAnimation {
+                                        target: acceptButton
+                                        property: "scale"
+                                        duration: 40
+                                        to: 1.0
+                                    }
+                                }
                             }
                         }
                         Column {
                             id: advancedOptions
+                            spacing: 0
                             Repeater {
                                 id: groupLayoutRepeater
                                 model: optionGroup.checked ? liveUSBData.optionValues : null
@@ -303,6 +348,18 @@ Dialog {
                                     }
                                 }
                             }
+                            // It's better to have this one separately to have the confirmation clearer
+                            CheckBox {
+                                id: writeImmediately
+                                height: optionGroup.checked ? implicitHeight : 0
+                                visible: optionGroup.checked
+                                width: implicitWidth
+                                property bool confirmed: false
+                                text: "Write the image immediately when the download is finished"
+                                onClicked: {
+                                    acceptButton.pressedOnce = !acceptButton.pressedOnce
+                                }
+                            }
                         }
                     }
                 }
diff --git a/liveusb/gui.py b/liveusb/gui.py
index 4bb6d8b..c3786d6 100755
--- a/liveusb/gui.py
+++ b/liveusb/gui.py
@@ -518,9 +518,6 @@ class Release(QObject):
             #self.live.log.removeHandler(handler)
             return
 
-        if self.parent().option('writeImmediately'):
-            self.write()
-
     @pyqtProperty(int, constant=True)
     def index(self):
         return self._index
@@ -754,14 +751,12 @@ class LiveUSBData(QObject):
     _currentDrive = 0
 
     # man, this is just awkward... but it seems like the only way to do it in a predictable manner without creating a new class
-    _optionKeys = ['dd', 'resetMBR', 'writeImmediately']
+    _optionKeys = ['dd', 'resetMBR']
     _optionNames = {'dd': _("Use <b>dd</b> to write the image - this will erase everything on your portable drive"),
                     'resetMBR': _("Reset the MBR (Master Boot Record)"),
-                    'writeImmediately': _("Write the image immediately when the download is finished")
                    }
     _optionValues = {'dd': False,
                      'resetMBR': False,
-                     'writeImmediately': False
                     }
 
     def __init__(self, opts):
diff --git a/liveusb/liveusb.qmlproject.user b/liveusb/liveusb.qmlproject.user
new file mode 100644
index 0000000..1fae4ee
--- /dev/null
+++ b/liveusb/liveusb.qmlproject.user
@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE QtCreatorProject>
+<!-- Written by QtCreator 3.3.2, 2015-04-09T14:37:57. -->
+<qtcreator>
+ <data>
+  <variable>EnvironmentId</variable>
+  <value type="QByteArray">{515cb585-bd1b-4140-bb6e-87289c7d6a97}</value>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.ActiveTarget</variable>
+  <value type="int">0</value>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.EditorSettings</variable>
+  <valuemap type="QVariantMap">
+   <value type="bool" key="EditorConfiguration.AutoIndent">true</value>
+   <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
+   <value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
+   <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
+    <value type="QString" key="language">Cpp</value>
+    <valuemap type="QVariantMap" key="value">
+     <value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
+    </valuemap>
+   </valuemap>
+   <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
+    <value type="QString" key="language">QmlJS</value>
+    <valuemap type="QVariantMap" key="value">
+     <value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
+    </valuemap>
+   </valuemap>
+   <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
+   <value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
+   <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
+   <value type="int" key="EditorConfiguration.IndentSize">4</value>
+   <value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
+   <value type="int" key="EditorConfiguration.MarginColumn">80</value>
+   <value type="bool" key="EditorConfiguration.MouseHiding">true</value>
+   <value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
+   <value type="int" key="EditorConfiguration.PaddingMode">1</value>
+   <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
+   <value type="bool" key="EditorConfiguration.ShowMargin">false</value>
+   <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
+   <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
+   <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
+   <value type="int" key="EditorConfiguration.TabSize">8</value>
+   <value type="bool" key="EditorConfiguration.UseGlobal">true</value>
+   <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
+   <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
+   <value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
+   <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
+   <value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
+  </valuemap>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.PluginSettings</variable>
+  <valuemap type="QVariantMap"/>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.Target.0</variable>
+  <valuemap type="QVariantMap">
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 5.3.2 ()</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Qt 5.3.2 ()</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{32b95b60-9295-4706-acaa-83f80aaef484}</value>
+   <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">-1</value>
+   <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
+   <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
+   <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">0</value>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
+    </valuemap>
+    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy locally</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
+   </valuemap>
+   <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
+    <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
+    <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
+    <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
+    <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
+    <value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
+    <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
+    <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
+    <value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
+    <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
+    <value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
+    <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
+    <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
+    <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
+     <value type="int">0</value>
+     <value type="int">1</value>
+     <value type="int">2</value>
+     <value type="int">3</value>
+     <value type="int">4</value>
+     <value type="int">5</value>
+     <value type="int">6</value>
+     <value type="int">7</value>
+     <value type="int">8</value>
+     <value type="int">9</value>
+     <value type="int">10</value>
+     <value type="int">11</value>
+     <value type="int">12</value>
+     <value type="int">13</value>
+     <value type="int">14</value>
+    </valuelist>
+    <value type="int" key="PE.EnvironmentAspect.Base">0</value>
+    <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName"></value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">QML Scene</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QmlProjectManager.QmlRunConfiguration.QmlScene</value>
+    <value type="QString" key="QmlProjectManager.QmlRunConfiguration.MainScript">CurrentFile</value>
+    <value type="QString" key="QmlProjectManager.QmlRunConfiguration.QDeclarativeViewerArguments"></value>
+    <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
+    <value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
+    <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
+    <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
+    <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
+    <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
+   </valuemap>
+   <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
+  </valuemap>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.TargetCount</variable>
+  <value type="int">1</value>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
+  <value type="int">18</value>
+ </data>
+ <data>
+  <variable>Version</variable>
+  <value type="int">18</value>
+ </data>
+</qtcreator>

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