mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-11-06 19:12:30 +01:00
Remove deprecated Qt.labs.settings and fix quit
This commit is contained in:
parent
d07f3db58e
commit
c4b2bcc67f
@ -1,3 +1,5 @@
|
||||
import QtCore as QCore
|
||||
import QtQml
|
||||
import QtQuick
|
||||
import QtQuick.Window
|
||||
import QtQuick.Controls
|
||||
@ -8,7 +10,6 @@ import ScreenPlay
|
||||
import Settings
|
||||
import ScreenPlayUtil as Util
|
||||
import Qt5Compat.GraphicalEffects
|
||||
import Qt.labs.settings 1.0 as Labs
|
||||
import "qml/Monitors" as Monitors
|
||||
import "qml/Installed" as Installed
|
||||
import "qml/Navigation" as Navigation
|
||||
@ -67,7 +68,7 @@ ApplicationWindow {
|
||||
onClosing: close => {
|
||||
close.accepted = false;
|
||||
if (App.screenPlayManager.activeWallpaperCounter === 0 && App.screenPlayManager.activeWidgetsCounter === 0) {
|
||||
Qt.quit();
|
||||
App.exit();
|
||||
}
|
||||
const alwaysMinimize = settings.value("alwaysMinimize", null);
|
||||
if (alwaysMinimize === null) {
|
||||
@ -81,7 +82,7 @@ ApplicationWindow {
|
||||
exitDialog.open();
|
||||
}
|
||||
|
||||
Labs.Settings {
|
||||
QCore.Settings {
|
||||
id: settings
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
import QtQuick
|
||||
import Qt.labs.settings 1.0 as Labs
|
||||
import QtQml
|
||||
import QtCore as QCore
|
||||
import QtQuick.Window
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls.Material
|
||||
@ -61,15 +62,16 @@ Util.Popup {
|
||||
color: Material.primaryTextColor
|
||||
}
|
||||
|
||||
Labs.Settings {
|
||||
QCore.Settings {
|
||||
id: settings
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.fillWidth: true
|
||||
Button {
|
||||
text: qsTr("Quit ScreenPlay now")
|
||||
onClicked: Qt.quit()
|
||||
onClicked: App.exit();
|
||||
}
|
||||
Button {
|
||||
text: qsTr("Minimize ScreenPlay")
|
||||
@ -85,6 +87,7 @@ Util.Popup {
|
||||
onClicked: {
|
||||
settings.setValue("alwaysMinimize", true);
|
||||
settings.sync();
|
||||
print(settings.value("alwaysMinimize"))
|
||||
App.showDockIcon(false);
|
||||
applicationWindow.hide();
|
||||
root.close();
|
||||
|
@ -232,6 +232,8 @@ QString App::version() const
|
||||
*/
|
||||
void App::exit()
|
||||
{
|
||||
m_screenPlayManager->removeAllWallpapers();
|
||||
m_screenPlayManager->removeAllWidgets();
|
||||
QApplication::instance()->quit();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user