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.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/noncore/net/opieirc/ircchanneltab.cpp b/noncore/net/opieirc/ircchanneltab.cpp
index b6e3954..7610058 100644
--- a/noncore/net/opieirc/ircchanneltab.cpp
+++ b/noncore/net/opieirc/ircchanneltab.cpp
@@ -16,4 +16,5 @@ IRCChannelTab::IRCChannelTab(IRCChannel *channel, IRCServerTab *parentTab, MainW
m_listVisible = TRUE;
m_listButton = new QPushButton(">", m_textview);
+ m_listButton->setFlat( true );
m_textview->setCornerWidget(m_listButton);
m_textview->setTextFormat(RichText);
@@ -26,5 +27,5 @@ IRCChannelTab::IRCChannelTab(IRCChannel *channel, IRCServerTab *parentTab, MainW
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(m_field, SIGNAL(closeTab()), this, SLOT(remove()));
connect(this, SIGNAL(editFocus()), m_field, SLOT(setEditFocus()));
@@ -37,5 +38,4 @@ IRCChannelTab::IRCChannelTab(IRCChannel *channel, IRCServerTab *parentTab, MainW
/* Construct the popup menu */
QPopupMenu *ctcpMenu = new QPopupMenu(m_list);
- m_popup->insertItem(Resource::loadPixmap("opieirc/ctcp"), tr("CTCP"), ctcpMenu);
m_popup->insertItem(Resource::loadPixmap("opieirc/query"), tr("Query"), this, SLOT(popupQuery()));
ctcpMenu->insertItem(Resource::loadPixmap("opieirc/ping"), tr("Ping"), this, SLOT(popupPing()));
@@ -50,4 +50,5 @@ IRCChannelTab::IRCChannelTab(IRCChannel *channel, IRCServerTab *parentTab, MainW
connect(m_field, SIGNAL(returnPressed()), this, SLOT(processCommand()));
+ connect(m_list, SIGNAL(doubleClicked ( QListBoxItem * ) ), this, SLOT(popupQuery( QListBoxItem * ) ));
settingsChanged();
}
@@ -59,5 +60,5 @@ void IRCChannelTab::scrolling(){
void IRCChannelTab::appendText(QString text) {
/* not using append because it creates layout problems */
- QString txt = m_textview->text() + text + "\n";
+ QString txt = m_textview->text() + IRCTab::appendTimestamp( text );
if (m_maxLines > 0 && m_lines >= m_maxLines) {
int firstBreak = txt.find('\n');
@@ -73,5 +74,7 @@ void IRCChannelTab::appendText(QString text) {
int p1, p2;
- if ( (p1 = text.find("ping", 0, false) )!= -1 && (p2 = text.find( m_parentTab->server()->nick(), 0,false )) != -1 ) {
+ if ( text.contains( IRCMessageParser::tr("Received a CTCP PING from ") ) )
+ emit ping( title() );
+ else 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 )
@@ -133,7 +136,7 @@ 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());
+void IRCChannelTab::popupQuery( QListBoxItem *item) {
+ if (item) {
+ IRCPerson *person = session()->getPerson(item->text());
if (person) {
IRCQueryTab *tab = m_parentTab->getTabForQuery(person);
@@ -147,4 +150,9 @@ void IRCChannelTab::popupQuery() {
}
+void IRCChannelTab::popupQuery() {
+ if ( m_list->currentItem() != -1 )
+ popupQuery( m_list->item(m_list->currentItem()));
+}
+
void IRCChannelTab::popupPing() {
//HAHA, no wonder these don't work