// The action
actionNick = new KAction( i18n( "&Test" ), "kopeteaway", 0,
this, SLOT( slotChangePublicName() ), actionCollection(), "Test" );
// The slot
void MSNAccount::slotChangePublicName()
{
bool ok;
QString name = KInputDialog::getText( i18n( "Change Display Name - MSN Plugin" ),
i18n( "Enter the new display name by which you want to be visible to your friends on MSN:" ),
myself()->property( Kopete::Global::Properties::self()->nickName()).value().toString(), &ok );
if ( ok )
{
if ( name.length() > 387 )
{
KMessageBox::error( Kopete::UI::Global::mainWidget(),
i18n( "The display name you entered is too long. Please use a shorter name.\n"
"Your display name has not been changed." ),
i18n( "Change Display Name - MSN Plugin" ) );
return;
}
if ( isConnected() )
setPublicName( name );
else
{
// Bypass the protocol, it doesn't work, call the slot
// directly. Upon connect the name will be synced.
// FIXME: Use a single code path instead!
slotPublicNameChanged( name );
// m_publicNameSyncMode = SyncToServer;
}
}
kdWarning()<<"hello"<