OpenWith: Double click to open the app
This commit is contained in:
parent
a57f67cba2
commit
e5cfe335a9
1 changed files with 12 additions and 11 deletions
|
@ -47,6 +47,14 @@ Item {
|
||||||
doneButton.focus = true
|
doneButton.focus = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function openApp() {
|
||||||
|
if (defaultCheckBox.checked)
|
||||||
|
mimeAppManager.setDefaultAppForFile(control.url, listView.model.get(listView.currentIndex).desktopFile)
|
||||||
|
|
||||||
|
launcher.launchApp(listView.model.get(listView.currentIndex).desktopFile, control.url)
|
||||||
|
main.close()
|
||||||
|
}
|
||||||
|
|
||||||
Keys.enabled: true
|
Keys.enabled: true
|
||||||
Keys.onEscapePressed: main.close()
|
Keys.onEscapePressed: main.close()
|
||||||
|
|
||||||
|
@ -89,10 +97,9 @@ Item {
|
||||||
id: mouseArea
|
id: mouseArea
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
|
acceptedButtons: Qt.LeftButton
|
||||||
onClicked: {
|
onDoubleClicked: control.openApp()
|
||||||
listView.currentIndex = index
|
onClicked: listView.currentIndex = index
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
@ -153,13 +160,7 @@ Item {
|
||||||
flat: true
|
flat: true
|
||||||
text: qsTr("Open")
|
text: qsTr("Open")
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
onClicked: {
|
onClicked: control.openApp()
|
||||||
if (defaultCheckBox.checked)
|
|
||||||
mimeAppManager.setDefaultAppForFile(control.url, listView.model.get(listView.currentIndex).desktopFile)
|
|
||||||
|
|
||||||
launcher.launchApp(listView.model.get(listView.currentIndex).desktopFile, control.url)
|
|
||||||
main.close()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue