Choose the appropriate initial directory for the Export Dissections window.

Bug: 12105
Change-Id: Ib2398e5213b2ef2501660d1bba13dca66f04bd55
Reviewed-on: https://code.wireshark.org/review/14549
Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Jeff Morriss 2016-03-21 20:56:01 -04:00 committed by Michael Mann
parent 139aa61588
commit 928b570a34
1 changed files with 26 additions and 2 deletions

View File

@ -36,14 +36,15 @@
#include "qt_ui_utils.h"
#include "wireshark_application.h"
#include <QDialogButtonBox>
#include <QGridLayout>
#include <QPushButton>
#endif // Q_OS_WIN
#include <epan/prefs.h>
#include "wireshark_application.h"
ExportDissectionDialog::ExportDissectionDialog(QWidget *parent, capture_file *cap_file, export_type_e export_type):
QFileDialog(parent),
export_type_(export_type),
@ -52,6 +53,29 @@ ExportDissectionDialog::ExportDissectionDialog(QWidget *parent, capture_file *ca
, save_bt_(NULL)
#endif /* Q_OS_WIN */
{
switch (prefs.gui_fileopen_style) {
case FO_STYLE_LAST_OPENED:
/* The user has specified that we should start out in the last directory
* we looked in. If we've already opened a file, use its containing
* directory, if we could determine it, as the directory, otherwise
* use the "last opened" directory saved in the preferences file if
* there was one.
*/
setDirectory(wsApp->lastOpenDir());
break;
case FO_STYLE_SPECIFIED:
/* The user has specified that we should always start out in a
* specified directory; if they've specified that directory,
* start out by showing the files in that dir.
*/
if (prefs.gui_fileopen_dir[0] != '\0')
setDirectory(prefs.gui_fileopen_dir);
break;
}
#if !defined(Q_OS_WIN)
QDialogButtonBox *button_box = findChild<QDialogButtonBox *>();
// Add extra widgets