author | zecke <zecke> | 2004-09-08 21:51:06 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-09-08 21:51:06 (UTC) |
commit | ebb830522c9662bda4c4453e532bcc29631c5d60 (patch) (unidiff) | |
tree | 5cf95975e91cb2db78be5cdf47c01a340109c1f4 /noncore/net/opieirc/ircservertab.cpp | |
parent | f0fdb800d57e9a1d95ba593185e9462300539eea (diff) | |
download | opie-ebb830522c9662bda4c4453e532bcc29631c5d60.zip opie-ebb830522c9662bda4c4453e532bcc29631c5d60.tar.gz opie-ebb830522c9662bda4c4453e532bcc29631c5d60.tar.bz2 |
-Close Tab Keyboard Accelerator with delayed deletion of the tab
-Optionally add a TimeStamp to the Tab
-Remove not implemented CTCP actions from the Channel PopupMenu
-Give Focus to the Edit Line
-Some more ping handling
patch inspired and copied from zautrix fork
Diffstat (limited to 'noncore/net/opieirc/ircservertab.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opieirc/ircservertab.cpp | 25 |
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 | ||
6 | bool IRCServerTab::containsPing( const QString& text, IRCServerTab* tab ) { | 6 | bool 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 | ||
39 | void IRCServerTab::scrolling(){ | 43 | void IRCServerTab::scrolling(){ |
@@ -43,7 +47,10 @@ void IRCServerTab::scrolling(){ | |||
43 | 47 | ||
44 | void IRCServerTab::appendText(QString text) { | 48 | void 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: { |