[Pkg-privacy-commits] [tails-installer] 64/210: Display error 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 ea32465c22a4708fc2b77ccb9ec7ee60569feb47
Author: Martin Briza <mbriza at redhat.com>
Date: Thu Apr 9 12:37:56 2015 +0200
Display error messages
---
liveusb/components/DownloadDialog.qml | 30 +++++++++++++++++++++++++++---
liveusb/gui.py | 17 ++++++++++++++++-
2 files changed, 43 insertions(+), 4 deletions(-)
diff --git a/liveusb/components/DownloadDialog.qml b/liveusb/components/DownloadDialog.qml
index ca6a8f2..0875989 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 + 64
+ height: layout.height + 56
standardButtons: StandardButton.NoButton
width: 640
@@ -41,7 +41,30 @@ Dialog {
width: parent.width
Repeater {
- model: liveUSBData.currentImage.writer.finished ? null : liveUSBData.currentImage.warning
+ model: liveUSBData.currentImage.error
+ 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.error[index]
+ }
+ }
+ }
+
+
+ Repeater {
+ model: (liveUSBData.currentImage.writer.finished || liveUSBData.currentImage.error.length > 0) ? null : liveUSBData.currentImage.warning
RowLayout {
width: infoColumn.width
spacing: 8
@@ -63,7 +86,7 @@ Dialog {
}
Repeater {
- model: liveUSBData.currentImage.info
+ model: liveUSBData.currentImage.error.length > 0 ? null : liveUSBData.currentImage.info
RowLayout {
width: infoColumn.width
spacing: 8
@@ -180,6 +203,7 @@ Dialog {
Layout.fillHeight: true
verticalAlignment: Text.AlignVCenter
text: "Advanced options"
+ enabled: optionGroup.enabled
MouseArea {
anchors.fill: parent
onClicked: optionGroup.checked = !optionGroup.checked
diff --git a/liveusb/gui.py b/liveusb/gui.py
index a42cb4b..cd242c4 100755
--- a/liveusb/gui.py
+++ b/liveusb/gui.py
@@ -224,7 +224,7 @@ class ReleaseWriterThread(QThread):
else:
self.copyImage(now)
except Exception, e:
- self.parent.status = e.args[0]
+ self.parent.release.addError(e.args[0])
self.live.log.exception(e)
self.parent.running = False
@@ -400,6 +400,7 @@ class ReleaseWriter(QObject):
class Release(QObject):
screenshotsChanged = pyqtSignal()
+ errorChanged = pyqtSignal()
warningChanged = pyqtSignal()
infoChanged = pyqtSignal()
statusChanged = pyqtSignal()
@@ -426,6 +427,7 @@ class Release(QObject):
self._path = ''
self._info = []
self._warning = []
+ self._error = []
if self._logo == '':
if self._name == 'Fedora Workstation':
@@ -470,6 +472,10 @@ class Release(QObject):
@pyqtSlot()
def write(self):
+ self._warning = []
+ self._error = []
+ self.errorChanged.emit()
+ self.warningChanged.emit()
self._writer.run()
@pyqtSlot()
@@ -625,6 +631,15 @@ class Release(QObject):
self._warning.append(value)
self.warningChanged.emit()
+ @pyqtProperty('QStringList', notify=errorChanged)
+ def error(self):
+ return self._error
+
+ def addError(self, value):
+ if value not in self._error:
+ self._error.append(value)
+ self.errorChanged.emit()
+
class ReleaseListModel(QAbstractListModel):
def __init__(self, parent, title=False):
QAbstractListModel.__init__(self, parent)
--
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