Bring PS5 GTA6 to 120FPS with DLSS 5. An advanced Windows video player and capture enhancement tool featuring real-time preview for videos, images, and capture card sources. Combine AI-powered Super Resolution, DLSS5 image enhancement, and Frame Generation to deliver a next-generation visual experience.
C++
feat(ui): the preset save and manage dialogs
Veyra Goal Agentb43f2b363a92
diff --git a/include/veyra/ui/QmlPlayerBridge.h b/include/veyra/ui/QmlPlayerBridge.hindex 49aa5e42..a1c5f882 100644--- a/include/veyra/ui/QmlPlayerBridge.h+++ b/include/veyra/ui/QmlPlayerBridge.h@@ -231,6 +231,11 @@ class QmlPlayerBridge : public QObject {Q_PROPERTY(QString srTargetLabel READ srTargetLabel NOTIFY settingsChanged)// Presets as a picker model: one preset concept, list and node together.Q_PROPERTY(QVariantList presetChoices READ presetChoices NOTIFY presetsChanged)+ // The design's save flow lists what the preset will contain before naming it:+ // each part, its current summary, and whether it is being saved.+ Q_PROPERTY(QVariantList presetSaveParts READ presetSaveParts NOTIFY chainChanged)+ // Which preset the app opens with, as the manage page's "set default" uses.+ Q_PROPERTY(int defaultPresetIndex READ defaultPresetIndex NOTIFY presetsChanged)public:// `engine` must outlive the bridge. `dataDirectory` holds ui-session.v1 and@@ -414,6 +419,8 @@ public:QString srTargetLabel() const;void setSrTargetIndex(int index);QVariantList presetChoices() const;+ QVariantList presetSaveParts() const;+ int defaultPresetIndex() const;// The native HWND the engine presents into. The UI creates it as a child// window of the QML window and hands it over; the bridge never draws QML@@ -470,6 +477,7 @@ public:Q_INVOKABLE bool deletePreset(int index);Q_INVOKABLE bool renamePreset(int index, const QString& name);Q_INVOKABLE bool duplicatePreset(int index);+ Q_INVOKABLE bool setDefaultPreset(int index);Q_INVOKABLE void refreshRecentFiles();Q_INVOKABLE void clearRecentFiles();diff --git a/qml/Veyra/DialogHost.qml b/qml/Veyra/DialogHost.qmlindex 82f8364b..ac2a6079 100644--- a/qml/Veyra/DialogHost.qml+++ b/qml/Veyra/DialogHost.qml@@ -396,6 +396,152 @@ Item {}}+ // --- 另存为预设 -------------------------------------------------------+ // The design lists every part that will be saved before asking for a name, so+ // the user can see what they are about to store.+ DLayer {+ id: saveDialog+ visible: host.dialog === "save"+ glyph: "☰"+ title: "另存为预设"+ sub: "预设会保存下面勾选的部分;应用时只覆盖勾选的部分"+ dialogWidth: 620+ property string presetName: ""+ property var chosen: ({})+ actions: [+ { label: "取消" },+ { label: "保存", primary: true }+ ]+ onActionTriggered: label => {+ if (label !== "保存") { host.close(); return }+ if (presetName.length === 0) { saveNote.text = "预设需要一个名字"; return }+ let mask = 0+ for (const part of veyra.presetSaveParts) {+ if (chosen[part.id] === true) mask |= (1 << ["chain","color","fg","audio"].indexOf(part.id))+ }+ if (veyra.savePresetAs(presetName, mask, false)) host.close()+ else saveNote.text = "保存失败:名称可能已存在"+ }++ DSection { text: "将要保存的内容" }+ DGroup {+ Repeater {+ model: veyra.presetSaveParts+ delegate: VRow {+ required property var modelData+ label: modelData.label+ hint: modelData.summary+ VSwitch {+ // A part at its default is still offered, but starts off: a+ // preset that stored nothing would be a surprise.+ checked: modelData.meaningful+ onToggled: {+ const c = Object.assign({}, saveDialog.chosen)+ c[modelData.id] = checked+ saveDialog.chosen = c+ }+ }+ }+ }+ }+ DSection { text: "名称" }+ VTextField {+ Layout.fillWidth: true+ placeholder: "例如:夜间游戏"+ onEdited: text => saveDialog.presetName = text+ }+ Text {+ id: saveNote+ Layout.fillWidth: true+ Layout.topMargin: 6+ text: ""+ color: Theme.warn+ font.family: Theme.fontUi+ font.pixelSize: Theme.fsSmall+ wrapMode: Text.WordWrap+ }+ }++ // --- 管理预设 ---------------------------------------------------------+ DLayer {+ visible: host.dialog === "manage"+ glyph: "☰"+ title: "管理预设"+ sub: "内置预设可以复制,不能改名或删除"+ dialogWidth: 620+ actions: [{ label: "完成", primary: true }]+ onActionTriggered: host.close()++ ColumnLayout {+ Layout.fillWidth: true+ spacing: 6+ Text {+ visible: veyra.presets.length === 0+ text: "还没有保存过预设。"+ color: Theme.t3+ font.family: Theme.fontUi+ font.pixelSize: Theme.fsSmall+ }+ Repeater {+ model: veyra.presets+ delegate: Rectangle {+ required property var modelData+ Layout.fillWidth: true+ implicitHeight: 46+ radius: 12+ color: Theme.card2+ border.width: 1+ border.color: veyra.defaultPresetIndex === modelData.index ? Theme.accent : Theme.stroke+ RowLayout {+ anchors.fill: parent+ anchors.leftMargin: 10+ anchors.rightMargin: 8+ spacing: 8+ ColumnLayout {+ Layout.fillWidth: true+ spacing: 2+ Text {+ text: modelData.name+ color: Theme.t1+ font.family: Theme.fontUi+ font.pixelSize: Theme.fsBody+ elide: Text.ElideRight+ }+ Text {+ Layout.fillWidth: true+ text: modelData.note.length > 0 ? modelData.note+ : (modelData.nodeMode ? "节点预设" : "列表预设")+ color: Theme.t3+ font.family: Theme.fontUi+ font.pixelSize: 11+ elide: Text.ElideRight+ }+ }+ VTag { visible: modelData.builtin; text: "内置" }+ VTag { visible: veyra.defaultPresetIndex === modelData.index; kind: "acc"; text: "启动默认" }+ VButton {+ ghost: true+ text: "复制"+ onClicked: veyra.duplicatePreset(modelData.index)+ }+ VButton {+ ghost: true+ text: "设为默认"+ visible: !modelData.builtin+ onClicked: veyra.setDefaultPreset(modelData.index)+ }+ VButton {+ ghost: true+ text: "删除"+ visible: !modelData.builtin+ onClicked: veyra.deletePreset(modelData.index)+ }+ }+ }+ }+ }+ }+// --- small building blocks the design's dialogs use --------------------component DSection: RowLayout {property string text: ""diff --git a/qml/Veyra/Main.qml b/qml/Veyra/Main.qmlindex c0e90798..ae31d916 100644--- a/qml/Veyra/Main.qml+++ b/qml/Veyra/Main.qml@@ -137,7 +137,10 @@ Window {onRequestPage: p => root.page = ponRequestAspect: aspect => root.fitToFilm(aspect)}- ProPage { onRequestPage: p => root.page = p }+ ProPage {+ onRequestPage: p => root.page = p+ onRequestDialog: key => dialogs.open(key)+ }NodePage { onRequestPage: p => root.page = p }ExportPage { onRequestPage: p => root.page = p }SettingsPage { onRequestPage: p => root.page = p }@@ -204,7 +207,7 @@ Window {function onNavigate(p) {// A dialog key opens the dialog; anything else is a page.if (p === "capture" || p === "ps5" || p === "screen"- || p === "subtitle" || p === "audio") {+ || p === "subtitle" || p === "audio" || p === "save" || p === "manage") {dialogs.open(p)return}diff --git a/qml/Veyra/ProPage.qml b/qml/Veyra/ProPage.qmlindex b84916ce..56d929a8 100644--- a/qml/Veyra/ProPage.qml+++ b/qml/Veyra/ProPage.qml@@ -16,6 +16,7 @@ import QtQuick.ShapesItem {id: rootsignal requestPage(string page)+ signal requestDialog(string key)// Design's st.tab: quality / fg / color / audio / display.property string tab: "quality"@@ -914,6 +915,7 @@ Item {MenuItem { text: "PS5 串流…"; onTriggered: veyra.openPs5Dialog() }MenuItem { text: "屏幕捕获…"; onTriggered: veyra.openScreenCaptureDialog() }}+ // The design puts 另存为 / 管理 in the professional page's preset menu.Menu {id: presetMenuwidth: 260@@ -925,6 +927,9 @@ Item {onTriggered: veyra.applyPresetIndex(modelData.index)}}+ MenuSeparator { }+ MenuItem { text: "另存为预设…"; onTriggered: root.requestDialog("save") }+ MenuItem { text: "管理预设…"; onTriggered: root.requestDialog("manage") }}// Switching to node mode rebuilds the chain, so the design asks first.diff --git a/src/ui/QmlPlayerBridge.cpp b/src/ui/QmlPlayerBridge.cppindex 47afbeff..854ce1a0 100644--- a/src/ui/QmlPlayerBridge.cpp+++ b/src/ui/QmlPlayerBridge.cpp@@ -1187,6 +1187,48 @@ bool QmlPlayerBridge::renamePreset(int index, const QString& name) {return ok;}+QVariantList QmlPlayerBridge::presetSaveParts() const {+ // What a preset would contain right now, part by part, so the save dialog can+ // list it before the user names anything. `meaningful` marks the parts that are+ // not at defaults, which is what makes "will be saved" honest.+ const auto s = settings();+ QVariantList out;+ auto add = [&](const char* id, const QString& label, const QString& summary, bool meaningful) {+ QVariantMap item;+ item["id"] = QString::fromUtf8(id);+ item["label"] = label;+ item["summary"] = summary;+ item["meaningful"] = meaningful;+ out << item;+ };+ QStringList chainParts;+ for (uint32_t i = 0; i < impl_->chain.nodeCount; ++i)+ chainParts << utf8Of(engine::effectInfo(impl_->chain.nodes[i].type).label);+ add("chain", tr("效果链"),+ chainParts.isEmpty() ? tr("空") : chainParts.join(QStringLiteral(" → ")),+ impl_->chain.nodeCount > 0);+ add("color", tr("色彩"), s.color.enabled ? tr("已启用") : tr("未启用"), s.color.enabled);+ add("fg", tr("补帧"),+ s.multiplier > 1 ? QStringLiteral("%1X").arg(s.multiplier) : tr("关闭"),+ s.multiplier > 1);+ add("audio", tr("声音"),+ s.audioOffsetMs != 0 ? tr("偏移 %1 ms").arg(s.audioOffsetMs) : tr("默认"),+ s.audioOffsetMs != 0);+ return out;+}++int QmlPlayerBridge::defaultPresetIndex() const {+ const auto index = impl_->facade.presets().defaultIndex();+ return index.has_value() ? int(*index) : -1;+}++bool QmlPlayerBridge::setDefaultPreset(int index) {+ if (index < 0 || size_t(index) >= impl_->facade.presets().entries().size()) return false;+ const bool ok = impl_->facade.presets().setDefault(size_t(index));+ if (ok) emit presetsChanged();+ return ok;+}+bool QmlPlayerBridge::duplicatePreset(int index) {if (index < 0 || size_t(index) >= impl_->facade.presets().entries().size()) return false;const bool ok = impl_->facade.presets().duplicate(size_t(index));