mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[Feature] Made external app testable on simu again. (#333)
Build with make PLATFORM=simulator FORCE_EXTERNAL=1 EXTERNAL_BUILTIN=1
This commit is contained in:
4
apps/external/Makefile
vendored
4
apps/external/Makefile
vendored
@@ -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/,\
|
||||
|
||||
6
apps/external/archive.cpp
vendored
6
apps/external/archive.cpp
vendored
@@ -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
|
||||
|
||||
80
apps/external/main_controller.cpp
vendored
80
apps/external/main_controller.cpp
vendored
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user