summaryrefslogtreecommitdiff
authorwazlaf <wazlaf>2002-09-11 22:22:04 (UTC)
committer wazlaf <wazlaf>2002-09-11 22:22:04 (UTC)
commit4864665ad76095620fdf5aa19d24f05967f32b40 (patch) (unidiff)
tree4b3e371b5da03292ce09f7e388885dd3ec049ff8
parent7ab82ad13aaf708ffba4bf4294d29b789007ddde (diff)
downloadopie-4864665ad76095620fdf5aa19d24f05967f32b40.zip
opie-4864665ad76095620fdf5aa19d24f05967f32b40.tar.gz
opie-4864665ad76095620fdf5aa19d24f05967f32b40.tar.bz2
serverlist browser
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieirc/.cvsignore3
-rw-r--r--noncore/net/opieirc/ircquerytab.cpp2
-rw-r--r--noncore/net/opieirc/ircquerytab.h24
-rw-r--r--noncore/net/opieirc/ircserver.cpp10
-rw-r--r--noncore/net/opieirc/ircserver.h6
-rw-r--r--noncore/net/opieirc/ircservereditor.cpp44
-rw-r--r--noncore/net/opieirc/ircservereditor.h5
-rw-r--r--noncore/net/opieirc/ircserverlist.cpp90
-rw-r--r--noncore/net/opieirc/ircserverlist.h12
-rw-r--r--noncore/net/opieirc/ircservertab.cpp9
-rw-r--r--noncore/net/opieirc/ircservertab.h4
-rw-r--r--noncore/net/opieirc/mainwindow.cpp23
-rw-r--r--noncore/net/opieirc/opieirc.pro6
13 files changed, 175 insertions, 63 deletions
diff --git a/noncore/net/opieirc/.cvsignore b/noncore/net/opieirc/.cvsignore
new file mode 100644
index 0000000..39391f4
--- a/dev/null
+++ b/noncore/net/opieirc/.cvsignore
@@ -0,0 +1,3 @@
1Makefile
2Makefile.in
3moc_*.cpp
diff --git a/noncore/net/opieirc/ircquerytab.cpp b/noncore/net/opieirc/ircquerytab.cpp
new file mode 100644
index 0000000..6d24845
--- a/dev/null
+++ b/noncore/net/opieirc/ircquerytab.cpp
@@ -0,0 +1,2 @@
1#include "ircquerytab.h"
2
diff --git a/noncore/net/opieirc/ircquerytab.h b/noncore/net/opieirc/ircquerytab.h
new file mode 100644
index 0000000..fac976d
--- a/dev/null
+++ b/noncore/net/opieirc/ircquerytab.h
@@ -0,0 +1,24 @@
1/*
2 OpieIRC - An embedded IRC client
3 Copyright (C) 2002 Wenzel Jakob
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
19*/
20
21#ifndef __IRCQUERYTAB_H
22#define __IRCQUERYTAB_H
23
24#endif /* __IRCQUERYTAB_H */
diff --git a/noncore/net/opieirc/ircserver.cpp b/noncore/net/opieirc/ircserver.cpp
index 33a788b..e16e2b2 100644
--- a/noncore/net/opieirc/ircserver.cpp
+++ b/noncore/net/opieirc/ircserver.cpp
@@ -1,15 +1,15 @@
1#include "ircserver.h" 1#include "ircserver.h"
2 2
3IRCServer::IRCServer() { 3IRCServer::IRCServer() {
4 m_port = 0; 4 m_port = 6667;
5} 5}
6 6
7void IRCServer::setHostname(QString hostname) { 7void IRCServer::setHostname(QString hostname) {
8 m_hostname = hostname; 8 m_hostname = hostname;
9} 9}
10 10
11void IRCServer::setDescription(QString description) { 11void IRCServer::setName(QString name) {
12 m_description = description; 12 m_name = name;
13} 13}
14 14
15void IRCServer::setPort(int port) { 15void IRCServer::setPort(int port) {
@@ -36,8 +36,8 @@ QString IRCServer::hostname() {
36 return m_hostname; 36 return m_hostname;
37} 37}
38 38
39QString IRCServer::description() { 39QString IRCServer::name() {
40 return m_description; 40 return m_name;
41} 41}
42 42
43unsigned short int IRCServer::port() { 43unsigned short int IRCServer::port() {
diff --git a/noncore/net/opieirc/ircserver.h b/noncore/net/opieirc/ircserver.h
index 5f06c73..f56f231 100644
--- a/noncore/net/opieirc/ircserver.h
+++ b/noncore/net/opieirc/ircserver.h
@@ -30,8 +30,8 @@ class IRCServer {
30public: 30public:
31 IRCServer(); 31 IRCServer();
32 32
33 void setName(QString name);
33 void setHostname(QString hostname); 34 void setHostname(QString hostname);
34 void setDescription(QString description);
35 void setPort(int port); 35 void setPort(int port);
36 void setUsername(QString username); 36 void setUsername(QString username);
37 void setPassword(QString password); 37 void setPassword(QString password);
@@ -39,7 +39,7 @@ public:
39 void setRealname(QString realname); 39 void setRealname(QString realname);
40 40
41 QString hostname(); 41 QString hostname();
42 QString description(); 42 QString name();
43 unsigned short int port(); 43 unsigned short int port();
44 QString username(); 44 QString username();
45 QString password(); 45 QString password();
@@ -47,7 +47,7 @@ public:
47 QString realname(); 47 QString realname();
48protected: 48protected:
49 QString m_hostname; 49 QString m_hostname;
50 QString m_description; 50 QString m_name;
51 unsigned short int m_port; 51 unsigned short int m_port;
52 QString m_username; 52 QString m_username;
53 QString m_password; 53 QString m_password;
diff --git a/noncore/net/opieirc/ircservereditor.cpp b/noncore/net/opieirc/ircservereditor.cpp
index 1b157d6..798081f 100644
--- a/noncore/net/opieirc/ircservereditor.cpp
+++ b/noncore/net/opieirc/ircservereditor.cpp
@@ -1,33 +1,30 @@
1#include <qmessagebox.h>
1#include <qlayout.h> 2#include <qlayout.h>
2#include <qlabel.h> 3#include <qlabel.h>
3#include "ircservereditor.h" 4#include "ircservereditor.h"
4 5
5IRCServerEditor::IRCServerEditor(IRCServer server, QWidget* parent, const char* name, bool modal = FALSE, WFlags f) : QDialog(parent, name, modal, f) { 6IRCServerEditor::IRCServerEditor(IRCServer server, QWidget* parent, const char* name, bool modal = FALSE, WFlags f) : QDialog(parent, name, modal, f) {
6 QGridLayout *layout = new QGridLayout(this, 6, 2, 5, 5); 7 QGridLayout *layout = new QGridLayout(this, 6, 2, 5, 5);
7 QLabel *label = new QLabel(tr("Hostname :"), this); 8 QLabel *label = new QLabel(tr("Profile name :"), this);
8 m_hostname = new QLineEdit(server.hostname(), this); 9 m_name = new QLineEdit(server.name(), this);
9 layout->addWidget(label, 0, 0); 10 layout->addWidget(label, 0, 0);
10 layout->addWidget(m_hostname, 0, 1); 11 layout->addWidget(m_name, 0, 1);
12 label = new QLabel(tr("Hostname :"), this);
13 m_hostname = new QLineEdit(server.hostname(), this);
14 layout->addWidget(label, 1, 0);
15 layout->addWidget(m_hostname, 1, 1);
11 label = new QLabel(tr("Port :"), this); 16 label = new QLabel(tr("Port :"), this);
12 m_port = new QLineEdit(QString::number(server.port()), this); 17 m_port = new QLineEdit(QString::number(server.port()), this);
13 layout->addWidget(label, 1, 0); 18 layout->addWidget(label, 2, 0);
14 layout->addWidget(m_port, 1, 1); 19 layout->addWidget(m_port, 2, 1);
15 label = new QLabel(tr("Nickname :"), this); 20 label = new QLabel(tr("Nickname :"), this);
16 m_nickname = new QLineEdit(server.nick(), this); 21 m_nickname = new QLineEdit(server.nick(), this);
17 layout->addWidget(label, 2, 0);
18 layout->addWidget(m_nickname, 2, 1);
19 label = new QLabel(tr("Description :"), this);
20 m_description = new QLineEdit(server.description(), this);
21 layout->addWidget(label, 3, 0); 22 layout->addWidget(label, 3, 0);
22 layout->addWidget(m_description, 3, 1); 23 layout->addWidget(m_nickname, 3, 1);
23 label = new QLabel(tr("Realname :"), this); 24 label = new QLabel(tr("Realname :"), this);
24 m_realname = new QLineEdit(server.realname(), this); 25 m_realname = new QLineEdit(server.realname(), this);
25 layout->addWidget(label, 4, 0); 26 layout->addWidget(label, 4, 0);
26 layout->addWidget(m_realname, 4, 1); 27 layout->addWidget(m_realname, 4, 1);
27 label = new QLabel(tr("Username :"), this);
28 m_username = new QLineEdit(server.username(), this);
29 layout->addWidget(label, 3, 0);
30 layout->addWidget(m_username, 3, 1);
31 label = new QLabel(tr("Password :"), this); 28 label = new QLabel(tr("Password :"), this);
32 m_password = new QLineEdit(server.password(), this); 29 m_password = new QLineEdit(server.password(), this);
33 layout->addWidget(label, 5, 0); 30 layout->addWidget(label, 5, 0);
@@ -36,14 +33,29 @@ IRCServerEditor::IRCServerEditor(IRCServer server, QWidget* parent, const char*
36} 33}
37 34
38 35
36void IRCServerEditor::accept() {
37 if (m_name->text().length()==0)
38 QMessageBox::critical(this, tr("Error"), tr("Profile name required"));
39 else if (m_hostname->text().length()==0)
40 QMessageBox::critical(this, tr("Error"), tr("Host name required"));
41 else if (m_port->text().toInt()<=0)
42 QMessageBox::critical(this, tr("Error"), tr("Port required"));
43 else if (m_nickname->text().length()==0)
44 QMessageBox::critical(this, tr("Error"), tr("Nickname required"));
45 else if (m_realname->text().length()==0)
46 QMessageBox::critical(this, tr("Error"), tr("Realname required"));
47 else
48 QDialog::accept();
49}
50
39IRCServer IRCServerEditor::getServer() { 51IRCServer IRCServerEditor::getServer() {
40 IRCServer server; 52 IRCServer server;
53 server.setName(m_name->text());
41 server.setHostname(m_hostname->text()); 54 server.setHostname(m_hostname->text());
42 server.setPort(m_port->text().toInt()); 55 server.setPort(m_port->text().toInt());
43 server.setNick(m_nickname->text()); 56 server.setNick(m_nickname->text());
44 server.setDescription(m_description->text());
45 server.setRealname(m_realname->text()); 57 server.setRealname(m_realname->text());
46 server.setUsername(m_username->text()); 58 server.setUsername(m_nickname->text());
47 server.setPassword(m_password->text()); 59 server.setPassword(m_password->text());
48 return server; 60 return server;
49} 61}
diff --git a/noncore/net/opieirc/ircservereditor.h b/noncore/net/opieirc/ircservereditor.h
index 86cdf32..20c94f7 100644
--- a/noncore/net/opieirc/ircservereditor.h
+++ b/noncore/net/opieirc/ircservereditor.h
@@ -30,12 +30,13 @@ class IRCServerEditor : public QDialog {
30public: 30public:
31 IRCServerEditor(IRCServer server, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags f = 0); 31 IRCServerEditor(IRCServer server, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags f = 0);
32 IRCServer getServer(); 32 IRCServer getServer();
33protected slots:
34 void accept();
33protected: 35protected:
36 QLineEdit *m_name;
34 QLineEdit *m_hostname; 37 QLineEdit *m_hostname;
35 QLineEdit *m_port; 38 QLineEdit *m_port;
36 QLineEdit *m_description;
37 QLineEdit *m_nickname; 39 QLineEdit *m_nickname;
38 QLineEdit *m_username;
39 QLineEdit *m_password; 40 QLineEdit *m_password;
40 QLineEdit *m_realname; 41 QLineEdit *m_realname;
41}; 42};
diff --git a/noncore/net/opieirc/ircserverlist.cpp b/noncore/net/opieirc/ircserverlist.cpp
index 964fa13..b2d746a 100644
--- a/noncore/net/opieirc/ircserverlist.cpp
+++ b/noncore/net/opieirc/ircserverlist.cpp
@@ -1,22 +1,35 @@
1#include <stdio.h>
1#include <qlayout.h> 2#include <qlayout.h>
2#include <qlabel.h> 3#include <qlabel.h>
3#include <qhbox.h> 4#include <qhbox.h>
4#include <qpushbutton.h> 5#include <qpushbutton.h>
5#include "ircserverlist.h" 6#include "ircserverlist.h"
6#include "ircservereditor.h" 7#include "ircservereditor.h"
8#include <stdio.h>
7 9
8class IRCListBoxServer : public QListBoxText { 10class IRCListBoxServer : public QListBoxText {
9public: 11public:
10 IRCListBoxServer(IRCServer server); 12 IRCListBoxServer(IRCServer server) : QListBoxText(server.name()) {
11 QString text(); 13 m_server = server;
14 }
15
16 IRCServer server() {
17 return m_server;
18 }
19
20 void setServer(IRCServer server) {
21 m_server = server;
22 setText(m_server.name());
23 }
24protected:
25 IRCServer m_server;
12}; 26};
13 27
14IRCServerList::IRCServerList(QWidget* parent, const char *name, bool modal, WFlags f) : QDialog(parent, name, modal, f) { 28IRCServerList::IRCServerList(QWidget* parent, const char *name, bool modal, WFlags f) : QDialog(parent, name, modal, f) {
15 QVBoxLayout *layout = new QVBoxLayout(this, 5, 5); 29 QVBoxLayout *layout = new QVBoxLayout(this, 5, 5);
16 setCaption(tr("Serverlist Browser")); 30 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); 31 QLabel *label = new QLabel(tr("Please choose a server profile"), this);
32 label->setAlignment(AlignHCenter);
20 layout->addWidget(label); 33 layout->addWidget(label);
21 m_list = new QListBox(this); 34 m_list = new QListBox(this);
22 layout->addWidget(m_list); 35 layout->addWidget(m_list);
@@ -28,6 +41,29 @@ IRCServerList::IRCServerList(QWidget* parent, const char *name, bool modal, WFla
28 connect(edit, SIGNAL(clicked()), this, SLOT(editServer())); 41 connect(edit, SIGNAL(clicked()), this, SLOT(editServer()));
29 connect(add, SIGNAL(clicked()), this, SLOT(addServer())); 42 connect(add, SIGNAL(clicked()), this, SLOT(addServer()));
30 layout->addWidget(buttons); 43 layout->addWidget(buttons);
44 /* Load the configuration file */
45 m_config = new Config("OpieIRC");
46 m_config->setGroup("OpieIRC");
47 int count = m_config->readNumEntry("ServerCount", 0);
48 if (count) {
49 for (int i=0; i<count; i++) {
50 m_config->setGroup("OpieIRC");
51 QString name = m_config->readEntry("Server"+QString::number(i));
52 if (name.length() > 0) {
53 IRCServer server;
54 m_config->setGroup(name);
55 server.setName(name);
56 server.setHostname(m_config->readEntry("Hostname"));
57 server.setPort(m_config->readNumEntry("Port"));
58 server.setUsername(m_config->readEntry("Username"));
59 server.setPassword(m_config->readEntry("Password"));
60 server.setNick(m_config->readEntry("Nick"));
61 server.setRealname(m_config->readEntry("Realname"));
62 m_list->insertItem(new IRCListBoxServer(server));
63 }
64 }
65 }
66
31 showMaximized(); 67 showMaximized();
32} 68}
33 69
@@ -36,18 +72,58 @@ void IRCServerList::addServer() {
36 IRCServerEditor editor(server, this, "ServerEditor", TRUE); 72 IRCServerEditor editor(server, this, "ServerEditor", TRUE);
37 if (editor.exec() == QDialog::Accepted) { 73 if (editor.exec() == QDialog::Accepted) {
38 server = editor.getServer(); 74 server = editor.getServer();
39 //m_servers->append(server); 75 /* Gets deleted by QListBox, so this is ok */
40 update(); 76 m_list->insertItem(new IRCListBoxServer(server));
41 } 77 }
42} 78}
43 79
44void IRCServerList::delServer() { 80void IRCServerList::delServer() {
81 int index = m_list->currentItem();
82 if (index != -1) {
83 m_list->removeItem(index);
84 }
45} 85}
46 86
47void IRCServerList::editServer() { 87void IRCServerList::editServer() {
88 int index = m_list->currentItem();
89 if (index != -1) {
90 IRCListBoxServer *item = (IRCListBoxServer *)m_list->item(index);
91 IRCServer server = item->server();
92 IRCServerEditor editor(server, this, "ServerEditor", TRUE);
93 if (editor.exec() == QDialog::Accepted) {
94 server = editor.getServer();
95 item->setServer(server);
96 }
97 }
98}
99
100int IRCServerList::exec() {
101 int returncode = QDialog::exec();
102 /* Now save the changes */
103 m_config->setGroup("OpieIRC");
104 m_config->clearGroup();
105 m_config->writeEntry("ServerCount", QString::number(m_list->count()));
106 for (unsigned int i=0; i<m_list->count(); i++) {
107 IRCServer server = ((IRCListBoxServer *)m_list->item(i))->server();
108 m_config->setGroup("OpieIRC");
109 m_config->writeEntry("Server"+QString::number(i), server.name());
110 m_config->setGroup(server.name());
111 m_config->writeEntry("Hostname", server.hostname());
112 m_config->writeEntry("Port", QString::number(server.port()));
113 m_config->writeEntry("Username", server.username());
114 m_config->writeEntry("Password", server.password());
115 m_config->writeEntry("Nick", server.nick());
116 m_config->writeEntry("Realname", server.realname());
117 }
118 return returncode;
119}
120
121bool IRCServerList::hasServer() {
122 return (m_list->currentItem() != -1);
48} 123}
49 124
50void IRCServerList::update() { 125IRCServer IRCServerList::server() {
126 return ((IRCListBoxServer *)m_list->item(m_list->currentItem()))->server();
51} 127}
52 128
53IRCServerList::~IRCServerList() { 129IRCServerList::~IRCServerList() {
diff --git a/noncore/net/opieirc/ircserverlist.h b/noncore/net/opieirc/ircserverlist.h
index ad9231d..d61210e 100644
--- a/noncore/net/opieirc/ircserverlist.h
+++ b/noncore/net/opieirc/ircserverlist.h
@@ -31,16 +31,20 @@ class IRCServerList : public QDialog {
31 Q_OBJECT 31 Q_OBJECT
32public: 32public:
33 IRCServerList(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags f = 0); 33 IRCServerList(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags f = 0);
34 int exec();
35 /* Check whether a server was selected */
36 bool hasServer();
37 /* Return the selected server */
38 IRCServer server();
39
34 ~IRCServerList(); 40 ~IRCServerList();
35public slots: 41public slots:
36 void addServer(); 42 void addServer();
37 void delServer(); 43 void delServer();
38 void editServer(); 44 void editServer();
39protected: 45protected:
40 void update(); 46 Config *m_config;
41protected: 47 QListBox *m_list;
42 Config *m_config;
43 QListBox *m_list;
44}; 48};
45 49
46#endif /* __IRCSERVERLIST_H */ 50#endif /* __IRCSERVERLIST_H */
diff --git a/noncore/net/opieirc/ircservertab.cpp b/noncore/net/opieirc/ircservertab.cpp
index 1f377aa..724f4bd 100644
--- a/noncore/net/opieirc/ircservertab.cpp
+++ b/noncore/net/opieirc/ircservertab.cpp
@@ -1,12 +1,12 @@
1#include <stdio.h> 1#include <stdio.h>
2#include "ircservertab.h" 2#include "ircservertab.h"
3 3
4IRCServerTab::IRCServerTab(IRCServer *server, MainWindow *mainWindow, QWidget *parent, const char *name, WFlags f) : IRCTab(parent, name, f) { 4IRCServerTab::IRCServerTab(IRCServer server, MainWindow *mainWindow, QWidget *parent, const char *name, WFlags f) : IRCTab(parent, name, f) {
5 m_server = server; 5 m_server = server;
6 m_session = new IRCSession(m_server); 6 m_session = new IRCSession(&m_server);
7 m_mainWindow = mainWindow; 7 m_mainWindow = mainWindow;
8 m_close = FALSE; 8 m_close = FALSE;
9 m_description->setText(tr("Connection to")+" <b>" + server->hostname() + ":" + QString::number(server->port()) + "</b>"); 9 m_description->setText(tr("Connection to")+" <b>" + server.hostname() + ":" + QString::number(server.port()) + "</b>");
10 m_textview = new QTextView(this); 10 m_textview = new QTextView(this);
11 m_textview->setHScrollBarMode(QScrollView::AlwaysOff); 11 m_textview->setHScrollBarMode(QScrollView::AlwaysOff);
12 m_textview->setVScrollBarMode(QScrollView::AlwaysOn); 12 m_textview->setVScrollBarMode(QScrollView::AlwaysOn);
@@ -30,7 +30,6 @@ IRCServerTab::~IRCServerTab() {
30 m_mainWindow->killTab(it.current()); 30 m_mainWindow->killTab(it.current());
31 } 31 }
32 delete m_session; 32 delete m_session;
33 delete m_server;
34} 33}
35 34
36void IRCServerTab::removeChannelTab(IRCChannelTab *tab) { 35void IRCServerTab::removeChannelTab(IRCChannelTab *tab) {
@@ -46,7 +45,7 @@ IRCSession *IRCServerTab::session() {
46} 45}
47 46
48IRCServer *IRCServerTab::server() { 47IRCServer *IRCServerTab::server() {
49 return m_server; 48 return &m_server;
50} 49}
51 50
52void IRCServerTab::processCommand() { 51void IRCServerTab::processCommand() {
diff --git a/noncore/net/opieirc/ircservertab.h b/noncore/net/opieirc/ircservertab.h
index 79b5876..fa9a0a3 100644
--- a/noncore/net/opieirc/ircservertab.h
+++ b/noncore/net/opieirc/ircservertab.h
@@ -30,7 +30,7 @@ class IRCServerTab : public IRCTab {
30 Q_OBJECT 30 Q_OBJECT
31public: 31public:
32 /* IRCTab implementation */ 32 /* IRCTab implementation */
33 IRCServerTab(IRCServer *server, MainWindow *mainWindow, QWidget *parent = 0, const char *name = 0, WFlags f = 0); 33 IRCServerTab(IRCServer server, MainWindow *mainWindow, QWidget *parent = 0, const char *name = 0, WFlags f = 0);
34 ~IRCServerTab(); 34 ~IRCServerTab();
35 QString title(); 35 QString title();
36 IRCSession *session(); 36 IRCSession *session();
@@ -49,7 +49,7 @@ protected slots:
49 void display(IRCOutput output); 49 void display(IRCOutput output);
50protected: 50protected:
51 bool m_close; 51 bool m_close;
52 IRCServer *m_server; 52 IRCServer m_server;
53 IRCSession *m_session; 53 IRCSession *m_session;
54 MainWindow *m_mainWindow; 54 MainWindow *m_mainWindow;
55 QTextView *m_textview; 55 QTextView *m_textview;
diff --git a/noncore/net/opieirc/mainwindow.cpp b/noncore/net/opieirc/mainwindow.cpp
index bc0b0d1..3d13ee9 100644
--- a/noncore/net/opieirc/mainwindow.cpp
+++ b/noncore/net/opieirc/mainwindow.cpp
@@ -59,21 +59,10 @@ void MainWindow::killTab(IRCTab *tab) {
59} 59}
60 60
61void MainWindow::newConnection() { 61void MainWindow::newConnection() {
62 IRCServer *server = new IRCServer(); 62 IRCServerList list(this, "ServerList", TRUE);
63 server->setHostname("irc.openprojects.net"); 63 if (list.exec() == QDialog::Accepted && list.hasServer()) {
64 server->setPort(6667); 64 IRCServerTab *serverTab = new IRCServerTab(list.server(), this, m_tabWidget);
65 server->setDescription("OpenProjects"); 65 addTab(serverTab);
66 server->setNick("opie-irc"); 66 serverTab->doConnect();
67 server->setUsername("opie-irc"); 67 }
68 server->setRealname("opie-irc");
69 IRCServerTab *serverTab = new IRCServerTab(server, this, m_tabWidget);
70 addTab(serverTab);
71 serverTab->doConnect();
72
73 /*
74 * Serverlist : not functional yet
75 IRCServerList *list = new IRCServerList(this, "ServerList", TRUE);
76 list->exec();
77 delete list;
78 */
79} 68}
diff --git a/noncore/net/opieirc/opieirc.pro b/noncore/net/opieirc/opieirc.pro
index d24535b..0e188e4 100644
--- a/noncore/net/opieirc/opieirc.pro
+++ b/noncore/net/opieirc/opieirc.pro
@@ -7,7 +7,8 @@ HEADERS = ircchannel.h ircconnection.h \
7 ircperson.h ircserver.h ircsession.h \ 7 ircperson.h ircserver.h ircsession.h \
8 mainwindow.h irctab.h ircservertab.h \ 8 mainwindow.h irctab.h ircservertab.h \
9 ircchanneltab.h ircchannellist.h \ 9 ircchanneltab.h ircchannellist.h \
10 ircserverlist.h ircservereditor.h 10 ircserverlist.h ircservereditor.h \
11 ircquerytab.h
11 SOURCES = ircchannel.cpp ircconnection.cpp \ 12 SOURCES = ircchannel.cpp ircconnection.cpp \
12 ircmessage.cpp \ 13 ircmessage.cpp \
13 ircmessageparser.cpp ircoutput.cpp \ 14 ircmessageparser.cpp ircoutput.cpp \
@@ -15,7 +16,8 @@ SOURCES = ircchannel.cpp ircconnection.cpp \
15 ircsession.cpp main.cpp mainwindow.cpp \ 16 ircsession.cpp main.cpp mainwindow.cpp \
16 irctab.cpp ircservertab.cpp \ 17 irctab.cpp ircservertab.cpp \
17 ircchanneltab.cpp ircchannellist.cpp \ 18 ircchanneltab.cpp ircchannellist.cpp \
18 ircserverlist.cpp ircservereditor.cpp 19 ircserverlist.cpp ircservereditor.cpp \
20 ircquerytab.cpp
19INCLUDEPATH += $(OPIEDIR)/include 21INCLUDEPATH += $(OPIEDIR)/include
20 DEPENDPATH+= $(OPIEDIR)/include 22 DEPENDPATH+= $(OPIEDIR)/include
21LIBS += -lqpe 23LIBS += -lqpe