wip: tsc-ui settings tabs and About via TSC_OPEN
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
This commit is contained in:
2 files changed
+14
-4
No files matched your search
@@ -196,8 +196,8 @@ pub fn run(options: RunOptions) -> Result<()> {
|
|||||||
// TSC_AUTOCONNECT=voice|observe connects the first bookmark on start,
|
// TSC_AUTOCONNECT=voice|observe connects the first bookmark on start,
|
||||||
// TSC_SCREENSHOT=<png> saves the window after TSC_SCREENSHOT_DELAY seconds and exits,
|
// TSC_SCREENSHOT=<png> saves the window after TSC_SCREENSHOT_DELAY seconds and exits,
|
||||||
// TSC_DEMO_STREAM=1 shows a local test stream in the viewer,
|
// TSC_DEMO_STREAM=1 shows a local test stream in the viewer,
|
||||||
// TSC_OPEN=share|settings opens that dialog on start, TSC_AUTOWATCH=1 watches the
|
// TSC_OPEN=share|settings[:<tab>]|about opens that on start, TSC_AUTOWATCH=1
|
||||||
// first stream that shows up.
|
// watches the first stream that shows up.
|
||||||
let dir: PathBuf = match (options.data_dir, std::env::var_os("TSC_DATA_DIR")) {
|
let dir: PathBuf = match (options.data_dir, std::env::var_os("TSC_DATA_DIR")) {
|
||||||
(Some(dir), _) => dir,
|
(Some(dir), _) => dir,
|
||||||
(None, Some(dir)) => dir.into(),
|
(None, Some(dir)) => dir.into(),
|
||||||
@@ -309,8 +309,14 @@ pub fn run(options: RunOptions) -> Result<()> {
|
|||||||
}
|
}
|
||||||
match std::env::var("TSC_OPEN").as_deref() {
|
match std::env::var("TSC_OPEN").as_deref() {
|
||||||
Ok("share") => ui.invoke_open_share_dialog(),
|
Ok("share") => ui.invoke_open_share_dialog(),
|
||||||
Ok("settings") => {
|
Ok("about") => {
|
||||||
|
with_app(|app| app.load_notices());
|
||||||
|
ui.set_show_about(true);
|
||||||
|
}
|
||||||
|
Ok(open) if open.starts_with("settings") => {
|
||||||
with_app(|app| app.open_settings());
|
with_app(|app| app.open_settings());
|
||||||
|
let tab = open.strip_prefix("settings:").and_then(|t| t.parse().ok());
|
||||||
|
ui.set_settings_tab(tab.unwrap_or(0));
|
||||||
ui.set_settings_open(true);
|
ui.set_settings_open(true);
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
|
|||||||
@@ -1010,6 +1010,7 @@ component LevelMeter inherits Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
component SettingsDialog inherits Dialog {
|
component SettingsDialog inherits Dialog {
|
||||||
|
in-out property <int> tab;
|
||||||
callback done();
|
callback done();
|
||||||
card-width: 640px;
|
card-width: 640px;
|
||||||
card-height: 660px;
|
card-height: 660px;
|
||||||
@@ -1022,6 +1023,7 @@ component SettingsDialog inherits Dialog {
|
|||||||
}
|
}
|
||||||
TabWidget {
|
TabWidget {
|
||||||
vertical-stretch: 1;
|
vertical-stretch: 1;
|
||||||
|
current-index <=> tab;
|
||||||
Tab {
|
Tab {
|
||||||
title: @tr("Audio");
|
title: @tr("Audio");
|
||||||
ScrollView {
|
ScrollView {
|
||||||
@@ -1454,7 +1456,8 @@ export component MainWindow inherits Window {
|
|||||||
default-font-size: 13px;
|
default-font-size: 13px;
|
||||||
|
|
||||||
property <bool> editing: false;
|
property <bool> editing: false;
|
||||||
property <bool> show-about: false;
|
in-out property <bool> show-about: false;
|
||||||
|
in-out property <int> settings-tab: 0;
|
||||||
in-out property <bool> sharing-dialog: false;
|
in-out property <bool> sharing-dialog: false;
|
||||||
in-out property <bool> settings-open: false;
|
in-out property <bool> settings-open: false;
|
||||||
property <bool> client-open: false;
|
property <bool> client-open: false;
|
||||||
@@ -1668,6 +1671,7 @@ export component MainWindow inherits Window {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if settings-open: SettingsDialog {
|
if settings-open: SettingsDialog {
|
||||||
|
tab <=> settings-tab;
|
||||||
done => {
|
done => {
|
||||||
settings-open = false;
|
settings-open = false;
|
||||||
Bridge.close-settings();
|
Bridge.close-settings();
|
||||||
|
|||||||
Reference in new issue
Block a user