[Pkg-privacy-commits] [tails-installer] 06/210: Some slight progress with the QML app

Intrigeri intrigeri at moszumanska.debian.org
Wed May 24 15:26:22 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 6a0cd4d222ab7d2947b3c21e2cee671ca3d2363c
Author: Martin Briza <mbriza at redhat.com>
Date:   Tue Jan 27 18:03:45 2015 +0100

    Some slight progress with the QML app
---
 liveusb/components/DownloadDialog.qml | 100 ++++++++++++++++++++++++++++++++
 liveusb/components/ImageDetails.qml   | 104 ++++++++++++++++++++++++++++++++++
 liveusb/components/ImageList.qml      |  19 +++++--
 liveusb/liveusb.qml                   | 100 +++++++++++++++++++++++++++-----
 4 files changed, 304 insertions(+), 19 deletions(-)

diff --git a/liveusb/components/DownloadDialog.qml b/liveusb/components/DownloadDialog.qml
new file mode 100644
index 0000000..9c8eed8
--- /dev/null
+++ b/liveusb/components/DownloadDialog.qml
@@ -0,0 +1,100 @@
+import QtQuick 2.0
+import QtQuick.Controls 1.2
+import QtQuick.Dialogs 1.2
+import QtQuick.Layouts 1.1
+import QtQuick.Window 2.0
+
+Dialog {
+    id: root
+    title: "Write Fedora Workstation to USB"
+
+    contentItem: Rectangle {
+        ToolBar {
+            id: dialogToolBar
+            height: 48
+
+            Button {
+                anchors {
+                    left: parent.left
+                    top: parent.top
+                    bottom: parent.bottom
+                    margins: 6
+                }
+                width: implicitWidth * 1.2
+                text: "Cancel"
+                onClicked: root.close()
+            }
+            Text {
+                anchors.centerIn: parent
+                text: "Write Fedora Workstation to USB"
+            }
+            Button {
+                anchors {
+                    right: parent.right
+                    top: parent.top
+                    bottom: parent.bottom
+                    margins: 6
+                }
+                width: implicitWidth * 1.2
+                enabled: false
+                text: "Write to disk"
+            }
+        }
+        color: palette.window
+        implicitWidth: 600
+        implicitHeight: 300
+        ColumnLayout {
+            id: layout
+            spacing: 24
+            anchors {
+                top: dialogToolBar.bottom
+                left: parent.left
+                right: parent.right
+                bottom: parent.bottom
+                topMargin: 48
+                leftMargin: 64
+                rightMargin: anchors.leftMargin
+                bottomMargin: anchors.topMargin
+            }
+
+            Text {
+                Layout.fillWidth: true
+                width: layout.width
+                wrapMode: Text.WordWrap
+                text: "Writing the image of Fedora Workstation will delete everything that's currently on the drive."
+            }
+
+            ColumnLayout {
+                Text {
+                    Layout.fillWidth: true
+                    horizontalAlignment: Text.AlignHCenter
+                    text: "Downloading (895MB left)"
+                }
+                ProgressBar {
+                    Layout.fillWidth: true
+                    value: 0.2
+                }
+            }
+
+            RowLayout {
+                Layout.fillWidth: true
+                Layout.alignment: Qt.AlignCenter
+                spacing: 32
+                Image {
+                    source: "http://upload.wikimedia.org/wikipedia/commons/3/3f/Fedora_logo.svg"
+                    sourceSize.width: 64
+                    sourceSize.height: 64
+                    fillMode: Image.PreserveAspectFit
+                }
+                Arrow {
+
+                }
+                ComboBox {
+                    model: ListModel {
+                        ListElement { text: "SanDisk Cruzer 2.0 GB Drive"; device:"sdj1" }
+                    }
+                }
+            }
+        }
+    }
+}
diff --git a/liveusb/components/ImageDetails.qml b/liveusb/components/ImageDetails.qml
new file mode 100644
index 0000000..640997f
--- /dev/null
+++ b/liveusb/components/ImageDetails.qml
@@ -0,0 +1,104 @@
+import QtQuick 2.0
+import QtQuick.Controls 1.2
+import QtQuick.Layouts 1.1
+
+Item {
+    id: root
+
+    ScrollView {
+        anchors {
+            fill: parent
+            leftMargin: anchors.rightMargin
+        }
+
+        contentItem: Item {
+            y: 48
+            x: 64
+            width: root.width - 2 * 64
+            height: childrenRect.height + 64 + 32
+
+            ColumnLayout {
+                width: parent.width
+                spacing: 32
+                RowLayout {
+                    anchors.left: parent.left
+                    anchors.right: parent.right
+                    spacing: 32
+                    Layout.alignment: Qt.AlignLeft
+                    Image {
+                        id: iconRect
+                        source: "http://upload.wikimedia.org/wikipedia/commons/3/3f/Fedora_logo.svg"
+                        sourceSize.width: 64
+                        sourceSize.height: 64
+                        fillMode: Image.PreserveAspectFit
+                    }
+
+                    ColumnLayout {
+                        Layout.alignment: Qt.AlignLeft
+                        spacing: 8
+                        Text {
+                            text: "Fedora Workstation 21"
+                        }
+                        RowLayout {
+                            Text {
+                                Layout.fillWidth: true
+                                anchors.left: parent.left
+                                text: "64bit"
+                                color: "gray"
+                            }
+                            Text {
+                                anchors.right: parent.right
+                                text: "953MB"
+                                color: "gray"
+                            }
+                        }
+                    }
+                }
+                Text {
+                    Layout.fillWidth: true
+                    width: Layout.width
+                    wrapMode: Text.WordWrap
+                    text: "Lorem ipsum, quia dolor sit, amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt, ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit, qui in ea voluptate velit esse, quam nihil molestiae consequatur, vel illum, qui dolorem eum fugiat, quo voluptas nulla pariatur?"
+                    font.pointSize: 9
+                }
+                RowLayout {
+                    spacing: 16
+                    ColumnLayout {
+                        Layout.fillWidth: true
+                        Text {
+                            Layout.fillWidth: true
+                            text: "ISO format image for Intel-compatible PCs (64-bit)"
+                            font.pointSize: 8
+                            color: "gray"
+                        }
+                        Text {
+                            Layout.fillWidth: true
+                            text: "Released on December 21st 2014"
+                            font.pointSize: 8
+                            color: "gray"
+                        }
+                    }
+                    Button {
+                        text: "Write to USB disk"
+                        onClicked: dialog.visible = true
+                    }
+                    Button {
+                        enabled: false
+                        text: "Boot with Boxes"
+                    }
+                }
+                Image {
+                    Layout.fillWidth: true
+                    fillMode: Image.PreserveAspectFit
+                    source: "http://fedora.cz/wp-content/uploads/2013/12/fedora-20-gnome-10.png"
+                    sourceSize.width: width
+                    //height: width / sourceSize.width * sourceSize.height / 5
+                }
+            }
+        }
+    }
+    DownloadDialog {
+        id: dialog
+    }
+}
+
diff --git a/liveusb/components/ImageList.qml b/liveusb/components/ImageList.qml
index 8220575..14a3e36 100644
--- a/liveusb/components/ImageList.qml
+++ b/liveusb/components/ImageList.qml
@@ -4,7 +4,15 @@ Rectangle {
     id: root
 
     property alias currentIndex: osListView.currentIndex
-    signal triggered
+    signal stepForward(int index)
+
+    anchors {
+        fill: parent
+        bottomMargin: 48
+        rightMargin: 64
+        topMargin: anchors.bottomMargin
+        leftMargin: anchors.rightMargin
+    }
 
     clip: true
     border {
@@ -24,7 +32,7 @@ Rectangle {
             x: 1
             y: 1
             color: "transparent"
-            Rectangle {
+            Image {
                 id: iconRect
                 anchors {
                     top: parent.top
@@ -35,10 +43,9 @@ Rectangle {
                     bottomMargin: anchors.topMargin
                 }
                 width: height
+                smooth: true
 
-                color: "transparent"
-                border.color: "#c3c3c3"
-                border.width: 1
+                source: icon
             }
             Item {
                 id: textRect
@@ -85,7 +92,7 @@ Rectangle {
                 anchors.fill: parent
                 onClicked: {
                     root.currentIndex = index
-                    root.triggered()
+                    root.stepForward(index)
                 }
                 onPressed: {
                     parent.color = "#ededed"
diff --git a/liveusb/liveusb.qml b/liveusb/liveusb.qml
index 1c48dd6..b4deea7 100644
--- a/liveusb/liveusb.qml
+++ b/liveusb/liveusb.qml
@@ -6,9 +6,17 @@ import QtQuick.Dialogs 1.2
 import "components"
 
 ApplicationWindow {
+    id: mainWindow
     width: 800
     height: 480
 
+    SystemPalette {
+        id: palette
+    }
+
+    property int currentImageIndex: 1
+    property bool canGoBack: false
+
     ListModel {
         id: osList
         ListElement {
@@ -20,25 +28,25 @@ ApplicationWindow {
         ListElement {
             name: "Fedora Workstation"
             description: "Fedora Workstation 21 64bit"
-            icon: ""
+            icon: "http://upload.wikimedia.org/wikipedia/commons/3/3f/Fedora_logo.svg"
             hasDetails: true
         }
         ListElement {
             name: "Fedora Workstation"
             description: "Fedora Workstation 20 64bit"
-            icon: ""
+            icon: "http://upload.wikimedia.org/wikipedia/commons/3/3f/Fedora_logo.svg"
             hasDetails: true
         }
         ListElement {
             name: "Ubuntu Desktop"
             description: "Ubuntu 14.04.1 LTS 64bit"
-            icon: ""
+            icon: "http://logonoid.com/images/ubuntu-logo.png"
             hasDetails: true
         }
         ListElement {
             name: "Ubuntu Desktop"
             description: "Ubuntu 14.10 64bit"
-            icon: ""
+            icon: "http://logonoid.com/images/ubuntu-logo.png"
             hasDetails: true
         }
     }
@@ -54,6 +62,50 @@ ApplicationWindow {
             left: parent.left
         }
 
+        Button {
+            id: backButton
+            visible: canGoBack
+            width: height
+            anchors {
+                left: parent.left
+                top: parent.top
+                bottom: parent.bottom
+                margins: 6
+            }
+            Item {
+                anchors.centerIn: parent
+                rotation: -45
+                transformOrigin: Item.Center
+                width: 10
+                height: 10
+                Rectangle {
+                    x: 1.5
+                    y: 1.5
+                    width: 2
+                    height: 9
+                    radius: 2
+                    color: "#444444"
+                }
+                Rectangle {
+                    y: 1.5
+                    x: 1.5
+                    width: 9
+                    height: 2
+                    radius: 2
+                    color: "#444444"
+                }
+            }
+            onClicked: {
+                canGoBack = false
+                contentLoader.source = "components/ImageList.qml"
+            }
+        }
+
+        Text {
+            text: "OS Boot Imager"
+            anchors.centerIn: parent
+        }
+
         ComboBox {
             anchors {
                 right: searchButton.left
@@ -74,6 +126,23 @@ ApplicationWindow {
                 bottom: parent.bottom
                 margins: 6
             }
+            Item {
+                anchors.centerIn: parent
+                width: 10
+                height: 10
+                Column {
+                    spacing: 2
+                    Repeater {
+                        model: 3
+                        delegate: Rectangle {
+                            height: 2
+                            width: 10
+                            radius: 2
+                            color: "#444444"
+                        }
+                    }
+                }
+            }
         }
 
         Rectangle {
@@ -117,20 +186,25 @@ ApplicationWindow {
                     color: "#a1a1a1"
                 }
             }
+            onClicked: mainWindow.close()
         }
 
     }
 
-    ImageList {
+    Loader {
+        id: contentLoader
         anchors {
-            top: parent.top
-            bottom: parent.bottom
-            left: parent.left
-            right: parent.right
-            topMargin: 48
-            bottomMargin: anchors.topMargin
-            leftMargin: 64
-            rightMargin: anchors.leftMargin
+            fill: parent
+        }
+
+        source: "components/ImageList.qml"
+    }
+    Connections {
+        target: contentLoader.item
+        onStepForward: {
+            currentImageIndex = index
+            canGoBack = true
+            contentLoader.source = "components/ImageDetails.qml"
         }
     }
 }

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