[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdebase/kcontrol/crypto
From:       Helge Deller <deller () kde ! org>
Date:       2004-06-16 18:50:13
Message-ID: 20040616185013.1852F983A () office ! kde ! org
[Download RAW message or body]

CVS commit by deller: 

small UI improvement: auto-select next (or previous) entry if current one is deleted. \
This enables the user to delete a few items in row without any additional \
                mouse/cursor selection.
CCMAIL: staikos@kde.org


  M +10 -2     crypto.cpp   1.134


--- kdebase/kcontrol/crypto/crypto.cpp  #1.133:1.134
@@ -1386,9 +1386,13 @@ OtherCertItem *x = static_cast<OtherCert
 
 void KCryptoConfig::slotRemoveCert() {
-OtherCertItem *x = static_cast<OtherCertItem *>(otherSSLBox->selectedItem());
+QListViewItem *act = otherSSLBox->selectedItem();
+OtherCertItem *x = static_cast<OtherCertItem *>(act);
    if (x) {
+      QListViewItem *next = act->itemBelow();
+      if (!next) next = act->itemAbove();
       otherSSLBox->takeItem(x);
       otherCertDelList.append(x);
       configChanged();
+      if (next) otherSSLBox->setSelected(next, true);
    }
 }
@@ -2172,10 +2176,14 @@ void KCryptoConfig::slotNewHostAuth() {
 
 void KCryptoConfig::slotRemoveHostAuth() {
-HostAuthItem *x = static_cast<HostAuthItem *>(hostAuthList->selectedItem());
+QListViewItem *act = hostAuthList->selectedItem();
+HostAuthItem *x = static_cast<HostAuthItem *>(act);
 
   if (x) {
+      QListViewItem *next = act->itemBelow();
+      if (!next) next = act->itemAbove();
       hostAuthList->takeItem(x);
       authDelList.append(x);
       configChanged();
+      if (next) hostAuthList->setSelected(next, true);
   }
 }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic