void Account::fillActionMenu( KActionMenu *actionMenu ) { //default implementation // KActionMenu *menu = new KActionMenu( QIcon(myself()->onlineStatus().iconFor( this )), accountId(), 0, 0); #ifdef __GNUC__ #warning No icon shown, we should go away from QPixmap genered icons with overlays. #endif QString nick; if (identity()->hasProperty( Kopete::Global::Properties::self()->nickName().key() )) nick = identity()->property( Kopete::Global::Properties::self()->nickName() ).value().toString(); else nick = myself()->displayName(); // Always add title at the beginning of actionMenu QAction *before = actionMenu->menu()->actions().value( 0, 0 ); actionMenu->menu()->addTitle( myself()->onlineStatus().iconFor( myself() ), nick.isNull() ? accountLabel() : i18n( "%2 <%1>", accountLabel(), nick ), before ); actionMenu->menu()->addSeparator(); KAction *propertiesAction = new KAction( i18n("Properties"), actionMenu ); QObject::connect( propertiesAction, SIGNAL(triggered(bool)), this, SLOT(editAccount()) ); actionMenu->addAction( propertiesAction ); }
KActionMenu * Account::actionMenu() { //default implementation KActionMenu *menu = new KActionMenu( accountId(), myself()->onlineStatus().iconFor( this ), this ); QString nick = myself()->property( Kopete::Global::Properties::self()->nickName()).value().toString(); menu->popupMenu()->insertTitle( myself()->onlineStatus().iconFor( myself() ), nick.isNull() ? accountLabel() : i18n( "%2 <%1>" ).arg( accountLabel(), nick ) ); OnlineStatusManager::self()->createAccountStatusActions(this, menu); menu->popupMenu()->insertSeparator(); menu->insert( new KAction ( i18n( "Properties" ), 0, this, SLOT( editAccount() ), menu, "actionAccountProperties" ) ); return menu; }
KActionMenu *JabberTransport::actionMenu () { KActionMenu *menu = new KActionMenu( accountId(), myself()->onlineStatus().iconFor( this ), this ); QString nick = myself()->property( Kopete::Global::Properties::self()->nickName()).value().toString(); menu->popupMenu()->insertTitle( myself()->onlineStatus().iconFor( myself() ), nick.isNull() ? accountLabel() : i18n( "%2 <%1>" ).arg( accountLabel(), nick ) ); QPtrList<KAction> *customActions = myself()->customContextMenuActions( ); if( customActions && !customActions->isEmpty() ) { menu->popupMenu()->insertSeparator(); for( KAction *a = customActions->first(); a; a = customActions->next() ) a->plug( menu->popupMenu() ); } delete customActions; return menu; /* KActionMenu *m_actionMenu = Kopete::Account::actionMenu(); m_actionMenu->popupMenu()->insertSeparator(); m_actionMenu->insert(new KAction (i18n ("Join Groupchat..."), "jabber_group", 0, this, SLOT (slotJoinNewChat ()), this, "actionJoinChat")); m_actionMenu->popupMenu()->insertSeparator(); m_actionMenu->insert ( new KAction ( i18n ("Services..."), "jabber_serv_on", 0, this, SLOT ( slotGetServices () ), this, "actionJabberServices") ); m_actionMenu->insert ( new KAction ( i18n ("Send Raw Packet to Server..."), "mail_new", 0, this, SLOT ( slotSendRaw () ), this, "actionJabberSendRaw") ); m_actionMenu->insert ( new KAction ( i18n ("Edit User Info..."), "identity", 0, this, SLOT ( slotEditVCard () ), this, "actionEditVCard") ); return m_actionMenu;*/ }