diff options
-rw-r--r-- | Userland/Applications/BrowserSettings/main.cpp | 2 | ||||
-rw-r--r-- | Userland/Applications/DisplaySettings/main.cpp | 8 | ||||
-rw-r--r-- | Userland/Applications/KeyboardSettings/main.cpp | 2 | ||||
-rw-r--r-- | Userland/Applications/MailSettings/main.cpp | 2 | ||||
-rw-r--r-- | Userland/Applications/MouseSettings/main.cpp | 4 | ||||
-rw-r--r-- | Userland/Applications/TerminalSettings/main.cpp | 4 | ||||
-rw-r--r-- | Userland/Libraries/LibGUI/SettingsWindow.h | 8 |
7 files changed, 15 insertions, 15 deletions
diff --git a/Userland/Applications/BrowserSettings/main.cpp b/Userland/Applications/BrowserSettings/main.cpp index 3d35037b03..0ac3903415 100644 --- a/Userland/Applications/BrowserSettings/main.cpp +++ b/Userland/Applications/BrowserSettings/main.cpp @@ -26,7 +26,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) auto window = TRY(GUI::SettingsWindow::try_create("Browser Settings", GUI::SettingsWindow::ShowDefaultsButton::Yes)); window->set_icon(app_icon.bitmap_for_size(16)); - window->add_tab<BrowserSettingsWidget>("Browser"); + TRY(window->add_tab<BrowserSettingsWidget>("Browser")); window->show(); return app->exec(); diff --git a/Userland/Applications/DisplaySettings/main.cpp b/Userland/Applications/DisplaySettings/main.cpp index fbfd8490b2..66ac660196 100644 --- a/Userland/Applications/DisplaySettings/main.cpp +++ b/Userland/Applications/DisplaySettings/main.cpp @@ -27,10 +27,10 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) auto app_icon = GUI::Icon::default_icon("app-display-settings"); auto window = TRY(GUI::SettingsWindow::try_create("Display Settings")); - window->add_tab<DisplaySettings::BackgroundSettingsWidget>("Background"); - window->add_tab<DisplaySettings::FontSettingsWidget>("Fonts"); - window->add_tab<DisplaySettings::MonitorSettingsWidget>("Monitor"); - window->add_tab<DisplaySettings::DesktopSettingsWidget>("Workspaces"); + TRY(window->add_tab<DisplaySettings::BackgroundSettingsWidget>("Background")); + TRY(window->add_tab<DisplaySettings::FontSettingsWidget>("Fonts")); + TRY(window->add_tab<DisplaySettings::MonitorSettingsWidget>("Monitor")); + TRY(window->add_tab<DisplaySettings::DesktopSettingsWidget>("Workspaces")); window->set_icon(app_icon.bitmap_for_size(16)); diff --git a/Userland/Applications/KeyboardSettings/main.cpp b/Userland/Applications/KeyboardSettings/main.cpp index 93bbbda3f5..8e1ea89090 100644 --- a/Userland/Applications/KeyboardSettings/main.cpp +++ b/Userland/Applications/KeyboardSettings/main.cpp @@ -31,7 +31,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) auto window = TRY(GUI::SettingsWindow::try_create("Keyboard Settings")); window->set_icon(app_icon.bitmap_for_size(16)); - window->add_tab<KeyboardSettingsWidget>("Keyboard"); + TRY(window->add_tab<KeyboardSettingsWidget>("Keyboard")); window->show(); return app->exec(); diff --git a/Userland/Applications/MailSettings/main.cpp b/Userland/Applications/MailSettings/main.cpp index f6dc69e3b6..8f4129642d 100644 --- a/Userland/Applications/MailSettings/main.cpp +++ b/Userland/Applications/MailSettings/main.cpp @@ -28,7 +28,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) auto app_icon = GUI::Icon::default_icon("app-mail"); auto window = GUI::SettingsWindow::construct("Mail Settings", GUI::SettingsWindow::ShowDefaultsButton::Yes); - window->add_tab<MailSettingsWidget>("Mail"); + TRY(window->add_tab<MailSettingsWidget>("Mail")); window->set_icon(app_icon.bitmap_for_size(16)); window->show(); diff --git a/Userland/Applications/MouseSettings/main.cpp b/Userland/Applications/MouseSettings/main.cpp index c795f2748a..e09aa91f70 100644 --- a/Userland/Applications/MouseSettings/main.cpp +++ b/Userland/Applications/MouseSettings/main.cpp @@ -26,8 +26,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) auto app_icon = GUI::Icon::default_icon("app-mouse"); auto window = TRY(GUI::SettingsWindow::try_create("Mouse Settings", GUI::SettingsWindow::ShowDefaultsButton::Yes)); - window->add_tab<MouseWidget>("Mouse"); - window->add_tab<ThemeWidget>("Cursor Theme"); + TRY(window->add_tab<MouseWidget>("Mouse")); + TRY(window->add_tab<ThemeWidget>("Cursor Theme")); window->set_icon(app_icon.bitmap_for_size(16)); window->show(); diff --git a/Userland/Applications/TerminalSettings/main.cpp b/Userland/Applications/TerminalSettings/main.cpp index 032df20eb1..8b796ab104 100644 --- a/Userland/Applications/TerminalSettings/main.cpp +++ b/Userland/Applications/TerminalSettings/main.cpp @@ -28,8 +28,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) auto window = TRY(GUI::SettingsWindow::try_create("Terminal Settings")); window->set_icon(app_icon.bitmap_for_size(16)); - window->add_tab<TerminalSettingsMainWidget>("Terminal"); - window->add_tab<TerminalSettingsViewWidget>("View"); + TRY(window->add_tab<TerminalSettingsMainWidget>("Terminal")); + TRY(window->add_tab<TerminalSettingsViewWidget>("View")); window->show(); return app->exec(); diff --git a/Userland/Libraries/LibGUI/SettingsWindow.h b/Userland/Libraries/LibGUI/SettingsWindow.h index f68d0922c7..d942ff4c73 100644 --- a/Userland/Libraries/LibGUI/SettingsWindow.h +++ b/Userland/Libraries/LibGUI/SettingsWindow.h @@ -32,11 +32,11 @@ public: virtual ~SettingsWindow() override; template<class T, class... Args> - T& add_tab(StringView const& title, Args&&... args) + ErrorOr<NonnullRefPtr<T>> add_tab(String title, Args&&... args) { - auto& t = m_tab_widget->add_tab<T>(title, forward<Args>(args)...); - m_tabs.append(t); - return t; + auto tab = TRY(m_tab_widget->try_add_tab<T>(move(title), forward<Args>(args)...)); + TRY(m_tabs.try_append(tab)); + return tab; } private: |