mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-06-03 11:21:52 +02:00
[ui] add string <--> file representation convertors
* convenient methods to conform strings to Qt file reprensentation using the "file:/" protocol prefix * use those methodes when manipulating files
This commit is contained in:
parent
62726b4663
commit
2cdc83f06f
7 changed files with 38 additions and 6 deletions
|
@ -2,6 +2,7 @@ import QtQuick 2.9
|
|||
import QtQuick.Layouts 1.3
|
||||
import QtQuick.Controls 2.2
|
||||
import MaterialIcons 2.2
|
||||
import Utils 1.0
|
||||
|
||||
/**
|
||||
A component to display and edit a Node's attributes.
|
||||
|
@ -43,7 +44,7 @@ ColumnLayout {
|
|||
id: settingsMenu
|
||||
MenuItem {
|
||||
text: "Open Cache Folder"
|
||||
onClicked: Qt.openUrlExternally("file://" + node.internalFolder)
|
||||
onClicked: Qt.openUrlExternally(Filepath.stringToFile(node.internalFolder))
|
||||
ToolTip.text: node.internalFolder
|
||||
ToolTip.visible: hovered
|
||||
ToolTip.delay: 500
|
||||
|
|
|
@ -108,7 +108,7 @@ RowLayout {
|
|||
_reconstruction.setAttribute(root.attribute, Number(value))
|
||||
break;
|
||||
case "File":
|
||||
_reconstruction.setAttribute(root.attribute, value.replace("file://", "").trim())
|
||||
_reconstruction.setAttribute(root.attribute, Filepath.fileToString(value.trim()))
|
||||
break;
|
||||
default:
|
||||
_reconstruction.setAttribute(root.attribute, value.trim())
|
||||
|
|
|
@ -3,6 +3,8 @@ import QtQuick.Controls 2.3
|
|||
import QtQuick.Controls 1.4 as Controls1 // SplitView
|
||||
import QtQuick.Layouts 1.3
|
||||
import MaterialIcons 2.2
|
||||
import Utils 1.0
|
||||
|
||||
import "common.js" as Common
|
||||
|
||||
/**
|
||||
|
@ -195,7 +197,7 @@ FocusScope {
|
|||
function loadCurrentFile(keepCursorPosition)
|
||||
{
|
||||
var xhr = new XMLHttpRequest;
|
||||
xhr.open("GET", fileSelector.currentFile);
|
||||
xhr.open("GET", Filepath.stringToFile(fileSelector.currentFile));
|
||||
xhr.onreadystatechange = function() {
|
||||
if(xhr.readyState == XMLHttpRequest.HEADERS_RECEIVED)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue