summaryrefslogtreecommitdiff
path: root/noncore/net/opieirc/ircmisc.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/opieirc/ircmisc.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieirc/ircmisc.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/noncore/net/opieirc/ircmisc.cpp b/noncore/net/opieirc/ircmisc.cpp
index 22387b3..6d93a34 100644
--- a/noncore/net/opieirc/ircmisc.cpp
+++ b/noncore/net/opieirc/ircmisc.cpp
@@ -1,27 +1,30 @@
-#include <stdio.h>
#include "ircmisc.h"
+/* OPIE */
+#include <opie2/odebug.h>
+using namespace Opie::Core;
+
IRCTabBar::IRCTabBar(QWidget *parent, const char *name) : QTabBar(parent, name) {
}
int IRCTabBar::insertTab(QTab *tab, int index) {
/* FIXME: find some nicer way to do this */
QExtTab *ext = new QExtTab();
ext->color = black;
ext->label = tab->text();
ext->r = tab->rect();
ext->enabled = tab->isEnabled();
ext->iconset = tab->iconSet();
delete tab;
return QTabBar::insertTab(ext, index);
}
void IRCTabBar::setTabColor(int index, QColor color) {
((QExtTab *)tab(index))->color = color;
update();
}
void IRCTabBar::paintLabel(QPainter* p, const QRect& br, QTab* t, bool focus) const {
QRect r = br;
QTabBar::paintLabel(p, br, t, focus);
if (t->id == currentTab())
@@ -43,41 +46,41 @@ IRCHistoryLineEdit::IRCHistoryLineEdit(QWidget *parent, const char *name) : QLin
m_index = -1;
installEventFilter(this);
}
void IRCHistoryLineEdit::keyPressEvent(QKeyEvent *event) {
int key = event->key();
if (key == Key_Up) {
if (m_history.count() > 0 && m_index < (signed int)m_history.count()-1) {
m_index++;
setText(m_history[m_index]);
}
} else if (key == Key_Down) {
if (m_history.count() > 0 && m_index > 0) {
m_index--;
setText(m_history[m_index]);
}
if (m_index == 0) {
m_index = -1;
setText("");
}
} else if (key == Key_Return) {
m_history.prepend(text());
m_index = -1;
} else if (key == Key_Tab) {
- printf("got tab\n");
+ odebug << "got tab" << oendl;
return;
}
QLineEdit::keyPressEvent(event);
}
bool IRCHistoryLineEdit::eventFilter(QObject *object, QEvent *event) {
if (event->type() == QEvent::KeyPress) {
QKeyEvent *k = (QKeyEvent *) event;
/* Catch tab characters */
if (k->key() == Key_Tab) {
- qDebug("tab!");
+ odebug << "tab!" << oendl;
return TRUE;
}
}
return QLineEdit::eventFilter(object, event);
}