mirror of
https://github.com/DarkMatterCore/nxdumptool.git
synced 2024-11-26 12:12:02 +00:00
Rename ErrorLayerView -> LayeredErrorFrame.
This commit is contained in:
parent
7af87f50f3
commit
2ca9878c85
3 changed files with 17 additions and 17 deletions
|
@ -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<nxdt::tasks::GameCardTask, nxdt::tasks::GameCardStatusEvent> GameCardErrorLayerView;
|
||||
typedef LayeredErrorFrame<nxdt::tasks::GameCardTask, nxdt::tasks::GameCardStatusEvent> GameCardLayeredErrorFrame;
|
||||
|
||||
class GameCardTab: public GameCardErrorLayerView
|
||||
class GameCardTab: public GameCardLayeredErrorFrame
|
||||
{
|
||||
typedef bool (*GameCardSizeFunc)(u64 *size);
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* error_layer_view.hpp
|
||||
* layered_error_frame.hpp
|
||||
*
|
||||
* Copyright (c) 2020-2021, DarkMatterCore <pabloacurielz@gmail.com>.
|
||||
*
|
||||
|
@ -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<typename TaskType, typename EventType>
|
||||
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<typename TaskType, typename EventType>
|
||||
ErrorLayerView<TaskType, EventType>::ErrorLayerView(TaskType *task) : brls::LayerView(), task(task)
|
||||
LayeredErrorFrame<TaskType, EventType>::LayeredErrorFrame(TaskType *task) : brls::LayerView(), task(task)
|
||||
{
|
||||
/* Error frame. */
|
||||
this->error_frame = new ErrorFrame();
|
||||
|
@ -69,7 +69,7 @@ namespace nxdt::views
|
|||
}
|
||||
|
||||
template<typename TaskType, typename EventType>
|
||||
ErrorLayerView<TaskType, EventType>::~ErrorLayerView(void)
|
||||
LayeredErrorFrame<TaskType, EventType>::~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<typename TaskType, typename EventType>
|
||||
void ErrorLayerView<TaskType, EventType>::SwitchLayerView(bool use_error_frame)
|
||||
void LayeredErrorFrame<TaskType, EventType>::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<typename TaskType, typename EventType>
|
||||
void ErrorLayerView<TaskType, EventType>::SetErrorFrameMessage(std::string msg)
|
||||
void LayeredErrorFrame<TaskType, EventType>::SetErrorFrameMessage(std::string msg)
|
||||
{
|
||||
this->error_frame->SetMessage(msg);
|
||||
}
|
||||
|
||||
template<typename TaskType, typename EventType>
|
||||
void ErrorLayerView<TaskType, EventType>::AddListView(brls::View* view)
|
||||
void LayeredErrorFrame<TaskType, EventType>::AddListView(brls::View* view)
|
||||
{
|
||||
this->list->addView(view);
|
||||
this->list_views.push_back(view);
|
||||
}
|
||||
|
||||
template<typename TaskType, typename EventType>
|
||||
void ErrorLayerView<TaskType, EventType>::RegisterListener(typename EventType::Callback cb)
|
||||
void LayeredErrorFrame<TaskType, EventType>::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__ */
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue