preparing for a settings module

This commit is contained in:
Chris Cochrun 2023-01-27 09:57:33 -06:00
parent 09f5e23612
commit e4e3e581ea
2 changed files with 27 additions and 2 deletions

View file

@ -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();

View file

@ -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()
}
}
}