SVN commit 1082473 by rjarosz: If account icon color has been changed change the color in "Add Contact" submenu too. M +15 -0 kopetewindow.cpp M +5 -0 kopetewindow.h --- trunk/KDE/kdenetwork/kopete/kopete/kopetewindow.cpp #1082472:1082473 @@ -1119,6 +1119,7 @@ KAction *action = new KAction ( KIcon ( account->accountIcon() ), account->accountLabel(), this ); actionCollection()->addAction ( s, action ); connect ( action, SIGNAL ( triggered ( bool ) ), d->addContactMapper, SLOT ( map() ) ); + connect ( account, SIGNAL(colorChanged(const QColor&)), this, SLOT(slotAccountColorChanged()) ); d->addContactMapper->setMapping ( action, account->protocol()->pluginId() + QChar ( 0xE000 ) + account->accountId() ); d->actionAddContact->addAction ( action ); @@ -1130,6 +1131,18 @@ } } +void KopeteWindow::slotAccountColorChanged() +{ + Kopete::Account* account = qobject_cast(sender()); + Q_ASSERT(account); + + // update add contact actionmenu + QString s = QString( "actionAdd%1Contact" ).arg( account->accountId() ); + QAction *action = actionCollection()->action ( s ); + if ( action ) + action->setIcon( KIcon( account->accountIcon() ) ); +} + void KopeteWindow::slotAccountUnregistered ( const Kopete::Account *account ) { QList accounts = Kopete::AccountManager::self()->accounts(); @@ -1139,6 +1152,8 @@ d->actionDisconnect->setEnabled ( false ); } + disconnect ( account, SIGNAL(colorChanged(const QColor&)), this, SLOT(slotAccountColorChanged()) ); + // update add contact actionmenu QString s = QString ( "actionAdd%1Contact" ).arg ( account->accountId() ); QAction *action = actionCollection()->action ( s ); --- trunk/KDE/kdenetwork/kopete/kopete/kopetewindow.h #1082472:1082473 @@ -154,6 +154,11 @@ void slotAccountRegistered( Kopete::Account *account ); /** + * This is used to change the account icon in the "Add Contact" submenu + */ + void slotAccountColorChanged(); + + /** * This is used to add the account to the "Add Contact" submenu */ void slotAccountUnregistered( const Kopete::Account *account );