[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdenetwork/kopete/kopete
From: Roman Jarosz <kedgedev () gmail ! com>
Date: 2010-01-30 16:14:56
Message-ID: 1264868096.899400.20030.nullmailer () svn ! kde ! org
[Download RAW message or body]
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<Kopete::Account*>(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<Kopete::Account *> 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 );
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic