Skip to content

Commit

Permalink
Refs #1, Signals and GUI fixes, mainly format and size
Browse files Browse the repository at this point in the history
  • Loading branch information
stdevPavelmc committed Jan 5, 2019
1 parent 8488b9b commit 68428b4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
4 changes: 2 additions & 2 deletions skyflash.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def shortenPath(self, fullpath, ccount):
class WorkerSignals(QObject):
data = pyqtSignal(str)
error = pyqtSignal(tuple)
progress = pyqtSignal(int)
progress = pyqtSignal(float)
result = pyqtSignal(str)
finished = pyqtSignal(str)

Expand Down Expand Up @@ -146,7 +146,7 @@ def skyDown(self, data_callback, progress_callback):
fileName = url.split("/")[-1]

# emit data of the download
data_callback.emit("~" + str(self.size/1000) + "MB" )
data_callback.emit("There is {:04.1f}MB to download...".format(self.size/1000/1000))

# start download
downloadedChunk = 0
Expand Down
24 changes: 9 additions & 15 deletions skyflash.qml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ApplicationWindow {
id: windows
width: 398
//height: 420
height: 120
height: 148
visible: true
title: qsTr("Skyflash tool")

Expand Down Expand Up @@ -65,10 +65,11 @@ ApplicationWindow {
// main placeholder
ColumnLayout {
id: mainBox
anchors.left: parent.left
anchors.leftMargin: 3
anchors.top: parent.top
anchors.topMargin: 3
anchors.rightMargin: 4
anchors.leftMargin: 4
anchors.bottomMargin: 4
anchors.topMargin: 4
anchors.fill: parent
Layout.fillWidth: true
Layout.fillHeight: true
clip: false
Expand Down Expand Up @@ -103,12 +104,7 @@ ApplicationWindow {
text: "Download"
tooltip: "Click here to download the base Skybian image from the official site"

onClicked: {
// start download, hide the label and show progress bar
lbImageComment.visible = false
pbDownload.visible = true
skf.downloadSkybian()
}
onClicked: { skf.downloadSkybian() }
}

// Browse button
Expand All @@ -119,9 +115,7 @@ ApplicationWindow {
text: "Browse"
tooltip: "Click here to browse a already downloaded Skybian image"

onClicked: {
fileDialog.open()
}
onClicked: { fileDialog.open() }
}

// label
Expand Down Expand Up @@ -323,7 +317,7 @@ ApplicationWindow {
// receiving the percent of the download
onDProg: {
pbDownload.value = percent
sbText.text = "Downloaded " + percent + "% so far"
sbText.text = "Downloaded " + Number(percent).toLocaleString(Qt.locale("en_US")) + "% so far"
}

// download / local done
Expand Down

0 comments on commit 68428b4

Please sign in to comment.