Diffstat (limited to 'noncore/net/opieirc/ircmisc.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opieirc/ircmisc.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
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 | |||
@@ -57,30 +57,43 @@ void IRCHistoryLineEdit::keyPressEvent(QKeyEvent *event) { | |||
57 | } else if (key == Key_Down) { | 57 | } else if (key == Key_Down) { |
58 | if (m_history.count() > 0 && m_index > 0) { | 58 | if (m_history.count() > 0 && m_index > 0) { |
59 | m_index--; | 59 | m_index--; |
60 | setText(m_history[m_index]); | 60 | setText(m_history[m_index]); |
61 | } | 61 | } |
62 | if (m_index == 0) { | 62 | if (m_index == 0) { |
63 | m_index = -1; | 63 | m_index = -1; |
64 | setText(""); | 64 | setText(""); |
65 | } | 65 | } |
66 | } else if (key == Key_Return) { | 66 | } else if (key == Key_Return) { |
67 | m_history.prepend(text()); | 67 | m_history.prepend(text()); |
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); |
74 | } | 81 | } |
75 | 82 | ||
76 | bool IRCHistoryLineEdit::eventFilter(QObject *object, QEvent *event) { | 83 | bool IRCHistoryLineEdit::eventFilter(QObject *object, QEvent *event) { |
77 | if (event->type() == QEvent::KeyPress) { | 84 | if (event->type() == QEvent::KeyPress) { |
78 | QKeyEvent *k = (QKeyEvent *) event; | 85 | QKeyEvent *k = (QKeyEvent *) event; |
79 | /* Catch tab characters */ | 86 | /* Catch tab characters */ |
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; |
83 | } | 90 | } |
84 | } | 91 | } |
85 | return QLineEdit::eventFilter(object, event); | 92 | return QLineEdit::eventFilter(object, event); |
86 | } | 93 | } |
94 | |||
95 | |||
96 | void IRCHistoryLineEdit::setEditFocus() { | ||
97 | setActiveWindow(); | ||
98 | setFocus(); | ||
99 | } | ||