1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:27:44 +00:00

can now tile background and made sure the IRC choose server popup still works

This commit is contained in:
Christopher Dumas 2019-05-26 10:14:03 -07:00 committed by Andreas Kling
parent 50154a23cb
commit c23882dde1
15 changed files with 127 additions and 44 deletions

View file

@ -48,11 +48,8 @@ void IRCAppWindow::setup_client()
m_client.on_nickname_changed = [this] (const String&) {
update_title();
};
m_client.on_connect = [this] {
m_client.join_channel("#test");
};
if (m_client.hostname() == "none") {
if (m_client.hostname().is_empty()) {
GInputBox input_box("Enter server:", "Connect to server", this);
auto result = input_box.exec();
if (result == GInputBox::ExecCancel)

View file

@ -35,7 +35,7 @@ IRCClient::IRCClient()
{
m_socket = new CTCPSocket(this);
m_nickname = m_config->read_entry("User", "Nickname", "seren1ty");
m_hostname = m_config->read_entry("Connection", "Server", "chat.freenode.net");
m_hostname = m_config->read_entry("Connection", "Server", "");
m_port = m_config->read_num_entry("Connection", "Port", 6667);
}
@ -47,6 +47,9 @@ void IRCClient::set_server(const String &hostname, int port)
{
m_hostname = hostname;
m_port = port;
m_config->write_entry("Connection", "Server", hostname);
m_config->write_num_entry("Connection", "Port", port);
m_config->sync();
}
void IRCClient::on_socket_connected()
@ -61,7 +64,7 @@ void IRCClient::on_socket_connected()
auto channel_str = m_config->read_entry("Connection", "AutoJoinChannels", "#test");
dbgprintf("IRCClient: Channels to autojoin: %s\n", channel_str.characters());
auto channels = channel_str.split(',');
for (auto channel : channels) {
for (auto& channel : channels) {
join_channel(channel);
dbgprintf("IRCClient: Auto joining channel: %s\n", channel.characters());
}

View file

@ -112,7 +112,7 @@ private:
void on_socket_connected();
String m_hostname { "none" };
String m_hostname;
int m_port { 6667 };
CTCPSocket* m_socket { nullptr };