2020-02-02 00:04:10 +00:00
|
|
|
#include "core/common.h"
|
|
|
|
#include "core/buttons.h"
|
|
|
|
#include "core/display.h"
|
2020-02-02 21:13:42 +00:00
|
|
|
#include <epaper/EPD.h>
|
2020-02-02 15:08:37 +00:00
|
|
|
#include "ModeRunner.h"
|
|
|
|
#include "ReaderMode.h"
|
2020-02-02 16:14:45 +00:00
|
|
|
#include "InternalMemoryMenuMode.h"
|
|
|
|
#include "SdCardMenuMode.h"
|
|
|
|
#include "SettingsMenuMode.h"
|
2020-02-02 00:04:10 +00:00
|
|
|
#include "MainMenuMode.h"
|
|
|
|
|
2020-02-02 16:14:45 +00:00
|
|
|
static char* options[] = {
|
|
|
|
"Continue Reading",
|
|
|
|
"Internal Memory",
|
2020-02-02 21:13:42 +00:00
|
|
|
"SD Card",
|
2020-02-02 16:14:45 +00:00
|
|
|
"Settings"
|
|
|
|
};
|
2020-02-02 15:08:37 +00:00
|
|
|
|
2020-02-02 16:14:45 +00:00
|
|
|
void MainMenuMode::start()
|
2020-02-02 15:08:37 +00:00
|
|
|
{
|
2020-02-02 16:14:45 +00:00
|
|
|
display_refresh();
|
2020-02-02 15:08:37 +00:00
|
|
|
}
|
|
|
|
|
2020-02-02 16:14:45 +00:00
|
|
|
void MainMenuMode::finish()
|
|
|
|
{}
|
|
|
|
|
|
|
|
char* MainMenuMode::getTitle()
|
2020-02-02 15:08:37 +00:00
|
|
|
{
|
2020-02-02 16:14:45 +00:00
|
|
|
return "Main Menu";
|
2020-02-02 15:08:37 +00:00
|
|
|
}
|
|
|
|
|
2020-02-02 16:14:45 +00:00
|
|
|
char** MainMenuMode::getOptions()
|
2020-02-02 15:08:37 +00:00
|
|
|
{
|
2020-02-02 16:14:45 +00:00
|
|
|
return options;
|
2020-02-02 15:08:37 +00:00
|
|
|
}
|
2020-02-02 16:14:45 +00:00
|
|
|
|
|
|
|
int MainMenuMode::getOptionsSize()
|
2020-02-02 00:04:10 +00:00
|
|
|
{
|
2020-02-02 16:14:45 +00:00
|
|
|
return 4;
|
|
|
|
}
|
2020-02-02 00:04:10 +00:00
|
|
|
|
2020-02-02 16:14:45 +00:00
|
|
|
void MainMenuMode::onOptionSelected(int option)
|
|
|
|
{
|
|
|
|
switch (option) {
|
|
|
|
case 0: // reading
|
|
|
|
display_refresh();
|
|
|
|
getModeRunner()->startInnerMode(new ReaderMode());
|
|
|
|
return;
|
|
|
|
case 1: // memory
|
|
|
|
getModeRunner()->startInnerMode(new InternalMemoryMenuMode());
|
2020-02-02 15:08:37 +00:00
|
|
|
break;
|
2020-02-02 16:14:45 +00:00
|
|
|
case 2: // sd card
|
|
|
|
getModeRunner()->startInnerMode(new SdCardMenuMode());
|
2020-02-02 15:08:37 +00:00
|
|
|
break;
|
2020-02-02 16:14:45 +00:00
|
|
|
case 3: // settings
|
|
|
|
getModeRunner()->startInnerMode(new SettingsMenuMode());
|
2020-02-02 00:04:10 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|