diff options
author | Jeff Morriss <jeff.morriss.ws@gmail.com> | 2016-03-21 20:56:01 -0400 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-03-26 01:43:37 +0000 |
commit | 928b570a34738e5c28adf86488bd4fda377791ac (patch) | |
tree | a5ab128fb38baf193e92535ec4a615589dd206a0 /ui/qt/export_dissection_dialog.cpp | |
parent | 139aa61588408da7e5e3abb0679ad1c4ad879a0c (diff) |
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>
Diffstat (limited to 'ui/qt/export_dissection_dialog.cpp')
-rw-r--r-- | ui/qt/export_dissection_dialog.cpp | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/ui/qt/export_dissection_dialog.cpp b/ui/qt/export_dissection_dialog.cpp index 53f6f869e1..769393da7e 100644 --- a/ui/qt/export_dissection_dialog.cpp +++ b/ui/qt/export_dissection_dialog.cpp @@ -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 |