[Pkg-privacy-commits] [tails-installer] 51/210: Distinguish between warnings and informational messages

Intrigeri intrigeri at moszumanska.debian.org
Wed May 24 15:26:27 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 00c1e1eb912215c984268f4ef98b62f4127b4bad
Author: Martin Briza <mbriza at redhat.com>
Date:   Tue Apr 7 16:30:28 2015 +0200

    Distinguish between warnings and informational messages
---
 liveusb/components/DownloadDialog.qml |  49 ++++++++++--
 liveusb/gui.py                        |  19 ++++-
 liveusb/liveusb.qmlproject.user       | 146 ----------------------------------
 3 files changed, 60 insertions(+), 154 deletions(-)

diff --git a/liveusb/components/DownloadDialog.qml b/liveusb/components/DownloadDialog.qml
index d7a2442..141d9c6 100644
--- a/liveusb/components/DownloadDialog.qml
+++ b/liveusb/components/DownloadDialog.qml
@@ -29,14 +29,53 @@ Dialog {
                 rightMargin: anchors.leftMargin
             }
             Column {
-                spacing: 8
+                id: infoColumn
+                spacing: 4
                 width: parent.width
+
+                Repeater {
+                    model: liveUSBData.currentImage.warning
+                    RowLayout {
+                        width: infoColumn.width
+                        spacing: 8
+                        Text {
+                            Layout.fillHeight: true
+                            verticalAlignment: Text.AlignVCenter
+                            color: "red"
+                            text: "!"
+                            font.pointSize: 14
+                        }
+                        Text {
+                            Layout.fillHeight: true
+                            Layout.fillWidth: true
+                            verticalAlignment: Text.AlignVCenter
+                            wrapMode: Text.Wrap
+                            text: liveUSBData.currentImage.warning[index]
+                        }
+                    }
+                }
+
                 Repeater {
                     model: liveUSBData.currentImage.info
-                    Text {
-                        wrapMode: Text.WordWrap
-                        textFormat: Text.RichText
-                        text: liveUSBData.currentImage.info[index]
+                    RowLayout {
+                        width:  infoColumn.width
+                        spacing: 8
+                        // a rotated exclamation mark instead of an 'i' as for information - that's funny, right... right?!
+                        Text {
+                            Layout.fillHeight: true
+                            verticalAlignment: Text.AlignVCenter
+                            color: "blue"
+                            text: "!"
+                            rotation: 180
+                            font.pointSize: 14
+                        }
+                        Text {
+                            Layout.fillHeight: true
+                            Layout.fillWidth: true
+                            verticalAlignment: Text.AlignVCenter
+                            wrapMode: Text.Wrap
+                            text: liveUSBData.currentImage.info[index]
+                        }
                     }
                 }
             }
diff --git a/liveusb/gui.py b/liveusb/gui.py
index f0cd841..7b638d1 100755
--- a/liveusb/gui.py
+++ b/liveusb/gui.py
@@ -394,6 +394,7 @@ class ReleaseWriter(QObject):
 
 class Release(QObject):
     screenshotsChanged = pyqtSignal()
+    warningChanged = pyqtSignal()
     infoChanged = pyqtSignal()
     statusChanged = pyqtSignal()
     pathChanged = pyqtSignal()
@@ -417,6 +418,7 @@ class Release(QObject):
         self._url = url
         self._path = ''
         self._info = []
+        self._warning = []
 
         if self._logo == '':
             if self._name == 'Fedora Workstation':
@@ -465,13 +467,14 @@ class Release(QObject):
 
     @pyqtSlot()
     def inspectDestination(self):
+        self._warning = []
         self.info = []
         if self.parent().option('dd'):
-            self.addInfo(_("<font color=\"red\">!</font> You are about to perform a destructive install. This will destroy all data and partitions on your USB drive"))
+            self.addWarning(_("You are about to perform a destructive install. This will destroy all data and partitions on your USB drive"))
         if self.live.blank_mbr():
             self.addInfo(_("The Master Boot Record on your device is blank. Writing the image will reset the MBR on this device"))
         elif not self.live.mbr_matches_syslinux_bin():
-            self.addInfo(_("The Master Boot Record on your device does not match your system's syslinux MBR.<br>"
+            self.addInfo(_("The Master Boot Record on your device does not match your system's syslinux MBR.\n"
                           "If you have trouble booting it, try setting the \"Reset the MBR\" advanced option."))
 
         try:
@@ -486,7 +489,7 @@ class Release(QObject):
             self.runningChanged.emit()
 
         if self.live.existing_liveos():
-            self.addInfo(_("\n<font color=\"red\">!</font>Your device already contains a LiveOS. If you continue, it will be overwritten."))
+            self.addWarning(_("Your device already contains a live OS. If you continue, it will be overwritten."))
             #TODO
 
         self.live.verify_filesystem()
@@ -603,6 +606,15 @@ class Release(QObject):
             self._info.append(value)
             self.infoChanged.emit()
 
+    @pyqtProperty('QStringList', notify=warningChanged)
+    def warning(self):
+        return self._warning
+
+    def addWarning(self, value):
+        if value not in self._warning:
+            self._warning.append(value)
+            self.warningChanged.emit()
+
 class ReleaseListModel(QAbstractListModel):
     def __init__(self, parent, title=False):
         QAbstractListModel.__init__(self, parent)
@@ -854,6 +866,7 @@ class LiveUSBData(QObject):
         if self._optionValues[self._optionKeys[index]] != value:
             self._optionValues[self._optionKeys[index]] = value
             self.optionsChanged.emit()
+            self.currentImage.inspectDestination()
 
     @pyqtSlot()
     def option(self, index):
diff --git a/liveusb/liveusb.qmlproject.user b/liveusb/liveusb.qmlproject.user
deleted file mode 100644
index 0960a09..0000000
--- a/liveusb/liveusb.qmlproject.user
+++ /dev/null
@@ -1,146 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE QtCreatorProject>
-<!-- Written by QtCreator 3.3.0, 2015-02-12T15:41:44. -->
-<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