Skip to content

Commit

Permalink
pre-select name filter in import/export file dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Jul 21, 2019
1 parent 741dddf commit e239994
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Gui/FileDialog.cpp
Expand Up @@ -199,6 +199,8 @@ QString FileDialog::getSaveFileName (QWidget * parent, const QString & caption,
dlg.setDirectory(dirName);
dlg.setOptions(options);
dlg.setNameFilters(filter.split(QLatin1String(";;")));
if (selectedFilter && !selectedFilter->isEmpty())
dlg.selectNameFilter(*selectedFilter);
dlg.onSelectedFilter(dlg.selectedNameFilter());
dlg.setNameFilterDetailsVisible(true);
dlg.setConfirmOverwrite(true);
Expand Down Expand Up @@ -295,6 +297,8 @@ QString FileDialog::getOpenFileName(QWidget * parent, const QString & caption, c
dlg.setOptions(options);
dlg.setNameFilters(filter.split(QLatin1String(";;")));
dlg.setNameFilterDetailsVisible(true);
if (selectedFilter && !selectedFilter->isEmpty())
dlg.selectNameFilter(*selectedFilter);
if (dlg.exec() == QDialog::Accepted) {
if (selectedFilter)
*selectedFilter = dlg.selectedNameFilter();
Expand Down Expand Up @@ -369,6 +373,8 @@ QStringList FileDialog::getOpenFileNames (QWidget * parent, const QString & capt
dlg.setOptions(options);
dlg.setNameFilters(filter.split(QLatin1String(";;")));
dlg.setNameFilterDetailsVisible(true);
if (selectedFilter && !selectedFilter->isEmpty())
dlg.selectNameFilter(*selectedFilter);
if (dlg.exec() == QDialog::Accepted) {
if (selectedFilter)
*selectedFilter = dlg.selectedNameFilter();
Expand Down

1 comment on commit e239994

@donovaly
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks! This speeds up the workflow.

Please sign in to comment.