@@ -811,44 +811,44 @@ void PMbrowserWindow::on_actionExport_Metadata_as_Table_triggered()
811
811
}
812
812
DlgExportMetadata dlg (this );
813
813
if (dlg.exec ()) {
814
- locale_manager lm;
815
- if (dlg. useSystemLocale ()) {
816
- lm. setLocale ( " " ); // set default locale
817
- }
818
- else {
819
- lm. setLocale ( " C " );
820
- }
821
- auto selected = dlg. getSelection ();
822
- if ( selected < 0 )
823
- {
824
- selected = hkTreeNode::LevelTrace;
825
- }
826
- else {
827
- ++selected; // first item in box is level 1
828
- }
829
- if (dlg. doCopy ()) {
830
- std::ostringstream s;
831
- this -> formatStimMetadataAsTableExport (s, selected) ;
832
- QGuiApplication::clipboard ()-> setText (s. str (). c_str () );
833
- }
834
- else {
835
- auto export_file_name = QFileDialog::getSaveFileName ( this , " Export Metadata as TXT " ,
836
- lastexportpath , " tab separated file (*.txt *.csv) " );
837
- if (export_file_name. length () > 0 ) {
838
- std::ofstream export_file (export_file_name.toStdString ());
839
- if (! export_file) {
840
- QMessageBox::warning ( this , " Error " ,
841
- QString ( " Cannot open file '%1' \n for saving " ). arg (export_file_name));
842
- return ;
843
- }
844
- try {
814
+ try {
815
+ locale_manager lm;
816
+ if (dlg. useSystemLocale ()) {
817
+ lm. setLocale ( " " ); // set default locale
818
+ }
819
+ else {
820
+ lm. setLocale ( " C " );
821
+ }
822
+ auto selected = dlg. getSelection ();
823
+ if (selected < 0 )
824
+ {
825
+ selected = hkTreeNode::LevelTrace;
826
+ }
827
+ else {
828
+ ++selected; // first item in box is level 1
829
+ }
830
+ if (dlg. doCopy ()) {
831
+ std::ostringstream s ;
832
+ this -> formatStimMetadataAsTableExport (s, selected );
833
+ QGuiApplication::clipboard ()-> setText (s. str (). c_str ());
834
+ }
835
+ else {
836
+ auto export_file_name = QFileDialog::getSaveFileName ( this , " Export Metadata as TXT " ,
837
+ lastexportpath, " tab separated file (*.txt *.csv) " );
838
+ if (export_file_name.length () > 0 ) {
839
+ std::ofstream export_file (export_file_name. toStdString ());
840
+ if (!export_file) {
841
+ QMessageBox::warning ( this , " Error " ,
842
+ QString ( " Cannot open file '%1' \n for saving " ). arg (export_file_name)) ;
843
+ return ;
844
+ }
845
845
this ->formatStimMetadataAsTableExport (export_file, selected);
846
846
}
847
- catch (const std::exception & e) {
848
- QMessageBox::warning (this , " Error while exporting" , e.what ());
849
- }
850
847
}
851
848
}
849
+ catch (const std::exception & e) {
850
+ QMessageBox::warning (this , " Error while exporting" , e.what ());
851
+ }
852
852
}
853
853
}
854
854
0 commit comments