This patch fixes BUG 138600, 125186, 137395. It improve error handling in MSN plugin to use notifications instead of messages box. To do this I needed to introduce 1 new string(and I could introduce more but I stepped out) and do BIC changes in Kopete::Utils.
That's why I'm asking for a review first before commiting -- Michaël Larouche KDE developer working on Kopete, Gamefu(KDE), Solid...on dial-up :P -------------------------------------- Website: http://www.tehbisnatch.org/ MSN: [EMAIL PROTECTED] IRC: irc.freenode.org/DarkShock Jabber/email: [EMAIL PROTECTED]
Index: protocols/msn/msnsocket.cpp
===================================================================
--- protocols/msn/msnsocket.cpp (révision 612600)
+++ protocols/msn/msnsocket.cpp (copie de travail)
@@ -196,8 +196,7 @@
//like if the socket is closed
emit socketClosed();
- //KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Error, errormsg, i18n( "MSN Plugin" ) );
- emit errorMessage( ErrorNormal, errormsg );
+ emit errorMessage( ErrorConnectionError, errormsg );
}
void MSNSocket::slotDataReceived()
@@ -531,7 +530,7 @@
{
kdDebug(14140) << k_funcinfo << endl;
QString msg;
-
+ ErrorType type = ErrorServerError;
switch ( code )
{
/*
@@ -567,15 +566,19 @@
*/
case 500:
msg = i18n ( "An internal server error occurred. Please try again later." );
+ type = MSNSocket::ErrorCannotConnect;
break;
case 502:
msg = i18n ( "It is no longer possible to perform this operation. The MSN server does not allow it anymore." );
+ type = MSNSocket::ErrorServerError;
break;
case 600:
case 910:
case 912:
+ case 921:
case 922:
msg = i18n ( "The MSN server is busy. Please try again later." );
+ type = MSNSocket::ErrorConnectionError;
break;
case 601:
case 604:
@@ -585,7 +588,9 @@
case 916:
case 917:
msg = i18n ( "The server is not available at the moment. Please try again later." );
+ type = MSNSocket::ErrorCannotConnect;
break;
+ // Server error
default:
// FIXME: if the error causes a disconnect, it will crash, but we can't disconnect every time
msg = i18n( "Unhandled MSN error code %1 \n"
@@ -595,8 +600,7 @@
}
if ( !msg.isEmpty() )
- //KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Error, msg, i18n( "MSN Plugin" ) );
- emit errorMessage( ErrorNormal, msg );
+ emit errorMessage( type, msg );
return;
}
Index: protocols/msn/msnaccount.cpp
===================================================================
--- protocols/msn/msnaccount.cpp (révision 612600)
+++ protocols/msn/msnaccount.cpp (copie de travail)
@@ -47,6 +47,7 @@
#include "kopeteglobal.h"
#include "kopetechatsessionmanager.h"
#include "contactaddednotifydialog.h"
+#include "kopeteutils.h"
#include "sha1.h"
@@ -59,6 +60,7 @@
#if MSN_WEBCAM
#include "avdevice/videodevicepool.h"
#endif
+
MSNAccount::MSNAccount( MSNProtocol *parent, const QString& AccountID, const char *name )
: Kopete::PasswordedAccount ( parent, AccountID.lower(), 0, name )
{
@@ -1280,43 +1282,38 @@
void MSNAccount::slotErrorMessageReceived( int type, const QString &msg )
{
- KMessageBox::DialogType msgBoxType;
QString caption = i18n( "MSN Plugin" );
+ // Use different notification type based on the error context.
switch(type)
{
- case MSNSocket::ErrorNormal:
+ case MSNSocket::ErrorConnectionLost:
{
- msgBoxType = KMessageBox::Error;
+ Kopete::Utils::notifyConnectionLost( this, caption, msg );
break;
}
- case MSNSocket::ErrorSorry:
+ case MSNSocket::ErrorConnectionError:
{
- msgBoxType = KMessageBox::Sorry;
+ Kopete::Utils::notifyConnectionError( this, caption, msg );
break;
}
- case MSNSocket::ErrorInformation:
+ case MSNSocket::ErrorCannotConnect:
{
- msgBoxType = KMessageBox::Information;
+ Kopete::Utils::notifyCannotConnect( this );
break;
}
- case MSNSocket::ErrorInternal:
+ case MSNSocket::ErrorInformation:
{
- msgBoxType = KMessageBox::Information;
- caption = i18n( "MSN Internal Error" );
+ KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Information, msg, caption );
break;
}
+ case MSNSocket::ErrorServerError:
default:
{
- msgBoxType = KMessageBox::Error;
+ Kopete::Utils::notifyServerError( this, caption, msg );
break;
}
}
-
- kdDebug(14140) << k_funcinfo << msg << endl;
- // Display the error
- KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), msgBoxType, msg, caption );
-
}
bool MSNAccount::createContact( const QString &contactId, Kopete::MetaContact *metaContact )
Index: protocols/msn/msnnotifysocket.cpp
===================================================================
--- protocols/msn/msnnotifysocket.cpp (révision 612600)
+++ protocols/msn/msnnotifysocket.cpp (copie de travail)
@@ -111,163 +111,155 @@
if(m_tmpHandles.contains(id))
handle=m_tmpHandles[id];
+ QString msg;
+ MSNSocket::ErrorType type;
// See http://www.hypothetic.org/docs/msn/basics.php for a
// description of all possible error codes.
// TODO: Add support for all of these!
switch( code )
{
- case 201:
- case 205:
- case 208:
- {
- QString msg = i18n( "<qt>The MSN user '%1' does not exist.<br>Please check the MSN ID.</qt>" ).arg( handle );
- //KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Sorry, msg, i18n( "MSN Plugin" ) );
- emit errorMessage( MSNSocket::ErrorSorry, msg );
- break;
- }
- case 207:
- case 218:
- case 540:
- {
- QString msg =i18n( "<qt>An internal error occurred in the MSN plugin.<br>"
- "MSN Error: %1<br>"
- "please send us a detailed bug report "
- "at [email protected] containing the raw debug output on the "
- "console (in gzipped format, as it is probably a lot of output.)" ).arg(code);
- //KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Information, msg , i18n( "MSN Internal Error" ) );
- emit errorMessage( MSNSocket::ErrorInternal, msg );
- break;
+ case 201:
+ case 205:
+ case 208:
+ {
+ msg = i18n( "<qt>The MSN user '%1' does not exist.<br>Please check the MSN ID.</qt>" ).arg( handle );
+ type = MSNSocket::ErrorServerError;
+ break;
+ }
+ case 207:
+ case 218:
+ case 540:
+ {
+ msg = i18n( "<qt>An internal error occurred in the MSN plugin.<br>"
+ "MSN Error: %1<br>"
+ "please send us a detailed bug report "
+ "at [email protected] containing the raw debug output on the "
+ "console (in gzipped format, as it is probably a lot of output.)" ).arg(code);
+ type = MSNSocket::ErrorServerError;
+ break;
+ }
+ case 209:
+ {
+ if(handle==m_account->accountId())
+ {
+ msg = i18n( "Unable to change your display name.\n"
+ "Please ensure your display is not too long and does not contains censored words." );
+ type = MSNSocket::ErrorServerError;
+ }
+ /*else
+ {
+ QString msg = i18n( "You are trying to change the display name of a user who has not "
+ "confirmed his or her email address;\n"
+ "the contact was not renamed on the server." );
+ KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Error, msg, i18n( "MSN Plugin" ) );
+ }*/
+ break;
+ }
+ case 210:
+ {
+ msg = i18n("Your contact list is full; you cannot add any new contacts.");
+ type = MSNSocket::ErrorServerError;
+ break;
+ }
+ case 215:
+ {
+ msg = i18n( "<qt>The user '%1' already exists in this group on the MSN server;<br>"
+ "if Kopete does not show the user, please send us a detailed bug report "
+ "at [email protected] containing the raw debug output on the "
+ "console (in gzipped format, as it is probably a lot of output.)</qt>" ).arg(handle);
+ type = MSNSocket::ErrorInformation;
+ break;
+ }
+ case 216:
+ {
+ //This might happen is you rename an user if he is not in the contactlist
+ //currently, we just iniore;
+ //TODO: try to don't rename user not in the list
+ //actualy, the bug is in MSNChatSession::slotUserJoined()
+ break;
+ }
+ case 219:
+ {
+ msg = i18n( "The user '%1' seems to already be blocked or allowed on the server." ).arg(handle);
+ type = MSNSocket::ErrorServerError;
+ break;
+ }
+ case 223:
+ {
+ msg = i18n( "You have reached the maximum number of groups:\n"
+ "MSN does not support more than 30 groups." );
+ type = MSNSocket::ErrorServerError;
+ break;
+ }
+ case 224:
+ case 225:
+ case 230:
+ {
+ msg = i18n("Kopete is trying to perform an operation on a group or a contact that does not exists on the server.\n"
+ "This might happen if the Kopete contact list and the MSN-server contact list are not correctly synchronized; if this is the case, you probably should send a bug report.");
+ type = MSNSocket::ErrorServerError;
+ break;
+ }
- }
- case 209:
- {
- if(handle==m_account->accountId())
+ case 229:
{
- QString msg = i18n( "Unable to change your display name.\n"
- "Please ensure your display is not too long and does not contains censored words." );
- //KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Sorry, msg, i18n( "MSN Plugin" ) );
- emit errorMessage( MSNSocket::ErrorSorry, msg );
+ msg = i18n("The group name is too long; it has not been changed on the MSN server.");
+ type = MSNSocket::ErrorServerError;
+ break;
}
- /*else
- {
- QString msg = i18n( "You are trying to change the display name of a user who has not "
- "confirmed his or her email address;\n"
- "the contact was not renamed on the server." );
- KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Error, msg, i18n( "MSN Plugin" ) );
- }*/
- break;
+ case 710:
+ {
+ msg = i18n( "You cannot open a Hotmail inbox because you do not have an MSN account with a valid "
+ "Hotmail or MSN mailbox." );
+ type = MSNSocket::ErrorServerError;
+ break;
+ }
+ case 715:
+ {
+ /*
+ //if(handlev==m_account->accountId())
+ QString msg = i18n( "Your email address has not been verified with the MSN server.\n"
+ "You should have received a mail with a link to confirm your email address.\n"
+ "Some functions will be restricted if you do not confirm your email address." );
+ KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Sorry, msg, i18n( "MSN Plugin" ) );//TODO don't show again
+ */
+ break;
+ }
+ case 800:
+ {
+ //This happen when too much commends are sent to the server.
+ //the command will not be executed, too bad.
+ // ignore it for now, as we don't really know what command it was.
+ /* QString msg = i18#n( "You are trying to change your status, or your display name too rapidly.\n"
+ "This might happen if you added yourself to your own contact list." );
+ KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Sorry, msg, i18n( "MSN Plugin" ) );
+ //FIXME: try to fix this problem*/
+ break;
+ }
+ case 911:
+ m_disconnectReason=Kopete::Account::BadPassword;
+ disconnect();
+ break;
+ case 913:
+ {
+ msg = i18n( "You can not send messages when you are offline or when you are invisible." );
+ type = MSNSocket::ErrorServerError;
+ break;
+ }
+ case 923:
+ {
+ msg = i18n( "You are trying to perform an action you are not allowed to perform in 'kid mode'." );
+ type = MSNSocket::ErrorServerError;
+ break;
+ }
+
+ default:
+ MSNSocket::handleError( code, id );
+ break;
}
- case 210:
- {
- QString msg = i18n("Your contact list is full; you cannot add any new contacts.");
- //KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Sorry, msg, i18n( "MSN Contact List Full" ) );
- emit errorMessage( MSNSocket::ErrorSorry, msg );
- break;
- }
- case 215:
- {
- QString msg = i18n( "<qt>The user '%1' already exists in this group on the MSN server;<br>"
- "if Kopete does not show the user, please send us a detailed bug report "
- "at [email protected] containing the raw debug output on the "
- "console (in gzipped format, as it is probably a lot of output.)</qt>" ).arg(handle);
- //KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Information, msg, i18n( "MSN Plugin" ) );
- emit errorMessage( MSNSocket::ErrorInformation, msg );
- break;
- }
- case 216:
- {
- //This might happen is you rename an user if he is not in the contactlist
- //currently, we just iniore;
- //TODO: try to don't rename user not in the list
- //actualy, the bug is in MSNChatSession::slotUserJoined()
- break;
- }
- case 219:
- {
- QString msg = i18n( "The user '%1' seems to already be blocked or allowed on the server." ).arg(handle);
- //KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Sorry, msg, i18n( "MSN Plugin" ) );
- emit errorMessage( MSNSocket::ErrorSorry, msg );
- break;
- }
- case 223:
- {
- QString msg = i18n( "You have reached the maximum number of groups:\n"
- "MSN does not support more than 30 groups." );
- //KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Sorry, msg, i18n( "MSN Plugin" ) );
- emit errorMessage( MSNSocket::ErrorSorry, msg );
- break;
- }
- case 224:
- case 225:
- case 230:
- {
- QString msg = i18n("Kopete is trying to perform an operation on a group or a contact that does not exists on the server.\n"
- "This might happen if the Kopete contact list and the MSN-server contact list are not correctly synchronized; if this is the case, you probably should send a bug report.");
- //KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Information,msg, i18n( "MSN Plugin" ) );
- emit errorMessage( MSNSocket::ErrorInformation, msg );
- break;
- }
- case 229:
- {
- QString msg = i18n("The group name is too long; it has not been changed on the MSN server.");
- //KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Sorry, msg, i18n( "Invalid Group Name - MSN Plugin" ) );
- emit errorMessage( MSNSocket::ErrorSorry, msg );
- break;
- }
- case 710:
- {
- QString msg = i18n( "You cannot open a Hotmail inbox because you do not have an MSN account with a valid "
- "Hotmail or MSN mailbox." );
- //KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Sorry, msg, i18n( "MSN Plugin" ) );
- emit errorMessage( MSNSocket::ErrorSorry, msg );
- break;
- }
- case 715:
- {
- /*
- //if(handlev==m_account->accountId())
- QString msg = i18n( "Your email address has not been verified with the MSN server.\n"
- "You should have received a mail with a link to confirm your email address.\n"
- "Some functions will be restricted if you do not confirm your email address." );
- KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Sorry, msg, i18n( "MSN Plugin" ) );//TODO don't show again
- */
- break;
- }
- case 800:
- {
- //This happen when too much commends are sent to the server.
- //the command will not be executed, too bad.
- // ignore it for now, as we don't really know what command it was.
-/* QString msg = i18#n( "You are trying to change your status, or your display name too rapidly.\n"
- "This might happen if you added yourself to your own contact list." );
- KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Sorry, msg, i18n( "MSN Plugin" ) );
- //FIXME: try to fix this problem*/
- break;
- }
- case 911:
- m_disconnectReason=Kopete::Account::BadPassword;
- disconnect();
- break;
- case 913:
- {
- QString msg = i18n( "You can not send messages when you are offline or when you are invisible." );
- //KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Sorry, msg, i18n( "MSN Plugin" ) );
- emit errorMessage( MSNSocket::ErrorSorry, msg );
- break;
- }
- case 923:
- {
- QString msg = i18n( "You are trying to perform an action you are not allowed to perform in 'kid mode'." );
- //KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Sorry, msg, i18n( "MSN Plugin" ) );
- emit errorMessage( MSNSocket::ErrorSorry, msg );
- break;
- }
-
- default:
- MSNSocket::handleError( code, id );
- break;
- }
+ if( !msg.isEmpty() )
+ emit errorMessage( type, msg );
}
void MSNNotifySocket::parseCommand( const QString &cmd, uint id, const QString &data )
Index: protocols/msn/msnswitchboardsocket.cpp
===================================================================
--- protocols/msn/msnswitchboardsocket.cpp (révision 612600)
+++ protocols/msn/msnswitchboardsocket.cpp (copie de travail)
@@ -111,54 +111,68 @@
void MSNSwitchBoardSocket::handleError( uint code, uint id )
{
kdDebug(14140) << k_funcinfo << endl;
+
+ QString msg;
+ MSNSocket::ErrorType type;
+
switch( code )
{
case 208:
{
- QString msg = i18n( "Invalid user:\n"
+ msg = i18n( "Invalid user:\n"
"this MSN user does not exist; please check the MSN ID." );
- //KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Error, msg, i18n( "MSN Plugin" ) );
- emit errorMessage( MSNSocket::ErrorNormal, msg );
+ type = MSNSocket::ErrorServerError;
+
userLeftChat(m_msgHandle , i18n("user never joined"));
break;
}
case 215:
{
- QString msg = i18n( "The user %1 is already in this chat." ).arg( m_msgHandle );
- //KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Error, msg, i18n( "MSN Plugin" ) );
- emit errorMessage( MSNSocket::ErrorNormal, msg );
+ msg = i18n( "The user %1 is already in this chat." ).arg( m_msgHandle );
+ type = MSNSocket::ErrorServerError;
+
//userLeftChat(m_msgHandle , i18n("user was twice in this chat") ); //(the user shouln't join there
break;
}
case 216:
{
- QString msg = i18n( "The user %1 is online but has blocked you:\nyou can not talk to this user." ).arg( m_msgHandle );
- //KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Information, msg, i18n( "MSN Plugin" ) );
- emit errorMessage( MSNSocket::ErrorInformation, msg );
+ msg = i18n( "The user %1 is online but has blocked you:\nyou can not talk to this user." ).arg( m_msgHandle );
+ type = MSNSocket::ErrorInformation;
+
userLeftChat(m_msgHandle, i18n("user blocked you"));
break;
}
case 217:
{
// TODO: we need to know the nickname instead of the handle.
- QString msg = i18n( "The user %1 is currently not signed in.\n" "Messages will not be delivered." ).arg( m_msgHandle );
- //KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Error, msg, i18n( "MSN Plugin" ) );
- emit errorMessage( MSNSocket::ErrorNormal, msg );
+ msg = i18n( "The user %1 is currently not signed in.\n" "Messages will not be delivered." ).arg( m_msgHandle );
+ type = MSNSocket::ErrorServerError;
+
userLeftChat(m_msgHandle, i18n("user disconnected"));
break;
}
case 713:
{
QString msg = i18n( "You are trying to invite too many contacts to this chat at the same time" ).arg( m_msgHandle );
- //KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Information, msg, i18n( "MSN Plugin" ) );
- emit errorMessage( MSNSocket::ErrorInformation, msg );
+ type = MSNSocket::ErrorInformation;
+
userLeftChat(m_msgHandle, i18n("user blocked you"));
break;
}
+ case 911:
+ {
+ msg = i18n("Kopete MSN plugin has trouble authenticating with switchboard server.");
+ type = MSNSocket::ErrorServerError;
+
+ break;
+ }
default:
MSNSocket::handleError( code, id );
break;
}
+
+ if( !msg.isEmpty() )
+ emit errorMessage( type, msg );
}
void MSNSwitchBoardSocket::parseCommand( const QString &cmd, uint id ,
Index: protocols/msn/msnsocket.h
===================================================================
--- protocols/msn/msnsocket.h (révision 612600)
+++ protocols/msn/msnsocket.h (copie de travail)
@@ -77,7 +77,7 @@
enum OnlineStatus { Connecting, Connected, Disconnecting, Disconnected };
enum LookupStatus { Processing, Success, Failed };
enum Transport { TcpTransport, HttpTransport };
- enum ErrorType { ErrorNormal, ErrorInternal, ErrorInformation, ErrorSorry };
+ enum ErrorType { ErrorConnectionLost, ErrorConnectionError, ErrorCannotConnect, ErrorServerError, ErrorInformation};
OnlineStatus onlineStatus() { return m_onlineStatus; }
Index: kopete/eventsrc
===================================================================
--- kopete/eventsrc (révision 612600)
+++ kopete/eventsrc (copie de travail)
@@ -1665,7 +1665,7 @@
Comment[zh_CN]=发生了服务内部错误
Comment[zh_HK]=服務發生內部錯誤
Comment[zh_TW]=服務發生內部錯誤
-default_presentation=2
+default_presentation=16
[buzz_nudge]
Name=Buzz/Nudge
Index: libkopete/kopeteutils.cpp
===================================================================
--- libkopete/kopeteutils.cpp (révision 612600)
+++ libkopete/kopeteutils.cpp (copie de travail)
@@ -64,7 +64,7 @@
QObject::connect( n, SIGNAL(closed()) , NotifyHelper::self() , SLOT( slotEventClosed() ) );
}
-void notifyConnectionLost( const Account *account, const QString caption, const QString message, const QString explanation, const QString debugInfo)
+void notifyConnectionLost( const Account *account, const QString &caption, const QString &message, const QString &explanation, const QString &debugInfo )
{
if (!account)
return;
@@ -93,7 +93,7 @@
return false; // On error, assume we are online
}
-void notifyCannotConnect( const Account *account, const QString explanation, const QString debugInfo)
+void notifyCannotConnect( const Account *account, const QString &explanation, const QString &debugInfo)
{
if (!account)
return;
@@ -101,6 +101,24 @@
notify( account->accountIcon(), QString::fromLatin1("cannot_connect"), notifyCannotConnect_DefaultCaption, notifyCannotConnect_DefaultMessage, notifyCannotConnect_DefaultExplanation, debugInfo);
}
+void notifyConnectionError( const Account *account, const QString &caption, const QString &message, const QString &explanation, const QString &debugInfo )
+{
+ if (!account)
+ return;
+
+ // TODO: Display a specific default connection error message, I don't want to introducte too many new strings
+ notify( account->accountIcon(32), QString::fromLatin1("connection_error"), caption, message, explanation, debugInfo);
+}
+
+void notifyServerError( const Account *account, const QString &caption, const QString &message, const QString &explanation, const QString &debugInfo )
+{
+ if (!account)
+ return;
+
+ // TODO: Display a specific default server error message, I don't want to introducte too many new strings
+ notify( account->accountIcon(32), QString::fromLatin1("server_error"), caption, message, explanation, debugInfo);
+}
+
} // end ns ErrorNotifier
} // end ns Kopete
Index: libkopete/kopeteutils.h
===================================================================
--- libkopete/kopeteutils.h (révision 612600)
+++ libkopete/kopeteutils.h (copie de travail)
@@ -53,10 +53,10 @@
* explanation, Kopete will use a default explanation.
*/
void KOPETE_EXPORT notifyConnectionLost( const Account *account,
- const QString caption = QString::null,
- const QString message = QString::null,
- const QString explanation = QString::null,
- const QString debugInfo = QString::null );
+ const QString &caption = QString::null,
+ const QString &message = QString::null,
+ const QString &explanation = QString::null,
+ const QString &debugInfo = QString::null );
/**
@@ -70,9 +70,44 @@
* explanation, Kopete will use a default explanation.
*/
void KOPETE_EXPORT notifyCannotConnect( const Account *account,
- const QString explanation = QString::null,
- const QString debugInfo = QString::null);
+ const QString &explanation = QString::null,
+ const QString &debugInfo = QString::null);
+/**
+ * Notifies the user that an error on a connection occcured without coupling plugins with GUI code.
+ *
+ * @param account The account where the connection error occured and wants to notify the user.
+ * @param caption A brief subject line, used where possible if the presentation allows it.
+ * @param message A short description of the error.
+ * @param explanation A long description on how the error occured and what the user can do about it.
+ * @param debugInfo Debug info that can be sent to the developers or to the network service owners.
+ *
+ * You can not provide debugInfo without an user explanation. If you don't provide a caption, message, or
+ * explanation, Kopete will use a default explanation.
+ */
+void KOPETE_EXPORT notifyConnectionError( const Account *account,
+ const QString &caption = QString::null,
+ const QString &message = QString::null,
+ const QString &explanation = QString::null,
+ const QString &debugInfo = QString::null );
+
+/**
+ * Notifies the user that an error on the server occcured without coupling plugins with GUI code.
+ *
+ * @param account The account where the server error occured and wants to notify the user.
+ * @param caption A brief subject line, used where possible if the presentation allows it.
+ * @param message A short description of the error.
+ * @param explanation A long description on how the error occured and what the user can do about it.
+ * @param debugInfo Debug info that can be sent to the developers or to the network service owners.
+ *
+ * You can not provide debugInfo without an user explanation. If you don't provide a caption, message, or
+ * explanation, Kopete will use a default explanation.
+ */
+void KOPETE_EXPORT notifyServerError( const Account *account,
+ const QString &caption = QString::null,
+ const QString &message = QString::null,
+ const QString &explanation = QString::null,
+ const QString &debugInfo = QString::null );
} // end ns Utils
} // end ns Kopete
pgprGNgwKD7Bx.pgp
Description: PGP signature
_______________________________________________ kopete-devel mailing list [email protected] https://mail.kde.org/mailman/listinfo/kopete-devel
