[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdeextragear-2/konversation/konversation
From:       John Tapsell <john () geola ! co ! uk>
Date:       2004-08-19 19:08:22
Message-ID: 20040819190822.4777794A3 () office ! kde ! org
[Download RAW message or body]

CVS commit by johnflux: 

For asthetics and understanding, don't print certain "connection failed" messages
twice in the server window.


  M +11 -2     konversationmainwindow.cpp   1.115
  M +3 -3      server.cpp   1.234


--- kdeextragear-2/konversation/konversation/server.cpp  #1.233:1.234
@@ -645,10 +645,10 @@ void Server::broken(int state)
   {
     statusView->appendServerMessage(i18n("Error"),i18n("Connection to Server %1 \
                lost. Trying to reconnect.").arg(serverName));
-    getMainWindow()->appendToFrontmost(i18n("Error"),i18n("Connection to Server %1 \
lost. Trying to reconnect.").arg(serverName),statusView); +    \
getMainWindow()->appendToFrontmostIfDifferent(i18n("Error"),i18n("Connection to \
Server %1 lost. Trying to reconnect.").arg(serverName),statusView);  // TODO: Make \
retry counter configurable  if(++reconnectCounter==10)
     {
       statusView->appendServerMessage(i18n("Error"),i18n("Connection to Server %1 \
                failed.").arg(serverName));
-      getMainWindow()->appendToFrontmost(i18n("Error"),i18n("Connection to Server %1 \
failed.").arg(serverName),statusView); +      \
getMainWindow()->appendToFrontmostIfDifferent(i18n("Error"),i18n("Connection to \
Server %1 failed.").arg(serverName),statusView);  reconnectCounter=0;
       rejoinChannels = false;
@@ -668,5 +668,5 @@ void Server::broken(int state)
   {
     statusView->appendServerMessage(i18n("Error"),i18n("Connection to Server %1 \
                closed.").arg(serverName));
-    getMainWindow()->appendToFrontmost(i18n("Error"),i18n("Connection to Server %1 \
closed.").arg(serverName),statusView); +    \
getMainWindow()->appendToFrontmostIfDifferent(i18n("Error"),i18n("Connection to \
Server %1 closed.").arg(serverName),statusView);  }
 

--- kdeextragear-2/konversation/konversation/konversationmainwindow.cpp  #1.114:1.115
@@ -339,9 +339,18 @@ void KonversationMainWindow::showStatusb
 #endif
 }
-
+/** Call this when you have already put a message in the serverView window, and want \
a message in the front most + *  window if it's on the same server, but not put the \
message twice. + */
+void KonversationMainWindow::appendToFrontmostIfDifferent(const QString& type,const \
QString& message,ChatWindow* serverView) +{
+  Q_ASSERT(serverView); if(!serverView) return;
+  updateFrontView();
+  if(frontView && (ChatWindow *)frontView != serverView && \
frontView->getServer()==serverView->getServer()) +    \
frontView->appendServerMessage(type,message); +}
 void KonversationMainWindow::appendToFrontmost(const QString& type,const QString& \
message,ChatWindow* serverView)  {
   // TODO: Make it an option to direct all status stuff into the status panel
-
+  Q_ASSERT(serverView); if(!serverView) return;
   updateFrontView();
   if(!frontView ||                                                  // Check if the \
frontView can actually display text or ...


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic