From 769c0bb4a3c6f8ba02081a4ef70b4847d3aaa517 Mon Sep 17 00:00:00 2001 From: jfa Date: Tue, 5 Jun 2007 12:33:21 +0000 Subject: [PATCH] NPAL16151: EDF445: Import/Export BREP by default. --- src/GEOMToolsGUI/GEOMToolsGUI.cxx | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/GEOMToolsGUI/GEOMToolsGUI.cxx b/src/GEOMToolsGUI/GEOMToolsGUI.cxx index 39022be14..baacd7c27 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI.cxx @@ -78,9 +78,15 @@ static QString getFileName( QWidget* parent, { static QString lastUsedFilter; QStringList filters; - for ( FilterMap::const_iterator it = filterMap.begin(); it != filterMap.end(); ++it ) + QString aBrepFilter; + for ( FilterMap::const_iterator it = filterMap.begin(); it != filterMap.end(); ++it ) { filters.push_back( it.key() ); + if (it.key().contains("BREP", false)) { + aBrepFilter = it.key(); + } + } + SUIT_FileDlg* fd = new SUIT_FileDlg( parent, open, true, true ); if ( !caption.isEmpty() ) fd->setCaption( caption ); @@ -88,10 +94,15 @@ static QString getFileName( QWidget* parent, if ( !initial.isEmpty() ) fd->setSelection( initial ); + fd->setFilters( filters ); + if ( !lastUsedFilter.isEmpty() && filterMap.contains( lastUsedFilter ) ) fd->setSelectedFilter( lastUsedFilter ); - - fd->setFilters( filters ); + else { + if (!aBrepFilter.isEmpty()) { + fd->setSelectedFilter(aBrepFilter); + } + } fd->exec(); QString filename = fd->selectedFile(); -- 2.39.2