[Pkg-privacy-commits] [tails-installer] 135/210: Allow modifying the architecture from the ImageDetail

Intrigeri intrigeri at moszumanska.debian.org
Wed May 24 15:26:38 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 10ec2d5dbca519899e5d9d46a979a024596a7937
Author: Martin Briza <mbriza at redhat.com>
Date:   Mon Aug 24 16:25:12 2015 +0200

    Allow modifying the architecture from the ImageDetail
---
 liveusb/components/AdwaitaRadioButton.qml | 22 ++++++++++++++++++++++
 liveusb/components/ImageDetails.qml       | 23 ++++++++++++++++++++---
 liveusb/components/ImageList.qml          | 20 +++++++++-----------
 liveusb/gui.py                            | 15 +++++++++++----
 4 files changed, 62 insertions(+), 18 deletions(-)

diff --git a/liveusb/components/AdwaitaRadioButton.qml b/liveusb/components/AdwaitaRadioButton.qml
new file mode 100644
index 0000000..ca53d31
--- /dev/null
+++ b/liveusb/components/AdwaitaRadioButton.qml
@@ -0,0 +1,22 @@
+import QtQuick 2.0
+import QtQuick.Controls 1.0
+import QtQuick.Controls.Styles 1.0
+
+RadioButton {
+    style: RadioButtonStyle {
+        indicator: AdwaitaRectangle {
+            implicitWidth: 15
+            implicitHeight: 15
+            radius: width / 2 + 1
+            Rectangle {
+                anchors.centerIn: parent
+                width: parent.width / 3
+                height: parent.width / 3
+                radius: parent.radius / 3
+                color: "black"
+                visible: control.checked
+            }
+        }
+    }
+}
+
diff --git a/liveusb/components/ImageDetails.qml b/liveusb/components/ImageDetails.qml
index cf5406e..aefb3c2 100644
--- a/liveusb/components/ImageDetails.qml
+++ b/liveusb/components/ImageDetails.qml
@@ -115,9 +115,26 @@ Item {
                                 color: "gray"
                             }
                         }
-                        Text {
-                            text: liveUSBData.releaseProxyModel.archFilter
-                            color: "gray"
+                        Item {
+                            height: childrenRect.height
+                            RowLayout {
+                                visible: liveUSBData.currentImage.arch.length
+                                ExclusiveGroup {
+                                    id: archEG
+                                }
+                                Repeater {
+                                    model: liveUSBData.currentImage.arch
+                                    AdwaitaRadioButton {
+                                        text: modelData
+                                        exclusiveGroup: archEG
+                                        checked: liveUSBData.releaseProxyModel.archFilter == modelData
+                                        onCheckedChanged: {
+                                            if (checked && liveUSBData.releaseProxyModel.archFilter != modelData)
+                                                liveUSBData.releaseProxyModel.archFilter = modelData
+                                        }
+                                    }
+                                }
+                            }
 
                             AdwaitaButton {
                                 text: qsTranslate("", "Select Live ISO")
diff --git a/liveusb/components/ImageList.qml b/liveusb/components/ImageList.qml
index ddc6ab9..34e4460 100644
--- a/liveusb/components/ImageList.qml
+++ b/liveusb/components/ImageList.qml
@@ -178,12 +178,16 @@ Item {
                 height: !liveUSBData.releaseProxyModel.isFront ? 54 : 36
                 width: osListView.width
                 Rectangle {
+                    clip: true
                     visible: liveUSBData.releaseProxyModel.isFront
                     anchors.fill: parent
                     anchors.margins: 1
                     radius: 3
                     Column {
                         id: threeDotDots
+                        property bool hidden: false
+                        opacity: hidden ? 0.0 : 1.0
+                        Behavior on opacity { NumberAnimation { duration: 60 } }
                         anchors.centerIn: parent
                         spacing: 2
                         Repeater {
@@ -197,15 +201,9 @@ Item {
                     }
                     Text {
                         id: threeDotText
-                        anchors.left: threeDotDots.right
-                        anchors.verticalCenter: threeDotDots.verticalCenter
-                        anchors.leftMargin: 12
-                        width: 0
-                        Behavior on width {
-                            NumberAnimation {
-                                duration: 120
-                            }
-                        }
+                        y: threeDotDots.hidden ? parent.height / 2 - height / 2 : -height
+                        anchors.horizontalCenter: threeDotDots.horizontalCenter
+                        Behavior on y { NumberAnimation { duration: 60 } }
                         clip: true
                         text: qsTranslate("", "Display additional Fedora flavors")
                         color: "gray"
@@ -214,7 +212,7 @@ Item {
                         id: threeDotTimer
                         interval: 200
                         onTriggered: {
-                            threeDotText.width = threeDotText.implicitWidth
+                            threeDotDots.hidden = true
                         }
                     }
                     MouseArea {
@@ -228,7 +226,7 @@ Item {
                             if (!containsMouse) {
                                 parent.color = "transparent"
                                 threeDotTimer.stop()
-                                threeDotText.width = 0
+                                threeDotDots.hidden = false
                             }
                         }
                         onClicked: {
diff --git a/liveusb/gui.py b/liveusb/gui.py
index 02ec2df..e1a1496 100755
--- a/liveusb/gui.py
+++ b/liveusb/gui.py
@@ -434,6 +434,8 @@ class Release(QObject):
     pathChanged = pyqtSignal()
     sizeChanged = pyqtSignal()
 
+    _archMap = {'64bit': ['x86_64'], '32bit': ['i686','i386'], 'ARM': ['armv7hl']}
+
     def __init__(self, parent, index, live, data):
         QObject.__init__(self, parent)
 
@@ -533,9 +535,14 @@ class Release(QObject):
             self._data['x86_64']['size'] = value
             self.sizeChanged.emit()
 
-    @pyqtProperty(str, constant=True)
+    @pyqtProperty('QStringList', constant=True)
     def arch(self):
-        return self._data['variants'].keys()
+        ret = list()
+        for key in self._archMap.keys():
+            for variant in self._archMap[key]:
+                if variant in self._data['variants'].keys():
+                    ret.append(str(key))
+        return ret
 
     @pyqtProperty(QDateTime, constant=True)
     def releaseDate(self):
@@ -677,7 +684,7 @@ class ReleaseListProxy(QSortFilterProxyModel):
 
     def filterAcceptsRow(self, sourceRow, sourceParent):
         row = self.sourceModel().index(sourceRow, 0, sourceParent).data()
-        if len(self._archFilter) == 0 or row.isLocal or set(row.arch) & set(self._archFilter):
+        if len(self._archFilter) == 0 or row.isLocal or self.archFilter in row.arch:
             if len(self._nameFilter) == 0 or self._nameFilter.lower() in row.name.lower() or self._nameFilter.lower() in row.summary.lower():
                 return True
         return False
@@ -702,7 +709,7 @@ class ReleaseListProxy(QSortFilterProxyModel):
         for name, abbrs in self._archMap.items():
             if abbrs == self._archFilter:
                 return name
-        self.archFilter = '64bit'
+        self._archFilter = self._archMap['64bit']
         return '64bit'
 
     @archFilter.setter

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