mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 13:49:12 +02:00
Add "Open Folder" button to file browser dialog
This commit is contained in:
parent
cb3dfa0457
commit
fd467caf86
1 changed files with 26 additions and 1 deletions
|
@ -203,6 +203,7 @@ ModalWindow {
|
||||||
var row = fileTableView.currentRow;
|
var row = fileTableView.currentRow;
|
||||||
|
|
||||||
if (row === -1) {
|
if (row === -1) {
|
||||||
|
openFolderButton.enabled = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -213,6 +214,7 @@ ModalWindow {
|
||||||
} else {
|
} else {
|
||||||
currentSelection.text = "";
|
currentSelection.text = "";
|
||||||
}
|
}
|
||||||
|
openFolderButton.enabled = currentSelectionIsFolder
|
||||||
}
|
}
|
||||||
|
|
||||||
function navigateUp() {
|
function navigateUp() {
|
||||||
|
@ -389,6 +391,13 @@ ModalWindow {
|
||||||
|
|
||||||
rows++;
|
rows++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fileTableView.selection.clear();
|
||||||
|
if (model.count > 0 && fileTableView.activeFocus) {
|
||||||
|
fileTableView.currentRow = 0;
|
||||||
|
fileTableView.selection.select(0);
|
||||||
|
d.update();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -617,6 +626,16 @@ ModalWindow {
|
||||||
Keys.onReturnPressed: okAction.trigger()
|
Keys.onReturnPressed: okAction.trigger()
|
||||||
KeyNavigation.up: selectionType
|
KeyNavigation.up: selectionType
|
||||||
KeyNavigation.left: selectionType
|
KeyNavigation.left: selectionType
|
||||||
|
KeyNavigation.right: openFolderButton
|
||||||
|
}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
id: openFolderButton
|
||||||
|
text: "Open Folder"
|
||||||
|
enabled: false
|
||||||
|
action: openFolderAction
|
||||||
|
KeyNavigation.up: selectionType
|
||||||
|
KeyNavigation.left: openButton
|
||||||
KeyNavigation.right: cancelButton
|
KeyNavigation.right: cancelButton
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -624,7 +643,7 @@ ModalWindow {
|
||||||
id: cancelButton
|
id: cancelButton
|
||||||
action: cancelAction
|
action: cancelAction
|
||||||
KeyNavigation.up: selectionType
|
KeyNavigation.up: selectionType
|
||||||
KeyNavigation.left: openButton
|
KeyNavigation.left: openFolderButton
|
||||||
KeyNavigation.right: fileTableView.contentItem
|
KeyNavigation.right: fileTableView.contentItem
|
||||||
Keys.onReturnPressed: { canceled(); root.enabled = false }
|
Keys.onReturnPressed: { canceled(); root.enabled = false }
|
||||||
}
|
}
|
||||||
|
@ -694,6 +713,12 @@ ModalWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Action {
|
||||||
|
id: openFolderAction
|
||||||
|
text: "Open Folder"
|
||||||
|
onTriggered: { fileTableView.navigateToCurrentRow(); }
|
||||||
|
}
|
||||||
|
|
||||||
Action {
|
Action {
|
||||||
id: cancelAction
|
id: cancelAction
|
||||||
text: "Cancel"
|
text: "Cancel"
|
||||||
|
|
Loading…
Reference in a new issue