Files
qbz/crates/qbz-ui/ui/settings/DeveloperSettings.slint
T
vicrodh 897ba7128c feat(qbz-ui): settings export modal + Developer row (04 §4.2)
Add the desktop "Export settings…" surface for the qbzd daemon epic (T18):
a Developer-settings row that opens a modal with the single default-off
"Include Qobuz login and integration tokens" gate, its warning line, and a
Cancel/Export footer. Confirm() is a Rust callback (wired next). New
SettingsExportState/SettingsExportActions globals, exported from app.slint
so the Rust layer binds them, and the modal mounted in AppShell. New strings
translated across all 8 locales (en es de fr pt ru ja nl).

cc
2026-07-15 07:50:27 -06:00

94 lines
3.0 KiB
Plaintext

// Settings > Developer — opt-in home for developer/diagnostic tools. Same
// structure as the other settings panels (GroupHeader + SettingRow + a
// SecondaryButton). Currently launches the Qobuz Connect diagnostics modal
// (live session topology + rolling event log); more dev tools can land here.
import { Theme } from "../foundation/semantic-colors.slint";
import { Typography } from "../foundation/typography.slint";
import { Radius } from "../foundation/radius.slint";
import { QconnectDevState, LogViewerState, SettingsExportState } from "../state.slint";
import { SettingRow } from "SettingRow.slint";
import { DiagnosticsPanel } from "DiagnosticsPanel.slint";
component GroupHeader inherits Text {
color: Theme.text-muted;
font-size: 11px;
letter-spacing: 1.5px;
font-weight: Typography.semibold;
}
component SecondaryButton inherits Rectangle {
in property <string> label;
callback clicked();
// 160px floor keeps the settings right-edge grid; longer translations grow.
width: Math.max(label-txt.preferred-width + 32px, 160px);
height: 34px;
border-radius: Radius.sm;
border-width: 1px;
border-color: Theme.border-subtle;
background: ta.has-hover ? Theme.surface-hover : Theme.surface-elevated;
label-txt := Text {
width: 100%;
height: 100%;
text: root.label;
color: Theme.text-secondary;
font-size: Typography.body;
font-weight: Typography.medium;
horizontal-alignment: center;
vertical-alignment: center;
}
ta := TouchArea {
mouse-cursor: pointer;
clicked => {
root.clicked();
}
}
}
export component DeveloperSettings inherits VerticalLayout {
spacing: 4px;
GroupHeader { text: @tr("QOBUZ CONNECT"); }
SettingRow {
label: @tr("Connect diagnostics");
description: @tr("Live session topology and a rolling event log for debugging Qobuz Connect at runtime.");
SecondaryButton {
label: @tr("Open diagnostics");
clicked => {
QconnectDevState.open = true;
}
}
}
GroupHeader { text: @tr("LOGS"); }
SettingRow {
label: @tr("Application logs");
description: @tr("View the in-app log, copy it (secrets redacted), or upload it to share in a GitHub issue.");
SecondaryButton {
label: @tr("Open log viewer");
clicked => {
LogViewerState.open = true;
}
}
}
GroupHeader { text: @tr("SETTINGS PORTABILITY"); }
SettingRow {
label: @tr("Export settings…");
description: @tr("Save a portable bundle of your settings to move to another machine or the qbzd daemon.");
SecondaryButton {
label: @tr("Export…");
clicked => {
// Always reset the auth gate so it opens default-OFF (04 §4.2).
SettingsExportState.include-auth = false;
SettingsExportState.open = true;
}
}
}
DiagnosticsPanel { }
}