1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-31 08:52:49 -05:00

clipboard: react to changes

This commit is contained in:
bbedward
2026-01-27 22:50:28 -05:00
parent d19e81ffac
commit eda59b348c
4 changed files with 111 additions and 17 deletions

View File

@@ -284,6 +284,20 @@ DankModal {
modal: clipboardHistoryModal
}
Connections {
target: DMSService
function onClipboardStateUpdate(data) {
if (!clipboardHistoryModal.shouldBeVisible) {
return;
}
const newHistory = data.history || [];
internalEntries = newHistory;
pinnedEntries = newHistory.filter(e => e.pinned);
pinnedCount = pinnedEntries.length;
updateFilteredModel();
}
}
ConfirmModal {
id: clearConfirmDialog
confirmButtonText: I18n.tr("Clear All")

View File

@@ -60,12 +60,13 @@ Singleton {
signal openUrlRequested(string url)
signal appPickerRequested(var data)
signal screensaverStateUpdate(var data)
signal clipboardStateUpdate(var data)
property bool capsLockState: false
property bool screensaverInhibited: false
property var screensaverInhibitors: []
property var activeSubscriptions: ["network", "network.credentials", "loginctl", "freedesktop", "freedesktop.screensaver", "gamma", "theme.auto", "bluetooth", "bluetooth.pairing", "dwl", "brightness", "wlroutput", "evdev", "browser", "dbus"]
property var activeSubscriptions: ["network", "network.credentials", "loginctl", "freedesktop", "freedesktop.screensaver", "gamma", "theme.auto", "bluetooth", "bluetooth.pairing", "dwl", "brightness", "wlroutput", "evdev", "browser", "dbus", "clipboard"]
Component.onCompleted: {
if (socketPath && socketPath.length > 0) {
@@ -392,6 +393,8 @@ Singleton {
screensaverStateUpdate(data);
} else if (service === "dbus") {
dbusSignalReceived(data.subscriptionId || "", data);
} else if (service === "clipboard") {
clipboardStateUpdate(data);
}
}
@@ -726,7 +729,8 @@ Singleton {
if (!response.error && response.result?.subscriptionId) {
dbusSubscriptions[response.result.subscriptionId] = true;
}
if (callback) callback(response);
if (callback)
callback(response);
});
}
@@ -737,7 +741,8 @@ Singleton {
if (!response.error) {
delete dbusSubscriptions[subscriptionId];
}
if (callback) callback(response);
if (callback)
callback(response);
});
}