As usual, I forgot the patch ;-) !
Index: kopete/kopete/kopeteiface.h
===================================================================
--- kopete/kopete/kopeteiface.h (revision 550164)
+++ kopete/kopete/kopeteiface.h (working copy)
@@ -155,6 +155,12 @@
* @param photoUrl URL to the photo
*/
void setGlobalPhoto( const KURL &photoUrl );
+
+ /**
+ * set the global status message
+ * @param message global status message
+ */
+ void setStatusMessage( const QString &message );
};
#endif
Index: kopete/kopete/kopeteeditglobalidentitywidget.h
===================================================================
--- kopete/kopete/kopeteeditglobalidentitywidget.h (revision 550164)
+++ kopete/kopete/kopeteeditglobalidentitywidget.h (working copy)
@@ -70,7 +70,10 @@
* User press Return/Enter in the KLineEdit, commit the new nickname.
*/
void changeNickname();
+ void changeStatusMessage();
+ void slotUpdateLineStatusMessage( const QString& message);
+
private:
class Private;
Private *d;
Index: kopete/kopete/kopeteiface.cpp
===================================================================
--- kopete/kopete/kopeteiface.cpp (revision 550164)
+++ kopete/kopete/kopeteiface.cpp (working copy)
@@ -33,6 +33,7 @@
#include "kopetecontact.h"
#include "kopeteconfig.h"
+
KopeteIface::KopeteIface() : DCOPObject( "KopeteIface" )
{
KConfig *config = KGlobal::config();
@@ -316,5 +317,10 @@
}
}
+void setStatusMessage( const QString &message )
+{
+ Kopete::AccountManager::self()->setStatusMessage( message );
+}
+
// vim: set noet ts=4 sts=4 sw=4:
Index: kopete/kopete/kopetewindow.cpp
===================================================================
--- kopete/kopete/kopetewindow.cpp (revision 550164)
+++ kopete/kopete/kopetewindow.cpp (working copy)
@@ -929,18 +929,7 @@
// same onlinestatus. Then update Kopete::Away and the UI.
void KopeteWindow::setStatusMessage( const QString & message )
{
- bool changed = false;
- for ( QPtrListIterator<Kopete::Account> it(
Kopete::AccountManager::self()->accounts() ); it.current(); ++it )
- {
- Kopete::Contact *self = it.current()->myself();
- bool isInvisible = self && self->onlineStatus().status() ==
Kopete::OnlineStatus::Invisible;
- if ( it.current()->isConnected() && !isInvisible )
- {
- changed = true;
- it.current()->setOnlineStatus( self->onlineStatus(),
message );
- }
- }
- Kopete::Away::getInstance()->setGlobalAwayMessage( message );
+ Kopete::AccountManager::self()->setStatusMessage( message );
m_globalStatusMessageStored = message;
m_globalStatusMessage->setText( message );
}
Index: kopete/kopete/kopeteeditglobalidentitywidget.cpp
===================================================================
--- kopete/kopete/kopeteeditglobalidentitywidget.cpp (revision 550164)
+++ kopete/kopete/kopeteeditglobalidentitywidget.cpp (working copy)
@@ -40,6 +40,8 @@
#include "kopeteglobal.h"
#include "kopetecontactlist.h"
#include "kopetemetacontact.h"
+#include "kopeteaccountmanager.h"
+#include "kopeteaway.h"
ClickableLabel::ClickableLabel(QWidget *parent, const char *name)
@@ -69,6 +71,7 @@
KLineEdit *lineNickname;
KLineEdit *lineStatusMessage;
QHBoxLayout *mainLayout;
+ QVBoxLayout *layout;
int iconSize;
QString lastNickname;
};
@@ -121,8 +124,9 @@
void KopeteEditGlobalIdentityWidget::createGUI()
{
- d->mainLayout = new QHBoxLayout(this);
-
+ d->layout = new QVBoxLayout(this);
+ d->mainLayout = new QHBoxLayout(d->layout);
+
// The picture label
d->labelPicture = new ClickableLabel(this);
d->labelPicture->setMinimumSize(QSize(d->iconSize, d->iconSize));
@@ -138,8 +142,18 @@
connect(d->lineNickname, SIGNAL(returnPressed()), this,
SLOT(changeNickname()));
// Show the nickname text in red when they are change.
connect(d->lineNickname, SIGNAL(textChanged(const QString&)), this,
SLOT(lineNicknameTextChanged(const QString& )));
+
+ // The away message lineEdit
+ d->lineStatusMessage = new KLineEdit(this);
+ d->layout->addWidget(d->lineStatusMessage);
+ connect(d->lineStatusMessage, SIGNAL(returnPressed()), this,
SLOT(changeStatusMessage()));
+ connect(Kopete::Away::getInstance(), SIGNAL(globalAwayMessageChanged(
const QString& )), this, SLOT(slotUpdateLineStatusMessage( const QString&)));
+
}
-
+void KopeteEditGlobalIdentityWidget::slotUpdateLineStatusMessage( const
QString& message)
+{
+ d->lineStatusMessage->setText( Kopete::Away::getInstance()->message());
+}
void KopeteEditGlobalIdentityWidget::updateGUI(const QString &key, const
QVariant &value)
{
kdDebug(14000) << k_funcinfo << "Updating the GUI reflecting the global
identity change." << endl;
@@ -236,6 +250,11 @@
}
}
+void KopeteEditGlobalIdentityWidget::changeStatusMessage()
+{
+ Kopete::AccountManager::self()->setStatusMessage(
d->lineStatusMessage->text() );
+}
+
void KopeteEditGlobalIdentityWidget::changeNickname()
{
if( !d->lineNickname->text().isEmpty() && d->lineNickname->text() !=
d->myself->displayName() )
Index: kopete/libkopete/kopeteaccountmanager.h
===================================================================
--- kopete/libkopete/kopeteaccountmanager.h (revision 550164)
+++ kopete/libkopete/kopeteaccountmanager.h (working copy)
@@ -109,7 +109,13 @@
*/
Account *registerAccount( Account *account );
+ /**
+ * This allows to change the status message for all accounts, without
changing the
+ * status
+ */
+ void setStatusMessage( const QString & message);
+
/**
* Flag to be used in setOnlineStatus
*
Index: kopete/libkopete/kopeteaway.cpp
===================================================================
--- kopete/libkopete/kopeteaway.cpp (revision 550164)
+++ kopete/libkopete/kopeteaway.cpp (working copy)
@@ -221,6 +221,8 @@
"Setting global away message: " << message << endl;
d->awayMessage = message;
}
+
+ emit globalAwayMessageChanged( message );
}
void Kopete::Away::setAutoAwayMessage(const QString &message)
Index: kopete/libkopete/kopeteaccountmanager.cpp
===================================================================
--- kopete/libkopete/kopeteaccountmanager.cpp (revision 550164)
+++ kopete/libkopete/kopeteaccountmanager.cpp (working copy)
@@ -414,3 +414,20 @@
#include "kopeteaccountmanager.moc"
// vim: set noet ts=4 sts=4 sw=4:
// kate: tab-width 4; indent-mode csands;
+
+void Kopete::AccountManager::setStatusMessage( const QString & message)
+{
+ bool changed = false;
+ for ( QPtrListIterator<Kopete::Account> it(
Kopete::AccountManager::self()->accounts() ); it.current(); ++it )
+ {
+ Kopete::Contact *self = it.current()->myself();
+ bool isInvisible = self && self->onlineStatus().status() ==
Kopete::OnlineStatus::Invisible;
+ if ( it.current()->isConnected() && !isInvisible )
+ {
+ changed = true;
+ it.current()->setOnlineStatus( self->onlineStatus(),
message );
+ }
+ }
+ Kopete::Away::getInstance()->setGlobalAwayMessage( message );
+
+}
Index: kopete/libkopete/kopeteaway.h
===================================================================
--- kopete/libkopete/kopeteaway.h (revision 550164)
+++ kopete/libkopete/kopeteaway.h (working copy)
@@ -201,6 +201,11 @@
* @brief Default messages were changed
*/
void messagesChanged();
+
+ /**
+ * @brief Away message has been changed
+ */
+ void globalAwayMessageChanged( const QString& message );
};
}
_______________________________________________
kopete-devel mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kopete-devel