initial commit

This commit is contained in:
Ly-sec
2025-11-17 16:35:22 +01:00
parent 063ca70c57
commit bb8107727c
17 changed files with 1031 additions and 7 deletions
+45
View File
@@ -5,6 +5,7 @@ import Quickshell
import Quickshell.Io
import "../Helpers/QtObj2JS.js" as QtObj2JS
import qs.Commons
import qs.Services.Noctalia
import qs.Services.UI
Singleton {
@@ -16,6 +17,9 @@ Singleton {
property bool directoriesCreated: false
property int settingsVersion: 23
property bool isDebug: Quickshell.env("NOCTALIA_DEBUG") === "1"
property bool changelogPending: false
property string changelogFromVersion: ""
property string changelogToVersion: ""
// Define our app directories
// Default config directory: ~/.config/noctalia
@@ -36,6 +40,7 @@ Singleton {
// Signal emitted when settings are loaded after startupcale changes
signal settingsLoaded
signal settingsSaved
signal changelogTriggered(string previousVersion, string currentVersion)
// -----------------------------------------------------
// -----------------------------------------------------
@@ -99,6 +104,7 @@ Singleton {
upgradeSettingsData();
validateMonitorConfigurations();
evaluateChangelogState();
isLoaded = true;
// Emit the signal
@@ -523,12 +529,51 @@ Singleton {
property string darkModeChange: ""
}
property JsonObject changelog: JsonObject {
property string lastSeenVersion: ""
property bool forceShowNextStart: false
}
// battery
property JsonObject battery: JsonObject {
property int chargingMode: 0
}
}
// -----------------------------------------------------
function evaluateChangelogState() {
const currentVersion = UpdateService ? (UpdateService.currentVersion || "") : "";
if (!currentVersion) {
return;
}
const storedVersion = adapter.changelog?.lastSeenVersion || "";
const forceShow = adapter.changelog?.forceShowNextStart || false;
const hasSeenBefore = storedVersion !== "";
const versionChanged = storedVersion !== currentVersion;
const shouldTrigger = forceShow || (hasSeenBefore && versionChanged);
if (shouldTrigger) {
changelogFromVersion = storedVersion;
changelogToVersion = currentVersion;
changelogPending = true;
root.changelogTriggered(storedVersion, currentVersion);
}
adapter.changelog.lastSeenVersion = currentVersion;
adapter.changelog.forceShowNextStart = false;
if (shouldTrigger || !hasSeenBefore) {
Qt.callLater(saveImmediate);
}
}
function clearChangelogRequest() {
changelogPending = false;
changelogFromVersion = "";
changelogToVersion = "";
}
// -----------------------------------------------------
// Function to preprocess paths by expanding "~" to user's home directory
function preprocessPath(path) {