diff --git a/Applications/DataExplorer/DataExplorer.cmake b/Applications/DataExplorer/DataExplorer.cmake index 8aba24410342a818899020bc86b9c0a2a630ae6f..445a66bb48fae468649917a389e65119dd31db4c 100644 --- a/Applications/DataExplorer/DataExplorer.cmake +++ b/Applications/DataExplorer/DataExplorer.cmake @@ -1,11 +1,15 @@ # Source files SET( SOURCES mainwindow.cpp + ${CMAKE_SOURCE_DIR}/Applications/Utils/OGSFileConverter/OGSFileConverter.cpp + ${CMAKE_SOURCE_DIR}/Applications/Utils/OGSFileConverter/FileListDialog.cpp ) # Moc Header files SET( MOC_HEADERS mainwindow.h + ${CMAKE_SOURCE_DIR}/Applications/Utils/OGSFileConverter/OGSFileConverter.h + ${CMAKE_SOURCE_DIR}/Applications/Utils/OGSFileConverter/FileListDialog.h ) # Header files @@ -16,6 +20,8 @@ SET( HEADERS # UI files SET( UIS mainwindow.ui + ${CMAKE_SOURCE_DIR}/Applications/Utils/OGSFileConverter/OGSFileConverter.ui + ${CMAKE_SOURCE_DIR}/Applications/Utils/OGSFileConverter/FileList.ui ) @@ -44,6 +50,7 @@ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR}/DataView/DiagramView ${CMAKE_CURRENT_BINARY_DIR}/VtkVis ${CMAKE_CURRENT_BINARY_DIR}/VtkAct + ${CMAKE_CURRENT_BINARY_DIR}/Applications/Utils/OGSFileConverter ${CMAKE_CURRENT_SOURCE_DIR}/Base ${CMAKE_CURRENT_SOURCE_DIR}/DataView ${CMAKE_CURRENT_SOURCE_DIR}/DataView/StratView diff --git a/Applications/DataExplorer/mainwindow.cpp b/Applications/DataExplorer/mainwindow.cpp index 28c14ea7cec38a216896e76b19396990ac9be860..b1d03b794e0accb78c5175e648410131b0179c0a 100644 --- a/Applications/DataExplorer/mainwindow.cpp +++ b/Applications/DataExplorer/mainwindow.cpp @@ -95,6 +95,8 @@ #include <vtkRenderer.h> #include <vtkVRMLExporter.h> +#include "Applications/Utils/OGSFileConverter/OGSFileConverter.h" + #ifdef VTKOSGCONVERTER_FOUND #include "vtkOsgConverter.h" #include <OpenSG/OSGCoredNodePtr.h> @@ -893,22 +895,12 @@ void MainWindow::exportBoreholesToGMS(std::string listName, std::string fileName } -void MainWindow::callFileConverter() const +void MainWindow::showFileConverter() const { - if (system(NULL) != 0) // command processor available - { - QSettings settings; - QString converter_path = settings.value("DataExplorerConverterPath").toString(); -#if _WIN32 - converter_path = QString("\"").append(converter_path).append("\""); -#endif - if (!converter_path.isEmpty()) - system(converter_path.toAscii()); - else - OGSError::box("Location of OGS File Converter not specified", "Error"); - } - else - OGSError::box("Error executing OGSFileConverter - no command processor available", "Error"); + OGSFileConverter* dlg = new OGSFileConverter(); + dlg->setAttribute(Qt::WA_DeleteOnClose); + dlg->show(); + dlg->raise(); } void MainWindow::callGMSH(std::vector<std::string> & selectedGeometries, diff --git a/Applications/DataExplorer/mainwindow.h b/Applications/DataExplorer/mainwindow.h index 0d5704832d326285e175c94fe278e3faa1408f35..7b43ea478154ae14194759d1567fa6780615f07c 100644 --- a/Applications/DataExplorer/mainwindow.h +++ b/Applications/DataExplorer/mainwindow.h @@ -57,8 +57,6 @@ protected slots: void open(int i = 0); /// Function calls for saving files. void save(); - /// Calls the OGSFileConverter as an external tool - void callFileConverter() const; /// Function calls for generating GMSH files from the GUI void callGMSH(std::vector<std::string> & selectedGeometries, unsigned param1, @@ -85,6 +83,8 @@ protected slots: void showDiagramPrefsDialog(); /// Calls the diagram prefs dialog from the station list (i.e. for a specific station). void showDiagramPrefsDialog(QModelIndex &index); + /// Calls the OGSFileConverter as an external tool + void showFileConverter() const; //TODO6 void showFileConverterDialog(); void showLicense(); void showLineEditDialog(const std::string &geoName); diff --git a/Applications/DataExplorer/mainwindow.ui b/Applications/DataExplorer/mainwindow.ui index a68296411a9214356b34fd430ebf853df0058df8..d3db0e16a73afc24230a6eaaf744fc662651ab70 100644 --- a/Applications/DataExplorer/mainwindow.ui +++ b/Applications/DataExplorer/mainwindow.ui @@ -643,7 +643,7 @@ <sender>actionFile_Converter</sender> <signal>triggered()</signal> <receiver>MainWindowClass</receiver> - <slot>callFileConverter()</slot> + <slot>showFileConverter()</slot> <hints> <hint type="sourcelabel"> <x>-1</x> @@ -700,7 +700,7 @@ <slot>showLicense()</slot> <slot>showMergeGeometriesDialog()</slot> <slot>showMeshElementRemovalDialog()</slot> - <slot>callFileConverter()</slot> + <slot>showFileConverter()</slot> <slot>showDataExplorerSettingsDialog()</slot> <slot>showMeshAnalysisDialog()</slot> </slots>