Skip to content

Commit 82d7bce

Browse files
committed
button enabling issue fixed and default folder have set for filedialog
1 parent 14433dc commit 82d7bce

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

MainPage.qml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ Page{
7272

7373
FileDialog {
7474
id: filedialog
75+
folder: shortcuts.home + "/Pictures"
7576
onAccepted: {
7677
var url = String(filedialog.fileUrl).split("/")
7778
mainmodel.prepareAndInsert(filedialog.fileUrl)

SecondPage.qml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ import QtQuick.Dialogs 1.2
55
import API.FileProcessor 1.0
66

77
Page {
8+
id: secpage
89
width: mainwindow.width
910
height: mainwindow.height
10-
11+
property bool processing: false
1112
Keys.onDeletePressed: filelist.removeMode ? filelist.removeIndexList() : 0
1213

1314
MyToolBar {
@@ -150,7 +151,7 @@ Page {
150151

151152
MyButton {
152153
id: startbutton
153-
enabled: filelist.removeMode ? false : true
154+
enabled: filelist.removeMode || secpage.processing ? false : true
154155
anchors.right: cancelbutton.left
155156
anchors.rightMargin: 10
156157
anchors.verticalCenter: parent.verticalCenter
@@ -167,7 +168,8 @@ Page {
167168
font.pixelSize: 15
168169
onClicked: {
169170
filep.started = true
170-
startbutton.enabled = false
171+
secpage.processing = true
172+
// startbutton.enabled = false
171173
// filep.startprocess()
172174
}
173175
}
@@ -198,7 +200,8 @@ Page {
198200
return
199201
}
200202
filep.started = false
201-
startbutton.enabled = true
203+
// startbutton.enabled = true
204+
secpage.processing = false
202205
progresscanvas.value = 0
203206
progresscanvas.requestPaint()
204207
}
@@ -380,6 +383,7 @@ Page {
380383
}
381384
FileDialog {
382385
id: filedialog
386+
folder: shortcuts.home + "/Pictures"
383387
onAccepted: {
384388
var url = String(filedialog.fileUrl).split("/")
385389
// model1.insert(0, {filename: url[url.length - 1], size: "10GB", type: "JPG"})

0 commit comments

Comments
 (0)