2021-08-11 17:51:06 +00:00
|
|
|
#include "../irda-app.h"
|
|
|
|
#include "irda/irda-app-event.h"
|
2021-06-02 15:16:05 +00:00
|
|
|
|
|
|
|
void IrdaAppSceneRemoteList::on_enter(IrdaApp* app) {
|
2021-07-22 00:07:00 +00:00
|
|
|
IrdaAppFileParser file_parser;
|
|
|
|
bool success = false;
|
2021-06-02 15:16:05 +00:00
|
|
|
auto remote_manager = app->get_remote_manager();
|
2021-07-22 00:07:00 +00:00
|
|
|
auto last_selected_remote = remote_manager->get_remote_name();
|
|
|
|
auto selected_file = file_parser.file_select(
|
|
|
|
last_selected_remote.size() ? last_selected_remote.c_str() : nullptr);
|
|
|
|
if(!selected_file.empty()) {
|
|
|
|
if(remote_manager->load(selected_file)) {
|
|
|
|
app->switch_to_next_scene(IrdaApp::Scene::Remote);
|
|
|
|
success = true;
|
|
|
|
}
|
2021-06-02 15:16:05 +00:00
|
|
|
}
|
|
|
|
|
2021-07-22 00:07:00 +00:00
|
|
|
if(!success) {
|
|
|
|
app->switch_to_previous_scene();
|
2021-06-09 13:04:49 +00:00
|
|
|
}
|
2021-06-02 15:16:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool IrdaAppSceneRemoteList::on_event(IrdaApp* app, IrdaAppEvent* event) {
|
|
|
|
bool consumed = false;
|
|
|
|
|
|
|
|
return consumed;
|
|
|
|
}
|
|
|
|
|
|
|
|
void IrdaAppSceneRemoteList::on_exit(IrdaApp* app) {
|
|
|
|
}
|