1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-02 23:22:07 +00:00

IRCClient: Ask the user which IRC server to connect to on startup.

This commit is contained in:
Andreas Kling 2019-04-02 20:40:45 +02:00
parent 76ce68ac48
commit cc20eef7ef
3 changed files with 20 additions and 8 deletions

View file

@ -12,9 +12,9 @@
#include <LibGUI/GInputBox.h>
#include <LibGUI/GSplitter.h>
#include <stdio.h>
#include <stdlib.h>
IRCAppWindow::IRCAppWindow()
: m_client("127.0.0.1", 6667)
{
update_title();
set_rect(200, 200, 600, 400);
@ -52,6 +52,13 @@ void IRCAppWindow::setup_client()
m_client.join_channel("#test");
};
GInputBox input_box("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);
update_title();
m_client.connect();
}