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

List:       kde-commits
Subject:    kdenetwork/kopete/libkopete
From:       Olivier Goffart <ogoffart () kde ! org>
Date:       2005-05-01 16:27:29
Message-ID: 20050501162729.69BF3669 () office ! kde ! org
[Download RAW message or body]

CVS commit by ogoffart: 

*Add a new didconnection reason: "OtherClient" used when we are connected with \
                another client
*Handle BadPassword disconnectionReason in passwordedAccount


  M +6 -0      kopeteaccount.cpp   1.143
  M +6 -2      kopeteaccount.h   1.91
  M +9 -0      kopetepasswordedaccount.cpp   1.11
  M +9 -0      kopetepasswordedaccount.h   1.10


--- kdenetwork/kopete/libkopete/kopeteaccount.cpp  #1.142:1.143
@@ -115,4 +115,10 @@ void Account::disconnected( DisconnectRe
                 QTimer::singleShot(0, this, SLOT(connect()));
         }
+        if(reason== OtherClient)
+        {
+                KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), \
KMessageBox::Information , +                        i18n( "You have connected from \
another client or computer to the account '%1'" ).arg(d->id) , +                      \
i18n ("Account diconnected - Kopete") ); +        }
 }
 

--- kdenetwork/kopete/libkopete/kopeteaccount.h  #1.90:1.91
@@ -88,4 +88,5 @@ public:
          */
         enum DisconnectReason {
+                OtherClient = -4,    ///< connection went down because another \
                client connected the same account
                 BadPassword = -3,    ///< connection failed because password was \
                incorrect
                 BadUserName = -2,    ///< connection failed because user name was \
invalid / unknown @@ -368,7 +369,10 @@ protected slots:
          * @p reason, this function may attempt to reconnect to the server.
          *
+         * - BadPassword will ask again for the password
+         * - OtherClient will show a message box
+         *
          * @param reason the reason for the disconnection.
          */
-        virtual void disconnected( DisconnectReason reason );
+        virtual void disconnected( Kopete::Account::DisconnectReason reason );
 
         /**

--- kdenetwork/kopete/libkopete/kopetepasswordedaccount.cpp  #1.10:1.11
@@ -97,4 +97,13 @@ bool Kopete::PasswordedAccount::removeAc
 }
 
+void Kopete::PasswordedAccount::disconnected( Kopete::Account::DisconnectReason \
reason ) +{
+        if(reason==Kopete::Account::BadPassword || \
reason==Kopete::Account::BadUserName) +        {
+                password().setWrong(true);
+        }
+        Kopete::Account::disconnected(reason);
+}
+
 
 #include "kopetepasswordedaccount.moc"

--- kdenetwork/kopete/libkopete/kopetepasswordedaccount.h  #1.9:1.10
@@ -105,4 +106,12 @@ protected:
         virtual QString passwordPrompt();
 
+protected slots:
+        /**
+         * @internal
+         * Reimplemented to set the password wrong if the reason is BadPassword
+         */
+        virtual void disconnected( Kopete::Account::DisconnectReason reason );
+
+
 private:
         class Private;


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

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