mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
Settings/State: Moved state IPC logic to ShellState.qml.
This commit is contained in:
@@ -366,7 +366,29 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
IpcHandler {
|
||||
target: "state"
|
||||
|
||||
// Returns all settings and shell state as JSON
|
||||
function all(): string {
|
||||
try {
|
||||
var snapshot = ShellState.buildStateSnapshot();
|
||||
if (!snapshot) {
|
||||
throw new Error("State snapshot unavailable");
|
||||
}
|
||||
return JSON.stringify(snapshot, null, 2);
|
||||
} catch (error) {
|
||||
Logger.e("IPC", "Failed to serialize state:", error);
|
||||
return JSON.stringify({
|
||||
"error": "Failed to serialize state: " + error
|
||||
}, null, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Queue an IPC panel operation - will execute when screen is detected
|
||||
// -------------------------------------------------------------------
|
||||
function withTargetScreen(callback) {
|
||||
if (pendingCallback) {
|
||||
Logger.w("IPC", "Another IPC call is pending, ignoring new call");
|
||||
@@ -383,27 +405,6 @@ Item {
|
||||
screenDetectorLoader.active = true;
|
||||
}
|
||||
}
|
||||
|
||||
IpcHandler {
|
||||
target: "state"
|
||||
|
||||
// Returns all settings and shell state as JSON
|
||||
function all(): string {
|
||||
try {
|
||||
var snapshot = Settings.buildStateSnapshot();
|
||||
if (!snapshot) {
|
||||
throw new Error("State snapshot unavailable");
|
||||
}
|
||||
return JSON.stringify(snapshot, null, 2);
|
||||
} catch (error) {
|
||||
Logger.e("IPC", "Failed to serialize state:", error);
|
||||
return JSON.stringify({
|
||||
"error": "Failed to serialize state: " + error
|
||||
}, null, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* For IPC calls on multi-monitors setup that will open panels on screen,
|
||||
* we need to open a QS PanelWindow and wait for it's "screen" property to stabilize.
|
||||
@@ -458,4 +459,6 @@ Item {
|
||||
}
|
||||
}
|
||||
}
|
||||
// -------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user