mod import_export;
mod logging;
mod system;
mod tmux;
use crate::SettingsUI;
use crate::section::section_matches;
use std::collections::HashSet;
pub use import_export::merge_config;
pub fn show(
ui: &mut egui::Ui,
settings: &mut SettingsUI,
changes_this_frame: &mut bool,
collapsed: &mut HashSet<String>,
) {
let query = settings.search_query.trim().to_lowercase();
if section_matches(
&query,
"Import/Export Preferences",
&[
"import",
"export",
"preferences",
"backup",
"restore",
"config",
"yaml",
"url import",
"merge",
],
) {
import_export::show_import_export_section(ui, settings, changes_this_frame, collapsed);
}
if section_matches(
&query,
"tmux Integration",
&[
"tmux",
"control mode",
"session",
"attach",
"prefix key",
"status bar",
"clipboard sync",
"auto-attach",
],
) {
tmux::show_tmux_section(ui, settings, changes_this_frame, collapsed);
}
if section_matches(
&query,
"Session Logging",
&[
"logging",
"recording",
"asciicast",
"asciinema",
"plain text",
"html",
"auto-log",
"log directory",
],
) {
logging::show_logging_section(ui, settings, changes_this_frame, collapsed);
}
if section_matches(
&query,
"Screenshots",
&["screenshot", "format", "png", "jpeg", "svg", "capture"],
) {
system::show_screenshot_section(ui, settings, changes_this_frame, collapsed);
}
if section_matches(
&query,
"Updates",
&[
"update",
"version",
"check",
"release",
"frequency",
"homebrew",
"cargo",
"self-update",
"daily",
"weekly",
"monthly",
],
) {
system::show_updates_section(ui, settings, changes_this_frame, collapsed);
}
if section_matches(
&query,
"File Transfers",
&[
"download",
"upload",
"transfer",
"file transfer",
"save location",
"save directory",
],
) {
system::show_file_transfers_section(ui, settings, changes_this_frame, collapsed);
}
if section_matches(
&query,
"Debug Logging",
&[
"debug",
"log",
"log level",
"log file",
"trace",
"verbose",
"diagnostics",
],
) {
system::show_debug_logging_section(ui, settings, changes_this_frame, collapsed);
}
if section_matches(
&query,
"Security",
&[
"security",
"environment",
"env var",
"allowlist",
"allow all env",
"variable substitution",
],
) {
system::show_security_section(ui, settings, changes_this_frame, collapsed);
}
}
pub fn keywords() -> &'static [&'static str] {
&[
"tmux",
"tmux integration",
"tmux path",
"control mode",
"session",
"default session",
"auto-attach",
"attach",
"clipboard sync",
"tmux clipboard",
"status bar",
"tmux status",
"refresh interval",
"prefix key",
"prefix",
"logging",
"session logging",
"auto log",
"auto-log",
"recording",
"asciicast",
"asciinema",
"log format",
"log directory",
"archive",
"archive on close",
"redact",
"redact passwords",
"password",
"sensitive",
"credentials",
"screenshot",
"screenshot format",
"png",
"jpeg",
"svg",
"html",
"update",
"version",
"check",
"release",
"update check",
"hourly",
"skipped version",
"download",
"upload",
"transfer",
"file transfer",
"save location",
"save directory",
"debug",
"debug logging",
"log level",
"log file",
"trace",
"verbose",
"diagnostics",
"import",
"export",
"preferences",
"merge",
"url",
"plain",
"plain text",
"left format",
"right format",
"check now",
"daily",
"weekly",
"monthly",
"homebrew",
"brew",
"cargo",
"self-update",
"backup",
"config",
"url import",
"security",
"environment",
"env var",
"allowlist",
"allow all env",
"variable substitution",
]
}