[Pkg-privacy-commits] [tails-installer] 39/210: A bit nicer local file install
Intrigeri
intrigeri at moszumanska.debian.org
Wed May 24 15:26:26 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 16af8dca123c0382c40f3960ada39f743f7e8652
Author: Martin Briza <mbriza at redhat.com>
Date: Wed Mar 18 10:35:15 2015 +0100
A bit nicer local file install
---
liveusb/components/AdwaitaButton.qml | 1 +
liveusb/components/ImageDetails.qml | 22 +++++++++++++++-------
liveusb/gui.py | 10 +++++++++-
3 files changed, 25 insertions(+), 8 deletions(-)
diff --git a/liveusb/components/AdwaitaButton.qml b/liveusb/components/AdwaitaButton.qml
index ead350d..fce73ae 100644
--- a/liveusb/components/AdwaitaButton.qml
+++ b/liveusb/components/AdwaitaButton.qml
@@ -11,6 +11,7 @@ Button {
background: AdwaitaRectangle {
color: root.color
border.color: control.enabled ? "#777777" : "#c2c2c2"
+ width: implicitWidth + 16
}
label: Text {
color: control.enabled ? root.textColor : "gray"
diff --git a/liveusb/components/ImageDetails.qml b/liveusb/components/ImageDetails.qml
index 354d834..59df20b 100644
--- a/liveusb/components/ImageDetails.qml
+++ b/liveusb/components/ImageDetails.qml
@@ -119,6 +119,17 @@ Item {
Text {
text: liveUSBData.currentImage.arch
color: "gray"
+
+ AdwaitaButton {
+ text: "Select the file"
+ Layout.alignment: Qt.AlignHCenter
+ visible: liveUSBData.currentImage.isLocal
+ onClicked: {
+ fileDialog.visible = false // for some reason it got stuck in the closed state once in a while, so ensure it's actually closed
+ fileDialog.visible = true
+ }
+ width: implicitWidth + 16
+ }
}
Text {
// I'm sorry, everyone, I can't find a better way to determine if the date is valid
@@ -132,7 +143,9 @@ Item {
Layout.fillWidth: true
width: Layout.width
wrapMode: Text.WordWrap
- text: liveUSBData.currentImage.fullDescription
+ text: liveUSBData.currentImage.isLocal ?
+ ("Selected image: " + (liveUSBData.currentImage.path ? (((String)(liveUSBData.currentImage.path)).split("/").slice(-1)[0]) : "None"))
+ : liveUSBData.currentImage.fullDescription
font.pointSize: 9
}
Repeater {
@@ -145,12 +158,6 @@ Item {
sourceSize.width: width
}
}
- AdwaitaButton {
- text: "Find the image"
- Layout.alignment: Qt.AlignHCenter
- visible: liveUSBData.currentImage.isLocal
- onClicked: fileDialog.visible = true
- }
}
}
@@ -184,6 +191,7 @@ Item {
}
FileDialog {
id: fileDialog
+ nameFilters: [ "Image files (*.iso)", "All files (*)"]
onAccepted: {
console.log(fileUrl)
liveUSBData.currentImage.path = fileUrl
diff --git a/liveusb/gui.py b/liveusb/gui.py
index 60467ae..fcb5a20 100755
--- a/liveusb/gui.py
+++ b/liveusb/gui.py
@@ -417,6 +417,7 @@ class Release(QObject):
screenshotsChanged = pyqtSignal()
statusChanged = pyqtSignal()
pathChanged = pyqtSignal()
+ sizeChanged = pyqtSignal()
def __init__(self, parent=None, live=None, name = '', logo = '', size = 0, arch = '', fullName = '', releaseDate = QDateTime(), shortDescription = '', fullDescription = '', isLocal = False, screenshots = [], url=''):
QObject.__init__(self, parent)
@@ -485,10 +486,16 @@ class Release(QObject):
def logo(self):
return self._logo
- @pyqtProperty(float, constant=True)
+ @pyqtProperty(float, notify=sizeChanged)
def size(self):
return self._size
+ @size.setter
+ def size(self, value):
+ if value != self._size:
+ self._size = value
+ self.sizeChanged.emit()
+
@pyqtProperty(str, constant=True)
def arch(self):
return self._arch
@@ -532,6 +539,7 @@ class Release(QObject):
if self._path != value:
self._download.path = value
self.pathChanged.emit();
+ self.size = self.live.isosize
@pyqtProperty(bool, notify=pathChanged)
def readyToWrite(self):
--
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