diff options
author | hstde <kranz.chr@googlemail.com> | 2021-08-08 02:06:18 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-08-08 10:53:57 +0200 |
commit | 7d22713a72d84fc0c12a67424fec91f54032bc17 (patch) | |
tree | 8555697ffcd35e02c1f143831085879fc81c096d /Userland/Applications | |
parent | 2fec891d8e80c726d543b7682c24a205d5532cef (diff) | |
download | serenity-7d22713a72d84fc0c12a67424fec91f54032bc17.zip |
Terminal: Save settings to config file
When exiting the terminal settings window, the opacity, bell and
maximum history size will be saved to the application config file.
Because the color scheme is neither configurable nor
will it be loaded on startup, it will not get saved for now.
Diffstat (limited to 'Userland/Applications')
-rw-r--r-- | Userland/Applications/Terminal/main.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Userland/Applications/Terminal/main.cpp b/Userland/Applications/Terminal/main.cpp index 2dcd416e9e..eec792eb0a 100644 --- a/Userland/Applications/Terminal/main.cpp +++ b/Userland/Applications/Terminal/main.cpp @@ -357,6 +357,23 @@ int main(int argc, char** argv) settings_window = create_settings_window(terminal); settings_window->show(); settings_window->move_to_front(); + settings_window->on_close = [&]() { + config->write_num_entry("Window", "Opacity", terminal.opacity()); + config->write_num_entry("Terminal", "MaxHistorySize", terminal.max_history_size()); + + auto bell = terminal.bell_mode(); + auto bell_setting = String::empty(); + if (bell == VT::TerminalWidget::BellMode::AudibleBeep) { + bell_setting = "AudibleBeep"; + } else if (bell == VT::TerminalWidget::BellMode::Disabled) { + bell_setting = "Disabled"; + } else { + bell_setting = "Visible"; + } + config->write_entry("Window", "Bell", bell_setting); + + config->sync(); + }; }); terminal.context_menu().add_separator(); |