diff options
Diffstat (limited to 'Applications/Terminal/main.cpp')
-rw-r--r-- | Applications/Terminal/main.cpp | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/Applications/Terminal/main.cpp b/Applications/Terminal/main.cpp index 2cf5f5dbf1..f10b6304a3 100644 --- a/Applications/Terminal/main.cpp +++ b/Applications/Terminal/main.cpp @@ -106,6 +106,7 @@ int main(int argc, char** argv) terminal.apply_size_increments_to_window(*window); window->show(); window->set_icon_path("/res/icons/16x16/app-terminal.png"); + terminal.set_should_beep(config->read_num_entry("Window", "AudibleBeep", 1) == 1); auto* opacity_adjustment_window = new GWindow; opacity_adjustment_window->set_title("Adjust opacity"); @@ -124,6 +125,23 @@ int main(int argc, char** argv) slider->set_range(0, 100); slider->set_value(100); + auto* beep_choice_window = new GWindow; + beep_choice_window->set_title("Terminal beep settings"); + beep_choice_window->set_rect(50, 50, 200, 100); + + auto* radio_buttons = new GWidget; + beep_choice_window->set_main_widget(radio_buttons); + radio_buttons->set_fill_with_background_color(true); + radio_buttons->set_layout(make<GBoxLayout>(Orientation::Vertical)); + radio_buttons->layout()->set_margins({ 4, 4, 4, 4 }); + + auto* sysbell_radio = new GRadioButton("Use (Audible) System Bell", radio_buttons); + auto* visbell_radio = new GRadioButton("Use (Visual) Terminal Bell", radio_buttons); + sysbell_radio->set_checked(terminal.should_beep()); + sysbell_radio->on_checked = [&terminal] (const bool res) { + terminal.set_should_beep(res); + }; + auto new_opacity = config->read_num_entry("Window", "Opacity", 255); terminal.set_opacity((float)new_opacity / 255.0); @@ -131,8 +149,11 @@ int main(int argc, char** argv) auto app_menu = make<GMenu>("Terminal"); app_menu->add_action(GAction::create("Adjust opacity...", [opacity_adjustment_window] (const GAction&) { - opacity_adjustment_window->show(); - })); + opacity_adjustment_window->show(); + })); + app_menu->add_action(GAction::create("Change audio output...", [beep_choice_window] (const GAction&) { + beep_choice_window->show(); + })); app_menu->add_action(GAction::create("Quit", { Mod_Alt, Key_F4 }, [] (const GAction&) { dbgprintf("Terminal: Quit menu activated!\n"); GApplication::the().quit(0); |