From 7b8330f8f855d05184b9ef80054dfdc81ac51cfd Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sat, 5 Dec 2020 22:10:03 +0100 Subject: [PATCH] Added command line support / dropping files onto executable Closes #36 --- source/main.cpp | 3 +++ source/views/view_hexeditor.cpp | 2 ++ 2 files changed, 5 insertions(+) diff --git a/source/main.cpp b/source/main.cpp index 2c3bad1fa..6019f242b 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -45,6 +45,9 @@ int main(int argc, char **argv) { window.addView(dataProvider); window.addView(); + if (argc > 1) + hex::View::postEvent(hex::Events::FileDropped, argv[1]); + window.loop(); return 0; diff --git a/source/views/view_hexeditor.cpp b/source/views/view_hexeditor.cpp index cc4f7e8f3..16f8ea4d9 100644 --- a/source/views/view_hexeditor.cpp +++ b/source/views/view_hexeditor.cpp @@ -466,6 +466,8 @@ namespace hex { if (this->m_dataProvider->isAvailable()) ProjectFile::setFilePath(path); + this->getWindowOpenState() = true; + View::postEvent(Events::FileLoaded); View::postEvent(Events::DataChanged); ProjectFile::markDirty();