diff options
author | Roland Knall <rknall@gmail.com> | 2019-07-22 17:03:46 +0200 |
---|---|---|
committer | Roland Knall <rknall@gmail.com> | 2019-07-22 15:58:35 +0000 |
commit | a96d6c4ceafdf7c6c930e2fbefc8d0274348df27 (patch) | |
tree | 4b0bff9ef9d4d7cb815d35b3202d3ce6105f4d83 /ui/qt/profile_dialog.cpp | |
parent | 8892da8a472c96960723b7cdfda8f1f25d6ffeef (diff) |
Qt: Stop profile import when action pending
When a reset/delete/add/rename action is pending, profiles
cannot be imported.
Change-Id: I4521b8a265ec4346b7028bc5a7173fd531be24c2
Reviewed-on: https://code.wireshark.org/review/34057
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
Diffstat (limited to 'ui/qt/profile_dialog.cpp')
-rw-r--r-- | ui/qt/profile_dialog.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ui/qt/profile_dialog.cpp b/ui/qt/profile_dialog.cpp index 6254ab6ec0..5eeb288853 100644 --- a/ui/qt/profile_dialog.cpp +++ b/ui/qt/profile_dialog.cpp @@ -180,6 +180,8 @@ void ProfileDialog::updateWidgets() bool enable_del = false; bool enable_ok = true; + pd_ui_->btnImport->setEnabled( ! model_->changesPending() ); + QModelIndex index = sort_model_->mapToSource(pd_ui_->profileTreeView->currentIndex()); if ( index.column() != ProfileModel::COL_NAME ) index = index.sibling(index.row(), ProfileModel::COL_NAME); @@ -249,6 +251,8 @@ void ProfileDialog::on_newToolButton_clicked() pd_ui_->profileTreeView->edit(ridx); currentItemChanged(); } + else + updateWidgets(); } void ProfileDialog::on_deleteToolButton_clicked() @@ -259,6 +263,8 @@ void ProfileDialog::on_deleteToolButton_clicked() QModelIndex newIdx = sort_model_->mapFromSource(model_->index(0, 0)); pd_ui_->profileTreeView->setCurrentIndex(newIdx); + + updateWidgets(); } void ProfileDialog::on_copyToolButton_clicked() @@ -279,6 +285,8 @@ void ProfileDialog::on_copyToolButton_clicked() pd_ui_->profileTreeView->edit(sort_model_->mapFromSource(ridx)); currentItemChanged(); } + else + updateWidgets(); } void ProfileDialog::on_buttonBox_accepted() |