diff --git a/skyflash.py b/skyflash.py index b223dd2..a079304 100755 --- a/skyflash.py +++ b/skyflash.py @@ -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) @@ -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 diff --git a/skyflash.qml b/skyflash.qml index 086c0a6..79d6de8 100644 --- a/skyflash.qml +++ b/skyflash.qml @@ -7,7 +7,7 @@ ApplicationWindow { id: windows width: 398 //height: 420 - height: 120 + height: 148 visible: true title: qsTr("Skyflash tool") @@ -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 @@ -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 @@ -119,9 +115,7 @@ ApplicationWindow { text: "Browse" tooltip: "Click here to browse a already downloaded Skybian image" - onClicked: { - fileDialog.open() - } + onClicked: { fileDialog.open() } } // label @@ -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