From 5c960b94a0049a74eafed79b62199bd95767fa52 Mon Sep 17 00:00:00 2001 From: Elias Steurer Date: Thu, 7 Dec 2023 14:17:20 +0100 Subject: [PATCH] Fix right click edit wallpaper --- ScreenPlay/qml/Create/CreateSidebar.qml | 2 +- ScreenPlay/qml/Create/Wizards/Importh264/Importh264Init.qml | 2 +- ScreenPlay/qml/Installed/InstalledView.qml | 6 +++--- ScreenPlayUtil/inc/public/ScreenPlayUtil/util.h | 2 +- ScreenPlayUtil/src/util.cpp | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ScreenPlay/qml/Create/CreateSidebar.qml b/ScreenPlay/qml/Create/CreateSidebar.qml index 742ccd22..e9f49057 100644 --- a/ScreenPlay/qml/Create/CreateSidebar.qml +++ b/ScreenPlay/qml/Create/CreateSidebar.qml @@ -85,7 +85,7 @@ Rectangle { } ListElement { - headline: qsTr("Godot Wallpaper") + headline: qsTr("3D Engine Wallpaper (Godot 4.2)") source: "qrc:/qml/ScreenPlayApp/qml/Create/Wizards/GodotWallpaper.qml" category: "Code Wallpaper" objectName: "" diff --git a/ScreenPlay/qml/Create/Wizards/Importh264/Importh264Init.qml b/ScreenPlay/qml/Create/Wizards/Importh264/Importh264Init.qml index 6a1a9e6a..c0156117 100644 --- a/ScreenPlay/qml/Create/Wizards/Importh264/Importh264Init.qml +++ b/ScreenPlay/qml/Create/Wizards/Importh264/Importh264Init.qml @@ -45,7 +45,7 @@ Item { Text { id: txtDescription - text: qsTr("ScreenPlay V0.15 and up can play *.mp4 (also more known as h264). This can improove performance on older systems.") + text: qsTr("ScreenPlay v0.15 and up can play *.mp4 (also more known as h264). This can improove performance on older systems.") color: Material.primaryTextColor Layout.fillWidth: true font.pointSize: 13 diff --git a/ScreenPlay/qml/Installed/InstalledView.qml b/ScreenPlay/qml/Installed/InstalledView.qml index ffc69c8a..68b5e037 100644 --- a/ScreenPlay/qml/Installed/InstalledView.qml +++ b/ScreenPlay/qml/Installed/InstalledView.qml @@ -242,7 +242,7 @@ Item { // call popup when we are in the closing animtion. if (contextMenu.visible || contextMenu.opened) return; - if (delegate.type === ContentTypes.InstalledType.GodotWallpaper) { + if (delegate.type === Util.ContentTypes.InstalledType.GodotWallpaper) { contextMenu.godotItem = editGodotWallpaperComp.createObject(); contextMenu.insertItem(0, contextMenu.godotItem); } @@ -260,10 +260,10 @@ Item { MenuItem { text: qsTr("Edit Wallpaper") objectName: "editWallpaper" - enabled: contextMenu.type === ContentTypes.InstalledType.GodotWallpaper + enabled: contextMenu.type === Util.ContentTypes.InstalledType.GodotWallpaper icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_edit.svg" onClicked: { - App.util.openGodotEditor(contextMenu.absoluteStoragePath); + App.util.openGodotEditor(contextMenu.absoluteStoragePath, App.globalVariables.godotEditorExecutablePath); } } } diff --git a/ScreenPlayUtil/inc/public/ScreenPlayUtil/util.h b/ScreenPlayUtil/inc/public/ScreenPlayUtil/util.h index 2223ef33..7e3d5db2 100644 --- a/ScreenPlayUtil/inc/public/ScreenPlayUtil/util.h +++ b/ScreenPlayUtil/inc/public/ScreenPlayUtil/util.h @@ -86,7 +86,7 @@ public: Q_INVOKABLE void copyToClipboard(const QString& text) const; Q_INVOKABLE void openFolderInExplorer(const QString& url) const; - Q_INVOKABLE bool openGodotEditor(QString contentPath) const; + Q_INVOKABLE bool openGodotEditor(QString contentPath, QString godotEditorExecutablePath) const; Q_INVOKABLE void requestAllLicenses(); Q_INVOKABLE void requestDataProtection(); Q_INVOKABLE bool fileExists(const QString& filePath) const; diff --git a/ScreenPlayUtil/src/util.cpp b/ScreenPlayUtil/src/util.cpp index dc2532cd..b0cb7c7b 100644 --- a/ScreenPlayUtil/src/util.cpp +++ b/ScreenPlayUtil/src/util.cpp @@ -519,11 +519,11 @@ void Util::openFolderInExplorer(const QString& url) const QDesktopServices::openUrl(QUrl::fromLocalFile(path)); } -bool Util::openGodotEditor(QString contentPath) const +bool Util::openGodotEditor(QString contentPath, QString godotEditorExecutablePath) const { const QList godotCmd = { "--editor", "--path", toLocal(contentPath) }; QProcess process; - // process.setProgram(m_globalVariables->godotEditorExecutablePath().toString()); + process.setProgram(godotEditorExecutablePath); process.setArguments(godotCmd); return process.startDetached(); }