mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-28 07:47:03 -05:00
impr: Update all of ImHex to the new popup system
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user