diff --git a/plugins/builtin/source/lang/de_DE.cpp b/plugins/builtin/source/lang/de_DE.cpp index ca6b2896e..8aa1dc4f8 100644 --- a/plugins/builtin/source/lang/de_DE.cpp +++ b/plugins/builtin/source/lang/de_DE.cpp @@ -63,6 +63,7 @@ namespace hex::plugin::builtin { { "hex.common.decimal", "Dezimal" }, { "hex.common.hexadecimal", "Hexadezimal" }, { "hex.common.octal", "Oktal" }, + { "hex.common.info", "Information" }, { "hex.common.error", "Fehler" }, { "hex.common.fatal", "Fataler Fehler" }, { "hex.common.address", "Adresse" }, @@ -82,6 +83,9 @@ namespace hex::plugin::builtin { { "hex.common.open", "Öffnen" }, { "hex.common.browse", "Druchsuchen..." }, + { "hex.message.yara_rule_added", "Yara Regel hinzugefügt!" }, + { "hex.message.magic_db_added", "Magic Datenbank hinzugefügt!" }, + { "hex.view.bookmarks.name", "Lesezeichen" }, { "hex.view.bookmarks.default_title", "Lesezeichen [0x{0:X} - 0x{1:X}]" }, { "hex.view.bookmarks.no_bookmarks", "Noch kein Lesezeichen erstellt. Füge eines hinzu mit Bearbeiten -> Lesezeichen erstellen" }, diff --git a/plugins/builtin/source/lang/en_US.cpp b/plugins/builtin/source/lang/en_US.cpp index 261bf05ee..d3399b1f8 100644 --- a/plugins/builtin/source/lang/en_US.cpp +++ b/plugins/builtin/source/lang/en_US.cpp @@ -63,6 +63,7 @@ namespace hex::plugin::builtin { { "hex.common.decimal", "Decimal" }, { "hex.common.hexadecimal", "Hexadecimal" }, { "hex.common.octal", "Octal" }, + { "hex.common.info", "Information" }, { "hex.common.error", "Error" }, { "hex.common.fatal", "Fatal Error" }, { "hex.common.address", "Address" }, @@ -82,6 +83,9 @@ namespace hex::plugin::builtin { { "hex.common.open", "Open" }, { "hex.common.browse", "Browse..." }, + { "hex.message.yara_rule_added", "Yara rule added!" }, + { "hex.message.magic_db_added", "Magic database added!" }, + { "hex.view.bookmarks.name", "Bookmarks" }, { "hex.view.bookmarks.default_title", "Bookmark [0x{0:X} - 0x{1:X}]" }, { "hex.view.bookmarks.no_bookmarks", "No bookmarks created yet. Add one with Edit -> Create Bookmark" }, diff --git a/plugins/builtin/source/lang/it_IT.cpp b/plugins/builtin/source/lang/it_IT.cpp index 702ac32cd..b3cf7e4f6 100644 --- a/plugins/builtin/source/lang/it_IT.cpp +++ b/plugins/builtin/source/lang/it_IT.cpp @@ -62,6 +62,7 @@ namespace hex::plugin::builtin { { "hex.common.decimal", "Decimale" }, { "hex.common.hexadecimal", "Esadecimale" }, { "hex.common.octal", "Ottale" }, + //{ "hex.common.info", "Information" }, { "hex.common.error", "Errore" }, { "hex.common.fatal", "Errore Fatale" }, { "hex.common.address", "Indirizzo" }, @@ -81,6 +82,9 @@ namespace hex::plugin::builtin { //{ "hex.common.open", "Open" }, //{ "hex.common.browse", "Browse..." }, + //{ "hex.message.yara_rule_added", "Yara rule added!" }, + //{ "hex.message.magic_db_added", "Magic database added!" }, + { "hex.view.bookmarks.name", "Segnalibri" }, { "hex.view.bookmarks.default_title", "Segnalibro [0x{0:X} - 0x{1:X}]" }, { "hex.view.bookmarks.no_bookmarks", "Non è stato creato alcun segnalibro. Aggiungine uno andando su Modifica -> Crea Segnalibro" }, diff --git a/plugins/builtin/source/lang/zh_CN.cpp b/plugins/builtin/source/lang/zh_CN.cpp index 80c400025..2295657aa 100644 --- a/plugins/builtin/source/lang/zh_CN.cpp +++ b/plugins/builtin/source/lang/zh_CN.cpp @@ -63,6 +63,7 @@ namespace hex::plugin::builtin { { "hex.common.decimal", "十进制" }, { "hex.common.hexadecimal", "十六进制" }, { "hex.common.octal", "八进制" }, + //{ "hex.common.info", "Information" }, { "hex.common.error", "错误" }, { "hex.common.fatal", "致命错误" }, { "hex.common.address", "地址" }, @@ -82,6 +83,9 @@ namespace hex::plugin::builtin { //{ "hex.common.open", "Open" }, //{ "hex.common.browse", "Browse..." }, + //{ "hex.message.yara_rule_added", "Yara rule added!" }, + //{ "hex.message.magic_db_added", "Magic database added!" }, + { "hex.view.bookmarks.name", "书签" }, { "hex.view.bookmarks.default_title", "书签 [0x{0:X} - 0x{1:X}]" }, { "hex.view.bookmarks.no_bookmarks", "空空如也。通过 编辑->添加书签" }, diff --git a/source/helpers/project_file_handler.cpp b/source/helpers/project_file_handler.cpp index eef288ed2..224e40b9a 100644 --- a/source/helpers/project_file_handler.cpp +++ b/source/helpers/project_file_handler.cpp @@ -85,6 +85,8 @@ namespace hex { ProjectFile::s_hasUnsavedChanged = false; ProjectFile::s_currProjectFilePath = filePath; + EventManager::post(); + return true; } diff --git a/source/views/view_hexeditor.cpp b/source/views/view_hexeditor.cpp index 09933af51..3acf7bd66 100644 --- a/source/views/view_hexeditor.cpp +++ b/source/views/view_hexeditor.cpp @@ -197,7 +197,6 @@ namespace hex { } else if (name == "Open Project") { hex::openFileBrowser("hex.view.hexeditor.open_project"_lang, DialogMode::Open, { { "Project File", "hexproj" } }, [this](auto path) { ProjectFile::load(path); - EventManager::post(); this->getWindowOpenState() = true; }); } @@ -473,7 +472,6 @@ namespace hex { if (ImGui::MenuItem("hex.view.hexeditor.menu.file.open_project"_lang, "")) { hex::openFileBrowser("hex.view.hexeditor.menu.file.open_project"_lang, DialogMode::Open, { { "Project File", "hexproj" } }, [this](auto path) { ProjectFile::load(path); - EventManager::post(); }); } diff --git a/source/window/window.cpp b/source/window/window.cpp index 4caf85a71..c8aa5facf 100644 --- a/source/window/window.cpp +++ b/source/window/window.cpp @@ -440,7 +440,6 @@ namespace hex { ImGui::SetCursorPosX(width / 9); if (ImGui::Button("hex.safety_backup.restore"_lang, ImVec2(width / 3, 0))) { ProjectFile::load(this->m_safetyBackupPath.string()); - EventManager::post(); ProjectFile::markDirty(); ProjectFile::clearProjectFilePath(); @@ -784,13 +783,23 @@ namespace hex { if (file.isValid()) EventManager::post(file.readString()); + } else if (path.extension() == ".hexproj") { + ProjectFile::load(path.string()); } else if (path.extension() == ".yar") { for (auto &destPath : hex::getPath(ImHexPath::Yara)) { std::error_code error; - std::filesystem::copy(path, destPath, error); - - if (!error) + if (std::filesystem::copy_file(path, destPath / path.filename(), std::filesystem::copy_options::overwrite_existing, error)) { + View::showMessagePopup("hex.message.yara_rule_added"_lang); break; + } + } + } else if (path.extension() == ".mgc") { + for (auto &destPath : hex::getPath(ImHexPath::Magic)) { + std::error_code error; + if (std::filesystem::copy_file(path, destPath / path.filename(), std::filesystem::copy_options::overwrite_existing, error)) { + View::showMessagePopup("hex.message.magic_db_added"_lang); + break; + } } } else { EventManager::post(path.string());