From 2ca9878c85b8a51fd2f09ab16ea2ed53105a2262 Mon Sep 17 00:00:00 2001 From: Pablo Curiel Date: Sun, 20 Jun 2021 13:27:10 -0400 Subject: [PATCH] Rename ErrorLayerView -> LayeredErrorFrame. --- include/gamecard_tab.hpp | 6 ++--- ...layer_view.hpp => layered_error_frame.hpp} | 26 +++++++++---------- source/gamecard_tab.cpp | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) rename include/{error_layer_view.hpp => layered_error_frame.hpp} (82%) diff --git a/include/gamecard_tab.hpp b/include/gamecard_tab.hpp index e9ed92a..707a899 100644 --- a/include/gamecard_tab.hpp +++ b/include/gamecard_tab.hpp @@ -25,15 +25,15 @@ #define __GAMECARD_TAB_HPP__ #include "tasks.hpp" -#include "error_layer_view.hpp" +#include "layered_error_frame.hpp" #include "focusable_item.hpp" namespace nxdt::views { /* Instantiate the template for our class. */ - typedef ErrorLayerView GameCardErrorLayerView; + typedef LayeredErrorFrame GameCardLayeredErrorFrame; - class GameCardTab: public GameCardErrorLayerView + class GameCardTab: public GameCardLayeredErrorFrame { typedef bool (*GameCardSizeFunc)(u64 *size); diff --git a/include/error_layer_view.hpp b/include/layered_error_frame.hpp similarity index 82% rename from include/error_layer_view.hpp rename to include/layered_error_frame.hpp index 0803d49..695e7e7 100644 --- a/include/error_layer_view.hpp +++ b/include/layered_error_frame.hpp @@ -1,5 +1,5 @@ /* - * error_layer_view.hpp + * layered_error_frame.hpp * * Copyright (c) 2020-2021, DarkMatterCore . * @@ -21,8 +21,8 @@ #pragma once -#ifndef __ERROR_LAYER_VIEW_HPP__ -#define __ERROR_LAYER_VIEW_HPP__ +#ifndef __LAYERED_ERROR_FRAME_HPP__ +#define __LAYERED_ERROR_FRAME_HPP__ #include "error_frame.hpp" @@ -30,7 +30,7 @@ namespace nxdt::views { /* Extended class to switch between ErrorFrame and List views whenever an event is triggered. */ template - class ErrorLayerView: public brls::LayerView + class LayeredErrorFrame: public brls::LayerView { private: TaskType *task = nullptr; @@ -50,12 +50,12 @@ namespace nxdt::views void RegisterListener(typename EventType::Callback cb); public: - ErrorLayerView(TaskType *task); - ~ErrorLayerView(void); + LayeredErrorFrame(TaskType *task); + ~LayeredErrorFrame(void); }; template - ErrorLayerView::ErrorLayerView(TaskType *task) : brls::LayerView(), task(task) + LayeredErrorFrame::LayeredErrorFrame(TaskType *task) : brls::LayerView(), task(task) { /* Error frame. */ this->error_frame = new ErrorFrame(); @@ -69,7 +69,7 @@ namespace nxdt::views } template - ErrorLayerView::~ErrorLayerView(void) + LayeredErrorFrame::~LayeredErrorFrame(void) { /* Unregister task listeners. */ for(typename EventType::Subscription task_sub : this->task_subs) this->task->UnregisterListener(task_sub); @@ -82,7 +82,7 @@ namespace nxdt::views } template - void ErrorLayerView::SwitchLayerView(bool use_error_frame) + void LayeredErrorFrame::SwitchLayerView(bool use_error_frame) { if ((use_error_frame && this->layer_view_index == 0) || (!use_error_frame && this->layer_view_index == 1)) return; @@ -106,24 +106,24 @@ namespace nxdt::views } template - void ErrorLayerView::SetErrorFrameMessage(std::string msg) + void LayeredErrorFrame::SetErrorFrameMessage(std::string msg) { this->error_frame->SetMessage(msg); } template - void ErrorLayerView::AddListView(brls::View* view) + void LayeredErrorFrame::AddListView(brls::View* view) { this->list->addView(view); this->list_views.push_back(view); } template - void ErrorLayerView::RegisterListener(typename EventType::Callback cb) + void LayeredErrorFrame::RegisterListener(typename EventType::Callback cb) { typename EventType::Subscription task_sub = this->task->RegisterListener(cb); this->task_subs.push_back(task_sub); } } -#endif /* __ERROR_LAYER_VIEW_HPP__ */ +#endif /* __LAYERED_ERROR_FRAME_HPP__ */ diff --git a/source/gamecard_tab.cpp b/source/gamecard_tab.cpp index cafbf22..e7d6b1d 100644 --- a/source/gamecard_tab.cpp +++ b/source/gamecard_tab.cpp @@ -41,7 +41,7 @@ namespace nxdt::views [GameCardCompatibilityType_Terra] = "Terra" }; - GameCardTab::GameCardTab(nxdt::tasks::GameCardTask *gc_status_task) : GameCardErrorLayerView(gc_status_task) + GameCardTab::GameCardTab(nxdt::tasks::GameCardTask *gc_status_task) : GameCardLayeredErrorFrame(gc_status_task) { /* Error frame. */ this->SetErrorFrameMessage("gamecard_tab/error_frame/not_inserted"_i18n);