summaryrefslogtreecommitdiff
path: root/Userland/Applications/BrowserSettings
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Applications/BrowserSettings')
-rw-r--r--Userland/Applications/BrowserSettings/BrowserSettingsWidget.cpp32
-rw-r--r--Userland/Applications/BrowserSettings/ContentFilterSettingsWidget.cpp6
-rw-r--r--Userland/Applications/BrowserSettings/main.cpp6
3 files changed, 22 insertions, 22 deletions
diff --git a/Userland/Applications/BrowserSettings/BrowserSettingsWidget.cpp b/Userland/Applications/BrowserSettings/BrowserSettingsWidget.cpp
index fc739bb803..9a5fb3417f 100644
--- a/Userland/Applications/BrowserSettings/BrowserSettingsWidget.cpp
+++ b/Userland/Applications/BrowserSettings/BrowserSettingsWidget.cpp
@@ -62,22 +62,22 @@ BrowserSettingsWidget::BrowserSettingsWidget()
load_from_gml(browser_settings_widget_gml);
m_homepage_url_textbox = find_descendant_of_type_named<GUI::TextBox>("homepage_url_textbox");
- m_homepage_url_textbox->set_text(Config::read_string("Browser", "Preferences", "Home", default_homepage_url), GUI::AllowCallback::No);
+ m_homepage_url_textbox->set_text(Config::read_string("Browser"sv, "Preferences"sv, "Home"sv, default_homepage_url), GUI::AllowCallback::No);
m_homepage_url_textbox->on_change = [&]() { set_modified(true); };
m_new_tab_url_textbox = find_descendant_of_type_named<GUI::TextBox>("new_tab_url_textbox");
- m_new_tab_url_textbox->set_text(Config::read_string("Browser", "Preferences", "NewTab", default_new_tab_url), GUI::AllowCallback::No);
+ m_new_tab_url_textbox->set_text(Config::read_string("Browser"sv, "Preferences"sv, "NewTab"sv, default_new_tab_url), GUI::AllowCallback::No);
m_new_tab_url_textbox->on_change = [&]() { set_modified(true); };
m_color_scheme_combobox = find_descendant_of_type_named<GUI::ComboBox>("color_scheme_combobox");
m_color_scheme_combobox->set_only_allow_values_from_model(true);
m_color_scheme_combobox->set_model(adopt_ref(*new ColorSchemeModel()));
m_color_scheme_combobox->set_selected_index(0, GUI::AllowCallback::No);
- set_color_scheme(Config::read_string("Browser", "Preferences", "ColorScheme", default_color_scheme));
+ set_color_scheme(Config::read_string("Browser"sv, "Preferences"sv, "ColorScheme"sv, default_color_scheme));
m_color_scheme_combobox->on_change = [&](auto, auto) { set_modified(true); };
m_show_bookmarks_bar_checkbox = find_descendant_of_type_named<GUI::CheckBox>("show_bookmarks_bar_checkbox");
- m_show_bookmarks_bar_checkbox->set_checked(Config::read_bool("Browser", "Preferences", "ShowBookmarksBar", default_show_bookmarks_bar), GUI::AllowCallback::No);
+ m_show_bookmarks_bar_checkbox->set_checked(Config::read_bool("Browser"sv, "Preferences"sv, "ShowBookmarksBar"sv, default_show_bookmarks_bar), GUI::AllowCallback::No);
m_show_bookmarks_bar_checkbox->on_checked = [&](auto) { set_modified(true); };
m_enable_search_engine_checkbox = find_descendant_of_type_named<GUI::CheckBox>("enable_search_engine_checkbox");
@@ -111,10 +111,10 @@ BrowserSettingsWidget::BrowserSettingsWidget()
m_custom_search_engine_group->set_enabled(m_is_custom_search_engine);
set_modified(true);
};
- set_search_engine_url(Config::read_string("Browser", "Preferences", "SearchEngine", default_search_engine));
+ set_search_engine_url(Config::read_string("Browser"sv, "Preferences"sv, "SearchEngine"sv, default_search_engine));
m_auto_close_download_windows_checkbox = find_descendant_of_type_named<GUI::CheckBox>("auto_close_download_windows_checkbox");
- m_auto_close_download_windows_checkbox->set_checked(Config::read_bool("Browser", "Preferences", "CloseDownloadWidgetOnFinish", default_auto_close_download_windows), GUI::AllowCallback::No);
+ m_auto_close_download_windows_checkbox->set_checked(Config::read_bool("Browser"sv, "Preferences"sv, "CloseDownloadWidgetOnFinish"sv, default_auto_close_download_windows), GUI::AllowCallback::No);
m_auto_close_download_windows_checkbox->on_checked = [&](auto) { set_modified(true); };
}
@@ -170,39 +170,39 @@ void BrowserSettingsWidget::apply_settings()
{
auto homepage_url = m_homepage_url_textbox->text();
if (!URL(homepage_url).is_valid()) {
- GUI::MessageBox::show_error(this->window(), "The homepage URL you have entered is not valid");
+ GUI::MessageBox::show_error(this->window(), "The homepage URL you have entered is not valid"sv);
m_homepage_url_textbox->select_all();
m_homepage_url_textbox->set_focus(true);
return;
}
- Config::write_string("Browser", "Preferences", "Home", homepage_url);
+ Config::write_string("Browser"sv, "Preferences"sv, "Home"sv, homepage_url);
auto new_tab_url = m_new_tab_url_textbox->text();
if (!URL(new_tab_url).is_valid()) {
- GUI::MessageBox::show_error(this->window(), "The new tab URL you have entered is not valid");
+ GUI::MessageBox::show_error(this->window(), "The new tab URL you have entered is not valid"sv);
m_new_tab_url_textbox->select_all();
m_new_tab_url_textbox->set_focus(true);
return;
}
- Config::write_string("Browser", "Preferences", "NewTab", new_tab_url);
+ Config::write_string("Browser"sv, "Preferences"sv, "NewTab"sv, new_tab_url);
- Config::write_bool("Browser", "Preferences", "ShowBookmarksBar", m_show_bookmarks_bar_checkbox->is_checked());
+ Config::write_bool("Browser"sv, "Preferences"sv, "ShowBookmarksBar"sv, m_show_bookmarks_bar_checkbox->is_checked());
auto color_scheme_index = m_color_scheme_combobox->selected_index();
auto color_scheme = m_color_scheme_combobox->model()->index(color_scheme_index, 1).data().to_string();
- Config::write_string("Browser", "Preferences", "ColorScheme", color_scheme);
+ Config::write_string("Browser"sv, "Preferences"sv, "ColorScheme"sv, color_scheme);
if (!m_enable_search_engine_checkbox->is_checked()) {
- Config::write_string("Browser", "Preferences", "SearchEngine", {});
+ Config::write_string("Browser"sv, "Preferences"sv, "SearchEngine"sv, {});
} else if (m_is_custom_search_engine) {
- Config::write_string("Browser", "Preferences", "SearchEngine", m_custom_search_engine_textbox->text());
+ Config::write_string("Browser"sv, "Preferences"sv, "SearchEngine"sv, m_custom_search_engine_textbox->text());
} else {
auto selected_index = m_search_engine_combobox->selected_index();
auto url = m_search_engine_combobox->model()->index(selected_index, 1).data().to_string();
- Config::write_string("Browser", "Preferences", "SearchEngine", url);
+ Config::write_string("Browser"sv, "Preferences"sv, "SearchEngine"sv, url);
}
- Config::write_bool("Browser", "Preferences", "CloseDownloadWidgetOnFinish", m_auto_close_download_windows_checkbox->is_checked());
+ Config::write_bool("Browser"sv, "Preferences"sv, "CloseDownloadWidgetOnFinish"sv, m_auto_close_download_windows_checkbox->is_checked());
}
void BrowserSettingsWidget::reset_default_values()
diff --git a/Userland/Applications/BrowserSettings/ContentFilterSettingsWidget.cpp b/Userland/Applications/BrowserSettings/ContentFilterSettingsWidget.cpp
index 7770fc083e..8d583c08f2 100644
--- a/Userland/Applications/BrowserSettings/ContentFilterSettingsWidget.cpp
+++ b/Userland/Applications/BrowserSettings/ContentFilterSettingsWidget.cpp
@@ -114,13 +114,13 @@ ContentFilterSettingsWidget::ContentFilterSettingsWidget()
m_domain_list_view = find_descendant_of_type_named<GUI::ListView>("domain_list_view");
m_add_new_domain_button = find_descendant_of_type_named<GUI::Button>("add_new_domain_button");
- m_enable_content_filtering_checkbox->set_checked(Config::read_bool("Browser", "Preferences", "EnableContentFilters", s_default_enable_content_filtering), GUI::AllowCallback::No);
+ m_enable_content_filtering_checkbox->set_checked(Config::read_bool("Browser"sv, "Preferences"sv, "EnableContentFilters"sv, s_default_enable_content_filtering), GUI::AllowCallback::No);
m_enable_content_filtering_checkbox->on_checked = [&](auto) { set_modified(true); };
m_add_new_domain_button->on_click = [&](unsigned) {
String text;
- if (GUI::InputBox::show(window(), text, "Enter domain name", "Add domain to Content Filter") == GUI::Dialog::ExecResult::OK
+ if (GUI::InputBox::show(window(), text, "Enter domain name"sv, "Add domain to Content Filter"sv) == GUI::Dialog::ExecResult::OK
&& !text.is_empty()) {
m_domain_list_model->add_domain(std::move(text));
set_modified(true);
@@ -151,7 +151,7 @@ void ContentFilterSettingsWidget::apply_settings()
{
// FIXME: Propagate errors
MUST(m_domain_list_model->save());
- Config::write_bool("Browser", "Preferences", "EnableContentFilters", m_enable_content_filtering_checkbox->is_checked());
+ Config::write_bool("Browser"sv, "Preferences"sv, "EnableContentFilters"sv, m_enable_content_filtering_checkbox->is_checked());
}
void ContentFilterSettingsWidget::reset_default_values()
diff --git a/Userland/Applications/BrowserSettings/main.cpp b/Userland/Applications/BrowserSettings/main.cpp
index 4c4527b5f5..bfcbf26b54 100644
--- a/Userland/Applications/BrowserSettings/main.cpp
+++ b/Userland/Applications/BrowserSettings/main.cpp
@@ -30,12 +30,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(Core::System::unveil("/home/anon/.config/BrowserContentFilters.txt", "rwc"));
TRY(Core::System::unveil(nullptr, nullptr));
- auto app_icon = GUI::Icon::default_icon("app-browser");
+ auto app_icon = GUI::Icon::default_icon("app-browser"sv);
auto window = TRY(GUI::SettingsWindow::create("Browser Settings", GUI::SettingsWindow::ShowDefaultsButton::Yes));
window->set_icon(app_icon.bitmap_for_size(16));
- (void)TRY(window->add_tab<BrowserSettingsWidget>("Browser", "browser"));
- (void)TRY(window->add_tab<ContentFilterSettingsWidget>("Content Filtering", "content-filtering"));
+ (void)TRY(window->add_tab<BrowserSettingsWidget>("Browser"sv, "browser"sv));
+ (void)TRY(window->add_tab<ContentFilterSettingsWidget>("Content Filtering"sv, "content-filtering"sv));
window->set_active_tab(selected_tab);
window->show();