diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-09-21 20:32:31 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-09-21 20:32:31 +0200 |
commit | 31b38ed88f3db123c498379f4615d2dce1ded406 (patch) | |
tree | a64bc5a935482193470d443c5cdcd70ad96472d6 /Applications/IRCClient | |
parent | defafd72bc771034d615d56fe3fc5f71a7f707e5 (diff) | |
download | serenity-31b38ed88f3db123c498379f4615d2dce1ded406.zip |
LibGUI: Don't create GMessageBox and GInputBox on the stack
We need to get rid of all instances of widgets-on-the-stack since that
will no longer work in the ref-counting world.
Diffstat (limited to 'Applications/IRCClient')
-rw-r--r-- | Applications/IRCClient/IRCAppWindow.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/Applications/IRCClient/IRCAppWindow.cpp b/Applications/IRCClient/IRCAppWindow.cpp index 45285216ae..f405c43285 100644 --- a/Applications/IRCClient/IRCAppWindow.cpp +++ b/Applications/IRCClient/IRCAppWindow.cpp @@ -68,12 +68,12 @@ void IRCAppWindow::setup_client() }; if (m_client.hostname().is_empty()) { - GInputBox input_box("Enter server:", "Connect to server", this); - auto result = input_box.exec(); + auto input_box = GInputBox::construct("Enter server:", "Connect to server", this); + auto result = input_box->exec(); if (result == GInputBox::ExecCancel) ::exit(0); - m_client.set_server(input_box.text_value(), 6667); + m_client.set_server(input_box->text_value(), 6667); } update_title(); bool success = m_client.connect(); @@ -83,9 +83,9 @@ void IRCAppWindow::setup_client() void IRCAppWindow::setup_actions() { m_join_action = GAction::create("Join channel", GraphicsBitmap::load_from_file("/res/icons/16x16/irc-join.png"), [&](auto&) { - GInputBox input_box("Enter channel name:", "Join channel", this); - if (input_box.exec() == GInputBox::ExecOK && !input_box.text_value().is_empty()) - m_client.handle_join_action(input_box.text_value()); + auto input_box = GInputBox::construct("Enter channel name:", "Join channel", this); + if (input_box->exec() == GInputBox::ExecOK && !input_box->text_value().is_empty()) + m_client.handle_join_action(input_box->text_value()); }); m_part_action = GAction::create("Part from channel", GraphicsBitmap::load_from_file("/res/icons/16x16/irc-part.png"), [this](auto&) { @@ -98,15 +98,15 @@ void IRCAppWindow::setup_actions() }); m_whois_action = GAction::create("Whois user", GraphicsBitmap::load_from_file("/res/icons/16x16/irc-whois.png"), [&](auto&) { - GInputBox input_box("Enter nickname:", "IRC WHOIS lookup", this); - if (input_box.exec() == GInputBox::ExecOK && !input_box.text_value().is_empty()) - m_client.handle_whois_action(input_box.text_value()); + auto input_box = GInputBox::construct("Enter nickname:", "IRC WHOIS lookup", this); + if (input_box->exec() == GInputBox::ExecOK && !input_box->text_value().is_empty()) + m_client.handle_whois_action(input_box->text_value()); }); m_open_query_action = GAction::create("Open query", GraphicsBitmap::load_from_file("/res/icons/16x16/irc-open-query.png"), [&](auto&) { - GInputBox input_box("Enter nickname:", "Open IRC query with...", this); - if (input_box.exec() == GInputBox::ExecOK && !input_box.text_value().is_empty()) - m_client.handle_open_query_action(input_box.text_value()); + auto input_box = GInputBox::construct("Enter nickname:", "Open IRC query with...", this); + if (input_box->exec() == GInputBox::ExecOK && !input_box->text_value().is_empty()) + m_client.handle_open_query_action(input_box->text_value()); }); m_close_query_action = GAction::create("Close query", GraphicsBitmap::load_from_file("/res/icons/16x16/irc-close-query.png"), [](auto&) { @@ -114,9 +114,9 @@ void IRCAppWindow::setup_actions() }); m_change_nick_action = GAction::create("Change nickname", GraphicsBitmap::load_from_file("/res/icons/16x16/irc-nick.png"), [this](auto&) { - GInputBox input_box("Enter nickname:", "Change nickname", this); - if (input_box.exec() == GInputBox::ExecOK && !input_box.text_value().is_empty()) - m_client.handle_change_nick_action(input_box.text_value()); + auto input_box = GInputBox::construct("Enter nickname:", "Change nickname", this); + if (input_box->exec() == GInputBox::ExecOK && !input_box->text_value().is_empty()) + m_client.handle_change_nick_action(input_box->text_value()); }); } |