diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2018-10-01 10:28:04 +0200 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2018-10-01 09:05:48 +0000 |
commit | 6f8ee143f794b5d8fa8dd945b5e913487ae779bd (patch) | |
tree | 0a74383c22f50f714308ebd58304f6d7d1271539 | |
parent | f69108b84e9f996641d9c920fffc19853115f56b (diff) |
Qt: Update UAT clear button enabling
Check for enabling the clear button when loading a UatDialog.
Also move setting enabled property to false for deleteToolButton,
copyToolButton, moveUpToolButton, moveDownToolButton and clearToolButton
to uat_dialog.ui.
Change-Id: I1ff3ed9906eb541e929297b34abcce2bee4a062c
Reviewed-on: https://code.wireshark.org/review/29953
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
-rw-r--r-- | ui/qt/uat_dialog.cpp | 6 | ||||
-rw-r--r-- | ui/qt/uat_dialog.ui | 15 |
2 files changed, 16 insertions, 5 deletions
diff --git a/ui/qt/uat_dialog.cpp b/ui/qt/uat_dialog.cpp index 669be66c6c..607c3ef8ef 100644 --- a/ui/qt/uat_dialog.cpp +++ b/ui/qt/uat_dialog.cpp @@ -36,11 +36,6 @@ UatDialog::UatDialog(QWidget *parent, epan_uat *uat) : ui->setupUi(this); if (uat) loadGeometry(0, 0, uat->name); - ui->deleteToolButton->setEnabled(false); - ui->copyToolButton->setEnabled(false); - ui->moveUpToolButton->setEnabled(false); - ui->moveDownToolButton->setEnabled(false); - ui->clearToolButton->setEnabled(false); ok_button_ = ui->buttonBox->button(QDialogButtonBox::Ok); help_button_ = ui->buttonBox->button(QDialogButtonBox::Help); @@ -107,6 +102,7 @@ void UatDialog::setUat(epan_uat *uat) uat_delegate_ = new UatDelegate; ui->uatTreeView->setModel(uat_model_); ui->uatTreeView->setItemDelegate(uat_delegate_); + ui->clearToolButton->setEnabled(uat_model_->rowCount() != 0); connect(uat_model_, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(modelDataChanged(QModelIndex))); diff --git a/ui/qt/uat_dialog.ui b/ui/qt/uat_dialog.ui index 3670f9132d..c2f8a9a3b5 100644 --- a/ui/qt/uat_dialog.ui +++ b/ui/qt/uat_dialog.ui @@ -61,6 +61,9 @@ <iconset resource="../../image/stock_icons.qrc"> <normaloff>:/stock/minus-8.png</normaloff>:/stock/minus-8.png</iconset> </property> + <property name="enabled"> + <bool>false</bool> + </property> </widget> </item> <item> @@ -75,6 +78,9 @@ <iconset resource="../../image/stock_icons.qrc"> <normaloff>:/stock/copy-8.png</normaloff>:/stock/copy-8.png</iconset> </property> + <property name="enabled"> + <bool>false</bool> + </property> </widget> </item> <item> @@ -89,6 +95,9 @@ <iconset resource="../../image/stock_icons.qrc"> <normaloff>:/stock/arrow_up.png</normaloff>:/stock/arrow_up.png</iconset> </property> + <property name="enabled"> + <bool>false</bool> + </property> </widget> </item> <item> @@ -103,6 +112,9 @@ <iconset resource="../../image/stock_icons.qrc"> <normaloff>:/stock/arrow_down.png</normaloff>:/stock/arrow_down.png</iconset> </property> + <property name="enabled"> + <bool>false</bool> + </property> </widget> </item> <item> @@ -118,6 +130,9 @@ <normaloff>:/stock/delete_list.png</normaloff>:/stock/delete_list.png </iconset> </property> + <property name="enabled"> + <bool>false</bool> + </property> </widget> </item> <item> |