mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-06-16 08:05:19 -04:00
calendar(dank): Add support for DankCalendar backend
- Add keyboard navigation to overview - Add edit events to overview - Add create events to overview - Add setting for auto/khal/dankcalendar backend selection
This commit is contained in:
@@ -7,29 +7,31 @@ Item {
|
||||
property alias path: socket.path
|
||||
property alias parser: socket.parser
|
||||
property bool connected: false
|
||||
property bool linkUp: false
|
||||
|
||||
property int reconnectBaseMs: 400
|
||||
property int reconnectMaxMs: 15000
|
||||
|
||||
property int _reconnectAttempt: 0
|
||||
|
||||
signal connectionStateChanged()
|
||||
signal connectionStateChanged
|
||||
|
||||
onConnectedChanged: {
|
||||
socket.connected = connected
|
||||
socket.connected = connected;
|
||||
}
|
||||
|
||||
Socket {
|
||||
id: socket
|
||||
|
||||
onConnectionStateChanged: {
|
||||
root.connectionStateChanged()
|
||||
root.linkUp = connected;
|
||||
root.connectionStateChanged();
|
||||
if (connected) {
|
||||
root._reconnectAttempt = 0
|
||||
return
|
||||
root._reconnectAttempt = 0;
|
||||
return;
|
||||
}
|
||||
if (root.connected) {
|
||||
root._scheduleReconnect()
|
||||
root._scheduleReconnect();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -39,24 +41,24 @@ Item {
|
||||
interval: 0
|
||||
repeat: false
|
||||
onTriggered: {
|
||||
socket.connected = false
|
||||
Qt.callLater(() => socket.connected = true)
|
||||
socket.connected = false;
|
||||
Qt.callLater(() => socket.connected = true);
|
||||
}
|
||||
}
|
||||
|
||||
function send(data) {
|
||||
const json = typeof data === "string" ? data : JSON.stringify(data)
|
||||
const message = json.endsWith("\n") ? json : json + "\n"
|
||||
socket.write(message)
|
||||
socket.flush()
|
||||
const json = typeof data === "string" ? data : JSON.stringify(data);
|
||||
const message = json.endsWith("\n") ? json : json + "\n";
|
||||
socket.write(message);
|
||||
socket.flush();
|
||||
}
|
||||
|
||||
function _scheduleReconnect() {
|
||||
const pow = Math.min(_reconnectAttempt, 10)
|
||||
const base = Math.min(reconnectBaseMs * Math.pow(2, pow), reconnectMaxMs)
|
||||
const jitter = Math.floor(Math.random() * Math.floor(base / 4))
|
||||
reconnectTimer.interval = base + jitter
|
||||
reconnectTimer.restart()
|
||||
_reconnectAttempt++
|
||||
const pow = Math.min(_reconnectAttempt, 10);
|
||||
const base = Math.min(reconnectBaseMs * Math.pow(2, pow), reconnectMaxMs);
|
||||
const jitter = Math.floor(Math.random() * Math.floor(base / 4));
|
||||
reconnectTimer.interval = base + jitter;
|
||||
reconnectTimer.restart();
|
||||
_reconnectAttempt++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,6 +182,7 @@ Singleton {
|
||||
|
||||
property int firstDayOfWeek: -1
|
||||
property bool showWeekNumber: false
|
||||
property string calendarBackend: "auto"
|
||||
property bool use24HourClock: true
|
||||
property bool showSeconds: false
|
||||
property bool padHours12Hour: false
|
||||
|
||||
@@ -37,6 +37,7 @@ var SPEC = {
|
||||
|
||||
firstDayOfWeek: { def: -1 },
|
||||
showWeekNumber: { def: false },
|
||||
calendarBackend: { def: "auto" },
|
||||
use24HourClock: { def: true },
|
||||
showSeconds: { def: false },
|
||||
padHours12Hour: { def: false },
|
||||
|
||||
Reference in New Issue
Block a user