summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/opieirc/ircchanneltab.cpp16
-rw-r--r--noncore/net/opieirc/ircmessageparser.cpp2
-rw-r--r--noncore/net/opieirc/ircmisc.cpp19
-rw-r--r--noncore/net/opieirc/ircmisc.h8
-rw-r--r--noncore/net/opieirc/ircquerytab.cpp9
-rw-r--r--noncore/net/opieirc/ircservertab.cpp11
-rw-r--r--noncore/net/opieirc/ircservertab.h2
-rw-r--r--noncore/net/opieirc/irctab.cpp7
-rw-r--r--noncore/net/opieirc/irctab.h10
-rw-r--r--noncore/net/opieirc/mainwindow.cpp37
-rw-r--r--noncore/net/opieirc/mainwindow.h7
11 files changed, 124 insertions, 4 deletions
diff --git a/noncore/net/opieirc/ircchanneltab.cpp b/noncore/net/opieirc/ircchanneltab.cpp
index 667e977..b6e3954 100644
--- a/noncore/net/opieirc/ircchanneltab.cpp
+++ b/noncore/net/opieirc/ircchanneltab.cpp
@@ -25,2 +25,7 @@ IRCChannelTab::IRCChannelTab(IRCChannel *channel, IRCServerTab *parentTab, MainW
25 m_field = new IRCHistoryLineEdit(this); 25 m_field = new IRCHistoryLineEdit(this);
26 connect(m_field, SIGNAL(nextTab()), this, SIGNAL(nextTab()));
27 connect(m_field, SIGNAL(prevTab()), this, SIGNAL(prevTab()));
28 connect(m_field, SIGNAL(closeTab()), this, SIGNAL(closeTab()));
29 connect(this, SIGNAL(editFocus()), m_field, SLOT(setEditFocus()));
30
26 QWhatsThis::add(m_field, tr("Type your message here to participate in the channel discussion")); 31 QWhatsThis::add(m_field, tr("Type your message here to participate in the channel discussion"));
@@ -43,2 +48,4 @@ IRCChannelTab::IRCChannelTab(IRCChannel *channel, IRCServerTab *parentTab, MainW
43 m_field->setFocus(); 48 m_field->setFocus();
49 m_field->setActiveWindow();
50
44 connect(m_field, SIGNAL(returnPressed()), this, SLOT(processCommand())); 51 connect(m_field, SIGNAL(returnPressed()), this, SLOT(processCommand()));
@@ -65,2 +72,11 @@ void IRCChannelTab::appendText(QString text) {
65 m_textview->ensureVisible(0, m_textview->contentsHeight()); 72 m_textview->ensureVisible(0, m_textview->contentsHeight());
73
74 int p1, p2;
75 if ( (p1 = text.find("ping", 0, false) )!= -1 && (p2 = text.find( m_parentTab->server()->nick(), 0,false )) != -1 ) {
76 int col = text.findRev("color", -1, false);
77 if ( col < p2 )
78 emit ping( title() );
79
80 }
81
66 emit changed(this); 82 emit changed(this);
diff --git a/noncore/net/opieirc/ircmessageparser.cpp b/noncore/net/opieirc/ircmessageparser.cpp
index 400ff41..90280d7 100644
--- a/noncore/net/opieirc/ircmessageparser.cpp
+++ b/noncore/net/opieirc/ircmessageparser.cpp
@@ -173,3 +173,3 @@ void IRCMessageParser::parseLiteralPart(IRCMessage *message) {
173void IRCMessageParser::parseLiteralPrivMsg(IRCMessage *message) { 173void IRCMessageParser::parseLiteralPrivMsg(IRCMessage *message) {
174 if (m_session->m_server->nick() == message->param(0)) { 174 if (m_session->m_server->nick().lower() == message->param(0).lower() ) {
175 /* IRC Query message detected, verify sender and display it */ 175 /* IRC Query message detected, verify sender and display it */
diff --git a/noncore/net/opieirc/ircmisc.cpp b/noncore/net/opieirc/ircmisc.cpp
index 6d93a34..df6f874 100644
--- a/noncore/net/opieirc/ircmisc.cpp
+++ b/noncore/net/opieirc/ircmisc.cpp
@@ -68,6 +68,13 @@ void IRCHistoryLineEdit::keyPressEvent(QKeyEvent *event) {
68 m_index = -1; 68 m_index = -1;
69 } else if (key == Key_Tab) { 69 } else if (key == Key_N && event->state() == Qt::ControlButton) {
70 odebug << "got tab" << oendl; 70 emit nextTab();
71 return;
72 } else if ( ( key == Key_Y || key == Key_Z ) && event->state() == Qt::ControlButton) {
73 emit closeTab();
74 return;
75 } else if (key == Key_P && event->state() == Qt::ControlButton) {
76 emit prevTab();
71 return; 77 return;
72 } 78 }
79
73 QLineEdit::keyPressEvent(event); 80 QLineEdit::keyPressEvent(event);
@@ -80,3 +87,3 @@ bool IRCHistoryLineEdit::eventFilter(QObject *object, QEvent *event) {
80 if (k->key() == Key_Tab) { 87 if (k->key() == Key_Tab) {
81 odebug << "tab!" << oendl; 88 emit nextTab();
82 return TRUE; 89 return TRUE;
@@ -86 +93,7 @@ bool IRCHistoryLineEdit::eventFilter(QObject *object, QEvent *event) {
86} 93}
94
95
96void IRCHistoryLineEdit::setEditFocus() {
97 setActiveWindow();
98 setFocus();
99}
diff --git a/noncore/net/opieirc/ircmisc.h b/noncore/net/opieirc/ircmisc.h
index b4a5b06..c42dcbd 100644
--- a/noncore/net/opieirc/ircmisc.h
+++ b/noncore/net/opieirc/ircmisc.h
@@ -63,2 +63,10 @@ public:
63 virtual bool eventFilter(QObject *object, QEvent *event); 63 virtual bool eventFilter(QObject *object, QEvent *event);
64public slots:
65 void setEditFocus();
66signals:
67 void nextTab();
68 void prevTab();
69 void closeTab();
70
71
64protected: 72protected:
diff --git a/noncore/net/opieirc/ircquerytab.cpp b/noncore/net/opieirc/ircquerytab.cpp
index a113b04..1fddc6d 100644
--- a/noncore/net/opieirc/ircquerytab.cpp
+++ b/noncore/net/opieirc/ircquerytab.cpp
@@ -18,2 +18,7 @@ IRCQueryTab::IRCQueryTab(IRCPerson *person, IRCServerTab *parentTab, MainWindow
18 m_field = new IRCHistoryLineEdit(this); 18 m_field = new IRCHistoryLineEdit(this);
19 connect(m_field, SIGNAL(nextTab()), this, SIGNAL(nextTab()));
20 connect(m_field, SIGNAL(prevTab()), this, SIGNAL(prevTab()));
21 connect(m_field, SIGNAL(closeTab()),this, SIGNAL(closeTab()));
22
23
19 QWhatsThis::add(m_field, tr("Type your text here in order to send a message to the other person")); 24 QWhatsThis::add(m_field, tr("Type your text here in order to send a message to the other person"));
@@ -46,2 +51,6 @@ void IRCQueryTab::appendText(QString text) {
46 m_textview->ensureVisible(0, m_textview->contentsHeight()); 51 m_textview->ensureVisible(0, m_textview->contentsHeight());
52
53 if ( IRCServerTab::containsPing( text, m_parentTab ) )
54 emit ping( title() );
55
47 emit changed(this); 56 emit changed(this);
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
@@ -4,2 +4,8 @@
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) {
@@ -18,2 +24,7 @@ IRCServerTab::IRCServerTab(IRCServer server, MainWindow *mainWindow, QWidget *pa
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"));
diff --git a/noncore/net/opieirc/ircservertab.h b/noncore/net/opieirc/ircservertab.h
index 48200d7..69543fc 100644
--- a/noncore/net/opieirc/ircservertab.h
+++ b/noncore/net/opieirc/ircservertab.h
@@ -35,2 +35,4 @@ class IRCServerTab : public IRCTab {
35public: 35public:
36 static bool containsPing(const QString& text, IRCServerTab *tab);
37
36 /* IRCTab implementation */ 38 /* IRCTab implementation */
diff --git a/noncore/net/opieirc/irctab.cpp b/noncore/net/opieirc/irctab.cpp
index 3351c3b..8e1dc16 100644
--- a/noncore/net/opieirc/irctab.cpp
+++ b/noncore/net/opieirc/irctab.cpp
@@ -4,2 +4,3 @@
4#include "irctab.h" 4#include "irctab.h"
5#include "mainwindow.h"
5 6
@@ -38 +39,7 @@ int IRCTab::id() {
38} 39}
40
41void IRCTab::showEvent( QShowEvent *ev ) {
42 topLevelWidget()->setCaption( MainWindow::appCaption() + " " + title() );
43 QWidget::showEvent( ev );
44 emit editFocus();
45}
diff --git a/noncore/net/opieirc/irctab.h b/noncore/net/opieirc/irctab.h
index 7a2d0a2..6c29ea5 100644
--- a/noncore/net/opieirc/irctab.h
+++ b/noncore/net/opieirc/irctab.h
@@ -45,2 +45,8 @@ signals:
45 void changed(IRCTab *); 45 void changed(IRCTab *);
46 void ping(const QString& );
47 void nextTab();
48 void prevTab();
49 void closeTab();
50 void editFocus();
51
46public slots: 52public slots:
@@ -48,2 +54,6 @@ public slots:
48 virtual void settingsChanged() = 0; 54 virtual void settingsChanged() = 0;
55
56protected:
57 void showEvent( QShowEvent* );
58
49protected: 59protected:
diff --git a/noncore/net/opieirc/mainwindow.cpp b/noncore/net/opieirc/mainwindow.cpp
index 0923a11..1143213 100644
--- a/noncore/net/opieirc/mainwindow.cpp
+++ b/noncore/net/opieirc/mainwindow.cpp
@@ -9,2 +9,7 @@
9 9
10QString MainWindow::appCaption() {
11 return QObject::tr("Opie IRC");
12}
13
14
10MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { 15MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) {
@@ -54,2 +59,7 @@ void MainWindow::addTab(IRCTab *tab) {
54 connect(tab, SIGNAL(changed(IRCTab*)), this, SLOT(changeEvent(IRCTab*))); 59 connect(tab, SIGNAL(changed(IRCTab*)), this, SLOT(changeEvent(IRCTab*)));
60 connect(tab, SIGNAL(ping (const QString&)), this, SLOT(slotPing(const QString&)));
61 connect(tab, SIGNAL(nextTab()), this, SLOT(slotNextTab()));
62 connect(tab, SIGNAL(prevTab()), this, SLOT(slotPrevTab()));
63 connect(tab, SIGNAL(closeTab()), this, SLOT(slotCloseTab()));
64
55 m_tabWidget->addTab(tab, tab->title()); 65 m_tabWidget->addTab(tab, tab->title());
@@ -91 +101,28 @@ void MainWindow::settings() {
91} 101}
102
103
104void MainWindow::slotNextTab() {
105 int i = m_tabWidget->currentPageIndex ();
106 m_tabWidget->setCurrentPage ( i+1 );
107
108 int j = m_tabWidget->currentPageIndex ();
109 if ( i == j )
110 m_tabWidget->setCurrentPage ( 1 );
111}
112
113void MainWindow::slotPrevTab() {
114 int i = m_tabWidget->currentPageIndex ();
115 if ( i > 1 )
116 m_tabWidget->setCurrentPage ( i-1 );
117}
118
119void MainWindow::slotCloseTab() {
120 IRCTab *tab = (IRCTab *) m_tabWidget->currentPage ();
121 if ( tab )
122 killTab ( tab );
123}
124
125void MainWindow::slotPing( const QString& channel ) {
126 raise();
127}
128
diff --git a/noncore/net/opieirc/mainwindow.h b/noncore/net/opieirc/mainwindow.h
index 0f60855..945fc71 100644
--- a/noncore/net/opieirc/mainwindow.h
+++ b/noncore/net/opieirc/mainwindow.h
@@ -38,2 +38,3 @@ public:
38 static QString appName() { return QString::fromLatin1("opieirc"); } 38 static QString appName() { return QString::fromLatin1("opieirc"); }
39 static QString appCaption();
39signals: 40signals:
@@ -45,2 +46,8 @@ protected slots:
45 void changeEvent(IRCTab *); 46 void changeEvent(IRCTab *);
47
48 void slotNextTab();
49 void slotPrevTab();
50 void slotCloseTab();
51 void slotPing(const QString&);
52
46protected: 53protected: