summaryrefslogtreecommitdiff
path: root/noncore/net/opieirc/ircservertab.cpp
Unidiff
Diffstat (limited to 'noncore/net/opieirc/ircservertab.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieirc/ircservertab.cpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/noncore/net/opieirc/ircservertab.cpp b/noncore/net/opieirc/ircservertab.cpp
index 2a34c0b..5ca7a29 100644
--- a/noncore/net/opieirc/ircservertab.cpp
+++ b/noncore/net/opieirc/ircservertab.cpp
@@ -4,7 +4,8 @@
4 4
5 5
6bool IRCServerTab::containsPing( const QString& text, IRCServerTab* tab ) { 6bool IRCServerTab::containsPing( const QString& text, IRCServerTab* tab ) {
7 return (text.find("ping") != -1 && text.find( tab->server()->nick() != -1)); 7 return (text.contains(IRCMessageParser::tr("Received a CTCP PING from "))) ||
8 (text.find("ping") != -1 && text.find( tab->server()->nick() != -1));
8} 9}
9 10
10 11
@@ -30,10 +31,13 @@ IRCServerTab::IRCServerTab(IRCServer server, MainWindow *mainWindow, QWidget *pa
30 QWhatsThis::add(m_field, tr("Type commands here. A list of available commands can be found inside the OpieIRC help")); 31 QWhatsThis::add(m_field, tr("Type commands here. A list of available commands can be found inside the OpieIRC help"));
31 m_layout->add(m_field); 32 m_layout->add(m_field);
32 connect(m_field, SIGNAL(returnPressed()), this, SLOT(processCommand())); 33 connect(m_field, SIGNAL(returnPressed()), this, SLOT(processCommand()));
33 m_field->setFocus();
34 connect(m_session, SIGNAL(outputReady(IRCOutput)), this, SLOT(display(IRCOutput))); 34 connect(m_session, SIGNAL(outputReady(IRCOutput)), this, SLOT(display(IRCOutput)));
35 connect(m_mainWindow, SIGNAL(updateScroll()), this, SLOT(scrolling())); 35 connect(m_mainWindow, SIGNAL(updateScroll()), this, SLOT(scrolling()));
36 settingsChanged(); 36 settingsChanged();
37
38 m_field->setFocus();
39 m_field->setActiveWindow();
40
37} 41}
38 42
39void IRCServerTab::scrolling(){ 43void IRCServerTab::scrolling(){
@@ -43,7 +47,10 @@ void IRCServerTab::scrolling(){
43 47
44void IRCServerTab::appendText(QString text) { 48void IRCServerTab::appendText(QString text) {
45 /* not using append because it creates layout problems */ 49 /* not using append because it creates layout problems */
46 QString txt = m_textview->text() + text + "\n"; 50 QString txt = m_textview->text() + IRCTab::appendTimestamp( text );
51
52
53
47 if (m_maxLines > 0 && m_lines >= m_maxLines) { 54 if (m_maxLines > 0 && m_lines >= m_maxLines) {
48 int firstBreak = txt.find('\n'); 55 int firstBreak = txt.find('\n');
49 if (firstBreak != -1) { 56 if (firstBreak != -1) {
@@ -234,11 +241,11 @@ void IRCServerTab::remove() {
234 /* Session has previously been closed */ 241 /* Session has previously been closed */
235 m_channelTabs.first(); 242 m_channelTabs.first();
236 while (m_channelTabs.current() != 0) { 243 while (m_channelTabs.current() != 0) {
237 m_mainWindow->killTab(m_channelTabs.current()); 244 m_mainWindow->killTab(m_channelTabs.current(), true);
238 } 245 }
239 m_queryTabs.first(); 246 m_queryTabs.first();
240 while (m_queryTabs.current() != 0) { 247 while (m_queryTabs.current() != 0) {
241 m_mainWindow->killTab(m_queryTabs.current()); 248 m_mainWindow->killTab(m_queryTabs.current(), true);
242 } 249 }
243 m_mainWindow->killTab(this); 250 m_mainWindow->killTab(this);
244 } 251 }
@@ -272,11 +279,11 @@ void IRCServerTab::display(IRCOutput output) {
272 if (m_close) { 279 if (m_close) {
273 m_channelTabs.first(); 280 m_channelTabs.first();
274 while (m_channelTabs.current() != 0) { 281 while (m_channelTabs.current() != 0) {
275 m_mainWindow->killTab(m_channelTabs.current()); 282 m_mainWindow->killTab(m_channelTabs.current(), true);
276 } 283 }
277 m_queryTabs.first(); 284 m_queryTabs.first();
278 while (m_queryTabs.current() != 0) { 285 while (m_queryTabs.current() != 0) {
279 m_mainWindow->killTab(m_queryTabs.current()); 286 m_mainWindow->killTab(m_queryTabs.current(), true);
280 } 287 }
281 m_mainWindow->killTab(this); 288 m_mainWindow->killTab(this);
282 } else { 289 } else {
@@ -312,14 +319,14 @@ void IRCServerTab::display(IRCOutput output) {
312 case OUTPUT_SELFPART: { 319 case OUTPUT_SELFPART: {
313 IRCChannelTab *channelTab = getTabForChannel((IRCChannel *)output.getParam(0)); 320 IRCChannelTab *channelTab = getTabForChannel((IRCChannel *)output.getParam(0));
314 if (channelTab) 321 if (channelTab)
315 m_mainWindow->killTab(channelTab); 322 m_mainWindow->killTab(channelTab, true);
316 } 323 }
317 break; 324 break;
318 case OUTPUT_SELFKICK: { 325 case OUTPUT_SELFKICK: {
319 appendText("<font color=\"" + m_errorColor + "\">" + output.htmlMessage() + "</font><br>"); 326 appendText("<font color=\"" + m_errorColor + "\">" + output.htmlMessage() + "</font><br>");
320 IRCChannelTab *channelTab = getTabForChannel((IRCChannel *)output.getParam(0)); 327 IRCChannelTab *channelTab = getTabForChannel((IRCChannel *)output.getParam(0));
321 if (channelTab) 328 if (channelTab)
322 m_mainWindow->killTab(channelTab); 329 m_mainWindow->killTab(channelTab, true);
323 } 330 }
324 break; 331 break;
325 case OUTPUT_CHANACTION: { 332 case OUTPUT_CHANACTION: {