Now allow to remove specialmailcollection (need kdepimlibs)

wilder-work
Montel Laurent 14 years ago
parent b51070c883
commit c4e84dd5b9
  1. 10
      configuredialog.cpp
  2. 1
      configuredialog_p.h

@ -432,11 +432,17 @@ AccountsPageReceivingTab::AccountsPageReceivingTab( QWidget * parent )
mAccountsReceiving.mFilterAccount->setProxy( mAccountsReceiving.mAccountList->agentFilterProxyModel() );
mAccountsReceiving.mFilterAccount->lineEdit()->setTrapReturnKey( true );
KConfig specialMailCollection(QLatin1String("specialmailcollectionsrc"));
if(specialMailCollection.hasGroup(QLatin1String("SpecialCollections"))) {
KConfigGroup grp = specialMailCollection.group(QLatin1String("SpecialCollections"));
mSpecialMailCollectionIdentifier = grp.readEntry(QLatin1String("DefaultResourceId"));
}
ConfigAgentDelegate *configDelegate = new ConfigAgentDelegate( mAccountsReceiving.mAccountList->view() );
mAccountsReceiving.mAccountList->view()->setItemDelegate( configDelegate );
connect( configDelegate, SIGNAL(optionsClicked(QString,QPoint)), this, SLOT(slotShowMailCheckMenu(QString,QPoint)) );
connect( mAccountsReceiving.mAccountList, SIGNAL(currentChanged(Akonadi::AgentInstance,Akonadi::AgentInstance)),
connect( mAccountsReceiving.mAccountList, SIGNAL(clicked(Akonadi::AgentInstance)),
SLOT(slotAccountSelected(Akonadi::AgentInstance)) );
connect( mAccountsReceiving.mAccountList, SIGNAL(doubleClicked(Akonadi::AgentInstance)),
this, SLOT(slotModifySelectedAccount()) );
@ -578,7 +584,7 @@ void AccountsPage::ReceivingTab::slotAccountSelected(const Akonadi::AgentInstanc
mAccountsReceiving.mRestartAccountButton->setEnabled( false );
} else {
mAccountsReceiving.mModifyAccountButton->setEnabled( !current.type().capabilities().contains( QLatin1String( "NoConfig" ) ) );
mAccountsReceiving.mRemoveAccountButton->setEnabled( true );
mAccountsReceiving.mRemoveAccountButton->setEnabled( mSpecialMailCollectionIdentifier != current.identifier() );
// Restarting an agent is not possible if it's in Running status... (see AgentProcessInstance::restartWhenIdle)
mAccountsReceiving.mRestartAccountButton->setEnabled( ( current.status() != 1 ) );
}

@ -214,6 +214,7 @@ private:
//FIXME virtual void doResetToDefaultsOther();
private:
QString mSpecialMailCollectionIdentifier;
Ui_AccountsPageReceivingTab mAccountsReceiving;
};

Loading…
Cancel
Save