Diffstat (limited to 'noncore/net/opieirc/ircserverlist.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opieirc/ircserverlist.cpp | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/noncore/net/opieirc/ircserverlist.cpp b/noncore/net/opieirc/ircserverlist.cpp new file mode 100644 index 0000000..964fa13 --- a/dev/null +++ b/noncore/net/opieirc/ircserverlist.cpp @@ -0,0 +1,55 @@ +#include <qlayout.h> +#include <qlabel.h> +#include <qhbox.h> +#include <qpushbutton.h> +#include "ircserverlist.h" +#include "ircservereditor.h" + +class IRCListBoxServer : public QListBoxText { +public: + IRCListBoxServer(IRCServer server); + QString text(); +}; + +IRCServerList::IRCServerList(QWidget* parent, const char *name, bool modal, WFlags f) : QDialog(parent, name, modal, f) { + QVBoxLayout *layout = new QVBoxLayout(this, 5, 5); + setCaption(tr("Serverlist Browser")); + m_config = new Config("OpieIRC"); + m_config->setGroup("OpieIRC"); + QLabel *label = new QLabel(tr("Please choose a server profile"), this); + layout->addWidget(label); + m_list = new QListBox(this); + layout->addWidget(m_list); + QHBox *buttons = new QHBox(this); + QPushButton *del = new QPushButton(tr("Delete"), buttons); + QPushButton *edit = new QPushButton(tr("Edit"), buttons); + QPushButton *add = new QPushButton(tr("Add"), buttons); + connect(del, SIGNAL(clicked()), this, SLOT(delServer())); + connect(edit, SIGNAL(clicked()), this, SLOT(editServer())); + connect(add, SIGNAL(clicked()), this, SLOT(addServer())); + layout->addWidget(buttons); + showMaximized(); +} + +void IRCServerList::addServer() { + IRCServer server; + IRCServerEditor editor(server, this, "ServerEditor", TRUE); + if (editor.exec() == QDialog::Accepted) { + server = editor.getServer(); + //m_servers->append(server); + update(); + } +} + +void IRCServerList::delServer() { +} + +void IRCServerList::editServer() { +} + +void IRCServerList::update() { +} + +IRCServerList::~IRCServerList() { + delete m_config; +} |