[Pkg-privacy-commits] [tails-installer] 48/210: Fix the dialog to actually be a dialog

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 530f28c7079dd0b3d4a55332d70b315e582772a8
Author: Martin Briza <mbriza at redhat.com>
Date:   Thu Apr 2 15:52:57 2015 +0200

    Fix the dialog to actually be a dialog
---
 liveusb/components/DownloadDialog.qml | 256 ++++++++++++++++++----------------
 liveusb/gui.py                        |   6 +-
 2 files changed, 136 insertions(+), 126 deletions(-)

diff --git a/liveusb/components/DownloadDialog.qml b/liveusb/components/DownloadDialog.qml
index b77539a..cbbd5d2 100644
--- a/liveusb/components/DownloadDialog.qml
+++ b/liveusb/components/DownloadDialog.qml
@@ -4,152 +4,162 @@ import QtQuick.Dialogs 1.2
 import QtQuick.Layouts 1.1
 import QtQuick.Window 2.0
 
-Window {
+Dialog {
     id: root
     title: "Write " + liveUSBData.currentImage.name + " to USB"
-    color: palette.window
 
-    maximumWidth: 640
-    minimumWidth: maximumWidth
-    height: layout.height + 96
+    height: layout.height + 64 + (group.checked ? 48 : 0)
+    standardButtons: StandardButton.NoButton
 
-    Column {
-        id: layout
-        spacing: 24
-        clip: true
-        anchors {
-            top: parent.top
-            left: parent.left
-            right: parent.right
-            topMargin: 48
-            leftMargin: 64
-            rightMargin: anchors.leftMargin
-        }
-        Text {
-            wrapMode: Text.WordWrap
-            //text: "Writing the image of " + liveUSBData.currentImage.name +" will delete everything that's currently on the drive."
-            text: liveUSBData.currentImage.info
-        }
+    width: 640
 
-        ColumnLayout {
-            width: parent.width
-            Behavior on y {
-                NumberAnimation {
-                    duration: 1000
-                }
+    contentItem: Rectangle {
+        anchors.fill: parent
+        color: palette.window
+        Column {
+            id: layout
+            spacing: 24
+            clip: true
+            anchors {
+                top: parent.top
+                left: parent.left
+                right: parent.right
+                topMargin: 48
+                leftMargin: 64
+                rightMargin: anchors.leftMargin
             }
-
             Text {
-                Layout.fillWidth: true
-                horizontalAlignment: Text.AlignHCenter
-                property double leftSize: liveUSBData.currentImage.download.maxProgress - liveUSBData.currentImage.download.progress
-                property string leftStr: leftSize <= 0 ? "" :
-                                         (leftSize < 1024) ? (leftSize + " B") :
-                                         (leftSize < (1024 * 1024)) ? ((leftSize / 1024).toFixed(1) + " KB") :
-                                         (leftSize < (1024 * 1024 * 1024)) ? ((leftSize / 1024 / 1024).toFixed(1) + " MB") :
-                                         ((leftSize / 1024 / 1024 / 1024).toFixed(1) + " GB")
-                text: liveUSBData.currentImage.status + (liveUSBData.currentImage.download.maxProgress > 0 ? " (" + leftStr + " left)" : "")
+                wrapMode: Text.WordWrap
+                //text: "Writing the image of " + liveUSBData.currentImage.name +" will delete everything that's currently on the drive."
+                text: liveUSBData.currentImage.info
             }
-            Item {
-                Layout.fillWidth: true
-                height: childrenRect.height
-                AdwaitaProgressBar {
-                    width: parent.width
-                    value: liveUSBData.currentImage.download.running ? liveUSBData.currentImage.download.progress / liveUSBData.currentImage.download.maxProgress : 0
-                    visible: !liveUSBData.currentImage.writer.running
+
+            ColumnLayout {
+                width: parent.width
+                Behavior on y {
+                    NumberAnimation {
+                        duration: 1000
+                    }
+                }
+
+                Text {
+                    Layout.fillWidth: true
+                    Layout.fillHeight: true
+                    horizontalAlignment: Text.AlignHCenter
+                    property double leftSize: liveUSBData.currentImage.download.maxProgress - liveUSBData.currentImage.download.progress
+                    property string leftStr: leftSize <= 0 ? "" :
+                                             (leftSize < 1024) ? (leftSize + " B") :
+                                             (leftSize < (1024 * 1024)) ? ((leftSize / 1024).toFixed(1) + " KB") :
+                                             (leftSize < (1024 * 1024 * 1024)) ? ((leftSize / 1024 / 1024).toFixed(1) + " MB") :
+                                             ((leftSize / 1024 / 1024 / 1024).toFixed(1) + " GB")
+                    text: liveUSBData.currentImage.status + (liveUSBData.currentImage.download.maxProgress > 0 ? " (" + leftStr + " left)" : "")
                 }
-                AdwaitaProgressBar {
-                    width: parent.width
-                    value: liveUSBData.currentImage.writer.running ? liveUSBData.currentImage.writer.progress / liveUSBData.currentImage.writer.maxProgress : 0
-                    visible: !liveUSBData.currentImage.download.running
-                    progressColor: liveUSBData.currentImage.writer.status == "Checking the source image" ? Qt.lighter("green") : "red"
+                Item {
+                    Layout.fillWidth: true
+                    height: childrenRect.height
+                    AdwaitaProgressBar {
+                        width: parent.width
+                        value: liveUSBData.currentImage.download.running ? liveUSBData.currentImage.download.progress / liveUSBData.currentImage.download.maxProgress : 0
+                        visible: !liveUSBData.currentImage.writer.running
+                    }
+                    AdwaitaProgressBar {
+                        width: parent.width
+                        value: liveUSBData.currentImage.writer.running ? liveUSBData.currentImage.writer.progress / liveUSBData.currentImage.writer.maxProgress : 0
+                        visible: !liveUSBData.currentImage.download.running
+                        progressColor: liveUSBData.currentImage.writer.status == "Checking the source image" ? Qt.lighter("green") : "red"
+                    }
                 }
             }
-        }
 
-        RowLayout {
-            anchors.horizontalCenter: parent.horizontalCenter
-            spacing: 32
-            IndicatedImage {
-                source: liveUSBData.currentImage.logo
-                sourceSize.width: 64
-                sourceSize.height: 64
-                fillMode: Image.PreserveAspectFit
-            }
-            Arrow {
+            RowLayout {
+                anchors.horizontalCenter: parent.horizontalCenter
+                spacing: 32
+                IndicatedImage {
+                    source: liveUSBData.currentImage.logo
+                    sourceSize.width: 64
+                    sourceSize.height: 64
+                    fillMode: Image.PreserveAspectFit
+                }
+                Arrow {
 
+                }
+                AdwaitaComboBox {
+                    Layout.preferredWidth: implicitWidth * 2.3
+                    model: liveUSBData.usbDriveNames
+                    currentIndex: liveUSBData.currentDrive
+                    onCurrentIndexChanged: liveUSBData.currentDrive = currentIndex
+                    enabled: !liveUSBData.currentImage.writer.running
+                }
             }
-            AdwaitaComboBox {
-                Layout.preferredWidth: implicitWidth * 2.3
-                model: liveUSBData.usbDriveNames
-                currentIndex: liveUSBData.currentDrive
-                onCurrentIndexChanged: liveUSBData.currentDrive = currentIndex
-                enabled: !liveUSBData.currentImage.writer.running
-            }
-        }
-        GroupBox {
-            id: group
-            title: "Advanced Options"
-            flat: true
-            checked: false
-            checkable: true
-            enabled: liveUSBData.options && liveUSBData.options[0]
-            ColumnLayout {
-                Repeater {
-                    id: groupLayoutRepeater
-                    model: group.checked ? liveUSBData.options : null
-                    CheckBox {
-                        checked: false
-                        height: 20
-                        width: 20
-                        text: groupLayoutRepeater.model[index]
+            Item {
+                width: group.width
+                height: group.height + group.y
+                GroupBox {
+                    id: group
+                    y: 8
+                    title: "Show Advanced Options"
+                    flat: true
+                    checked: false
+                    checkable: true
+                    enabled: liveUSBData.options && liveUSBData.options[0]
+                    ColumnLayout {
+                        Repeater {
+                            id: groupLayoutRepeater
+                            model: group.checked ? liveUSBData.options : null
+                            CheckBox {
+                                checked: false
+                                height: 20
+                                width: 20
+                                text: groupLayoutRepeater.model[index]
+                            }
+                        }
                     }
                 }
             }
         }
-    }
-    Item {
-        id: dialogButtonBar
-        height: 32
-        anchors {
-            left: parent.left
-            right: parent.right
-            bottom: parent.bottom
-            bottomMargin: 24
-            leftMargin: 16
-            rightMargin: anchors.leftMargin
-        }
-
-        AdwaitaButton {
-            id: cancelButton
+        Item {
+            id: dialogButtonBar
+            height: 32
             anchors {
-                right: acceptButton.left
-                top: parent.top
+                left: parent.left
+                right: parent.right
                 bottom: parent.bottom
-                rightMargin: 6
+                bottomMargin: 24
+                leftMargin: 16
+                rightMargin: anchors.leftMargin
             }
-            width: implicitWidth * 1.2
-            text: "Cancel"
-            enabled: !liveUSBData.currentImage.writer.running
-            onClicked: {
-                liveUSBData.currentImage.download.cancel()
-                liveUSBData.currentImage.writer.cancel()
-                root.close()
+
+            AdwaitaButton {
+                id: cancelButton
+                anchors {
+                    right: acceptButton.left
+                    top: parent.top
+                    bottom: parent.bottom
+                    rightMargin: 6
+                }
+                width: implicitWidth * 1.2
+                text: "Cancel"
+                enabled: !liveUSBData.currentImage.writer.running
+                onClicked: {
+                    liveUSBData.currentImage.download.cancel()
+                    liveUSBData.currentImage.writer.cancel()
+                    root.close()
+                }
             }
-        }
-        AdwaitaButton {
-            id: acceptButton
-            anchors {
-                right: parent.right
-                top: parent.top
-                bottom: parent.bottom
+            AdwaitaButton {
+                id: acceptButton
+                anchors {
+                    right: parent.right
+                    top: parent.top
+                    bottom: parent.bottom
+                }
+                color: "red"
+                textColor: enabled ? "white" : palette.text
+                width: implicitWidth * 1.2
+                enabled: liveUSBData.currentImage.readyToWrite && !liveUSBData.currentImage.writer.running
+                text: "Write to disk"
+                onClicked: liveUSBData.currentImage.write()
             }
-            color: "red"
-            textColor: enabled ? "white" : palette.text
-            width: implicitWidth * 1.2
-            enabled: liveUSBData.currentImage.readyToWrite && !liveUSBData.currentImage.writer.running
-            text: "Write to disk"
-            onClicked: liveUSBData.currentImage.write()
         }
     }
 }
diff --git a/liveusb/gui.py b/liveusb/gui.py
index ec26cf6..c37bf96 100755
--- a/liveusb/gui.py
+++ b/liveusb/gui.py
@@ -471,7 +471,7 @@ class Release(QObject):
             self.info = _("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.info = _("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")
+                          "If you have trouble booting it, try setting the \"Reset the MBR\" advanced option.")
 
         try:
             self.live.mount_device()
@@ -485,7 +485,7 @@ class Release(QObject):
             self.runningChanged.emit()
 
         if self.live.existing_liveos():
-            self.info += _("\nYour device already contains a LiveOS. If you continue, this will be overwritten.")
+            self.info += _("\nYour device already contains a LiveOS. If you continue, it will be overwritten.")
             #TODO
 
         self.live.verify_filesystem()
@@ -701,7 +701,7 @@ class LiveUSBData(QObject):
     _currentIndex = 0
     _currentDrive = 0
 
-    _options = [_("Use dd to write the image (destructive method)"), _("Reset the MBR (Master Boot Record)")]
+    _options = [_("Use <b>dd</b> to write the image - this will erase everything on your portable drive"), _("Reset the MBR (Master Boot Record)")]
     _optionValues = [False, False]
 
     def __init__(self, opts):

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