summaryrefslogtreecommitdiff
path: root/noncore/net/opieirc/ircchanneltab.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/opieirc/ircchanneltab.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieirc/ircchanneltab.cpp18
1 files changed, 17 insertions, 1 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
@@ -20,12 +20,17 @@ IRCChannelTab::IRCChannelTab(IRCChannel *channel, IRCServerTab *parentTab, MainW
QWhatsThis::add(m_textview, tr("Channel discussion"));
connect(m_listButton, SIGNAL(clicked()), this, SLOT(toggleList()));
m_list = new IRCChannelList(m_channel, hbox);
m_list->update();
m_list->setMaximumWidth(LISTWIDTH);
m_field = new IRCHistoryLineEdit(this);
+ connect(m_field, SIGNAL(nextTab()), this, SIGNAL(nextTab()));
+ connect(m_field, SIGNAL(prevTab()), this, SIGNAL(prevTab()));
+ connect(m_field, SIGNAL(closeTab()), this, SIGNAL(closeTab()));
+ connect(this, SIGNAL(editFocus()), m_field, SLOT(setEditFocus()));
+
QWhatsThis::add(m_field, tr("Type your message here to participate in the channel discussion"));
m_popup = new QPopupMenu(m_list);
m_lines = 0;
/* Required so that embedded-style "right" clicks work */
QPEApplication::setStylusOperation(m_list->viewport(), QPEApplication::RightOnHold);
connect(m_list, SIGNAL(mouseButtonPressed(int,QListBoxItem*,const QPoint&)), this, SLOT(mouseButtonPressed(int,QListBoxItem*,const QPoint&)));
@@ -38,12 +43,14 @@ 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);
hbox->show();
m_layout->add(m_field);
m_field->setFocus();
+ m_field->setActiveWindow();
+
connect(m_field, SIGNAL(returnPressed()), this, SLOT(processCommand()));
settingsChanged();
}
void IRCChannelTab::scrolling(){
m_textview->ensureVisible(0, m_textview->contentsHeight());
@@ -60,12 +67,21 @@ void IRCChannelTab::appendText(QString text) {
} else {
m_lines++;
}
m_textview->ensureVisible(0, m_textview->contentsHeight());
m_textview->setText(txt);
m_textview->ensureVisible(0, m_textview->contentsHeight());
+
+ int p1, p2;
+ if ( (p1 = text.find("ping", 0, false) )!= -1 && (p2 = text.find( m_parentTab->server()->nick(), 0,false )) != -1 ) {
+ int col = text.findRev("color", -1, false);
+ if ( col < p2 )
+ emit ping( title() );
+
+ }
+
emit changed(this);
}
IRCChannelTab::~IRCChannelTab() {
m_parentTab->removeChannelTab(this);
}
@@ -119,13 +135,13 @@ void IRCChannelTab::mouseButtonPressed(int mouse, QListBoxItem *, const QPoint &
void IRCChannelTab::popupQuery() {
if (m_list->currentItem() != -1) {
IRCPerson *person = session()->getPerson(m_list->item(m_list->currentItem())->text());
if (person) {
IRCQueryTab *tab = m_parentTab->getTabForQuery(person);
if (!tab) {
- tab = new IRCQueryTab(person, m_parentTab, m_mainWindow, (QWidget *)parent());
+ tab = new IRCQueryTab(person, m_parentTab, m_mainWindow, (QWidget *)parent());
m_parentTab->addQueryTab(tab);
m_mainWindow->addTab(tab);
}
}
}
}