[Pkg-privacy-commits] [tails-installer] 62/210: Change the advanced groupbox to a layout, move the buttons to one line
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 787731171ed65c51c8528922102f9ba093bc4e50
Author: Martin Briza <mbriza at redhat.com>
Date: Thu Apr 9 12:14:46 2015 +0200
Change the advanced groupbox to a layout, move the buttons to one line
---
liveusb/components/AdwaitaRectangle.qml | 2 +-
liveusb/components/DownloadDialog.qml | 181 +++++++++++++++++---------------
liveusb/gui.py | 4 +-
3 files changed, 103 insertions(+), 84 deletions(-)
diff --git a/liveusb/components/AdwaitaRectangle.qml b/liveusb/components/AdwaitaRectangle.qml
index d4e3886..e04a407 100644
--- a/liveusb/components/AdwaitaRectangle.qml
+++ b/liveusb/components/AdwaitaRectangle.qml
@@ -10,7 +10,7 @@ Rectangle {
radius: parent.radius - 1
anchors.margins: 0.5
anchors.fill: parent
- gradient: control.enabled ? !control.pressed ? !control.hovered ? regularGradient: hoveredGradient : downGradient : disabledGradient
+ gradient: control.enabled ? !(control.pressed || control.checked) ? !control.hovered ? regularGradient: hoveredGradient : downGradient : disabledGradient
Gradient {
id: disabledGradient
GradientStop { position: 0.0; color: "light gray" }
diff --git a/liveusb/components/DownloadDialog.qml b/liveusb/components/DownloadDialog.qml
index 219b9fb..ca6a8f2 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 + (optionGroup.checked ? 48 : 0)
+ height: layout.height + 64
standardButtons: StandardButton.NoButton
width: 640
@@ -147,92 +147,109 @@ Dialog {
enabled: !liveUSBData.currentImage.writer.running
}
}
- Item {
- width: optionGroup.width
- height: optionGroup.height + optionGroup.y
- GroupBox {
- id: optionGroup
- y: 8
- title: "Show Advanced Options"
- flat: true
- checked: false
- checkable: true
- enabled: liveUSBData.optionNames && liveUSBData.optionNames[0] && !liveUSBData.currentImage.writer.running
- onEnabledChanged: {
- if (!liveUSBData.currentImage.writer.running)
- checked = false
+
+ ColumnLayout {
+ width: parent.width
+ spacing: 12
+ RowLayout {
+ height: acceptButton.height
+ width: parent.width
+ AdwaitaButton {
+ id: optionGroup
+ implicitHeight: parent.height / 8 * 5
+ implicitWidth: parent.height / 8 * 5
+ Layout.alignment: Qt.AlignVCenter
+ checkable: true
+ checked: false
+ enabled: liveUSBData.optionNames && liveUSBData.optionNames[0] && !liveUSBData.currentImage.writer.running
+ onEnabledChanged: {
+ if (!liveUSBData.currentImage.writer.running)
+ checked = false
+ }
+ Text {
+ anchors.fill: parent
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ text: "+"
+ font.bold: true
+ font.pointSize: 12
+ }
}
- ColumnLayout {
- Repeater {
- id: groupLayoutRepeater
- model: optionGroup.checked ? liveUSBData.optionValues : null
- CheckBox {
- checked: liveUSBData.optionValues[index]
- enabled: !liveUSBData.currentImage.writer.running
- height: 20
- width: 20
- text: liveUSBData.optionNames[index]
- onClicked: {
- acceptButton.pressedOnce = false
- liveUSBData.setOption(index, checked)
- }
+
+ Text {
+ Layout.fillHeight: true
+ verticalAlignment: Text.AlignVCenter
+ text: "Advanced options"
+ MouseArea {
+ anchors.fill: parent
+ onClicked: optionGroup.checked = !optionGroup.checked
+ }
+ }
+
+ Item {
+ Layout.fillWidth: true
+ height: 1
+ }
+
+ AdwaitaButton {
+ id: cancelButton
+ anchors {
+ right: acceptButton.left
+ top: parent.top
+ bottom: parent.bottom
+ rightMargin: 6
+ }
+ text: "Cancel"
+ enabled: !liveUSBData.currentImage.writer.running
+ onClicked: {
+ liveUSBData.currentImage.download.cancel()
+ liveUSBData.currentImage.writer.cancel()
+ acceptButton.pressedOnce = false
+ root.close()
+ }
+ }
+ AdwaitaButton {
+ id: acceptButton
+ anchors {
+ right: parent.right
+ top: parent.top
+ bottom: parent.bottom
+ }
+ property bool pressedOnce: false
+ color: "red"
+ textColor: enabled ? "white" : palette.text
+ enabled: liveUSBData.currentImage.readyToWrite && !liveUSBData.currentImage.writer.running
+ text: pressedOnce ? "Are you sure?" : "Write to disk"
+ onClicked: {
+ if(pressedOnce || !liveUSBData.currentImage.warning || liveUSBData.currentImage.warning.length == 0) {
+ liveUSBData.currentImage.write()
+ pressedOnce = false
+ optionGroup.checked = false
+ }
+ else {
+ pressedOnce = true
+ }
+ }
+ }
+ }
+ Column {
+ id: advancedOptions
+ Repeater {
+ id: groupLayoutRepeater
+ model: optionGroup.checked ? liveUSBData.optionValues : null
+ CheckBox {
+ checked: liveUSBData.optionValues[index]
+ enabled: !liveUSBData.currentImage.writer.running
+ height: 20
+ width: implicitWidth
+ text: liveUSBData.optionNames[index]
+ onClicked: {
+ acceptButton.pressedOnce = false
+ liveUSBData.setOption(index, checked)
}
}
}
}
- }
- }
- }
- }
- Item {
- id: dialogButtonBar
- height: 32
- anchors {
- left: parent.left
- right: parent.right
- bottom: parent.bottom
- bottomMargin: 24
- leftMargin: 24
- rightMargin: anchors.leftMargin
- }
-
- AdwaitaButton {
- id: cancelButton
- anchors {
- right: acceptButton.left
- top: parent.top
- bottom: parent.bottom
- rightMargin: 6
- }
- text: "Cancel"
- enabled: !liveUSBData.currentImage.writer.running
- onClicked: {
- liveUSBData.currentImage.download.cancel()
- liveUSBData.currentImage.writer.cancel()
- pressedOnce = false
- root.close()
- }
- }
- AdwaitaButton {
- id: acceptButton
- anchors {
- right: parent.right
- top: parent.top
- bottom: parent.bottom
- }
- property bool pressedOnce: false
- color: "red"
- textColor: enabled ? "white" : palette.text
- enabled: liveUSBData.currentImage.readyToWrite && !liveUSBData.currentImage.writer.running
- text: pressedOnce ? "Are you sure?" : "Write to disk"
- onClicked: {
- 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 5819a7c..24ce750 100755
--- a/liveusb/gui.py
+++ b/liveusb/gui.py
@@ -233,7 +233,9 @@ class ReleaseWriterThread(QThread):
def ddImage(self, now):
self.live.dd_image()
#self.live.log.removeHandler(handler)
- duration = str(datetime.now() - now).split('.')[0]
+ #duration = str(datetime.now() - now).split('.')[0]
+ self.parent.status = "Finished!"
+ self.parent.finished = True
self.progressThread.stop()
return
--
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