From e4e3e581ea992e6c4bcc22cd755913c1c13e647f Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Fri, 27 Jan 2023 09:57:33 -0600 Subject: [PATCH] preparing for a settings module --- src/qml/main.qml | 18 ++++++++++++++++++ src/qml/presenter/Settings.qml | 11 +++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/qml/main.qml b/src/qml/main.qml index a9be00a..f592d37 100644 --- a/src/qml/main.qml +++ b/src/qml/main.qml @@ -22,6 +22,8 @@ Kirigami.ApplicationWindow { property bool editMode: false + property string soundEffect + signal edit() onActiveFocusItemChanged: console.log("FOCUS CHANGED TO: " + activeFocusControl) @@ -148,6 +150,22 @@ Kirigami.ApplicationWindow { } } + FileDialog { + id: soundFileDialog + title: "Pick a Sound Effect" + folder: shortcuts.home + /* fileMode: FileDialog.SaveFile */ + /* defaultSuffix: ".pres" */ + selectExisting: true + onAccepted: { + soundEffect = loadFileDialog.fileUrl; + showPassiveNotification(soundEffect); + } + onRejected: { + console.log("Canceled") + } + } + function toggleEditMode() { editMode = !editMode; mainPage.editSwitch(); diff --git a/src/qml/presenter/Settings.qml b/src/qml/presenter/Settings.qml index 874011c..790bcb2 100644 --- a/src/qml/presenter/Settings.qml +++ b/src/qml/presenter/Settings.qml @@ -5,12 +5,12 @@ import QtQuick.Layouts 1.2 import org.kde.kirigami 2.13 as Kirigami import "./" as Presenter import org.presenter 1.0 +import Qt.labs.settings 1.0 Kirigami.OverlaySheet { - + id: root property ListModel theModel - id: root header: Kirigami.Heading { text: "Settings" } @@ -29,5 +29,12 @@ Kirigami.OverlaySheet { presentationScreen = screens[currentIndex]; } } + Controls.ToolButton { + id: soundEffectBut + Kirigami.FormData.label: i18nc("@label:button", "Sound Effect:") + text: "Sound Effect" + onClicked: soundFileDialog.open() + } } + }