From 8cd16756721b7fbaf91c481a5609f7b03702e04b Mon Sep 17 00:00:00 2001 From: redgl0w <43498612+RedGl0w@users.noreply.github.com> Date: Thu, 9 Jan 2020 17:31:12 +0100 Subject: [PATCH 01/11] Update .gitlab-ci.yml --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5b284f655..d80d89859 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,3 +23,4 @@ job:build: - output/release/device/n0100/epsilon.bin - omega-auto-increment/version.txt name: artifact:build:simulator + From 8149a1def1ad77bf52b70a722fbfab176ca00197 Mon Sep 17 00:00:00 2001 From: redgl0w <43498612+RedGl0w@users.noreply.github.com> Date: Thu, 9 Jan 2020 17:34:58 +0100 Subject: [PATCH 02/11] Update main_controller.cpp --- apps/external/main_controller.cpp | 62 ++++++++++++++++++++++++++++--- 1 file changed, 57 insertions(+), 5 deletions(-) diff --git a/apps/external/main_controller.cpp b/apps/external/main_controller.cpp index 627fbca08..d878ec2bc 100644 --- a/apps/external/main_controller.cpp +++ b/apps/external/main_controller.cpp @@ -4,6 +4,8 @@ #include #include "archive.h" #include "app.h" +#include +#include using namespace Poincare; @@ -30,7 +32,7 @@ void MainController::didBecomeFirstResponder() { } bool MainController::handleEvent(Ion::Events::Event event) { - if (numberOfRows() > 0 && (event == Ion::Events::OK || event == Ion::Events::EXE)) { + if ((event == Ion::Events::OK || event == Ion::Events::EXE) && ((selectedRow() < k_numberOfCells - 2) && numberOfFiles() > 0)) { uint32_t res = executeFile(m_cells[selectedRow()].text(), ((App *)m_app)->heap(), ((App *)m_app)->heapSize()); ((App*)m_app)->redraw(); switch(res) { @@ -83,14 +85,64 @@ int MainController::typeAtLocation(int i, int j) { void MainController::willDisplayCellForIndex(HighlightCell * cell, int index) { PointerTextTableCell * myTextCell = (PointerTextTableCell *)cell; struct File f; - if(fileAtIndex(index, f)) { - myTextCell->setText(f.name); - myTextCell->setTextColor(f.isExecutable ? KDColorBlack : Palette::GreyDark); + #ifdef DEVICE + if(Ion::fccId() == "2ALWP-N0100"){ + if(index == 0){ + myTextCell->setText("External is not compatible"); + myTextCell->setTextColor(Palette::Red); + } else { + myTextCell->setText("with n0100"); + myTextCell->setTextColor(Palette::Red); + } + }else{ + if(index == k_numberOfCells-1){ + myTextCell->setText("zardam.github.io/nw-external-apps/"); + myTextCell->setTextColor(Palette::AccentText); + return; } + if(index == k_numberOfCells-2){ + myTextCell->setText("Get more apps at"); + myTextCell->setTextColor(Palette::AccentText); + return; + } + if(index == 0 && numberOfFiles() == 0){ + myTextCell->setText("No apps installed"); + myTextCell->setTextColor(Palette::Red); + } + if(numberOfFiles() > 0){ + if(fileAtIndex(index, f)) { + myTextCell->setText(f.name); + myTextCell->setTextColor(f.isExecutable ? KDColorBlack : Palette::GreyDark); + } + } + } + #else + if(index == 0){ + myTextCell->setText("External is not compatible"); + myTextCell->setTextColor(Palette::Red); + } else { + myTextCell->setText("with the simulator"); + myTextCell->setTextColor(Palette::Red); + } + #endif } void MainController::viewWillAppear() { - int count = numberOfFiles(); + int count; + #ifdef DEVICE + if(Ion::fccId() == "2ALWP-N0100"){ + count = 2; + }else { + if(numberOfFiles() > 0){ + count = numberOfFiles()+2; + } else { + count = 3; + } + } + + #else + count = 2; + #endif k_numberOfCells = count <= k_maxNumberOfCells ? count : k_maxNumberOfCells; m_selectableTableView.reloadData(); } From 35791b1ed718b254cc946920dbc35074812ca8c8 Mon Sep 17 00:00:00 2001 From: redgl0w <43498612+RedGl0w@users.noreply.github.com> Date: Thu, 9 Jan 2020 17:35:26 +0100 Subject: [PATCH 03/11] Update archive.cpp --- apps/external/archive.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/external/archive.cpp b/apps/external/archive.cpp index 3472aabe5..d25c888e0 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 = "App"; + entry.name = "No apps installed "; entry.data = NULL; entry.dataLength = 0; entry.isExecutable = true; @@ -137,7 +137,7 @@ int indexFromName(const char *name) { } size_t numberOfFiles() { - return 1; + return 0; } #endif From f6b0882dfbfb51252bfb40013dfcd85cdae31781 Mon Sep 17 00:00:00 2001 From: redgl0w Date: Fri, 10 Jan 2020 07:26:05 +0100 Subject: [PATCH 04/11] Corrected theme issue --- apps/external/main_controller.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/external/main_controller.cpp b/apps/external/main_controller.cpp index d878ec2bc..19d3b1543 100644 --- a/apps/external/main_controller.cpp +++ b/apps/external/main_controller.cpp @@ -90,29 +90,35 @@ void MainController::willDisplayCellForIndex(HighlightCell * cell, int index) { if(index == 0){ myTextCell->setText("External is not compatible"); myTextCell->setTextColor(Palette::Red); + myTextCell->setHighlighted(myTextCell->isHighlighted()); } else { myTextCell->setText("with n0100"); myTextCell->setTextColor(Palette::Red); + myTextCell->setHighlighted(myTextCell->isHighlighted()); } }else{ if(index == k_numberOfCells-1){ myTextCell->setText("zardam.github.io/nw-external-apps/"); myTextCell->setTextColor(Palette::AccentText); + myTextCell->setHighlighted(myTextCell->isHighlighted()); return; } if(index == k_numberOfCells-2){ myTextCell->setText("Get more apps at"); myTextCell->setTextColor(Palette::AccentText); + myTextCell->setHighlighted(myTextCell->isHighlighted()); return; } if(index == 0 && numberOfFiles() == 0){ myTextCell->setText("No apps installed"); myTextCell->setTextColor(Palette::Red); + myTextCell->setHighlighted(myTextCell->isHighlighted()); } if(numberOfFiles() > 0){ if(fileAtIndex(index, f)) { myTextCell->setText(f.name); - myTextCell->setTextColor(f.isExecutable ? KDColorBlack : Palette::GreyDark); + myTextCell->setTextColor(f.isExecutable ? Palette::PrimaryText : Palette::Palette::SecondaryText); + myTextCell->setHighlighted(myTextCell->isHighlighted()); } } } @@ -120,9 +126,11 @@ void MainController::willDisplayCellForIndex(HighlightCell * cell, int index) { if(index == 0){ myTextCell->setText("External is not compatible"); myTextCell->setTextColor(Palette::Red); + myTextCell->setHighlighted(myTextCell->isHighlighted()); } else { myTextCell->setText("with the simulator"); myTextCell->setTextColor(Palette::Red); + myTextCell->setHighlighted(myTextCell->isHighlighted()); } #endif } From ae91706bce605ddd9a7c8b2471675528e8076be9 Mon Sep 17 00:00:00 2001 From: redgl0w Date: Fri, 10 Jan 2020 07:27:31 +0100 Subject: [PATCH 05/11] Simplified reloading --- apps/external/main_controller.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/apps/external/main_controller.cpp b/apps/external/main_controller.cpp index 19d3b1543..bd341058d 100644 --- a/apps/external/main_controller.cpp +++ b/apps/external/main_controller.cpp @@ -84,41 +84,36 @@ int MainController::typeAtLocation(int i, int j) { 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("External is not compatible"); myTextCell->setTextColor(Palette::Red); - myTextCell->setHighlighted(myTextCell->isHighlighted()); } else { myTextCell->setText("with n0100"); myTextCell->setTextColor(Palette::Red); - myTextCell->setHighlighted(myTextCell->isHighlighted()); } }else{ if(index == k_numberOfCells-1){ myTextCell->setText("zardam.github.io/nw-external-apps/"); myTextCell->setTextColor(Palette::AccentText); - myTextCell->setHighlighted(myTextCell->isHighlighted()); return; } if(index == k_numberOfCells-2){ myTextCell->setText("Get more apps at"); myTextCell->setTextColor(Palette::AccentText); - myTextCell->setHighlighted(myTextCell->isHighlighted()); return; } if(index == 0 && numberOfFiles() == 0){ myTextCell->setText("No apps installed"); myTextCell->setTextColor(Palette::Red); - myTextCell->setHighlighted(myTextCell->isHighlighted()); } if(numberOfFiles() > 0){ if(fileAtIndex(index, f)) { myTextCell->setText(f.name); myTextCell->setTextColor(f.isExecutable ? Palette::PrimaryText : Palette::Palette::SecondaryText); - myTextCell->setHighlighted(myTextCell->isHighlighted()); } } } @@ -126,11 +121,9 @@ void MainController::willDisplayCellForIndex(HighlightCell * cell, int index) { if(index == 0){ myTextCell->setText("External is not compatible"); myTextCell->setTextColor(Palette::Red); - myTextCell->setHighlighted(myTextCell->isHighlighted()); } else { myTextCell->setText("with the simulator"); myTextCell->setTextColor(Palette::Red); - myTextCell->setHighlighted(myTextCell->isHighlighted()); } #endif } From 71ad0cce74922df4d6b82b573282b11779054e1c Mon Sep 17 00:00:00 2001 From: redgl0w Date: Fri, 10 Jan 2020 07:55:58 +0100 Subject: [PATCH 06/11] Added translations (without translating) --- apps/external/Makefile | 1 + apps/external/base.de.i18n | 5 +++++ apps/external/base.en.i18n | 5 +++++ apps/external/base.es.i18n | 5 +++++ apps/external/base.fr.i18n | 5 +++++ apps/external/base.pt.i18n | 5 +++++ apps/external/base.universal.i18n | 1 + apps/external/main_controller.cpp | 14 +++++++------- 8 files changed, 34 insertions(+), 7 deletions(-) create mode 100644 apps/external/base.universal.i18n diff --git a/apps/external/Makefile b/apps/external/Makefile index f2680b165..61fbefd14 100644 --- a/apps/external/Makefile +++ b/apps/external/Makefile @@ -26,6 +26,7 @@ i18n_files += $(addprefix apps/external/,\ base.es.i18n\ base.fr.i18n\ base.pt.i18n\ + base.universal.i18n\ ) $(eval $(call depends_on_image,apps/external/app.cpp,apps/external/external_icon.png)) diff --git a/apps/external/base.de.i18n b/apps/external/base.de.i18n index 6072a563a..49b8a2173 100644 --- a/apps/external/base.de.i18n +++ b/apps/external/base.de.i18n @@ -2,3 +2,8 @@ ExternalApp = "External" ExternalAppCapital = "EXTERNAL" ExternalAppApiMismatch = "API mismatch" ExternalAppExecError = "Cannot execute file" +ExternalNotCompatible = "External is not compatible" +WithSimulator = "with the simulator" +WithN0100 = "with n0100" +GetMoreAppsAt = "Get more apps at" +NoAppsInstalled = "No apps installed" diff --git a/apps/external/base.en.i18n b/apps/external/base.en.i18n index 6072a563a..49b8a2173 100644 --- a/apps/external/base.en.i18n +++ b/apps/external/base.en.i18n @@ -2,3 +2,8 @@ ExternalApp = "External" ExternalAppCapital = "EXTERNAL" ExternalAppApiMismatch = "API mismatch" ExternalAppExecError = "Cannot execute file" +ExternalNotCompatible = "External is not compatible" +WithSimulator = "with the simulator" +WithN0100 = "with n0100" +GetMoreAppsAt = "Get more apps at" +NoAppsInstalled = "No apps installed" diff --git a/apps/external/base.es.i18n b/apps/external/base.es.i18n index 6072a563a..49b8a2173 100644 --- a/apps/external/base.es.i18n +++ b/apps/external/base.es.i18n @@ -2,3 +2,8 @@ ExternalApp = "External" ExternalAppCapital = "EXTERNAL" ExternalAppApiMismatch = "API mismatch" ExternalAppExecError = "Cannot execute file" +ExternalNotCompatible = "External is not compatible" +WithSimulator = "with the simulator" +WithN0100 = "with n0100" +GetMoreAppsAt = "Get more apps at" +NoAppsInstalled = "No apps installed" diff --git a/apps/external/base.fr.i18n b/apps/external/base.fr.i18n index 6072a563a..49b8a2173 100644 --- a/apps/external/base.fr.i18n +++ b/apps/external/base.fr.i18n @@ -2,3 +2,8 @@ ExternalApp = "External" ExternalAppCapital = "EXTERNAL" ExternalAppApiMismatch = "API mismatch" ExternalAppExecError = "Cannot execute file" +ExternalNotCompatible = "External is not compatible" +WithSimulator = "with the simulator" +WithN0100 = "with n0100" +GetMoreAppsAt = "Get more apps at" +NoAppsInstalled = "No apps installed" diff --git a/apps/external/base.pt.i18n b/apps/external/base.pt.i18n index 6072a563a..49b8a2173 100644 --- a/apps/external/base.pt.i18n +++ b/apps/external/base.pt.i18n @@ -2,3 +2,8 @@ ExternalApp = "External" ExternalAppCapital = "EXTERNAL" ExternalAppApiMismatch = "API mismatch" ExternalAppExecError = "Cannot execute file" +ExternalNotCompatible = "External is not compatible" +WithSimulator = "with the simulator" +WithN0100 = "with n0100" +GetMoreAppsAt = "Get more apps at" +NoAppsInstalled = "No apps installed" diff --git a/apps/external/base.universal.i18n b/apps/external/base.universal.i18n new file mode 100644 index 000000000..bd64604ea --- /dev/null +++ b/apps/external/base.universal.i18n @@ -0,0 +1 @@ +URL = "zardam.github.io/nw-external-apps/" \ No newline at end of file diff --git a/apps/external/main_controller.cpp b/apps/external/main_controller.cpp index bd341058d..b2b1d06df 100644 --- a/apps/external/main_controller.cpp +++ b/apps/external/main_controller.cpp @@ -89,25 +89,25 @@ void MainController::willDisplayCellForIndex(HighlightCell * cell, int index) { #ifdef DEVICE if(Ion::fccId() == "2ALWP-N0100"){ if(index == 0){ - myTextCell->setText("External is not compatible"); + myTextCell->setText(I18n::translate(I18n::Message::ExternalNotCompatible)); myTextCell->setTextColor(Palette::Red); } else { - myTextCell->setText("with n0100"); + myTextCell->setText(I18n::translate(I18n::Message::WithN0100)); myTextCell->setTextColor(Palette::Red); } }else{ if(index == k_numberOfCells-1){ - myTextCell->setText("zardam.github.io/nw-external-apps/"); + myTextCell->setText(I18n::translate(I18n::Message::URL)); myTextCell->setTextColor(Palette::AccentText); return; } if(index == k_numberOfCells-2){ - myTextCell->setText("Get more apps at"); + myTextCell->setText(I18n::translate(I18n::Message::GetMoreAppsAt)); myTextCell->setTextColor(Palette::AccentText); return; } if(index == 0 && numberOfFiles() == 0){ - myTextCell->setText("No apps installed"); + myTextCell->setText(I18n::translate(I18n::Message::NoAppsInstalled)); myTextCell->setTextColor(Palette::Red); } if(numberOfFiles() > 0){ @@ -119,10 +119,10 @@ void MainController::willDisplayCellForIndex(HighlightCell * cell, int index) { } #else if(index == 0){ - myTextCell->setText("External is not compatible"); + myTextCell->setText(I18n::translate(I18n::Message::ExternalNotCompatible)); myTextCell->setTextColor(Palette::Red); } else { - myTextCell->setText("with the simulator"); + myTextCell->setText(I18n::translate(I18n::Message::WithSimulator)); myTextCell->setTextColor(Palette::Red); } #endif From 2829d0ee71e28d70879a43a3966de8476be8eb0b Mon Sep 17 00:00:00 2001 From: redgl0w <43498612+RedGl0w@users.noreply.github.com> Date: Fri, 10 Jan 2020 18:28:27 +0100 Subject: [PATCH 07/11] Update base.de.i18n --- apps/external/base.de.i18n | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/external/base.de.i18n b/apps/external/base.de.i18n index 49b8a2173..fb566db70 100644 --- a/apps/external/base.de.i18n +++ b/apps/external/base.de.i18n @@ -2,8 +2,8 @@ ExternalApp = "External" ExternalAppCapital = "EXTERNAL" ExternalAppApiMismatch = "API mismatch" ExternalAppExecError = "Cannot execute file" -ExternalNotCompatible = "External is not compatible" -WithSimulator = "with the simulator" -WithN0100 = "with n0100" -GetMoreAppsAt = "Get more apps at" -NoAppsInstalled = "No apps installed" +ExternalNotCompatible = "External ist nicht kompatibel" +WithSimulator = "mit dem Simulator" +WithN0100 = "mit n0100" +GetMoreAppsAt = "Weitere Apps erhalten Sie auf" +NoAppsInstalled = "Keine Apps installiert" From f79172c1fe2613e03c82105608131f83a8c4a54f Mon Sep 17 00:00:00 2001 From: redgl0w <43498612+RedGl0w@users.noreply.github.com> Date: Fri, 10 Jan 2020 18:29:36 +0100 Subject: [PATCH 08/11] Update base.es.i18n --- apps/external/base.es.i18n | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/external/base.es.i18n b/apps/external/base.es.i18n index 49b8a2173..2b0dcd3be 100644 --- a/apps/external/base.es.i18n +++ b/apps/external/base.es.i18n @@ -2,8 +2,8 @@ ExternalApp = "External" ExternalAppCapital = "EXTERNAL" ExternalAppApiMismatch = "API mismatch" ExternalAppExecError = "Cannot execute file" -ExternalNotCompatible = "External is not compatible" -WithSimulator = "with the simulator" -WithN0100 = "with n0100" -GetMoreAppsAt = "Get more apps at" -NoAppsInstalled = "No apps installed" +ExternalNotCompatible = "Externo no es compatible" +WithSimulator = "con el simulador" +WithN0100 = "con n0100" +GetMoreAppsAt = "Obtenga más aplicaciones en" +NoAppsInstalled = "No hay aplicaciones instaladas" From bed98a872352c2da08f545e6d863c953bfa6ea73 Mon Sep 17 00:00:00 2001 From: redgl0w <43498612+RedGl0w@users.noreply.github.com> Date: Fri, 10 Jan 2020 18:30:32 +0100 Subject: [PATCH 09/11] Update base.pt.i18n --- apps/external/base.pt.i18n | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/external/base.pt.i18n b/apps/external/base.pt.i18n index 49b8a2173..ae08d7478 100644 --- a/apps/external/base.pt.i18n +++ b/apps/external/base.pt.i18n @@ -2,8 +2,8 @@ ExternalApp = "External" ExternalAppCapital = "EXTERNAL" ExternalAppApiMismatch = "API mismatch" ExternalAppExecError = "Cannot execute file" -ExternalNotCompatible = "External is not compatible" -WithSimulator = "with the simulator" -WithN0100 = "with n0100" -GetMoreAppsAt = "Get more apps at" -NoAppsInstalled = "No apps installed" +ExternalNotCompatible = "Externo no es compatiblee" +WithSimulator = "con el simulador" +WithN0100 = "con n0100" +GetMoreAppsAt = "Obtenga más aplicaciones en" +NoAppsInstalled = "No hay aplicaciones instaladas" From 152e5152f5e506b404ec89e7210faebf44d837f1 Mon Sep 17 00:00:00 2001 From: redgl0w <43498612+RedGl0w@users.noreply.github.com> Date: Fri, 10 Jan 2020 18:31:29 +0100 Subject: [PATCH 10/11] Update base.fr.i18n --- apps/external/base.fr.i18n | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/external/base.fr.i18n b/apps/external/base.fr.i18n index 49b8a2173..f5428b984 100644 --- a/apps/external/base.fr.i18n +++ b/apps/external/base.fr.i18n @@ -2,8 +2,8 @@ ExternalApp = "External" ExternalAppCapital = "EXTERNAL" ExternalAppApiMismatch = "API mismatch" ExternalAppExecError = "Cannot execute file" -ExternalNotCompatible = "External is not compatible" -WithSimulator = "with the simulator" -WithN0100 = "with n0100" -GetMoreAppsAt = "Get more apps at" -NoAppsInstalled = "No apps installed" +ExternalNotCompatible = "External n'est pas compatible" +WithSimulator = "avec le simulateur" +WithN0100 = "avec n0100" +GetMoreAppsAt = "Télécharge d'autre apps" +NoAppsInstalled = "Aucune applications installées" From 46d2721c8dc6dd0408677b3ad26634b89a9d7348 Mon Sep 17 00:00:00 2001 From: redgl0w <43498612+RedGl0w@users.noreply.github.com> Date: Fri, 10 Jan 2020 18:35:04 +0100 Subject: [PATCH 11/11] Update base.fr.i18n --- apps/external/base.fr.i18n | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/external/base.fr.i18n b/apps/external/base.fr.i18n index f5428b984..a505cddc6 100644 --- a/apps/external/base.fr.i18n +++ b/apps/external/base.fr.i18n @@ -5,5 +5,5 @@ ExternalAppExecError = "Cannot execute file" ExternalNotCompatible = "External n'est pas compatible" WithSimulator = "avec le simulateur" WithN0100 = "avec n0100" -GetMoreAppsAt = "Télécharge d'autre apps" +GetMoreAppsAt = "Télécharge d'autres apps sur" NoAppsInstalled = "Aucune applications installées"