implement file assoc

This commit is contained in:
HookedBehemoth 2019-11-05 00:05:20 +01:00
parent b0dbbeb510
commit 78adda7c76
2 changed files with 26 additions and 3 deletions

22
eBookReader.cfg Normal file
View File

@ -0,0 +1,22 @@
fileassoc={
app_path="/switch/eBookReader/eBookReaderSwitch.nro";
targets=(
{
file_extension=".pdf";
icon_path="/config/nx-hbmenu/fileassoc/eBook.jpg";
},
{
file_extension=".epub";
icon_path="/config/nx-hbmenu/fileassoc/eBook.jpg";
},
{
file_extension=".cbz";
icon_path="/config/nx-hbmenu/fileassoc/eBook.jpg";
},
{
file_extension=".xps";
icon_path="/config/nx-hbmenu/fileassoc/eBook.jpg";
}
);
};

View File

@ -16,6 +16,7 @@ extern "C" {
#include "common.h" #include "common.h"
#include "textures.h" #include "textures.h"
#include "MenuChooser.h" #include "MenuChooser.h"
#include "menu_book_reader.h"
#include "fs.h" #include "fs.h"
#include "config.h" #include "config.h"
} }
@ -25,11 +26,9 @@ SDL_Window* WINDOW;
SDL_Event EVENT; SDL_Event EVENT;
TTF_Font *ROBOTO_35, *ROBOTO_30, *ROBOTO_27, *ROBOTO_25, *ROBOTO_20, *ROBOTO_15; TTF_Font *ROBOTO_35, *ROBOTO_30, *ROBOTO_27, *ROBOTO_25, *ROBOTO_20, *ROBOTO_15;
bool configDarkMode; bool configDarkMode;
bool run = true;
void Term_Services() { void Term_Services() {
std::cout << "Terminate Serices" << std::endl; std::cout << "Terminate Serices" << std::endl;
run = false;
timeExit(); timeExit();
TTF_CloseFont(ROBOTO_35); TTF_CloseFont(ROBOTO_35);
@ -127,7 +126,9 @@ void Init_Services() {
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
Init_Services(); Init_Services();
if (run) { if (argc == 2) {
Menu_OpenBook(argv[1]);
} else {
Menu_StartChoosing(); Menu_StartChoosing();
} }