V1
Some checks failed
Release / windows-x86_64-gnu (push) Failing after 3m53s

This commit is contained in:
2026-06-19 04:00:36 +08:00
Unverified
parent d32882443f
commit 0f07dd9f5b
9 changed files with 639 additions and 399 deletions

View File

@@ -222,6 +222,16 @@ export component AppWindow inherits Window {
in-out property <bool> ui-debug-ids: false;
in property <image> background-image;
in-out property <string> config-dir-text;
// WebDAV sync settings
in-out property <bool> webdav-enabled: false;
in-out property <string> webdav-url-text;
in-out property <string> webdav-username-text;
in-out property <string> webdav-password-text;
in-out property <string> webdav-status-text;
callback webdav-test-connection();
callback webdav-push();
callback webdav-pull();
callback webdav-save-settings(bool, string, string, string);
callback app-config-save(string, string, string, int, string, string, string, bool, string);
callback app-config-pick-dir();
callback app-background-pick();
@@ -1012,7 +1022,7 @@ export component AppWindow inherits Window {
x: (parent.width - self.width) / 2;
y: (parent.height - self.height) / 2;
width: min(640px, parent.width - 48px);
height: min(500px, parent.height - 48px);
height: min(620px, parent.height - 48px);
background: Theme.bg-panel;
border-radius: Theme.radius-md;
border-width: 1px;
@@ -1301,6 +1311,112 @@ export component AppWindow inherits Window {
}
}
// --- WebDAV Sync Settings ---
Rectangle { height: 1px; background: Theme.border-subtle; }
HorizontalLayout {
height: 30px;
spacing: 10px;
Text {
width: 148px;
height: parent.height;
text: @tr("WebDAV sync");
color: Theme.text-secondary;
font-size: Theme.fs-sm;
font-weight: 600;
vertical-alignment: center;
overflow: elide;
}
ConfigButton {
label: root.webdav-enabled ? @tr("On") : @tr("Off");
button-width: 76px;
selected: root.webdav-enabled;
clicked => {
root.webdav-enabled = !root.webdav-enabled;
}
}
Rectangle { horizontal-stretch: 1; }
}
HorizontalLayout {
height: 30px;
spacing: 10px;
Text {
width: 148px;
height: parent.height;
text: @tr("WebDAV URL");
color: Theme.text-secondary;
font-size: Theme.fs-sm;
vertical-alignment: center;
overflow: elide;
}
ConfigTextField {
value <=> root.webdav-url-text;
field-width: 300px;
}
}
HorizontalLayout {
height: 30px;
spacing: 10px;
Text {
width: 148px;
height: parent.height;
text: @tr("WebDAV username");
color: Theme.text-secondary;
font-size: Theme.fs-sm;
vertical-alignment: center;
overflow: elide;
}
ConfigTextField {
value <=> root.webdav-username-text;
field-width: 160px;
}
Text {
width: 80px;
height: parent.height;
text: @tr("Password");
color: Theme.text-secondary;
font-size: Theme.fs-sm;
vertical-alignment: center;
overflow: elide;
}
ConfigTextField {
value <=> root.webdav-password-text;
field-width: 140px;
}
}
HorizontalLayout {
height: 30px;
spacing: 10px;
Text {
width: 148px;
height: parent.height;
text: root.webdav-status-text;
color: root.webdav-status-text == @tr("Connection OK") ? Theme.success : Theme.text-muted;
font-size: Theme.fs-xs;
vertical-alignment: center;
overflow: elide;
horizontal-stretch: 1;
}
ConfigButton {
label: @tr("Test");
button-width: 72px;
clicked => { root.webdav-test-connection(); }
}
ConfigButton {
label: @tr("Upload");
button-width: 82px;
clicked => { root.webdav-push(); }
}
ConfigButton {
label: @tr("Download");
button-width: 82px;
clicked => { root.webdav-pull(); }
}
}
HorizontalLayout {
height: 30px;
spacing: 10px;
@@ -1319,6 +1435,11 @@ export component AppWindow inherits Window {
primary: true;
clicked => {
if root.ui-debug-ids { root.debug-click("configuration", "save"); }
root.webdav-save-settings(
root.webdav-enabled,
root.webdav-url-text,
root.webdav-username-text,
root.webdav-password-text);
root.app-config-save(
root.max-tabs-text,
root.terminal-font-size-text,