impr: Update all of ImHex to the new popup system

This commit is contained in:
WerWolv
2023-04-08 00:58:53 +02:00
parent 9c9ac23818
commit 80edaea392
36 changed files with 578 additions and 478 deletions

View File

@@ -17,33 +17,6 @@ namespace hex {
return ImHexApi::Provider::isValid() && ImHexApi::Provider::get()->isAvailable();
}
void View::showInfoPopup(const std::string &message) {
EventManager::post<RequestShowInfoPopup>(message);
}
void View::showErrorPopup(const std::string &message) {
EventManager::post<RequestShowErrorPopup>(message);
}
void View::showFatalPopup(const std::string &message) {
EventManager::post<RequestShowFatalErrorPopup>(message);
}
void View::showYesNoQuestionPopup(const std::string &message, const std::function<void()> &yesCallback, const std::function<void()> &noCallback) {
EventManager::post<RequestShowYesNoQuestionPopup>(message, yesCallback, noCallback);
}
void View::showFileChooserPopup(const std::vector<std::fs::path> &paths, const std::vector<nfdfilteritem_t> &validExtensions, bool multiple, const std::function<void(std::fs::path)> &callback) {
if (paths.empty()) {
fs::openFileBrowser(fs::DialogMode::Open, validExtensions, [callback](const auto &path) {
callback(path);
}, {}, multiple);
} else {
EventManager::post<RequestShowFileChooserPopup>(paths, validExtensions, callback, multiple);
}
}
bool View::hasViewMenuItemEntry() const {
return true;
}