1
0
mirror of synced 2025-01-30 03:27:25 +01:00

ux: Added save pattern option to File menu

This commit is contained in:
WerWolv 2021-12-12 00:52:54 +01:00
parent 8a36897fd9
commit 15e38e1012
5 changed files with 16 additions and 0 deletions

View File

@ -193,6 +193,9 @@ namespace hex::plugin::builtin {
void ViewPatternEditor::drawMenu() {
if (ImGui::BeginMenu("hex.menu.file"_lang)) {
ImGui::Separator();
if (ImGui::MenuItem("hex.builtin.view.pattern_editor.menu.file.load_pattern"_lang)) {
this->m_selectedPatternFile = 0;
@ -210,6 +213,15 @@ namespace hex::plugin::builtin {
View::doLater([]{ ImGui::OpenPopup("hex.builtin.view.pattern_editor.menu.file.load_pattern"_lang); });
}
if (ImGui::MenuItem("hex.builtin.view.pattern_editor.menu.file.save_pattern"_lang)) {
hex::openFileBrowser("hex.builtin.view.pattern_editor.menu.file.save_pattern"_lang, DialogMode::Save, { { "Pattern", "hexpat" }}, [this](const std::string &path) {
File file(path, File::Mode::Create);
file.write(this->m_textEditor.GetText());
});
}
ImGui::EndMenu();
}
}

View File

@ -267,6 +267,7 @@ namespace hex::plugin::builtin {
{ "hex.builtin.view.pattern_editor.accept_pattern.pattern_language", "Pattern" },
{ "hex.builtin.view.pattern_editor.accept_pattern.question", "Ausgewähltes Pattern anwenden?" },
{ "hex.builtin.view.pattern_editor.menu.file.load_pattern", "Pattern laden..." },
{ "hex.builtin.view.pattern_editor.menu.file.save_pattern", "Pattern speichern..." },
{ "hex.builtin.view.pattern_editor.open_pattern", "Pattern öffnen" },
{ "hex.builtin.view.pattern_editor.evaluating", "Evaluieren..." },
{ "hex.builtin.view.pattern_editor.auto", "Auto evaluieren" },

View File

@ -270,6 +270,7 @@ namespace hex::plugin::builtin {
{ "hex.builtin.view.pattern_editor.accept_pattern.pattern_language", "Patterns" },
{ "hex.builtin.view.pattern_editor.accept_pattern.question", "Do you want to apply the selected pattern?" },
{ "hex.builtin.view.pattern_editor.menu.file.load_pattern", "Load pattern..." },
{ "hex.builtin.view.pattern_editor.menu.file.save_pattern", "Save pattern..." },
{ "hex.builtin.view.pattern_editor.open_pattern", "Open pattern" },
{ "hex.builtin.view.pattern_editor.evaluating", "Evaluating..." },
{ "hex.builtin.view.pattern_editor.auto", "Auto evaluate" },

View File

@ -267,6 +267,7 @@ namespace hex::plugin::builtin {
{ "hex.builtin.view.pattern_editor.accept_pattern.pattern_language", "Pattern" },
{ "hex.builtin.view.pattern_editor.accept_pattern.question", "Vuoi applicare i patter selezionati" },
{ "hex.builtin.view.pattern_editor.menu.file.load_pattern", "Caricamento dei pattern..." },
//{ "hex.builtin.view.pattern_editor.menu.file.save_pattern", "Save pattern..." },
{ "hex.builtin.view.pattern_editor.open_pattern", "Apri pattern" },
{ "hex.builtin.view.pattern_editor.evaluating", "Valutazione..." },
{ "hex.builtin.view.pattern_editor.auto", "Auto valutazione" },

View File

@ -267,6 +267,7 @@ namespace hex::plugin::builtin {
{ "hex.builtin.view.pattern_editor.accept_pattern.pattern_language", "模式" },
{ "hex.builtin.view.pattern_editor.accept_pattern.question", "是否应用找到的模式?" },
{ "hex.builtin.view.pattern_editor.menu.file.load_pattern", "加载模式文件..." },
//{ "hex.builtin.view.pattern_editor.menu.file.save_pattern", "Save pattern..." },
{ "hex.builtin.view.pattern_editor.open_pattern", "打开模式" },
{ "hex.builtin.view.pattern_editor.evaluating", "计算中..." },
{ "hex.builtin.view.pattern_editor.auto", "自动计算" },