mirror of
https://github.com/Swordfish90/cool-retro-term.git
synced 2026-02-08 00:32:27 +00:00
Make sure settings are stored when the app is closed.
This commit is contained in:
@@ -148,6 +148,11 @@ QtObject {
|
|||||||
fontScaling = Math.max(fontScaling - 0.05, minimumFontScaling)
|
fontScaling = Math.max(fontScaling - 0.05, minimumFontScaling)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function close() {
|
||||||
|
storeSettings()
|
||||||
|
storeCustomProfiles()
|
||||||
|
}
|
||||||
|
|
||||||
property Storage storage: Storage {}
|
property Storage storage: Storage {}
|
||||||
|
|
||||||
function stringify(obj) {
|
function stringify(obj) {
|
||||||
@@ -891,11 +896,6 @@ QtObject {
|
|||||||
|
|
||||||
initializedSettings()
|
initializedSettings()
|
||||||
}
|
}
|
||||||
Component.onDestruction: {
|
|
||||||
storeSettings()
|
|
||||||
storeCustomProfiles()
|
|
||||||
// storage.dropSettings(); //DROPS THE SETTINGS!.. REMEMBER TO DISABLE ONCE ENABLED!!
|
|
||||||
}
|
|
||||||
|
|
||||||
// VARS ///////////////////////////////////////////////////////////////////
|
// VARS ///////////////////////////////////////////////////////////////////
|
||||||
property Label _sampleLabel: Label {
|
property Label _sampleLabel: Label {
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ ApplicationWindow {
|
|||||||
id: quitAction
|
id: quitAction
|
||||||
text: qsTr("Quit")
|
text: qsTr("Quit")
|
||||||
shortcut: "Ctrl+Shift+Q"
|
shortcut: "Ctrl+Shift+Q"
|
||||||
onTriggered: Qt.quit()
|
onTriggered: appSettings.close()
|
||||||
}
|
}
|
||||||
Action {
|
Action {
|
||||||
id: showsettingsAction
|
id: showsettingsAction
|
||||||
|
|||||||
@@ -64,7 +64,8 @@ QtObject {
|
|||||||
|
|
||||||
window.destroy()
|
window.destroy()
|
||||||
|
|
||||||
if (windowsModel.count === 0)
|
if (windowsModel.count === 0) {
|
||||||
Qt.quit()
|
appSettings.close()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user