summaryrefslogtreecommitdiff
authorfliplap <fliplap>2003-07-22 05:36:18 (UTC)
committer fliplap <fliplap>2003-07-22 05:36:18 (UTC)
commitd672a787dd122410063ac6cb721be8b5f8cd418e (patch) (side-by-side diff)
treed29b21fc979c41a48b2d201c9b37647e729c521c
parent2fdb15d45c336bbe1540bd9de6b5bfaea13df163 (diff)
downloadopie-d672a787dd122410063ac6cb721be8b5f8cd418e.zip
opie-d672a787dd122410063ac6cb721be8b5f8cd418e.tar.gz
opie-d672a787dd122410063ac6cb721be8b5f8cd418e.tar.bz2
fixed scroll issue, added many commands
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieirc/ircchanneltab.cpp8
-rw-r--r--noncore/net/opieirc/ircchanneltab.h1
-rw-r--r--noncore/net/opieirc/ircquerytab.cpp6
-rw-r--r--noncore/net/opieirc/ircquerytab.h1
-rw-r--r--noncore/net/opieirc/ircservertab.cpp111
-rw-r--r--noncore/net/opieirc/ircservertab.h6
-rw-r--r--noncore/net/opieirc/ircsession.cpp37
-rw-r--r--noncore/net/opieirc/ircsession.h10
-rw-r--r--noncore/net/opieirc/mainwindow.cpp5
-rw-r--r--noncore/net/opieirc/mainwindow.h4
10 files changed, 172 insertions, 17 deletions
diff --git a/noncore/net/opieirc/ircchanneltab.cpp b/noncore/net/opieirc/ircchanneltab.cpp
index c1964c8..beb8bce 100644
--- a/noncore/net/opieirc/ircchanneltab.cpp
+++ b/noncore/net/opieirc/ircchanneltab.cpp
@@ -33,3 +33,2 @@ IRCChannelTab::IRCChannelTab(IRCChannel *channel, IRCServerTab *parentTab, MainW
connect(m_list, SIGNAL(mouseButtonPressed(int, QListBoxItem *, const QPoint&)), this, SLOT(mouseButtonPressed(int, QListBoxItem *, const QPoint &)));
-
/* Construct the popup menu */
@@ -41,3 +40,3 @@ IRCChannelTab::IRCChannelTab(IRCChannel *channel, IRCServerTab *parentTab, MainW
ctcpMenu->insertItem(Resource::loadPixmap("opieirc/whois"), tr("Whois"), this, SLOT(popupWhois()));
-
+ connect(m_mainWindow, SIGNAL(updateScroll()), this, SLOT(scrolling()));
m_layout->add(hbox);
@@ -50,2 +49,6 @@ IRCChannelTab::IRCChannelTab(IRCChannel *channel, IRCServerTab *parentTab, MainW
+void IRCChannelTab::scrolling(){
+ m_textview->ensureVisible(0, m_textview->contentsHeight());
+}
+
void IRCChannelTab::appendText(QString text) {
@@ -131,2 +134,3 @@ void IRCChannelTab::popupQuery() {
void IRCChannelTab::popupPing() {
+ //HAHA, no wonder these don't work
}
diff --git a/noncore/net/opieirc/ircchanneltab.h b/noncore/net/opieirc/ircchanneltab.h
index a03ee3e..001c96d 100644
--- a/noncore/net/opieirc/ircchanneltab.h
+++ b/noncore/net/opieirc/ircchanneltab.h
@@ -49,2 +49,3 @@ public slots:
void settingsChanged();
+ void scrolling();
protected slots:
diff --git a/noncore/net/opieirc/ircquerytab.cpp b/noncore/net/opieirc/ircquerytab.cpp
index 21a53dc..a113b04 100644
--- a/noncore/net/opieirc/ircquerytab.cpp
+++ b/noncore/net/opieirc/ircquerytab.cpp
@@ -24,2 +24,3 @@ IRCQueryTab::IRCQueryTab(IRCPerson *person, IRCServerTab *parentTab, MainWindow
connect(m_field, SIGNAL(returnPressed()), this, SLOT(processCommand()));
+ connect(m_mainWindow, SIGNAL(updateScroll()), this, SLOT(scrolling()));
settingsChanged();
@@ -27,2 +28,7 @@ IRCQueryTab::IRCQueryTab(IRCPerson *person, IRCServerTab *parentTab, MainWindow
+void IRCQueryTab::scrolling(){
+ m_textview->ensureVisible(0, m_textview->contentsHeight());
+}
+
+
void IRCQueryTab::appendText(QString text) {
diff --git a/noncore/net/opieirc/ircquerytab.h b/noncore/net/opieirc/ircquerytab.h
index f9cc8e1..b3b04fb 100644
--- a/noncore/net/opieirc/ircquerytab.h
+++ b/noncore/net/opieirc/ircquerytab.h
@@ -39,2 +39,3 @@ public:
public slots:
+ void scrolling();
void remove();
diff --git a/noncore/net/opieirc/ircservertab.cpp b/noncore/net/opieirc/ircservertab.cpp
index 5aa447f..1d9520a 100644
--- a/noncore/net/opieirc/ircservertab.cpp
+++ b/noncore/net/opieirc/ircservertab.cpp
@@ -24,2 +24,3 @@ IRCServerTab::IRCServerTab(IRCServer server, MainWindow *mainWindow, QWidget *pa
connect(m_session, SIGNAL(outputReady(IRCOutput)), this, SLOT(display(IRCOutput)));
+ connect(m_mainWindow, SIGNAL(updateScroll()), this, SLOT(scrolling()));
settingsChanged();
@@ -27,2 +28,7 @@ IRCServerTab::IRCServerTab(IRCServer server, MainWindow *mainWindow, QWidget *pa
+void IRCServerTab::scrolling(){
+ m_textview->ensureVisible(0, m_textview->contentsHeight());
+}
+
+
void IRCServerTab::appendText(QString text) {
@@ -66,2 +72,6 @@ IRCSession *IRCServerTab::session() {
}
+/*
+QString *IRCServerTab::mynick() {
+ return (*m_server->nick());
+} */
@@ -81,4 +91,5 @@ void IRCServerTab::executeCommand(IRCTab *tab, QString line) {
command = command.upper().right(command.length()-1);
-
- if (command == "JOIN") {
+
+ //JOIN
+ if (command == "JOIN" || command == "J") {
QString channel;
@@ -88,5 +99,80 @@ void IRCServerTab::executeCommand(IRCTab *tab, QString line) {
} else {
- tab->appendText("<font color=\"" + m_errorColor + "\">Unknown channel format!</font><br>");
+ tab->appendText("<font color=\"" + m_errorColor + "\">Unknown channel format!</font><br>");
}
- } else if (command == "ME") {
+ }
+
+ //KICK
+ else if (command == "KICK"){
+ QString nickname;
+ stream >> nickname;
+ if (nickname.length() > 0) {
+ if (line.length() > 7 + nickname.length()) {
+ QString text = line.right(line.length()-nickname.length()-7);
+ IRCPerson person;
+ person.setNick(nickname);
+ m_session->kick(((IRCChannelTab *)tab)->channel(), &person, text);
+ } else {
+ IRCPerson person;
+ person.setNick(nickname);
+ m_session->kick(((IRCChannelTab *)tab)->channel(), &person);
+ }
+ }
+ }
+
+ else if (command == "OP"){
+ QString nickname;
+ stream >> nickname;
+ if (nickname.length() > 0) {
+ if (line.length() > 7 + nickname.length()) {
+ QString text = line.right(line.length()-nickname.length()-7);
+ IRCPerson person;
+ person.setNick(nickname);
+ m_session->kick(((IRCChannelTab *)tab)->channel(), &person, text);
+ } else {
+ IRCPerson person;
+ person.setNick(nickname);
+ m_session->kick(((IRCChannelTab *)tab)->channel(), &person);
+ }
+ }
+ }
+
+ //SEND MODES
+ else if (command == "MODE"){
+ QString text = line.right(line.length()-6);
+ if (text.length() > 0) {
+ m_session->mode(text);
+ } else {
+ tab->appendText("<font color=\"" + m_errorColor + "\">/mode channel {[+|-]|o|p|s|i|t|n|b|v} [limit] [user] [ban mask]<br>/mode nickname {[+|-]|i|w|s|o}</font><br>");
+ }
+ }
+ //SEND RAW MESSAGE TO SERVER, COMPLETELY UNCHECKED - anything in the RFC...or really anything you want
+ else if (command == "RAW"){
+ QString text = line.right(line.length()-5);
+ if (text.length() > 0) {
+ m_session->raw(text);
+ }
+ }
+ else if (command == "SUSPEND"){
+ QString text = line.right(line.length()-9);
+ if (text.upper() == "ON") {
+ QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable;
+ }
+ else if (text.upper() == "OFF"){
+ QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Disable;
+ } else {
+ tab->appendText("<font color=\"" + m_errorColor + "\">Line: "+ line +"</font><br>Text: "+text);
+ }
+ }
+
+ else if (command == "QUIT"){
+ QString text = line.right(line.length()-6);
+ if (text.length() > 0) {
+ m_session->quit(text);
+ } else {
+ m_session->quit();
+ }
+ }
+
+ //SEND ACTION
+ else if (command == "ME") {
QString text = line.right(line.length()-4);
@@ -100,6 +186,8 @@ void IRCServerTab::executeCommand(IRCTab *tab, QString line) {
} else {
- tab->appendText("<font color=\"" + m_errorColor + "\">Invalid tab for this command</font><br>");
+ tab->appendText("<font color=\"" + m_errorColor + "\">Invalid tab for this command</font><br>");
}
}
- } else if (command == "MSG") {
+ }
+ //SEND PRIVMSG
+ else if (command == "MSG") {
QString nickname;
@@ -114,5 +202,6 @@ void IRCServerTab::executeCommand(IRCTab *tab, QString line) {
}
- }
- } else {
- tab->appendText("<font color=\"" + m_errorColor + "\">Unknown command</font><br>");
+ }
+ }
+ else {
+ tab->appendText("<font color=\"" + m_errorColor + "\">Unknown command</font><br>");
}
@@ -155,3 +244,3 @@ IRCChannelTab *IRCServerTab::getTabForChannel(IRCChannel *channel) {
QListIterator<IRCChannelTab> it(m_channelTabs);
-
+
for (; it.current(); ++it) {
@@ -165,3 +254,3 @@ IRCQueryTab *IRCServerTab::getTabForQuery(IRCPerson *person) {
QListIterator<IRCQueryTab> it(m_queryTabs);
-
+
for (; it.current(); ++it) {
diff --git a/noncore/net/opieirc/ircservertab.h b/noncore/net/opieirc/ircservertab.h
index 8d24cba..48200d7 100644
--- a/noncore/net/opieirc/ircservertab.h
+++ b/noncore/net/opieirc/ircservertab.h
@@ -22,3 +22,4 @@
#define __IRCSERVERTAB_H
-
+#include <qpe/qpeapplication.h>
+#include <qpe/qcopenvelope_qws.h>
#include "irctab.h"
@@ -30,2 +31,3 @@
+
class IRCServerTab : public IRCTab {
@@ -42,2 +44,3 @@ public:
void doConnect();
+// QString *mynick();
/* Remove tabs from the internal tab lists */
@@ -55,2 +58,3 @@ protected:
public slots:
+ void scrolling();
void remove();
diff --git a/noncore/net/opieirc/ircsession.cpp b/noncore/net/opieirc/ircsession.cpp
index 122a943..1cc1ee2 100644
--- a/noncore/net/opieirc/ircsession.cpp
+++ b/noncore/net/opieirc/ircsession.cpp
@@ -30,2 +30,38 @@ void IRCSession::join(QString channelname) {
+void IRCSession::quit(){
+ m_connection->sendLine("QUIT :[OI] I'm too good to need a reason");
+}
+
+void IRCSession::quit(QString message){
+ m_connection->sendLine("QUIT :" + message);
+}
+
+void IRCSession::topic(IRCChannel *channel, QString message){
+ m_connection->sendLine("TOPIC :" + channel->channelname() + " " + message);
+}
+
+void IRCSession::mode(IRCChannel *channel, QString message){
+ m_connection->sendLine("MODE " + channel->channelname() + " " + message);
+}
+
+void IRCSession::mode(IRCPerson *person, QString message){
+ m_connection->sendLine("MODE " + person->nick() + " " + message);
+}
+
+void IRCSession::mode(QString message){
+ m_connection->sendLine("MODE " + message);
+}
+
+void IRCSession::raw(QString message){
+ m_connection->sendLine(message);
+}
+
+void IRCSession::kick(IRCChannel *channel, IRCPerson *person) {
+ m_connection->sendLine("KICK "+ channel->channelname() + " " + person->nick() +" :0wn3d - no reason");
+}
+
+void IRCSession::kick(IRCChannel *channel, IRCPerson *person, QString message) {
+ m_connection->sendLine("KICK "+ channel->channelname() + " " + person->nick() +" :" + message);
+}
+
void IRCSession::sendMessage(IRCPerson *person, QString message) {
@@ -110,2 +146 @@ void IRCSession::handleMessage(IRCMessage *message) {
}
-
diff --git a/noncore/net/opieirc/ircsession.h b/noncore/net/opieirc/ircsession.h
index aa4bed3..a6a3e50 100644
--- a/noncore/net/opieirc/ircsession.h
+++ b/noncore/net/opieirc/ircsession.h
@@ -45,3 +45,12 @@ public:
void join(QString channel);
+ void quit(QString message);
+ void quit();
+ void raw(QString message);
+ void topic(IRCChannel *channel, QString message);
+ void mode(IRCChannel *channel, QString message);
+ void mode(IRCPerson *person, QString message);
+ void mode(QString message);
void part(IRCChannel *channel);
+ void kick(IRCChannel *channel, IRCPerson *person);
+ void kick(IRCChannel *channel, IRCPerson *person, QString message);
void beginSession();
@@ -49,3 +58,2 @@ public:
void endSession();
-
void sendMessage(IRCPerson *person, QString message);
diff --git a/noncore/net/opieirc/mainwindow.cpp b/noncore/net/opieirc/mainwindow.cpp
index 3ed29e3..8f76cdd 100644
--- a/noncore/net/opieirc/mainwindow.cpp
+++ b/noncore/net/opieirc/mainwindow.cpp
@@ -32,2 +32,6 @@ MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(
+/*IRCTabWidget MainWindow::getTabWidget(){
+ return m_tabWidget;
+} */
+
void MainWindow::loadSettings() {
@@ -47,2 +51,3 @@ void MainWindow::selected(QWidget *) {
m_tabWidget->setTabColor(m_tabWidget->currentPageIndex(), black);
+ emit updateScroll();
}
diff --git a/noncore/net/opieirc/mainwindow.h b/noncore/net/opieirc/mainwindow.h
index 9946f10..bd1a9ce 100644
--- a/noncore/net/opieirc/mainwindow.h
+++ b/noncore/net/opieirc/mainwindow.h
@@ -34,5 +34,7 @@ public:
MainWindow(QWidget *parent = 0, const char *name = 0, WFlags f = 0);
-
+// IRCTabWidget getTabWidget();
void addTab(IRCTab *tab);
void killTab(IRCTab *tab);
+signals:
+ void updateScroll();
protected slots: