summaryrefslogtreecommitdiff
path: root/noncore/net/opieirc/ircservertab.cpp
Unidiff
Diffstat (limited to 'noncore/net/opieirc/ircservertab.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieirc/ircservertab.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/noncore/net/opieirc/ircservertab.cpp b/noncore/net/opieirc/ircservertab.cpp
index d1aab40..2a34c0b 100644
--- a/noncore/net/opieirc/ircservertab.cpp
+++ b/noncore/net/opieirc/ircservertab.cpp
@@ -1,10 +1,16 @@
1#include <qtextstream.h> 1#include <qtextstream.h>
2#include <qwhatsthis.h> 2#include <qwhatsthis.h>
3#include "ircservertab.h" 3#include "ircservertab.h"
4 4
5
6bool IRCServerTab::containsPing( const QString& text, IRCServerTab* tab ) {
7 return (text.find("ping") != -1 && text.find( tab->server()->nick() != -1));
8}
9
10
5IRCServerTab::IRCServerTab(IRCServer server, MainWindow *mainWindow, QWidget *parent, const char *name, WFlags f) : IRCTab(parent, name, f) { 11IRCServerTab::IRCServerTab(IRCServer server, MainWindow *mainWindow, QWidget *parent, const char *name, WFlags f) : IRCTab(parent, name, f) {
6 m_server = server; 12 m_server = server;
7 m_session = new IRCSession(&m_server); 13 m_session = new IRCSession(&m_server);
8 m_mainWindow = mainWindow; 14 m_mainWindow = mainWindow;
9 m_close = FALSE; 15 m_close = FALSE;
10 m_lines = 0; 16 m_lines = 0;
@@ -13,12 +19,17 @@ IRCServerTab::IRCServerTab(IRCServer server, MainWindow *mainWindow, QWidget *pa
13 m_textview->setHScrollBarMode(QScrollView::AlwaysOff); 19 m_textview->setHScrollBarMode(QScrollView::AlwaysOff);
14 m_textview->setVScrollBarMode(QScrollView::AlwaysOn); 20 m_textview->setVScrollBarMode(QScrollView::AlwaysOn);
15 m_textview->setTextFormat(RichText); 21 m_textview->setTextFormat(RichText);
16 QWhatsThis::add(m_textview, tr("Server messages")); 22 QWhatsThis::add(m_textview, tr("Server messages"));
17 m_layout->add(m_textview); 23 m_layout->add(m_textview);
18 m_field = new IRCHistoryLineEdit(this); 24 m_field = new IRCHistoryLineEdit(this);
25 connect(m_field, SIGNAL(nextTab()), this, SIGNAL(nextTab()));
26 connect(m_field, SIGNAL(prevTab()), this, SIGNAL(prevTab()));
27 connect(m_field, SIGNAL(closeTab()), this, SIGNAL(closeTab()));
28 connect(this, SIGNAL(editFocus()), m_field, SLOT(setEditFocus()));
29
19 QWhatsThis::add(m_field, tr("Type commands here. A list of available commands can be found inside the OpieIRC help")); 30 QWhatsThis::add(m_field, tr("Type commands here. A list of available commands can be found inside the OpieIRC help"));
20 m_layout->add(m_field); 31 m_layout->add(m_field);
21 connect(m_field, SIGNAL(returnPressed()), this, SLOT(processCommand())); 32 connect(m_field, SIGNAL(returnPressed()), this, SLOT(processCommand()));
22 m_field->setFocus(); 33 m_field->setFocus();
23 connect(m_session, SIGNAL(outputReady(IRCOutput)), this, SLOT(display(IRCOutput))); 34 connect(m_session, SIGNAL(outputReady(IRCOutput)), this, SLOT(display(IRCOutput)));
24 connect(m_mainWindow, SIGNAL(updateScroll()), this, SLOT(scrolling())); 35 connect(m_mainWindow, SIGNAL(updateScroll()), this, SLOT(scrolling()));
@@ -118,20 +129,20 @@ void IRCServerTab::executeCommand(IRCTab *tab, QString line) {
118 } 129 }
119 } 130 }
120 131
121 else if (command == "OP"){ 132 else if (command == "OP"){
122 QString nickname; 133 QString nickname;
123 stream >> nickname; 134 stream >> nickname;
124 if (nickname.length() > 0) { 135 if (nickname.length() > 0) {
125 QString text = line.right(line.length()-nickname.length()-5); 136 QString text = line.right(line.length()-nickname.length()-5);
126 IRCPerson person; 137 IRCPerson person;
127 person.setNick(nickname); 138 person.setNick(nickname);
128 m_session->op(((IRCChannelTab *)tab)->channel(), &person); 139 m_session->op(((IRCChannelTab *)tab)->channel(), &person);
129 } 140 }
130 } 141 }
131 142
132 //SEND MODES 143 //SEND MODES
133 else if (command == "MODE"){ 144 else if (command == "MODE"){
134 QString text = line.right(line.length()-6); 145 QString text = line.right(line.length()-6);
135 if (text.length() > 0) { 146 if (text.length() > 0) {
136 m_session->mode(text); 147 m_session->mode(text);
137 } else { 148 } else {