diff --git a/apps/global_preferences.h b/apps/global_preferences.h index 3077b93fee2..124476430e4 100644 --- a/apps/global_preferences.h +++ b/apps/global_preferences.h @@ -36,6 +36,8 @@ class GlobalPreferences { void setAutocomplete(bool autocomple) { m_autoComplete = autocomple; } bool syntaxhighlighting() const { return m_syntaxhighlighting; } void setSyntaxhighlighting(bool syntaxhighlight) { m_syntaxhighlighting = syntaxhighlight; } + bool clearshift() const { return m_clearkshift; } + void setclearshift(bool clearalphashift) { m_clearkshift = clearalphashift; } int brightnessLevel() const { return m_brightnessLevel; } void setBrightnessLevel(int brightnessLevel); const KDFont * font() const { return m_font; } @@ -63,6 +65,7 @@ class GlobalPreferences { m_dfuUnlocked(false), m_autoComplete(true), m_syntaxhighlighting(true), + m_clearkshift(true), m_brightnessLevel(Ion::Backlight::MaxBrightness), m_idleBeforeSuspendSeconds(55), m_idleBeforeDimmingSeconds(45), @@ -80,6 +83,7 @@ class GlobalPreferences { bool m_dfuUnlocked; bool m_autoComplete; bool m_syntaxhighlighting; + bool m_clearkshift; int m_brightnessLevel; int m_idleBeforeSuspendSeconds; int m_idleBeforeDimmingSeconds; diff --git a/apps/settings/base.de.i18n b/apps/settings/base.de.i18n index 8f8cd5898b2..b8f9e3f37f1 100644 --- a/apps/settings/base.de.i18n +++ b/apps/settings/base.de.i18n @@ -81,3 +81,4 @@ ExtAppWriteExplanation1 = "Standardmäßig externe Anwendungen" ExtAppWriteExplanation2 = "kann nicht in den Speicher schreiben" ExtAppWriteExplanation3 = "Flash (dauerhaft) Ihres Rechners." ExtAppEnabled = "Aufstecken" +Clearshift = "Tastenkombination Umschalt + Löschen" diff --git a/apps/settings/base.en.i18n b/apps/settings/base.en.i18n index 56f15205480..70864bbfff5 100644 --- a/apps/settings/base.en.i18n +++ b/apps/settings/base.en.i18n @@ -81,3 +81,4 @@ ExtAppWriteExplanation1 = "By default, external applications" ExtAppWriteExplanation2 = "cannot write to memory" ExtAppWriteExplanation3 = "flash (persistent) of your calculator." ExtAppEnabled = "Pin up" +Clearshift = "Shortcut shift + clear" diff --git a/apps/settings/base.es.i18n b/apps/settings/base.es.i18n index 42ce777f24e..2c69189d920 100644 --- a/apps/settings/base.es.i18n +++ b/apps/settings/base.es.i18n @@ -81,3 +81,4 @@ ExtAppWriteExplanation1 = "Por defecto, las aplicaciones externas" ExtAppWriteExplanation2 = "no se puede escribir en la memoria" ExtAppWriteExplanation3 = "flash (persistente) de su calculadora." ExtAppEnabled = "Fijar" +Clearshift = "Atajo de cambio + borrar" diff --git a/apps/settings/base.fr.i18n b/apps/settings/base.fr.i18n index 676e64687ca..67c8f6cce36 100644 --- a/apps/settings/base.fr.i18n +++ b/apps/settings/base.fr.i18n @@ -72,6 +72,7 @@ Time = "Heure" RTCWarning1 = "Activer l'horloge décharge la batterie plus" RTCWarning2 = "vite quand la calculatrice est éteinte." SyntaxHighlighting = "Coloration syntaxique" +Clearshift = "Raccourci shift + clear" Normal = "Normale" IdleTimeBeforeDimming = "Assombrir après (s)" IdleTimeBeforeSuspend = "Éteindre après (s)" diff --git a/apps/settings/base.hu.i18n b/apps/settings/base.hu.i18n index a46e8cddaa0..26d314cc97f 100644 --- a/apps/settings/base.hu.i18n +++ b/apps/settings/base.hu.i18n @@ -81,3 +81,4 @@ ExtAppWriteExplanation1 = "Alapértelmezés szerint külső alkalmazások" ExtAppWriteExplanation2 = "nem tud a memóriába írni" ExtAppWriteExplanation3 = "villog (tartósan) a számológép." ExtAppEnabled = "Feltűz" +Clearshift = "Gyorsbillentyű eltolás + törlés" diff --git a/apps/settings/base.it.i18n b/apps/settings/base.it.i18n index 76b7090850f..59d4c98dc86 100644 --- a/apps/settings/base.it.i18n +++ b/apps/settings/base.it.i18n @@ -81,3 +81,4 @@ ExtAppWriteExplanation1 = "Per impostazione predefinita, le app esterne" ExtAppWriteExplanation2 = "non possono scrivere in memoria flash" ExtAppWriteExplanation3 = "(persistente) della calcolatrice." ExtAppEnabled = "Affiggere" +Clearshift = "Scorciatoia Maiusc + Cancella" diff --git a/apps/settings/base.nl.i18n b/apps/settings/base.nl.i18n index f26e546c402..66842924b6a 100644 --- a/apps/settings/base.nl.i18n +++ b/apps/settings/base.nl.i18n @@ -81,3 +81,4 @@ ExtAppWriteExplanation1 = "Standaard zijn externe toepassingen" ExtAppWriteExplanation2 = "kan niet naar het geheugen schrijven" ExtAppWriteExplanation3 = "flash (aanhoudend) van uw rekenmachine." ExtAppEnabled = "Vastpinnen" +Clearshift = "Sneltoets shift + wissen" diff --git a/apps/settings/base.pt.i18n b/apps/settings/base.pt.i18n index 950bc992718..d79d837e776 100644 --- a/apps/settings/base.pt.i18n +++ b/apps/settings/base.pt.i18n @@ -81,3 +81,4 @@ ExtAppWriteExplanation1 = "Por padrão, aplicativos externos" ExtAppWriteExplanation2 = "não pode gravar na memória" ExtAppWriteExplanation3 = "flash (persistente) de sua calculadora." ExtAppEnabled = "Pôster" +Clearshift = "Shift de atalho + limpar" diff --git a/apps/settings/main_controller.cpp b/apps/settings/main_controller.cpp index 7e71771f93a..347ead0d59e 100644 --- a/apps/settings/main_controller.cpp +++ b/apps/settings/main_controller.cpp @@ -24,7 +24,7 @@ constexpr SettingsMessageTree s_contributorsChildren[18] = {SettingsMessageTree( // Code Settings #ifdef HAS_CODE -constexpr SettingsMessageTree s_codeChildren[3] = {SettingsMessageTree(I18n::Message::FontSizes, s_modelFontChildren), SettingsMessageTree(I18n::Message::Autocomplete), SettingsMessageTree(I18n::Message::SyntaxHighlighting)}; +constexpr SettingsMessageTree s_codeChildren[4] = {SettingsMessageTree(I18n::Message::FontSizes, s_modelFontChildren), SettingsMessageTree(I18n::Message::Autocomplete), SettingsMessageTree(I18n::Message::SyntaxHighlighting), SettingsMessageTree(I18n::Message::Clearshift)}; #endif constexpr SettingsMessageTree s_modelFontChildren[2] = {SettingsMessageTree(I18n::Message::LargeFont), SettingsMessageTree(I18n::Message::SmallFont)}; diff --git a/apps/settings/main_controller.h b/apps/settings/main_controller.h index e78aff9a243..3e1c5ba82d2 100644 --- a/apps/settings/main_controller.h +++ b/apps/settings/main_controller.h @@ -25,7 +25,7 @@ extern const Shared::SettingsMessageTree s_symbolChildren[4]; extern const Shared::SettingsMessageTree s_symbolFunctionChildren[3]; extern const Shared::SettingsMessageTree s_modelMathOptionsChildren[6]; extern const Shared::SettingsMessageTree s_modelFontChildren[2]; -extern const Shared::SettingsMessageTree s_codeChildren[3]; +extern const Shared::SettingsMessageTree s_codeChildren[4]; extern const Shared::SettingsMessageTree s_modelDateTimeChildren[3]; extern const Shared::SettingsMessageTree s_accessibilityChildren[6]; extern const Shared::SettingsMessageTree s_contributorsChildren[18]; diff --git a/apps/settings/sub_menu/code_options_controller.cpp b/apps/settings/sub_menu/code_options_controller.cpp index ae7d5bbc2a2..55f86fbcc3a 100644 --- a/apps/settings/sub_menu/code_options_controller.cpp +++ b/apps/settings/sub_menu/code_options_controller.cpp @@ -13,6 +13,7 @@ CodeOptionsController::CodeOptionsController(Responder * parentResponder) : m_chevronCellFontSize.setMessageFont(KDFont::LargeFont); m_switchCellAutoCompletion.setMessageFont(KDFont::LargeFont); m_switchCellSyntaxHighlighting.setMessageFont(KDFont::LargeFont); + m_switchCellClearshift.setMessageFont(KDFont::LargeFont); } bool CodeOptionsController::handleEvent(Ion::Events::Event event) { @@ -26,6 +27,10 @@ bool CodeOptionsController::handleEvent(Ion::Events::Event event) { GlobalPreferences::sharedGlobalPreferences()->setSyntaxhighlighting(!GlobalPreferences::sharedGlobalPreferences()->syntaxhighlighting()); m_selectableTableView.reloadCellAtLocation(m_selectableTableView.selectedColumn(), m_selectableTableView.selectedRow()); break; + case 3: + GlobalPreferences::sharedGlobalPreferences()->setclearshift(!GlobalPreferences::sharedGlobalPreferences()->clearshift()); + m_selectableTableView.reloadCellAtLocation(m_selectableTableView.selectedColumn(), m_selectableTableView.selectedRow()); + break; default: GenericSubController * subController = nullptr; subController = &m_preferencesController; @@ -48,8 +53,10 @@ HighlightCell * CodeOptionsController::reusableCell(int index, int type) { } else if (index == 1) { return &m_switchCellAutoCompletion; + }else if (index == 2) { + return &m_switchCellSyntaxHighlighting; } - return &m_switchCellSyntaxHighlighting; + return &m_switchCellClearshift; } int CodeOptionsController::reusableCellCount(int type) { @@ -79,6 +86,11 @@ void CodeOptionsController::willDisplayCellForIndex(HighlightCell * cell, int in SwitchView * mySwitch = (SwitchView *)mySwitchCell->accessoryView(); mySwitch->setState(GlobalPreferences::sharedGlobalPreferences()->syntaxhighlighting()); } + else if (thisLabel == I18n::Message::Clearshift) { + MessageTableCellWithSwitch * mySwitchCell = (MessageTableCellWithSwitch *)cell; + SwitchView * mySwitch = (SwitchView *)mySwitchCell->accessoryView(); + mySwitch->setState(GlobalPreferences::sharedGlobalPreferences()->clearshift()); + } #endif } diff --git a/apps/settings/sub_menu/code_options_controller.h b/apps/settings/sub_menu/code_options_controller.h index 5f9b6acea22..e8d1f0149e8 100644 --- a/apps/settings/sub_menu/code_options_controller.h +++ b/apps/settings/sub_menu/code_options_controller.h @@ -14,11 +14,12 @@ class CodeOptionsController : public GenericSubController { int reusableCellCount(int type) override; void willDisplayCellForIndex(HighlightCell * cell, int index) override; private: - constexpr static int k_totalNumberOfCell = 4; + constexpr static int k_totalNumberOfCell = 5; PreferencesController m_preferencesController; MessageTableCellWithChevronAndMessage m_chevronCellFontSize; MessageTableCellWithSwitch m_switchCellAutoCompletion; MessageTableCellWithSwitch m_switchCellSyntaxHighlighting; + MessageTableCellWithSwitch m_switchCellClearshift; }; } diff --git a/escher/src/text_area.cpp b/escher/src/text_area.cpp index 5427ed5b652..143ce26784f 100644 --- a/escher/src/text_area.cpp +++ b/escher/src/text_area.cpp @@ -4,6 +4,7 @@ #include #include #include +#include <../../apps/global_preferences.h> #include #include @@ -249,11 +250,13 @@ bool TextArea::handleEvent(Ion::Events::Event event) { contentView()->resetSelection(); contentView()->moveCursorGeo(0, event == Ion::Events::Up ? -step : step); } else if (event == Ion::Events::Clear) { - if (!contentView()->selectionIsEmpty()) { - deleteSelection(); - return true; - } else if (!contentView()->removeEndOfLine()) { - contentView()->removeStartOfLine(); + if (GlobalPreferences::sharedGlobalPreferences()->clearshift()) { + if (!contentView()->selectionIsEmpty()) { + deleteSelection(); + return true; + } else if (!contentView()->removeEndOfLine()) { + contentView()->removeStartOfLine(); + } } } else if (event == Ion::Events::Paste) { return handleEventWithText(Clipboard::sharedClipboard()->storedText()); diff --git a/python/port/mod/os/modos.cpp b/python/port/mod/os/modos.cpp index a8333006d33..a2c7a861532 100644 --- a/python/port/mod/os/modos.cpp +++ b/python/port/mod/os/modos.cpp @@ -18,11 +18,14 @@ extern "C" { #error This file expects EPSILON_VERSION to be defined #endif +#ifndef UPSILON_VERSION +#error This file expects UPSILON_VERSION to be defined +#endif STATIC const MP_DEFINE_STR_OBJ(modos_uname_info_sysname_obj, "NumWorks"); STATIC const MP_DEFINE_STR_OBJ(modos_uname_info_nodename_obj, ""); -STATIC const MP_DEFINE_STR_OBJ(modos_uname_info_release_obj, "O" MP_STRINGIFY(OMEGA_VERSION) "E-" MP_STRINGIFY(EPSILON_VERSION)); +STATIC const MP_DEFINE_STR_OBJ(modos_uname_info_release_obj, "O" MP_STRINGIFY(OMEGA_VERSION) "E-" MP_STRINGIFY(EPSILON_VERSION) "U-" MP_STRINGIFY(UPSILON_VERSION)); STATIC const MP_DEFINE_STR_OBJ(modos_uname_info_version_obj, MICROPY_VERSION_STRING); #if defined(DEVICE_N0110)