author | wazlaf <wazlaf> | 2002-09-20 23:28:14 (UTC) |
---|---|---|
committer | wazlaf <wazlaf> | 2002-09-20 23:28:14 (UTC) |
commit | 912092425248f7fc5155b4c7c46b7d00ec2676bc (patch) (side-by-side diff) | |
tree | 5bbf746e83b2dffad89542c42031a573c34da751 /noncore/net/opieirc/ircservereditor.cpp | |
parent | cd3df897c1b0ed93c2be3ab411011a0bdfe88bf9 (diff) | |
download | opie-912092425248f7fc5155b4c7c46b7d00ec2676bc.zip opie-912092425248f7fc5155b4c7c46b7d00ec2676bc.tar.gz opie-912092425248f7fc5155b4c7c46b7d00ec2676bc.tar.bz2 |
support for client commands (only /join implemented so far), crash bugfix, fixed 2 leaks, server browser now includes a channel list
Diffstat (limited to 'noncore/net/opieirc/ircservereditor.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opieirc/ircservereditor.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/noncore/net/opieirc/ircservereditor.cpp b/noncore/net/opieirc/ircservereditor.cpp index 798081f..c3a444d 100644 --- a/noncore/net/opieirc/ircservereditor.cpp +++ b/noncore/net/opieirc/ircservereditor.cpp @@ -6,3 +6,3 @@ IRCServerEditor::IRCServerEditor(IRCServer server, QWidget* parent, const char* name, bool modal = FALSE, WFlags f) : QDialog(parent, name, modal, f) { - QGridLayout *layout = new QGridLayout(this, 6, 2, 5, 5); + QGridLayout *layout = new QGridLayout(this, 7, 2, 5, 5); QLabel *label = new QLabel(tr("Profile name :"), this); @@ -31,2 +31,6 @@ IRCServerEditor::IRCServerEditor(IRCServer server, QWidget* parent, const char* layout->addWidget(m_password, 5, 1); + label = new QLabel(tr("Channels :"), this); + m_channels = new QLineEdit(server.channels(), this); + layout->addWidget(label, 6, 0); + layout->addWidget(m_channels, 6, 1); showMaximized(); @@ -46,4 +50,14 @@ void IRCServerEditor::accept() { QMessageBox::critical(this, tr("Error"), tr("Realname required")); - else + else { + /* Now verify whether the channel list has a valid format */ + QStringList channels = QStringList::split(QChar(','), m_channels->text()); + for (QStringList::Iterator it = channels.begin(); it != channels.end(); ++it) { + QString channelName = (*it).stripWhiteSpace(); + if (!channelName.startsWith("#")) { + QMessageBox::critical(this, tr("Error"), tr("The channel list needs to contain a\ncomma separated list of channel\n names which start with '#'")); + return; + } + } QDialog::accept(); + } } @@ -59,2 +73,3 @@ IRCServer IRCServerEditor::getServer() { server.setPassword(m_password->text()); + server.setChannels(m_channels->text()); return server; |