From c21ecc1308502176f845a933adc29852ec6b7666 Mon Sep 17 00:00:00 2001 From: Dario Lombardo Date: Mon, 1 Oct 2018 22:09:33 +0200 Subject: [PATCH] Qt: show more infos about why interfaces are not loaded. Change-Id: Ie5a28587f711282fd5d83b5513b42594c73ca514 Reviewed-on: https://code.wireshark.org/review/29996 Petri-Dish: Anders Broman Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman --- ui/qt/interface_frame.cpp | 8 +++++++- ui/qt/interface_frame.h | 1 + ui/qt/main_window_slots.cpp | 4 +++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ui/qt/interface_frame.cpp b/ui/qt/interface_frame.cpp index 7f2f727ae9..1eafb32133 100644 --- a/ui/qt/interface_frame.cpp +++ b/ui/qt/interface_frame.cpp @@ -249,8 +249,9 @@ void InterfaceFrame::resetInterfaceTreeDisplay() { ui->interfaceTree->setHidden(true); ui->lblNoInterfaces->setHidden(false); - ui->lblNoInterfaces->setText( proxyModel.interfaceError() ); + if ( prefs.capture_no_interface_load ) + ui->lblNoInterfaces->setText( "Interfaces not loaded (due to preference)" ); } else { @@ -372,6 +373,11 @@ void InterfaceFrame::getPoints(int idx, PointList * pts) sourceModel.getPoints(idx, pts); } +void InterfaceFrame::showRunOnFile(void) +{ + ui->lblNoInterfaces->setText("Interfaces not loaded on startup (run on capture file)"); +} + /* * Editor modelines * diff --git a/ui/qt/interface_frame.h b/ui/qt/interface_frame.h index 16e2279199..b5112541a7 100644 --- a/ui/qt/interface_frame.h +++ b/ui/qt/interface_frame.h @@ -58,6 +58,7 @@ public slots: void toggleRemoteInterfaces(); #endif void getPoints(int idx, PointList *pts); + void showRunOnFile(); protected: void hideEvent(QHideEvent *evt); diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp index 6bafd44275..68b680fe5c 100644 --- a/ui/qt/main_window_slots.cpp +++ b/ui/qt/main_window_slots.cpp @@ -198,6 +198,8 @@ bool MainWindow::openCaptureFile(QString cf_path, QString read_filter, unsigned ret = false; goto finish; } + } else { + this->welcome_page_->getInterfaceFrame()->showRunOnFile(); } // TODO detect call from "cf_read" -> "update_progress_dlg" @@ -248,7 +250,6 @@ bool MainWindow::openCaptureFile(QString cf_path, QString read_filter, unsigned } switch (cf_read(CaptureFile::globalCapFile(), FALSE)) { - case CF_READ_OK: case CF_READ_ERROR: /* Just because we got an error, that doesn't mean we were unable @@ -267,6 +268,7 @@ bool MainWindow::openCaptureFile(QString cf_path, QString read_filter, unsigned } break; } + // get_dirname overwrites its path. wsApp->setLastOpenDir(get_dirname(cf_path.toUtf8().data()));