diff --git a/apps/external/Makefile b/apps/external/Makefile index 9308ab64a..6a7df2c48 100644 --- a/apps/external/Makefile +++ b/apps/external/Makefile @@ -18,6 +18,10 @@ else include $(EXTAPP_PATH)/sources.mak endif +ifdef EXTERNAL_BUILTIN +SFLAGS += -DEXTERNAL_BUILTIN +endif + apps_src += $(app_external_src) i18n_files += $(addprefix apps/external/,\ diff --git a/apps/external/archive.cpp b/apps/external/archive.cpp index d25c888e0..e21f19d41 100644 --- a/apps/external/archive.cpp +++ b/apps/external/archive.cpp @@ -118,7 +118,7 @@ size_t numberOfFiles() { #else bool fileAtIndex(size_t index, File &entry) { - entry.name = "No apps installed "; + entry.name = "Built-in"; entry.data = NULL; entry.dataLength = 0; entry.isExecutable = true; @@ -133,11 +133,11 @@ uint32_t executeFile(const char *name, void * heap, const uint32_t heapSize) { } int indexFromName(const char *name) { - return 0; + return 1; } size_t numberOfFiles() { - return 0; + return 1; } #endif diff --git a/apps/external/main_controller.cpp b/apps/external/main_controller.cpp index b2b1d06df..623fbcda4 100644 --- a/apps/external/main_controller.cpp +++ b/apps/external/main_controller.cpp @@ -86,37 +86,37 @@ void MainController::willDisplayCellForIndex(HighlightCell * cell, int index) { PointerTextTableCell * myTextCell = (PointerTextTableCell *)cell; myTextCell->setHighlighted(myTextCell->isHighlighted()); struct File f; - #ifdef DEVICE - if(Ion::fccId() == "2ALWP-N0100"){ - if(index == 0){ - myTextCell->setText(I18n::translate(I18n::Message::ExternalNotCompatible)); - myTextCell->setTextColor(Palette::Red); - } else { - myTextCell->setText(I18n::translate(I18n::Message::WithN0100)); - myTextCell->setTextColor(Palette::Red); - } - }else{ - if(index == k_numberOfCells-1){ - myTextCell->setText(I18n::translate(I18n::Message::URL)); - myTextCell->setTextColor(Palette::AccentText); - return; - } - if(index == k_numberOfCells-2){ - myTextCell->setText(I18n::translate(I18n::Message::GetMoreAppsAt)); - myTextCell->setTextColor(Palette::AccentText); - return; - } - if(index == 0 && numberOfFiles() == 0){ - myTextCell->setText(I18n::translate(I18n::Message::NoAppsInstalled)); - myTextCell->setTextColor(Palette::Red); - } - if(numberOfFiles() > 0){ - if(fileAtIndex(index, f)) { - myTextCell->setText(f.name); - myTextCell->setTextColor(f.isExecutable ? Palette::PrimaryText : Palette::Palette::SecondaryText); - } - } - } + #if defined(DEVICE) || defined(EXTERNAL_BUILTIN) + #if defined(DEVICE_N0100) && !defined(EXTERNAL_BUILTIN) + if(index == 0){ + myTextCell->setText(I18n::translate(I18n::Message::ExternalNotCompatible)); + myTextCell->setTextColor(Palette::Red); + } else { + myTextCell->setText(I18n::translate(I18n::Message::WithN0100)); + myTextCell->setTextColor(Palette::Red); + } + #else + if(index == k_numberOfCells-1){ + myTextCell->setText(I18n::translate(I18n::Message::URL)); + myTextCell->setTextColor(Palette::AccentText); + return; + } + if(index == k_numberOfCells-2){ + myTextCell->setText(I18n::translate(I18n::Message::GetMoreAppsAt)); + myTextCell->setTextColor(Palette::AccentText); + return; + } + if(index == 0 && numberOfFiles() == 0){ + myTextCell->setText(I18n::translate(I18n::Message::NoAppsInstalled)); + myTextCell->setTextColor(Palette::Red); + } + if(numberOfFiles() > 0){ + if(fileAtIndex(index, f)) { + myTextCell->setText(f.name); + myTextCell->setTextColor(f.isExecutable ? Palette::PrimaryText : Palette::Palette::SecondaryText); + } + } + #endif #else if(index == 0){ myTextCell->setText(I18n::translate(I18n::Message::ExternalNotCompatible)); @@ -130,16 +130,16 @@ void MainController::willDisplayCellForIndex(HighlightCell * cell, int index) { void MainController::viewWillAppear() { int count; - #ifdef DEVICE - if(Ion::fccId() == "2ALWP-N0100"){ + #if defined(DEVICE) || defined(EXTERNAL_BUILTIN) + #if defined(DEVICE_N0100) || !defined(EXTERNAL_BUILTIN) count = 2; - }else { - if(numberOfFiles() > 0){ - count = numberOfFiles()+2; - } else { - count = 3; - } - } + #else + if(numberOfFiles() > 0){ + count = numberOfFiles()+2; + } else { + count = 3; + } + #endif #else count = 2; diff --git a/build/defaults.mak b/build/defaults.mak index 1b3380249..9f8c010da 100644 --- a/build/defaults.mak +++ b/build/defaults.mak @@ -58,6 +58,12 @@ endif ifeq ("$(PLATFORM)", "device") SFLAGS += -DPLATFORM_DEVICE + ifeq ("$(MODEL)", "n0110") + SFLAGS += -DDEVICE_N0110 + endif + ifeq ("$(MODEL)", "n0100") + SFLAGS += -DDEVICE_N0100 + endif endif # Host detection diff --git a/build/platform.simulator.mak b/build/platform.simulator.mak index e25beb0b8..c6a904e30 100644 --- a/build/platform.simulator.mak +++ b/build/platform.simulator.mak @@ -17,4 +17,4 @@ SFLAGS += -DEPSILON_SIMULATOR_HAS_LIBPNG=$(EPSILON_SIMULATOR_HAS_LIBPNG) ifeq ($(EPSILON_SIMULATOR_HAS_LIBPNG),1) SFLAGS += `libpng-config --cflags` LDFLAGS += `libpng-config --ldflags` -endif \ No newline at end of file +endif