ui: Added error popup when an exception is thrown in a task

This commit is contained in:
WerWolv
2022-09-03 23:56:57 +02:00
parent 0a115a3c03
commit 1a21627cdb
11 changed files with 33 additions and 2 deletions

View File

@@ -153,6 +153,15 @@ namespace hex::plugin::builtin {
ImGui::EndPopup();
}
// Task exception popup
for (const auto &task : TaskManager::getRunningTasks()) {
if (task->hadException()) {
EventManager::post<RequestShowErrorPopup>(hex::format("hex.builtin.popup.error.task_exception"_lang, LangEntry(task->getUnlocalizedName()), task->getExceptionMessage()));
task->clearException();
break;
}
}
}
void addGlobalUIItems() {

View File

@@ -101,6 +101,7 @@ namespace hex::plugin::builtin {
{ "hex.builtin.popup.error.read_only", "Schreibzugriff konnte nicht erlangt werden. Datei wurde im Lesemodus geöffnet." },
{ "hex.builtin.popup.error.open", "Öffnen der Datei fehlgeschlagen!" },
{ "hex.builtin.popup.error.create", "Erstellen der neuen Datei fehlgeschlagen!" },
{ "hex.builtin.popup.error.task_exception", "Fehler in Task '{}':\n\n{}" },
{ "hex.builtin.menu.file", "Datei" },
{ "hex.builtin.file.open_file", "Datei öffnen..." },

View File

@@ -103,6 +103,7 @@ namespace hex::plugin::builtin {
{ "hex.builtin.popup.error.read_only", "Couldn't get write access. File opened in read-only mode." },
{ "hex.builtin.popup.error.open", "Failed to open file!" },
{ "hex.builtin.popup.error.create", "Failed to create new file!" },
{ "hex.builtin.popup.error.task_exception", "Exception thrown in Task '{}':\n\n{}" },
{ "hex.builtin.menu.file", "File" },
{ "hex.builtin.menu.file.create_file", "New File..." },

View File

@@ -101,6 +101,7 @@ namespace hex::plugin::builtin {
{ "hex.builtin.popup.error.read_only", "Impossibile scrivere sul File. File aperto solo in modalità lettura" },
{ "hex.builtin.popup.error.open", "Impossibile aprire il File!" },
{ "hex.builtin.popup.error.create", "Impossibile creare il nuovo File!" },
//{ "hex.builtin.popup.error.task_exception", "Exception thrown in Task '{}':\n\n{}" },
{ "hex.builtin.menu.file", "File" },
//{ "hex.builtin.menu.file.create_file", "New File..." },

View File

@@ -101,6 +101,7 @@ namespace hex::plugin::builtin {
{ "hex.builtin.popup.error.read_only", "書き込み権限を取得できませんでした。ファイルが読み取り専用で開かれました。" },
{ "hex.builtin.popup.error.open", "ファイルを開けませんでした。" },
{ "hex.builtin.popup.error.create", "新しいファイルを作成できませんでした。" },
//{ "hex.builtin.popup.error.task_exception", "Exception thrown in Task '{}':\n\n{}" },
{ "hex.builtin.menu.file", "ファイル" },
//{ "hex.builtin.menu.file.create_file", "New File..." },

View File

@@ -102,6 +102,7 @@ namespace hex::plugin::builtin {
{ "hex.builtin.popup.error.read_only", "쓰기 권한을 가져올 수 없습니다. 파일이 읽기 전용 모드로 열렸습니다." },
{ "hex.builtin.popup.error.open", "파일을 여는데 실패했습니다!" },
{ "hex.builtin.popup.error.create", "새 파일을 만드는데 실패했습니다!" },
//{ "hex.builtin.popup.error.task_exception", "Exception thrown in Task '{}':\n\n{}" },
{ "hex.builtin.menu.file", "파일" },
{ "hex.builtin.menu.file.create_file", "새 파일..." },

View File

@@ -101,6 +101,7 @@ namespace hex::plugin::builtin {
{ "hex.builtin.popup.error.read_only", "Não foi possível obter acesso de gravação. Arquivo aberto no modo somente leitura." },
{ "hex.builtin.popup.error.open", "Falha ao abrir o arquivo!" },
{ "hex.builtin.popup.error.create", "Falha ao criar um novo arquivo!" },
//{ "hex.builtin.popup.error.task_exception", "Exception thrown in Task '{}':\n\n{}" },
{ "hex.builtin.menu.file", "File" },
//{ "hex.builtin.menu.file.create_file", "New File..." },

View File

@@ -101,6 +101,7 @@ namespace hex::plugin::builtin {
{ "hex.builtin.popup.error.read_only", "无法获得写权限,文件以只读方式打开。" },
{ "hex.builtin.popup.error.open", "打开文件失败!" },
{ "hex.builtin.popup.error.create", "创建新文件失败!" },
//{ "hex.builtin.popup.error.task_exception", "Exception thrown in Task '{}':\n\n{}" },
{ "hex.builtin.menu.file", "文件" },
//{ "hex.builtin.menu.file.create_file", "New File..." },

View File

@@ -101,6 +101,7 @@ namespace hex::plugin::builtin {
{ "hex.builtin.popup.error.read_only", "無法取得寫入權限。檔案已以唯讀模式開啟。" },
{ "hex.builtin.popup.error.open", "無法開啟檔案!" },
{ "hex.builtin.popup.error.create", "無法建立新檔案!" },
//{ "hex.builtin.popup.error.task_exception", "Exception thrown in Task '{}':\n\n{}" },
{ "hex.builtin.menu.file", "檔案" },
//{ "hex.builtin.menu.file.create_file", "New File..." },