From 125e1a8a82dcd05a9ef8b93117a37c68cf044e63 Mon Sep 17 00:00:00 2001 From: Laury Date: Fri, 17 Jun 2022 18:01:15 +0200 Subject: [PATCH] [settings] Remove option to save cursor --- apps/code/editor_controller.cpp | 6 +----- apps/global_preferences.h | 4 ---- apps/settings/base.de.i18n | 1 - apps/settings/base.en.i18n | 1 - apps/settings/base.es.i18n | 1 - apps/settings/base.fr.i18n | 1 - apps/settings/base.hu.i18n | 1 - apps/settings/base.it.i18n | 1 - apps/settings/base.nl.i18n | 1 - apps/settings/base.pt.i18n | 1 - apps/settings/main_controller.cpp | 2 +- apps/settings/main_controller.h | 2 +- apps/settings/sub_menu/code_options_controller.cpp | 13 ------------- apps/settings/sub_menu/code_options_controller.h | 1 - 14 files changed, 3 insertions(+), 33 deletions(-) diff --git a/apps/code/editor_controller.cpp b/apps/code/editor_controller.cpp index be09c9662..f314f3d72 100644 --- a/apps/code/editor_controller.cpp +++ b/apps/code/editor_controller.cpp @@ -64,11 +64,7 @@ void EditorController::didBecomeFirstResponder() { void EditorController::viewWillAppear() { ViewController::viewWillAppear(); m_editorView.loadSyntaxHighlighter(); - if(GlobalPreferences::sharedGlobalPreferences()->cursorSaving()) { - m_editorView.setCursorLocation(m_editorView.text() + strlen(m_editorView.text())); - } else { - m_editorView.setCursorLocation(m_editorView.text() + strlen(m_editorView.text())); - } + m_editorView.setCursorLocation(m_editorView.text() + strlen(m_editorView.text())); } void EditorController::viewDidDisappear() { diff --git a/apps/global_preferences.h b/apps/global_preferences.h index ab48e2c14..3077b93fe 100644 --- a/apps/global_preferences.h +++ b/apps/global_preferences.h @@ -36,8 +36,6 @@ public: void setAutocomplete(bool autocomple) { m_autoComplete = autocomple; } bool syntaxhighlighting() const { return m_syntaxhighlighting; } void setSyntaxhighlighting(bool syntaxhighlight) { m_syntaxhighlighting = syntaxhighlight; } - bool cursorSaving() const { return m_cursorSaving; } - void setCursorSaving(bool cursorsave) { m_cursorSaving = cursorsave; } int brightnessLevel() const { return m_brightnessLevel; } void setBrightnessLevel(int brightnessLevel); const KDFont * font() const { return m_font; } @@ -65,7 +63,6 @@ private: m_dfuUnlocked(false), m_autoComplete(true), m_syntaxhighlighting(true), - m_cursorSaving(true), m_brightnessLevel(Ion::Backlight::MaxBrightness), m_idleBeforeSuspendSeconds(55), m_idleBeforeDimmingSeconds(45), @@ -83,7 +80,6 @@ private: bool m_dfuUnlocked; bool m_autoComplete; bool m_syntaxhighlighting; - bool m_cursorSaving; int m_brightnessLevel; int m_idleBeforeSuspendSeconds; int m_idleBeforeDimmingSeconds; diff --git a/apps/settings/base.de.i18n b/apps/settings/base.de.i18n index dfd788b1b..3eb0e59fb 100644 --- a/apps/settings/base.de.i18n +++ b/apps/settings/base.de.i18n @@ -72,7 +72,6 @@ Time = "Uhrzeit" RTCWarning1 = "Das Aktivieren der Uhr verkürzt die" RTCWarning2 = "Akkulaufzeit im Bereitschaftsmodus." SyntaxHighlighting = "Syntaxhervorhebung" -CursorSaving = "Cursor speichern" USBExplanation1 = "USB-Schutz schützt Ihren" USBExplanation2 = "Taschenrechner vor" USBExplanation3 = "unbeabsichtigter Verriegelung" diff --git a/apps/settings/base.en.i18n b/apps/settings/base.en.i18n index fe2428773..c6a048e2a 100644 --- a/apps/settings/base.en.i18n +++ b/apps/settings/base.en.i18n @@ -72,7 +72,6 @@ Time = "Time" RTCWarning1 = "Enabling the clock drains the battery faster" RTCWarning2 = "when the calculator is powered off." SyntaxHighlighting = "Syntax Highlighting" -CursorSaving = "Cursor saving" USBExplanation1 = "The USB protection protects" USBExplanation2 = "the calculator from" USBExplanation3 = "unintentional locking" diff --git a/apps/settings/base.es.i18n b/apps/settings/base.es.i18n index c50ef97fa..839f25ba8 100644 --- a/apps/settings/base.es.i18n +++ b/apps/settings/base.es.i18n @@ -72,7 +72,6 @@ Time = "Hora" RTCWarning1 = "Activar el reloj gasta la batería más rápido" RTCWarning2 = "cuando la calculadora está apagada." SyntaxHighlighting = "Resaltado de sintaxis" -CursorSaving = "Ahorro de cursor" USBExplanation1 = "La protección USB protege" USBExplanation2 = "su calculadora del" USBExplanation3 = "bloqueo involuntario" diff --git a/apps/settings/base.fr.i18n b/apps/settings/base.fr.i18n index 55cea88df..87a4596ce 100644 --- a/apps/settings/base.fr.i18n +++ b/apps/settings/base.fr.i18n @@ -72,7 +72,6 @@ Time = "Heure" RTCWarning1 = "Activer l'horloge décharge la batterie plus" RTCWarning2 = "vite quand la calculatrice est éteinte." SyntaxHighlighting = "Coloration syntaxique" -CursorSaving = "Sauvegarde du curseur" USBExplanation1 = "La protection USB protège votre" USBExplanation2 = "calculatrice contre un verrouillage" USBExplanation3 = "non-intentionnel" diff --git a/apps/settings/base.hu.i18n b/apps/settings/base.hu.i18n index 8476c7eff..99dc79fc3 100644 --- a/apps/settings/base.hu.i18n +++ b/apps/settings/base.hu.i18n @@ -72,7 +72,6 @@ Time = "Óra" RTCWarning1 = "Amikor a számológép alvómódban van, az óra" RTCWarning2 = "használása az elemet gyorsabban meríti ki." SyntaxHighlighting = "Szintaxis kiemelés" -CursorSaving = "Kurzor mentése" USBExplanation1 = "Az USB-védelem megvédi" USBExplanation2 = "a számológépet a nem" USBExplanation3 = "szándékos reteszeléstől" diff --git a/apps/settings/base.it.i18n b/apps/settings/base.it.i18n index 854796e78..2603da889 100644 --- a/apps/settings/base.it.i18n +++ b/apps/settings/base.it.i18n @@ -72,7 +72,6 @@ Time = "Time" RTCWarning1 = "Enabling the clock drains the battery faster" RTCWarning2 = "when the calculator is powered off." SyntaxHighlighting = "Evidenziazione della sintassi" -CursorSaving = "Salvataggio cursore" USBExplanation1 = "La protezione USB protegge" USBExplanation2 = "la calcolatrice dal" USBExplanation3 = "blocco involontario" diff --git a/apps/settings/base.nl.i18n b/apps/settings/base.nl.i18n index 474812c5c..d71a76824 100644 --- a/apps/settings/base.nl.i18n +++ b/apps/settings/base.nl.i18n @@ -72,7 +72,6 @@ Time = "Time" RTCWarning1 = "Enabling the clock drains the battery faster" RTCWarning2 = "when the calculator is powered off." SyntaxHighlighting = "Syntax Highlighting" -CursorSaving = "Cursor opslaan" USBExplanation1 = "USB-beveiliging beschermt uw" USBExplanation2 = "rekenmachine tegen" USBExplanation3 = "onbedoelde vergrendeling" diff --git a/apps/settings/base.pt.i18n b/apps/settings/base.pt.i18n index dd2a2cf26..b7639cb6e 100644 --- a/apps/settings/base.pt.i18n +++ b/apps/settings/base.pt.i18n @@ -72,7 +72,6 @@ Time = "Time" RTCWarning1 = "Enabling the clock drains the battery faster" RTCWarning2 = "when the calculator is powered off." SyntaxHighlighting = "Destaque da sintaxe" -CursorSaving = "Economia de cursor" USBExplanation1 = "A proteção USB protege" USBExplanation2 = "sua calculadora contra" USBExplanation3 = "bloqueios não intencionais" diff --git a/apps/settings/main_controller.cpp b/apps/settings/main_controller.cpp index d7a15e3a1..61eb08f13 100644 --- a/apps/settings/main_controller.cpp +++ b/apps/settings/main_controller.cpp @@ -26,7 +26,7 @@ constexpr SettingsMessageTree s_contributorsChildren[18] = {SettingsMessageTree( // Code Settings #ifdef HAS_CODE -constexpr SettingsMessageTree s_codeChildren[4] = {SettingsMessageTree(I18n::Message::FontSizes, s_modelFontChildren), SettingsMessageTree(I18n::Message::Autocomplete), SettingsMessageTree(I18n::Message::SyntaxHighlighting), SettingsMessageTree(I18n::Message::CursorSaving)}; +constexpr SettingsMessageTree s_codeChildren[3] = {SettingsMessageTree(I18n::Message::FontSizes, s_modelFontChildren), SettingsMessageTree(I18n::Message::Autocomplete), SettingsMessageTree(I18n::Message::SyntaxHighlighting)}; #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 3e1c5ba82..e78aff9a2 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[4]; +extern const Shared::SettingsMessageTree s_codeChildren[3]; 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 f3c17b2fc..ae7d5bbc2 100644 --- a/apps/settings/sub_menu/code_options_controller.cpp +++ b/apps/settings/sub_menu/code_options_controller.cpp @@ -13,7 +13,6 @@ CodeOptionsController::CodeOptionsController(Responder * parentResponder) : m_chevronCellFontSize.setMessageFont(KDFont::LargeFont); m_switchCellAutoCompletion.setMessageFont(KDFont::LargeFont); m_switchCellSyntaxHighlighting.setMessageFont(KDFont::LargeFont); - m_switchCellCursorSaving.setMessageFont(KDFont::LargeFont); } bool CodeOptionsController::handleEvent(Ion::Events::Event event) { @@ -27,10 +26,6 @@ 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()->setCursorSaving(!GlobalPreferences::sharedGlobalPreferences()->cursorSaving()); - m_selectableTableView.reloadCellAtLocation(m_selectableTableView.selectedColumn(), m_selectableTableView.selectedRow()); - break; default: GenericSubController * subController = nullptr; subController = &m_preferencesController; @@ -54,9 +49,6 @@ HighlightCell * CodeOptionsController::reusableCell(int index, int type) { else if (index == 1) { return &m_switchCellAutoCompletion; } - else if (index == 2) { - return &m_switchCellCursorSaving; - } return &m_switchCellSyntaxHighlighting; } @@ -87,11 +79,6 @@ void CodeOptionsController::willDisplayCellForIndex(HighlightCell * cell, int in SwitchView * mySwitch = (SwitchView *)mySwitchCell->accessoryView(); mySwitch->setState(GlobalPreferences::sharedGlobalPreferences()->syntaxhighlighting()); } - else if (thisLabel == I18n::Message::CursorSaving) { - MessageTableCellWithSwitch * mySwitchCell = (MessageTableCellWithSwitch *)cell; - SwitchView * mySwitch = (SwitchView *)mySwitchCell->accessoryView(); - mySwitch->setState(GlobalPreferences::sharedGlobalPreferences()->cursorSaving()); - } #endif } diff --git a/apps/settings/sub_menu/code_options_controller.h b/apps/settings/sub_menu/code_options_controller.h index 854de5e8e..5f9b6acea 100644 --- a/apps/settings/sub_menu/code_options_controller.h +++ b/apps/settings/sub_menu/code_options_controller.h @@ -19,7 +19,6 @@ private: MessageTableCellWithChevronAndMessage m_chevronCellFontSize; MessageTableCellWithSwitch m_switchCellAutoCompletion; MessageTableCellWithSwitch m_switchCellSyntaxHighlighting; - MessageTableCellWithSwitch m_switchCellCursorSaving; }; }