-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
myCheckPermissions( true )
{
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
-
+ setOption(QFileDialog::DontUseNativeDialog, true);
setModal( modal );
setSizeGripEnabled( true );
if ( parent )
setWindowIcon( parent->windowIcon() );
// GDD
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
myUrls.insert(0,QUrl::fromLocalFile(QDesktopServices::storageLocation(QDesktopServices::ApplicationsLocation)));
myUrls.insert(0,QUrl::fromLocalFile(QDesktopServices::storageLocation(QDesktopServices::HomeLocation)));
+#else
+ myUrls.insert(0,QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::ApplicationsLocation)));
+ myUrls.insert(0,QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::HomeLocation)));
+#endif
setSidebarUrls(myUrls);
// add quick directories widgets
return fileName;
QRegExp r( QString::fromLatin1("\\(?[a-zA-Z0-9.*? +;#|]*\\)?$") );
- int index = r.indexIn( selectedFilter().trimmed() );
+ int index = r.indexIn( selectedNameFilter().trimmed() );
if ( QFileInfo( fileName ).exists() )
return fileName; // if file exists return as is
// Due to transformations from the filter list (*.txt *.*xx *.c++ SUIT*.* ) we
// will have the pattern (\.txt|\..*xx|\.c\+\+|\..*) (as we validate extension only,
// we remove everything except extension mask from the pattern
- QString wildcard = selectedFilter().mid( index, r.matchedLength() ).trimmed();
+ QString wildcard = selectedNameFilter().mid( index, r.matchedLength() ).trimmed();
// replace '|' and ';' separators by space symbol and also brackets if there are some
wildcard.replace( QRegExp( "[\\|;|(|)]" )," " );
*/
void SUIT_FileDlg::addFilter( const QString& filter )
{
- QStringList flist = filters();
+ QStringList flist = nameFilters();
if ( !flist.contains( filter ) ) {
flist << filter;
- setFilters( flist );
+ setNameFilters( flist );
}
- selectFilter( filter );
+ selectNameFilter( filter );
}
/*!
tmpfilename = tmpfilename.replace(QRegExp("\\*"), "" ).replace(QRegExp("\\?"), "" );
if ( filters.isEmpty() )
- fd.setFilter( tr( "ALL_FILES_FILTER" ) ); // All files (*)
+ fd.setNameFilter( tr( "ALL_FILES_FILTER" ) ); // All files (*)
else
- fd.setFilters( filters );
+ fd.setNameFilters( filters );
if ( !caption.isEmpty() )
fd.setWindowTitle( caption );
fd.setFileMode( ExistingFiles );
if ( filters.isEmpty() )
- fd.setFilter( tr( "ALL_FILES_FILTER" ) ); // All files (*)
+ fd.setNameFilter( tr( "ALL_FILES_FILTER" ) ); // All files (*)
else
- fd.setFilters( filters );
+ fd.setNameFilters( filters );
if ( !caption.isEmpty() )
fd.setWindowTitle( caption );