mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:44:02 +02:00
commit
92909af52c
3 changed files with 19 additions and 13 deletions
|
@ -199,7 +199,7 @@ FocusScope {
|
|||
anchors.leftMargin: hifi.dimensions.textPadding
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
id: popupText
|
||||
text: listView.model[index]
|
||||
text: listView.model[index] ? listView.model[index] : ""
|
||||
size: hifi.fontSizes.textFieldInput
|
||||
color: hifi.colors.baseGray
|
||||
}
|
||||
|
|
|
@ -186,7 +186,12 @@ ModalWindow {
|
|||
}
|
||||
|
||||
if (helper.urlToPath(folder).toLowerCase() !== helper.urlToPath(fileTableModel.folder).toLowerCase()) {
|
||||
if (root.selectDirectory) {
|
||||
currentSelection.text = currentText !== "This PC" ? currentText : "";
|
||||
d.currentSelectionUrl = helper.pathToUrl(currentText);
|
||||
}
|
||||
fileTableModel.folder = folder;
|
||||
fileTableView.forceActiveFocus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -212,9 +217,11 @@ ModalWindow {
|
|||
function update() {
|
||||
var row = fileTableView.currentRow;
|
||||
|
||||
openButton.text = root.selectDirectory && row === -1 ? "Choose" : "Open"
|
||||
|
||||
if (row === -1) {
|
||||
if (!root.selectDirectory) {
|
||||
currentSelection.text = "";
|
||||
currentSelectionIsFolder = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -445,12 +452,6 @@ ModalWindow {
|
|||
|
||||
onSortIndicatorOrderChanged: { updateSort(); }
|
||||
|
||||
onActiveFocusChanged: {
|
||||
if (activeFocus && currentRow == -1) {
|
||||
fileTableView.selection.select(0)
|
||||
}
|
||||
}
|
||||
|
||||
itemDelegate: Item {
|
||||
clip: true
|
||||
|
||||
|
@ -607,6 +608,12 @@ ModalWindow {
|
|||
readOnly: !root.saveDialog
|
||||
activeFocusOnTab: !readOnly
|
||||
onActiveFocusChanged: if (activeFocus) { selectAll(); }
|
||||
onTextChanged: {
|
||||
if (root.saveDialog && text !== "") {
|
||||
fileTableView.selection.clear();
|
||||
fileTableView.currentRow = -1;
|
||||
}
|
||||
}
|
||||
onAccepted: okAction.trigger();
|
||||
}
|
||||
|
||||
|
@ -652,7 +659,7 @@ ModalWindow {
|
|||
|
||||
Action {
|
||||
id: okAction
|
||||
text: root.saveDialog ? "Save" : (root.selectDirectory ? "Choose" : "Open")
|
||||
text: currentSelection.text ? (root.selectDirectory && fileTableView.currentRow === -1 ? "Choose" : (root.saveDialog ? "Save" : "Open")) : "Open"
|
||||
enabled: currentSelection.text || !root.selectDirectory && d.currentSelectionIsFolder ? true : false
|
||||
onTriggered: {
|
||||
if (!root.selectDirectory && !d.currentSelectionIsFolder
|
||||
|
@ -676,7 +683,6 @@ ModalWindow {
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
// Handle the ambiguity between different cases
|
||||
// * typed name (with or without extension)
|
||||
// * full path vs relative vs filename only
|
||||
|
|
|
@ -1222,7 +1222,7 @@ function handeMenuEvent(menuItem) {
|
|||
Window.alert("No entities have been selected.");
|
||||
} else {
|
||||
var filename = "entities__" + Window.location.hostname + ".svo.json";
|
||||
filename = Window.save("Select where to save", filename, "*.json")
|
||||
filename = Window.save("Select Where to Save", filename, "*.json")
|
||||
if (filename) {
|
||||
var success = Clipboard.exportEntities(filename, selectionManager.selections);
|
||||
if (!success) {
|
||||
|
@ -1234,7 +1234,7 @@ function handeMenuEvent(menuItem) {
|
|||
|
||||
var importURL = null;
|
||||
if (menuItem == "Import Entities") {
|
||||
var fullPath = Window.browse("Select models to import", "", "*.json");
|
||||
var fullPath = Window.browse("Select Model to Import", "", "*.json");
|
||||
if (fullPath) {
|
||||
importURL = "file:///" + fullPath;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue