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 @@ | |||
1 | #include <qlayout.h> | ||
2 | #include <qlabel.h> | ||
3 | #include <qhbox.h> | ||
4 | #include <qpushbutton.h> | ||
5 | #include "ircserverlist.h" | ||
6 | #include "ircservereditor.h" | ||
7 | |||
8 | class IRCListBoxServer : public QListBoxText { | ||
9 | public: | ||
10 | IRCListBoxServer(IRCServer server); | ||
11 | QString text(); | ||
12 | }; | ||
13 | |||
14 | IRCServerList::IRCServerList(QWidget* parent, const char *name, bool modal, WFlags f) : QDialog(parent, name, modal, f) { | ||
15 | QVBoxLayout *layout = new QVBoxLayout(this, 5, 5); | ||
16 | setCaption(tr("Serverlist Browser")); | ||
17 | m_config = new Config("OpieIRC"); | ||
18 | m_config->setGroup("OpieIRC"); | ||
19 | QLabel *label = new QLabel(tr("Please choose a server profile"), this); | ||
20 | layout->addWidget(label); | ||
21 | m_list = new QListBox(this); | ||
22 | layout->addWidget(m_list); | ||
23 | QHBox *buttons = new QHBox(this); | ||
24 | QPushButton *del = new QPushButton(tr("Delete"), buttons); | ||
25 | QPushButton *edit = new QPushButton(tr("Edit"), buttons); | ||
26 | QPushButton *add = new QPushButton(tr("Add"), buttons); | ||
27 | connect(del, SIGNAL(clicked()), this, SLOT(delServer())); | ||
28 | connect(edit, SIGNAL(clicked()), this, SLOT(editServer())); | ||
29 | connect(add, SIGNAL(clicked()), this, SLOT(addServer())); | ||
30 | layout->addWidget(buttons); | ||
31 | showMaximized(); | ||
32 | } | ||
33 | |||
34 | void IRCServerList::addServer() { | ||
35 | IRCServer server; | ||
36 | IRCServerEditor editor(server, this, "ServerEditor", TRUE); | ||
37 | if (editor.exec() == QDialog::Accepted) { | ||
38 | server = editor.getServer(); | ||
39 | //m_servers->append(server); | ||
40 | update(); | ||
41 | } | ||
42 | } | ||
43 | |||
44 | void IRCServerList::delServer() { | ||
45 | } | ||
46 | |||
47 | void IRCServerList::editServer() { | ||
48 | } | ||
49 | |||
50 | void IRCServerList::update() { | ||
51 | } | ||
52 | |||
53 | IRCServerList::~IRCServerList() { | ||
54 | delete m_config; | ||
55 | } | ||