[settings] Remove option to save cursor

This commit is contained in:
Laury
2022-06-17 18:01:15 +02:00
parent 0751c88a2d
commit 125e1a8a82
14 changed files with 3 additions and 33 deletions

View File

@@ -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() {

View File

@@ -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;

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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)};

View File

@@ -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];

View File

@@ -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
}

View File

@@ -19,7 +19,6 @@ private:
MessageTableCellWithChevronAndMessage m_chevronCellFontSize;
MessageTableCellWithSwitch m_switchCellAutoCompletion;
MessageTableCellWithSwitch m_switchCellSyntaxHighlighting;
MessageTableCellWithSwitch m_switchCellCursorSaving;
};
}