@@ -963,6 +963,7 @@ void DefaultParamsDialog::profileChanged(const int index) {
963963 if (index == customProfileItemIdx) {
964964 profileCB->setEditText (profileCB->currentText ());
965965 profileCB->lineEdit ()->selectAll ();
966+ profileCB->setFocus ();
966967 profileSaveButton->setEnabled (true );
967968 profileDeleteButton->setEnabled (false );
968969 setTabWidgetsEnabled (true );
@@ -998,6 +999,7 @@ void DefaultParamsDialog::profileChanged(const int index) {
998999 QMessageBox::critical (this , tr (" Error" ), tr (" Error loading the profile." ));
9991000 profileCB->setCurrentIndex (0 );
10001001 profileCB->removeItem (index);
1002+ customProfileItemIdx--;
10011003
10021004 profileSaveButton->setEnabled (false );
10031005 profileDeleteButton->setEnabled (false );
@@ -1037,16 +1039,15 @@ void DefaultParamsDialog::profileSavePressed() {
10371039}
10381040
10391041void DefaultParamsDialog::profileDeletePressed () {
1040- const ScopedIncDec<int > scopeGuard (ignoreProfileChanges);
1041-
10421042 if (profileManager.deleteProfile (profileCB->currentText ())) {
1043- const int deletedProfileIndex = profileCB->currentIndex ();
1044- profileCB->setCurrentIndex (customProfileItemIdx--);
1045- profileCB->removeItem (deletedProfileIndex);
1043+ {
1044+ const ScopedIncDec<int > scopeGuard (ignoreProfileChanges);
10461045
1047- profileSaveButton->setEnabled (true );
1048- profileDeleteButton->setEnabled (false );
1049- setTabWidgetsEnabled (true );
1046+ const int deletedProfileIndex = profileCB->currentIndex ();
1047+ profileCB->setCurrentIndex (customProfileItemIdx--);
1048+ profileCB->removeItem (deletedProfileIndex);
1049+ }
1050+ profileChanged (customProfileItemIdx);
10501051 } else {
10511052 QMessageBox::critical (this , tr (" Error" ), tr (" Error deleting the profile." ));
10521053 }
0 commit comments