diff --git a/Applications/DataExplorer/main.cpp b/Applications/DataExplorer/main.cpp index 88b73df9541bd2c4a4fcbecffb06be4740330912..d3163eabe755677760a985f1dae7b27c2bdb06c7 100644 --- a/Applications/DataExplorer/main.cpp +++ b/Applications/DataExplorer/main.cpp @@ -37,6 +37,9 @@ int main(int argc, char* argv[]) MainWindow* w = new MainWindow(); w->setWindowTitle( w->windowTitle() + " - " + QString::fromStdString(BaseLib::BuildInfo::git_describe)); + if (QCoreApplication::arguments().size()>1) { + w->LoadFile(QCoreApplication::arguments().at(1)); + } w->show(); int returncode = a.exec(); delete w; diff --git a/Applications/DataExplorer/mainwindow.cpp b/Applications/DataExplorer/mainwindow.cpp index d24e173c6a10cc31f4a7f2f0597eac72b79b7caa..6f1a47389c3743f8af704b0153d8bb4410f683ff 100644 --- a/Applications/DataExplorer/mainwindow.cpp +++ b/Applications/DataExplorer/mainwindow.cpp @@ -1096,6 +1096,16 @@ void MainWindow::HideWindow() this->hide(); } +void MainWindow::LoadFile(const QString &fileName) +{ + ImportFileType::type t; + QString ext = QFileInfo(fileName).suffix(); + if (ext=="msh" || ext=="vtu" || ext=="gli" || ext=="gml") { + t = ImportFileType::OGS_MSH; + this->loadFile(t,fileName); + } +} + void MainWindow::on_actionExportVTK_triggered(bool checked /*= false*/) { Q_UNUSED(checked) diff --git a/Applications/DataExplorer/mainwindow.h b/Applications/DataExplorer/mainwindow.h index 36837c99f543bf30e2400141b8534b98a4719cf3..59be10bda703f956b233ad1207678f3329c5bccd 100644 --- a/Applications/DataExplorer/mainwindow.h +++ b/Applications/DataExplorer/mainwindow.h @@ -45,6 +45,7 @@ public: void ShowWindow(); void HideWindow(); + void LoadFile(const QString &fileName); protected: void closeEvent( QCloseEvent* event );