mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 05:27:41 -05:00
refactor: Rework features that use external libraries into optional plugins (#1470)
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
#include <imgui.h>
|
||||
|
||||
#include <hex/ui/imgui_imhex_extensions.h>
|
||||
#include <content/popups/popup_notification.hpp>
|
||||
#include <popups/popup_notification.hpp>
|
||||
|
||||
#include <wolv/io/file.hpp>
|
||||
|
||||
@@ -113,7 +113,7 @@ namespace hex::plugin::builtin {
|
||||
wolv::io::File output(outputPath, wolv::io::File::Mode::Create);
|
||||
|
||||
if (!output.isValid()) {
|
||||
PopupError::open("hex.builtin.tools.file_tools.combiner.error.open_output"_lang);
|
||||
ui::PopupError::open("hex.builtin.tools.file_tools.combiner.error.open_output"_lang);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ namespace hex::plugin::builtin {
|
||||
|
||||
wolv::io::File input(file, wolv::io::File::Mode::Read);
|
||||
if (!input.isValid()) {
|
||||
PopupError::open(hex::format("hex.builtin.tools.file_tools.combiner.open_input"_lang, wolv::util::toUTF8String(file)));
|
||||
ui::PopupError::open(hex::format("hex.builtin.tools.file_tools.combiner.open_input"_lang, wolv::util::toUTF8String(file)));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ namespace hex::plugin::builtin {
|
||||
selectedIndex = 0;
|
||||
outputPath.clear();
|
||||
|
||||
PopupInfo::open("hex.builtin.tools.file_tools.combiner.success"_lang);
|
||||
ui::PopupInfo::open("hex.builtin.tools.file_tools.combiner.success"_lang);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <imgui.h>
|
||||
|
||||
#include <hex/ui/imgui_imhex_extensions.h>
|
||||
#include <content/popups/popup_notification.hpp>
|
||||
#include <popups/popup_notification.hpp>
|
||||
|
||||
#include <wolv/io/file.hpp>
|
||||
#include <wolv/utils/guards.hpp>
|
||||
@@ -54,7 +54,7 @@ namespace hex::plugin::builtin {
|
||||
wolv::io::File file(selectedFile, wolv::io::File::Mode::Write);
|
||||
|
||||
if (!file.isValid()) {
|
||||
PopupError::open("hex.builtin.tools.file_tools.shredder.error.open"_lang);
|
||||
ui::PopupError::open("hex.builtin.tools.file_tools.shredder.error.open"_lang);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ namespace hex::plugin::builtin {
|
||||
|
||||
file.remove();
|
||||
|
||||
PopupInfo::open("hex.builtin.tools.file_tools.shredder.success"_lang);
|
||||
ui::PopupInfo::open("hex.builtin.tools.file_tools.shredder.success"_lang);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include <imgui.h>
|
||||
|
||||
#include <hex/ui/imgui_imhex_extensions.h>
|
||||
#include <content/popups/popup_notification.hpp>
|
||||
#include <popups/popup_notification.hpp>
|
||||
|
||||
#include <wolv/io/file.hpp>
|
||||
#include <wolv/utils/guards.hpp>
|
||||
@@ -101,12 +101,12 @@ namespace hex::plugin::builtin {
|
||||
wolv::io::File file(selectedFile, wolv::io::File::Mode::Read);
|
||||
|
||||
if (!file.isValid()) {
|
||||
PopupError::open("hex.builtin.tools.file_tools.splitter.picker.error.open"_lang);
|
||||
ui::PopupError::open("hex.builtin.tools.file_tools.splitter.picker.error.open"_lang);
|
||||
return;
|
||||
}
|
||||
|
||||
if (file.getSize() < splitSize) {
|
||||
PopupError::open("hex.builtin.tools.file_tools.splitter.picker.error.size"_lang);
|
||||
ui::PopupError::open("hex.builtin.tools.file_tools.splitter.picker.error.size"_lang);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ namespace hex::plugin::builtin {
|
||||
wolv::io::File partFile(path, wolv::io::File::Mode::Create);
|
||||
|
||||
if (!partFile.isValid()) {
|
||||
PopupError::open(hex::format("hex.builtin.tools.file_tools.splitter.picker.error.create"_lang, index));
|
||||
ui::PopupError::open(hex::format("hex.builtin.tools.file_tools.splitter.picker.error.create"_lang, index));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ namespace hex::plugin::builtin {
|
||||
index++;
|
||||
}
|
||||
|
||||
PopupInfo::open("hex.builtin.tools.file_tools.splitter.picker.success"_lang);
|
||||
ui::PopupInfo::open("hex.builtin.tools.file_tools.splitter.picker.success"_lang);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace hex::plugin::builtin {
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (ImGui::Button("hex.builtin.common.cancel"_lang)) {
|
||||
if (ImGui::Button("hex.ui.common.cancel"_lang)) {
|
||||
request.cancel();
|
||||
}
|
||||
}
|
||||
@@ -33,9 +33,9 @@ namespace hex::plugin::builtin {
|
||||
ImGuiExt::Header("hex.builtin.tools.file_uploader.recent"_lang);
|
||||
|
||||
if (ImGui::BeginTable("##links", 3, ImGuiTableFlags_ScrollY | ImGuiTableFlags_Borders | ImGuiTableFlags_Resizable | ImGuiTableFlags_RowBg, ImVec2(0, 200))) {
|
||||
ImGui::TableSetupColumn("hex.builtin.common.file"_lang);
|
||||
ImGui::TableSetupColumn("hex.builtin.common.link"_lang);
|
||||
ImGui::TableSetupColumn("hex.builtin.common.size"_lang);
|
||||
ImGui::TableSetupColumn("hex.ui.common.file"_lang);
|
||||
ImGui::TableSetupColumn("hex.ui.common.link"_lang);
|
||||
ImGui::TableSetupColumn("hex.ui.common.size"_lang);
|
||||
ImGui::TableSetupScrollFreeze(0, 1);
|
||||
ImGui::TableHeadersRow();
|
||||
|
||||
@@ -81,11 +81,11 @@ namespace hex::plugin::builtin {
|
||||
json.at("data").at("file").at("metadata").at("size").at("readable")
|
||||
});
|
||||
} catch (...) {
|
||||
PopupError::open("hex.builtin.tools.file_uploader.invalid_response"_lang);
|
||||
ui::PopupError::open("hex.builtin.tools.file_uploader.invalid_response"_lang);
|
||||
}
|
||||
} else if (response.getStatusCode() == 0) {
|
||||
// Canceled by user, no action needed
|
||||
} else PopupError::open(hex::format("hex.builtin.tools.file_uploader.error"_lang, response.getStatusCode()));
|
||||
} else ui::PopupError::open(hex::format("hex.builtin.tools.file_uploader.error"_lang, response.getStatusCode()));
|
||||
|
||||
uploadProcess = {};
|
||||
currFile.clear();
|
||||
|
||||
Reference in New Issue
Block a user