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 <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Dario Lombardo 2018-10-01 22:09:33 +02:00 committed by Anders Broman
parent c36f11ba55
commit c21ecc1308
3 changed files with 11 additions and 2 deletions

View File

@ -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
*

View File

@ -58,6 +58,7 @@ public slots:
void toggleRemoteInterfaces();
#endif
void getPoints(int idx, PointList *pts);
void showRunOnFile();
protected:
void hideEvent(QHideEvent *evt);

View File

@ -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()));