diff --git a/romfs/i18n/en-US/gamecard_tab.json b/romfs/i18n/en-US/gamecard_tab.json index 5fae0f5..8d6c0a4 100644 --- a/romfs/i18n/en-US/gamecard_tab.json +++ b/romfs/i18n/en-US/gamecard_tab.json @@ -1,6 +1,4 @@ { - "notification": "Gamecard status change detected!", - "error_frame": { "not_inserted": "No gamecard inserted.", "processing": "Processing gamecard, please wait...", diff --git a/romfs/i18n/en-US/tasks.json b/romfs/i18n/en-US/tasks.json new file mode 100644 index 0000000..bece869 --- /dev/null +++ b/romfs/i18n/en-US/tasks.json @@ -0,0 +1,6 @@ +{ + "notifications": { + "gamecard": "Gamecard status change detected!", + "user_titles": "User titles updated!" + } +} diff --git a/romfs/i18n/en-US/titles_tab.json b/romfs/i18n/en-US/titles_tab.json index 98d9a7f..7fe55aa 100644 --- a/romfs/i18n/en-US/titles_tab.json +++ b/romfs/i18n/en-US/titles_tab.json @@ -1,4 +1,3 @@ { - "no_titles_available": "No titles available.", - "user_titles_notification": "User titles list updated!" + "no_titles_available": "No titles available." } diff --git a/source/gamecard_tab.cpp b/source/gamecard_tab.cpp index f51b0b0..bb6f2f4 100644 --- a/source/gamecard_tab.cpp +++ b/source/gamecard_tab.cpp @@ -83,8 +83,6 @@ namespace nxdt::views /* Subscribe to gamecard status event. */ this->gc_status_task_sub = this->gc_status_task->RegisterListener([this](GameCardStatus gc_status) { - brls::Application::notify("gamecard_tab/notification"_i18n); - if (gc_status < GameCardStatus_InsertedAndInfoLoaded) this->SwitchLayerView(true); switch(gc_status) diff --git a/source/tasks.cpp b/source/tasks.cpp index 2d0a93b..e17345b 100644 --- a/source/tasks.cpp +++ b/source/tasks.cpp @@ -25,6 +25,8 @@ #define NXDT_TASK_INTERVAL 250 /* 250 ms. */ +using namespace brls::i18n::literals; /* For _i18n. */ + namespace nxdt::tasks { /* Status info task. */ @@ -97,9 +99,14 @@ namespace nxdt::tasks this->cur_gc_status = (GameCardStatus)gamecardGetStatus(); if (this->cur_gc_status != this->prev_gc_status) { - this->gc_status_event.fire(this->cur_gc_status); - this->prev_gc_status = this->cur_gc_status; brls::Logger::debug("Gamecard status change triggered: {}.", this->cur_gc_status); + brls::Application::notify("tasks/notifications/gamecard"_i18n); + + /* Update previous gamecard status. */ + this->prev_gc_status = this->cur_gc_status; + + /* Fire task event. */ + this->gc_status_event.fire(this->cur_gc_status); } } @@ -133,12 +140,14 @@ namespace nxdt::tasks if (titleIsGameCardInfoUpdated()) { + brls::Logger::debug("Title info updated."); + brls::Application::notify("tasks/notifications/user_titles"_i18n); + /* Update user metadata vector. */ this->PopulateApplicationMetadataVector(false); /* Fire task event. */ this->title_event.fire(&(this->user_metadata)); - brls::Logger::debug("Title info updated."); } } diff --git a/source/titles_tab.cpp b/source/titles_tab.cpp index 694f11d..8ee6c13 100644 --- a/source/titles_tab.cpp +++ b/source/titles_tab.cpp @@ -90,8 +90,6 @@ namespace nxdt::views this->title_task_sub = this->title_task->RegisterListener([this](const nxdt::tasks::TitleApplicationMetadataVector* app_metadata) { /* Update list. */ this->PopulateList(app_metadata); - - brls::Application::notify("titles_tab/user_titles_notification"_i18n); }); } }