Fix UI bug as reported by Casey Allen Shobe: when you click OK on the

dialog that tells you that subscriptions are not enabled but then do not
save the subscription dialog nothing is changed. Therefore show the
dialog only when something actually changed and subscriptions are
needed.
CCMAIL: cshobe@seattleserver.com

svn path=/branches/KDE/3.5/kdepim/; revision=488215
wilder-work
Carsten Burghardt 21 years ago
parent 6c7d84e090
commit c022a2942d
  1. 50
      subscriptiondialog.cpp

@ -241,11 +241,28 @@ void SubscriptionDialog::findParentItem( QString &name, QString &path, QString &
//------------------------------------------------------------------------------
void SubscriptionDialog::slotSave()
{
KMail::ImapAccountBase *account = static_cast<KMail::ImapAccountBase*>(mAcct);
if( !account->onlySubscribedFolders() ) {
int result = KMessageBox::questionYesNoCancel( this,
i18n("Currently subscriptions are not used for server %1\ndo you want to enable subscriptions?")
.arg( account->name() ),
i18n("Enable Subscriptions?"), i18n("Enable"), i18n("Do Not Enable"));
switch(result) {
case KMessageBox::Yes:
mForceSubscriptionEnable = true;
break;
case KMessageBox::No:
break;
case KMessageBox::Cancel:
cancel();
}
}
// subscribe
QListViewItemIterator it(subView);
for ( ; it.current(); ++it)
{
static_cast<ImapAccountBase*>(account())->changeSubscription(true,
account->changeSubscription(true,
static_cast<GroupItem*>(it.current())->info().path);
}
@ -253,16 +270,12 @@ void SubscriptionDialog::slotSave()
QListViewItemIterator it2(unsubView);
for ( ; it2.current(); ++it2)
{
static_cast<ImapAccountBase*>(account())->changeSubscription(false,
account->changeSubscription(false,
static_cast<GroupItem*>(it2.current())->info().path);
}
if( mForceSubscriptionEnable ) {
KMail::ImapAccountBase *account = static_cast<KMail::ImapAccountBase*>(mAcct);
if( account )
{
account->setOnlySubscribedFolders(true);
}
if ( mForceSubscriptionEnable ) {
account->setOnlySubscribedFolders(true);
}
}
@ -368,27 +381,6 @@ void SubscriptionDialog::slotConnectionResult( int errorCode, const QString& err
void SubscriptionDialog::show()
{
KDialogBase::show();
KMail::ImapAccountBase *account = static_cast<KMail::ImapAccountBase*>(mAcct);
if( account )
{
if( !account->onlySubscribedFolders() )
{
kdDebug() << "Not subscribed!!!" << endl;
int result = KMessageBox::questionYesNoCancel( this,
i18n("Currently subscriptions are not used for server %1\ndo you want to enable subscriptions?")
.arg( account->name() ),
i18n("Enable Subscriptions?"), i18n("Enable"), i18n("Do Not Enable"));
switch(result) {
case KMessageBox::Yes:
mForceSubscriptionEnable = true;
break;
case KMessageBox::No:
break;
case KMessageBox::Cancel:
cancel();
}
}
}
}
} // namespace

Loading…
Cancel
Save