summaryrefslogtreecommitdiff
authorskyhusker <skyhusker>2005-02-02 13:40:47 (UTC)
committer skyhusker <skyhusker>2005-02-02 13:40:47 (UTC)
commit1a5dc271114432e0e598af499c076bfbf69ff972 (patch) (unidiff)
treef7f9b272949c51f818fbcfe4009f745c6a42fca5
parent737b0b5ce3e5db15bf11f696b070c9b475f92b61 (diff)
downloadopie-1a5dc271114432e0e598af499c076bfbf69ff972.zip
opie-1a5dc271114432e0e598af499c076bfbf69ff972.tar.gz
opie-1a5dc271114432e0e598af499c076bfbf69ff972.tar.bz2
Added a pointer to the mainwindow because it's needed by the dcc confirmation dialog
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieirc/ircservertab.cpp2
-rw-r--r--noncore/net/opieirc/ircsession.cpp3
-rw-r--r--noncore/net/opieirc/ircsession.h3
3 files changed, 5 insertions, 3 deletions
diff --git a/noncore/net/opieirc/ircservertab.cpp b/noncore/net/opieirc/ircservertab.cpp
index bddc37e..62a06e8 100644
--- a/noncore/net/opieirc/ircservertab.cpp
+++ b/noncore/net/opieirc/ircservertab.cpp
@@ -5,25 +5,25 @@
5#include "ircmessageparser.h" 5#include "ircmessageparser.h"
6#include "ircchannelperson.h" 6#include "ircchannelperson.h"
7 7
8 8
9bool IRCServerTab::containsPing( const QString& text, IRCServerTab* tab ) { 9bool IRCServerTab::containsPing( const QString& text, IRCServerTab* tab ) {
10 return (text.contains(IRCMessageParser::tr("Received a CTCP PING from "))) || 10 return (text.contains(IRCMessageParser::tr("Received a CTCP PING from "))) ||
11 (text.find("ping") != -1 && text.find( tab->server()->nick() != -1)); 11 (text.find("ping") != -1 && text.find( tab->server()->nick() != -1));
12} 12}
13 13
14 14
15IRCServerTab::IRCServerTab(IRCServer server, MainWindow *mainWindow, QWidget *parent, const char *name, WFlags f) : IRCTab(parent, name, f) { 15IRCServerTab::IRCServerTab(IRCServer server, MainWindow *mainWindow, QWidget *parent, const char *name, WFlags f) : IRCTab(parent, name, f) {
16 m_server = server; 16 m_server = server;
17 m_session = new IRCSession(&m_server); 17 m_session = new IRCSession(this, &m_server);
18 m_mainWindow = mainWindow; 18 m_mainWindow = mainWindow;
19 m_close = FALSE; 19 m_close = FALSE;
20 m_lines = 0; 20 m_lines = 0;
21 m_description->setText(tr("Connecting to")+" <b>" + server.hostname() + ":" + QString::number(server.port()) + "</b>"); 21 m_description->setText(tr("Connecting to")+" <b>" + server.hostname() + ":" + QString::number(server.port()) + "</b>");
22 m_textview = new QTextView(this); 22 m_textview = new QTextView(this);
23 m_textview->setHScrollBarMode(QScrollView::AlwaysOff); 23 m_textview->setHScrollBarMode(QScrollView::AlwaysOff);
24 m_textview->setVScrollBarMode(QScrollView::AlwaysOn); 24 m_textview->setVScrollBarMode(QScrollView::AlwaysOn);
25 m_textview->setTextFormat(RichText); 25 m_textview->setTextFormat(RichText);
26 QWhatsThis::add(m_textview, tr("Server messages")); 26 QWhatsThis::add(m_textview, tr("Server messages"));
27 m_layout->add(m_textview); 27 m_layout->add(m_textview);
28 m_field = new IRCHistoryLineEdit(this); 28 m_field = new IRCHistoryLineEdit(this);
29 connect(m_field, SIGNAL(nextTab()), this, SIGNAL(nextTab())); 29 connect(m_field, SIGNAL(nextTab()), this, SIGNAL(nextTab()));
diff --git a/noncore/net/opieirc/ircsession.cpp b/noncore/net/opieirc/ircsession.cpp
index 80a327a..fd8ba72 100644
--- a/noncore/net/opieirc/ircsession.cpp
+++ b/noncore/net/opieirc/ircsession.cpp
@@ -1,22 +1,23 @@
1 1
2#include "ircsession.h" 2#include "ircsession.h"
3#include "ircmessageparser.h" 3#include "ircmessageparser.h"
4#include "ircchannelperson.h" 4#include "ircchannelperson.h"
5#include "ircversion.h" 5#include "ircversion.h"
6 6
7IRCSession::IRCSession(IRCServer *server) { 7IRCSession::IRCSession(QWidget *parent, IRCServer *server) {
8 m_server = server; 8 m_server = server;
9 m_connection = new IRCConnection(m_server); 9 m_connection = new IRCConnection(m_server);
10 m_parser = new IRCMessageParser(this); 10 m_parser = new IRCMessageParser(this);
11 m_parent = parent;
11 connect(m_connection, SIGNAL(messageArrived(IRCMessage*)), this, SLOT(handleMessage(IRCMessage*))); 12 connect(m_connection, SIGNAL(messageArrived(IRCMessage*)), this, SLOT(handleMessage(IRCMessage*)));
12 connect(m_parser, SIGNAL(outputReady(IRCOutput)), this, SIGNAL(outputReady(IRCOutput))); 13 connect(m_parser, SIGNAL(outputReady(IRCOutput)), this, SIGNAL(outputReady(IRCOutput)));
13 connect(m_connection, SIGNAL(outputReady(IRCOutput)), this, SIGNAL(outputReady(IRCOutput))); 14 connect(m_connection, SIGNAL(outputReady(IRCOutput)), this, SIGNAL(outputReady(IRCOutput)));
14} 15}
15 16
16IRCSession::~IRCSession() { 17IRCSession::~IRCSession() {
17 /* We want this to get deleted automatically */ 18 /* We want this to get deleted automatically */
18 m_channels.setAutoDelete(TRUE); 19 m_channels.setAutoDelete(TRUE);
19 m_people.setAutoDelete(TRUE); 20 m_people.setAutoDelete(TRUE);
20 21
21 delete m_parser; 22 delete m_parser;
22 delete m_connection; 23 delete m_connection;
diff --git a/noncore/net/opieirc/ircsession.h b/noncore/net/opieirc/ircsession.h
index 3859b68..7c91893 100644
--- a/noncore/net/opieirc/ircsession.h
+++ b/noncore/net/opieirc/ircsession.h
@@ -30,25 +30,25 @@
30#include "ircoutput.h" 30#include "ircoutput.h"
31 31
32class IRCMessageParser; 32class IRCMessageParser;
33 33
34/* The IRCSession stores all information relating to the connection 34/* The IRCSession stores all information relating to the connection
35 to one IRC server. IRCSession makes it possible to run multiple 35 to one IRC server. IRCSession makes it possible to run multiple
36 IRC server connections from within the same program */ 36 IRC server connections from within the same program */
37 37
38class IRCSession : public QObject { 38class IRCSession : public QObject {
39friend class IRCMessageParser; 39friend class IRCMessageParser;
40 Q_OBJECT 40 Q_OBJECT
41public: 41public:
42 IRCSession(IRCServer *server); 42 IRCSession(QWidget *parent, IRCServer *server);
43 ~IRCSession(); 43 ~IRCSession();
44 44
45 void join(QString channel); 45 void join(QString channel);
46 void quit(QString message); 46 void quit(QString message);
47 void quit(); 47 void quit();
48 void raw(QString message); 48 void raw(QString message);
49 void topic(IRCChannel *channel, QString message); 49 void topic(IRCChannel *channel, QString message);
50 void mode(IRCChannel *channel, QString message); 50 void mode(IRCChannel *channel, QString message);
51 void mode(IRCPerson *person, QString message); 51 void mode(IRCPerson *person, QString message);
52 void mode(QString message); 52 void mode(QString message);
53 void part(IRCChannel *channel); 53 void part(IRCChannel *channel);
54 void op(IRCChannel *channel, IRCPerson *person); 54 void op(IRCChannel *channel, IRCPerson *person);
@@ -81,15 +81,16 @@ protected slots:
81 void handleMessage(IRCMessage *message); 81 void handleMessage(IRCMessage *message);
82signals: 82signals:
83 void outputReady(IRCOutput output); 83 void outputReady(IRCOutput output);
84 void updateChannels(); 84 void updateChannels();
85protected: 85protected:
86 IRCServer *m_server; 86 IRCServer *m_server;
87 IRCConnection *m_connection; 87 IRCConnection *m_connection;
88 IRCMessageParser *m_parser; 88 IRCMessageParser *m_parser;
89 QList<IRCChannel> m_channels; 89 QList<IRCChannel> m_channels;
90 QList<IRCPerson> m_people; 90 QList<IRCPerson> m_people;
91 QString m_validUsermodes; 91 QString m_validUsermodes;
92 QString m_validChannelmodes; 92 QString m_validChannelmodes;
93 QWidget *m_parent;
93}; 94};
94 95
95#endif /* __IRCSESSION_H */ 96#endif /* __IRCSESSION_H */