Esempio n. 1
0
KActionMenu* WPAccount::actionMenu()
{
	kdDebug(14170) <<  "WPAccount::actionMenu()" << endl;

	/// How to remove an action from Kopete::Account::actionMenu()? GF

	KActionMenu *theActionMenu = new KActionMenu(accountId() , myself()->onlineStatus().iconFor(this), this);
	theActionMenu->popupMenu()->insertTitle(myself()->onlineStatus().iconFor(this), i18n("WinPopup (%1)").arg(accountId()));

	if (mProtocol)
	{
		KAction *goOnline = new KAction("Online", QIconSet(mProtocol->WPOnline.iconFor(this)), 0,
										 this, SLOT(connect()), theActionMenu, "actionGoAvailable");
		goOnline->setEnabled(isConnected() && isAway());
		theActionMenu->insert(goOnline);

		KAction *goAway = new KAction("Away", QIconSet(mProtocol->WPAway.iconFor(this)), 0,
									  this, SLOT(goAway()), theActionMenu, "actionGoAway");
		goAway->setEnabled(isConnected() && !isAway());
		theActionMenu->insert(goAway);

		/// One can not really go offline manually - appears online as long as samba server is running. GF

		theActionMenu->popupMenu()->insertSeparator();
		theActionMenu->insert(new KAction(i18n("Properties"),  0,
							  this, SLOT(editAccount()), theActionMenu, "actionAccountProperties"));

	}

	return theActionMenu;
}
void CoreAccountSettingsPage::on_editAccountButton_clicked() {
  QModelIndex idx = ui.accountView->selectionModel()->currentIndex();
  if(!idx.isValid())
    return;

  editAccount(idx);
}
void CoreAccountSettingsPage::on_accountView_doubleClicked(const QModelIndex &index) {
  if(!index.isValid())
    return;

  if(isStandAlone())
    emit connectToCore(index.data(CoreAccountModel::AccountIdRole).value<AccountId>());
  else
    editAccount(index);
}
void AccountSettings::editCurrentAccount()
{
    if(!accountModel->rowCount())
        return;

    QModelIndex index = accountView->currentIndex();
    if (!index.isValid())
        return;

    QMailAccount account(accountModel->idFromIndex(index));
    //if (account.messageType() != QMailMessage::Sms)
    editAccount(&account);
}
Esempio n. 5
0
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;
}
void AccountSettings::addAccount()
{
    QMailAccount newAccount;
    editAccount(&newAccount);
}