diff --git a/src/Interface/Application/LayerIOFunctions.cc b/src/Interface/Application/LayerIOFunctions.cc index 752a0fe..5b806de 100755 --- a/src/Interface/Application/LayerIOFunctions.cc +++ b/src/Interface/Application/LayerIOFunctions.cc @@ -102,12 +102,13 @@ bool LayerIOFunctions::ImportFiles( QMainWindow* main_window, std::string file_t #if defined(__APPLE__) || defined(_WIN32) // Use native dialog file_list = QFileDialog::getOpenFileNames( main_window, - "Import Layer(s)... ", current_file_folder.string().c_str(), filters, &qs_filtername ); + "Import Layer(s)... ", current_file_folder.string().c_str(), filters, &qs_filtername, QFileDialog::DontUseNativeDialog ); #else // It seems Ubuntus Qt4 version is broken and its dialog tends to crash // Hence use the other way of defining a dialog QFileDialog* diag = new QFileDialog( main_window, "Import Layer(s)...", current_file_folder.string().c_str(), filters ); + diag->setOption(QFileDialog::DontUseNativeDialog); diag->setFileMode(QFileDialog::ExistingFiles); diag->setNameFilter( qs_filtername ); diag->exec(); @@ -231,12 +232,13 @@ void LayerIOFunctions::ImportSeries( QMainWindow* main_window ) #if defined(__APPLE__) || defined(_WIN32) // Use native dialog file_list = QFileDialog::getOpenFileNames( main_window, - "Select a file from the series... ", current_file_folder.string().c_str(), filters, &filtername ); + "Select a file from the series... ", current_file_folder.string().c_str(), filters, &filtername, QFileDialog::DontUseNativeDialog ); #else // It seems Ubuntus Qt4 version is broken and its dialog tends to crash // Hence use the other way of defining a dialog QFileDialog* diag = new QFileDialog( main_window, "Select a file from the series...", current_file_folder.string().c_str(), filters ); + diag->setOption(QFileDialog::DontUseNativeDialog); diag->setFileMode(QFileDialog::ExistingFiles); diag->setNameFilter( filtername ); diag->exec(); @@ -334,7 +336,8 @@ void LayerIOFunctions::ExportLayer( QMainWindow* main_window ) QString filename = QFileDialog::getSaveFileName( main_window, "Export Data Layer As... ", QString::fromStdString( file_path.string() ), - "NRRD files (*.nrrd);;DICOM files (*.dcm);;TIFF files (*.tiff);;PNG files (*.png);;MRC files (*.mrc);;Matlab files (*.mat)" ); + "NRRD files (*.nrrd);;DICOM files (*.dcm);;TIFF files (*.tiff);;PNG files (*.png);;MRC files (*.mrc);;Matlab files (*.mat)", + 0, QFileDialog::DontUseNativeDialog ); if( filename == "" ) return; diff --git a/src/Interface/Application/LayerWidget.cc b/src/Interface/Application/LayerWidget.cc index c129922..292a627 100644 --- a/src/Interface/Application/LayerWidget.cc +++ b/src/Interface/Application/LayerWidget.cc @@ -376,7 +376,7 @@ void LayerWidgetPrivate::export_layer( const std::string& type_extension ) { boost::filesystem::path current_folder = ProjectManager::Instance()->get_current_file_folder(); QString export_path = QFileDialog::getExistingDirectory( this->parent_, tr( "Choose Directory for Export..." ), - current_folder.string().c_str(), QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks ); + current_folder.string().c_str(), QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks | QFileDialog::DontUseNativeDialog ); if( export_path == "" ) return; diff --git a/src/Interface/Application/Menu.cc b/src/Interface/Application/Menu.cc index 2e16638..985d930 100644 --- a/src/Interface/Application/Menu.cc +++ b/src/Interface/Application/Menu.cc @@ -663,7 +663,10 @@ void Menu::open_project() QFileDialog::getOpenFileName ( this->main_window_, QString::fromStdString( project_type ), QString::fromStdString( current_projects_path.string() ), - QString::fromStdString( project_file_type ) ) ).toStdString() ); + QString::fromStdString( project_file_type ), + 0, + QFileDialog::DontUseNativeDialog + ) ).toStdString() ); #else // It seems Ubuntus Qt4 version is broken and its dialog tends to crash @@ -672,6 +675,7 @@ void Menu::open_project() QString::fromStdString( project_type ), QString::fromStdString( current_projects_path.string() ), QString::fromStdString( project_file_type ) ); + diag->setOption(QFileDialog::DontUseNativeDialog); diag->setFileMode(QFileDialog::ExistingFile); diag->exec(); diff --git a/src/Interface/Application/PreferencesInterface.cc b/src/Interface/Application/PreferencesInterface.cc index 09c8e2c..6753a8f 100644 --- a/src/Interface/Application/PreferencesInterface.cc +++ b/src/Interface/Application/PreferencesInterface.cc @@ -105,7 +105,7 @@ PreferencesInterface::~PreferencesInterface() void PreferencesInterface::change_project_directory() { QString path = QFileDialog::getExistingDirectory ( this, tr( "Directory" ), - project_directory_.path() ); + project_directory_.path(), QFileDialog::ShowDirsOnly | QFileDialog::DontUseNativeDialog ); if ( path.isNull() == false ) { project_directory_.setPath( path ); diff --git a/src/Interface/Application/ProjectExportWizard.cc b/src/Interface/Application/ProjectExportWizard.cc index 30674a2..3129480 100644 --- a/src/Interface/Application/ProjectExportWizard.cc +++ b/src/Interface/Application/ProjectExportWizard.cc @@ -128,7 +128,8 @@ void ExportInfoPage::set_path() QDir project_directory_ = QDir( QFileDialog::getExistingDirectory ( this, tr( "Choose Directory for Export..." ), this->project_path_lineedit_->text(), - QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks ) ); + QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks | + QFileDialog::DontUseNativeDialog ) ); if ( project_directory_.exists() ) { diff --git a/src/Interface/Application/ProjectWizard.cc b/src/Interface/Application/ProjectWizard.cc index 14cc4b4..ddc5016 100644 --- a/src/Interface/Application/ProjectWizard.cc +++ b/src/Interface/Application/ProjectWizard.cc @@ -165,7 +165,8 @@ void ProjectInfoPage::set_path() QDir project_directory_ = QDir( QFileDialog::getExistingDirectory ( this, "Choose Directory...", this->project_path_lineedit_->text(), - QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks ) ); + QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks | + QFileDialog::DontUseNativeDialog ) ); if ( project_directory_.exists() ) { diff --git a/src/Interface/Application/SaveProjectAsWizard.cc b/src/Interface/Application/SaveProjectAsWizard.cc index b646b66..5eb226f 100644 --- a/src/Interface/Application/SaveProjectAsWizard.cc +++ b/src/Interface/Application/SaveProjectAsWizard.cc @@ -177,7 +177,8 @@ void SaveAsInfoPage::set_path() QDir project_directory_ = QDir( QFileDialog::getExistingDirectory ( this, tr( "Choose Save Directory..." ), this->project_path_lineedit_->text(), - QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks ) ); + QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks | + QFileDialog::DontUseNativeDialog ) ); if( project_directory_.exists() ) { diff --git a/src/Interface/Application/SegmentationExportWizard.cc b/src/Interface/Application/SegmentationExportWizard.cc index 737420c..7ee503e 100644 --- a/src/Interface/Application/SegmentationExportWizard.cc +++ b/src/Interface/Application/SegmentationExportWizard.cc @@ -337,13 +337,15 @@ bool SegmentationSelectionPage::validatePage() " File (*" + file_type + ")"; filename = QFileDialog::getSaveFileName( this, "Export Segmentation As... ", - current_folder.string().c_str(), QString::fromStdString( file_selector ) ); + current_folder.string().c_str(), QString::fromStdString( file_selector ), + 0, QFileDialog::DontUseNativeDialog + ); } else { filename = QFileDialog::getExistingDirectory( this, tr( "Choose Directory for Export..." ), current_folder.string().c_str(), QFileDialog::ShowDirsOnly | - QFileDialog::DontResolveSymlinks ); + QFileDialog::DontResolveSymlinks | QFileDialog::DontUseNativeDialog ); if( !QFileInfo( filename ).exists() ) { diff --git a/src/Interface/Application/SplashScreen.cc b/src/Interface/Application/SplashScreen.cc index 211a3d5..0aaa3b4 100644 --- a/src/Interface/Application/SplashScreen.cc +++ b/src/Interface/Application/SplashScreen.cc @@ -180,9 +180,12 @@ void SplashScreen::open_existing() boost::filesystem::path full_path = boost::filesystem::path( ( QFileDialog::getOpenFileName ( 0, - QString::fromStdString( project_type ), - QString::fromStdString( current_projects_path.string() ), - QString::fromStdString( project_file_type ) ) ).toStdString() ); + QString::fromStdString( project_type ), + QString::fromStdString( current_projects_path.string() ), + QString::fromStdString( project_file_type ), + 0, + QFileDialog::DontUseNativeDialog + ) ).toStdString() ); bool is_path_extension = false; for ( size_t j = 0; j < project_path_extensions.size(); j++ )
Archive powered by MHonArc 2.6.18.