summaryrefslogtreecommitdiff
path: root/ui/qt/interface_frame.cpp
diff options
context:
space:
mode:
authorRoland Knall <roland.knall@br-automation.com>2016-10-13 09:11:50 +0200
committerRoland Knall <rknall@gmail.com>2016-10-13 11:53:46 +0000
commit4f6ed3852dcba51ef19604a090ecfc91bc997940 (patch)
treeee40d30c2aff3c6322175f14fcc1445ca94db4a7 /ui/qt/interface_frame.cpp
parent8b0e66f22c059533643195ba7571cafe9f006f58 (diff)
downloadwireshark-4f6ed3852dcba51ef19604a090ecfc91bc997940.tar.gz
Interface List: Fix display of zero entries
If WS is started with zero entries, no text is being displayed, and pushing a button does not yield the display of the list. This fixes it. Change-Id: I70b0637e5f95e805b54780afb7eb2e43b3e5f21c Reviewed-on: https://code.wireshark.org/review/18180 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Roland Knall <rknall@gmail.com> Tested-by: Roland Knall <rknall@gmail.com>
Diffstat (limited to 'ui/qt/interface_frame.cpp')
-rw-r--r--ui/qt/interface_frame.cpp27
1 files changed, 15 insertions, 12 deletions
diff --git a/ui/qt/interface_frame.cpp b/ui/qt/interface_frame.cpp
index b53a0747b4..b94178693d 100644
--- a/ui/qt/interface_frame.cpp
+++ b/ui/qt/interface_frame.cpp
@@ -124,6 +124,7 @@ void InterfaceFrame::hideEvent(QHideEvent *) {
}
void InterfaceFrame::showEvent(QShowEvent *) {
+
#ifdef HAVE_LIBPCAP
if (stat_timer_)
stat_timer_->start(stat_update_interval_);
@@ -136,10 +137,9 @@ void InterfaceFrame::actionButton_toggled(bool checked)
if ( ifType.isValid() )
{
proxyModel->setInterfaceTypeVisible(ifType.toInt(), checked);
-#ifdef HAVE_EXTCAP
- ui->interfaceTree->resizeColumnToContents(proxyModel->mapSourceToColumn(IFTREE_COL_EXTCAP));
-#endif
}
+
+ resetInterfaceTreeDisplay();
}
QAbstractButton * InterfaceFrame::createButton(QString text, QString prop, QVariant content )
@@ -159,20 +159,29 @@ QAbstractButton * InterfaceFrame::createButton(QString text, QString prop, QVari
void InterfaceFrame::interfaceListChanged()
{
+ resetInterfaceTreeDisplay();
+ resetInterfaceButtons();
+}
+
+void InterfaceFrame::resetInterfaceTreeDisplay()
+{
if ( proxyModel->rowCount() == 0 )
{
ui->interfaceTree->setHidden(true);
ui->lblNoInterfaces->setHidden(false);
- ui->lblNoInterfaces->setText( sourceModel->interfaceError() );
+ ui->lblNoInterfaces->setText( proxyModel->interfaceError() );
}
else
{
ui->interfaceTree->setHidden(false);
ui->lblNoInterfaces->setHidden(true);
+#ifdef HAVE_EXTCAP
+ ui->interfaceTree->resizeColumnToContents(proxyModel->mapSourceToColumn(IFTREE_COL_EXTCAP));
+#endif
+ ui->interfaceTree->resizeColumnToContents(proxyModel->mapSourceToColumn(IFTREE_COL_NAME));
+ ui->interfaceTree->resizeColumnToContents(proxyModel->mapSourceToColumn(IFTREE_COL_STATS));
}
-
- resetInterfaceButtons();
}
void InterfaceFrame::resetInterfaceButtons()
@@ -196,12 +205,6 @@ void InterfaceFrame::resetInterfaceButtons()
buttonLayout->addWidget(button);
}
-#ifdef HAVE_EXTCAP
- ui->interfaceTree->resizeColumnToContents(proxyModel->mapSourceToColumn(IFTREE_COL_EXTCAP));
-#endif
- ui->interfaceTree->resizeColumnToContents(proxyModel->mapSourceToColumn(IFTREE_COL_NAME));
- ui->interfaceTree->resizeColumnToContents(proxyModel->mapSourceToColumn(IFTREE_COL_STATS));
-
#ifdef HAVE_LIBPCAP
if (!stat_timer_) {
updateStatistics();