Diffstat (limited to 'noncore/net/opieirc/ircchanneltab.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opieirc/ircchanneltab.cpp | 18 |
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 | |||
20 | QWhatsThis::add(m_textview, tr("Channel discussion")); | 20 | QWhatsThis::add(m_textview, tr("Channel discussion")); |
21 | connect(m_listButton, SIGNAL(clicked()), this, SLOT(toggleList())); | 21 | connect(m_listButton, SIGNAL(clicked()), this, SLOT(toggleList())); |
22 | m_list = new IRCChannelList(m_channel, hbox); | 22 | m_list = new IRCChannelList(m_channel, hbox); |
23 | m_list->update(); | 23 | m_list->update(); |
24 | m_list->setMaximumWidth(LISTWIDTH); | 24 | m_list->setMaximumWidth(LISTWIDTH); |
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")); |
27 | m_popup = new QPopupMenu(m_list); | 32 | m_popup = new QPopupMenu(m_list); |
28 | m_lines = 0; | 33 | m_lines = 0; |
29 | /* Required so that embedded-style "right" clicks work */ | 34 | /* Required so that embedded-style "right" clicks work */ |
30 | QPEApplication::setStylusOperation(m_list->viewport(), QPEApplication::RightOnHold); | 35 | QPEApplication::setStylusOperation(m_list->viewport(), QPEApplication::RightOnHold); |
31 | connect(m_list, SIGNAL(mouseButtonPressed(int,QListBoxItem*,const QPoint&)), this, SLOT(mouseButtonPressed(int,QListBoxItem*,const QPoint&))); | 36 | 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 | |||
38 | ctcpMenu->insertItem(Resource::loadPixmap("opieirc/whois"), tr("Whois"), this, SLOT(popupWhois())); | 43 | ctcpMenu->insertItem(Resource::loadPixmap("opieirc/whois"), tr("Whois"), this, SLOT(popupWhois())); |
39 | connect(m_mainWindow, SIGNAL(updateScroll()), this, SLOT(scrolling())); | 44 | connect(m_mainWindow, SIGNAL(updateScroll()), this, SLOT(scrolling())); |
40 | m_layout->add(hbox); | 45 | m_layout->add(hbox); |
41 | hbox->show(); | 46 | hbox->show(); |
42 | m_layout->add(m_field); | 47 | m_layout->add(m_field); |
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())); |
45 | settingsChanged(); | 52 | settingsChanged(); |
46 | } | 53 | } |
47 | 54 | ||
48 | void IRCChannelTab::scrolling(){ | 55 | void IRCChannelTab::scrolling(){ |
49 | m_textview->ensureVisible(0, m_textview->contentsHeight()); | 56 | m_textview->ensureVisible(0, m_textview->contentsHeight()); |
@@ -60,12 +67,21 @@ void IRCChannelTab::appendText(QString text) { | |||
60 | } else { | 67 | } else { |
61 | m_lines++; | 68 | m_lines++; |
62 | } | 69 | } |
63 | m_textview->ensureVisible(0, m_textview->contentsHeight()); | 70 | m_textview->ensureVisible(0, m_textview->contentsHeight()); |
64 | m_textview->setText(txt); | 71 | m_textview->setText(txt); |
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); |
67 | } | 83 | } |
68 | 84 | ||
69 | IRCChannelTab::~IRCChannelTab() { | 85 | IRCChannelTab::~IRCChannelTab() { |
70 | m_parentTab->removeChannelTab(this); | 86 | m_parentTab->removeChannelTab(this); |
71 | } | 87 | } |
@@ -119,13 +135,13 @@ void IRCChannelTab::mouseButtonPressed(int mouse, QListBoxItem *, const QPoint & | |||
119 | void IRCChannelTab::popupQuery() { | 135 | void IRCChannelTab::popupQuery() { |
120 | if (m_list->currentItem() != -1) { | 136 | if (m_list->currentItem() != -1) { |
121 | IRCPerson *person = session()->getPerson(m_list->item(m_list->currentItem())->text()); | 137 | IRCPerson *person = session()->getPerson(m_list->item(m_list->currentItem())->text()); |
122 | if (person) { | 138 | if (person) { |
123 | IRCQueryTab *tab = m_parentTab->getTabForQuery(person); | 139 | IRCQueryTab *tab = m_parentTab->getTabForQuery(person); |
124 | if (!tab) { | 140 | if (!tab) { |
125 | tab = new IRCQueryTab(person, m_parentTab, m_mainWindow, (QWidget *)parent()); | 141 | tab = new IRCQueryTab(person, m_parentTab, m_mainWindow, (QWidget *)parent()); |
126 | m_parentTab->addQueryTab(tab); | 142 | m_parentTab->addQueryTab(tab); |
127 | m_mainWindow->addTab(tab); | 143 | m_mainWindow->addTab(tab); |
128 | } | 144 | } |
129 | } | 145 | } |
130 | } | 146 | } |
131 | } | 147 | } |