Skip to content

Commit

Permalink
💥 Rename ExtUI settings methods
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Mar 29, 2022
1 parent 4edfb69 commit d6fcae4
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 21 deletions.
4 changes: 2 additions & 2 deletions Marlin/src/lcd/extui/anycubic_chiron/chiron_extui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ namespace ExtUI {
// Called after loading or resetting stored settings
}

void onConfigurationStoreWritten(bool success) {
void onSettingsStored(bool success) {
// Called after the entire EEPROM has been written,
// whether successful or not.
}

void onConfigurationStoreRead(bool success) {
void onSettingsLoaded(bool success) {
// Called after the entire EEPROM has been read,
// whether successful or not.
}
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/lcd/extui/anycubic_i3mega/anycubic_extui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ namespace ExtUI {
// Called after loading or resetting stored settings
}

void onConfigurationStoreWritten(bool success) {
void onSettingsStored(bool success) {
// Called after the entire EEPROM has been written,
// whether successful or not.
}

void onConfigurationStoreRead(bool success) {
void onSettingsLoaded(bool success) {
// Called after the entire EEPROM has been read,
// whether successful or not.
}
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/lcd/extui/dgus/dgus_extui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ namespace ExtUI {
// Called after loading or resetting stored settings
}

void onConfigurationStoreWritten(bool success) {
void onSettingsStored(bool success) {
// Called after the entire EEPROM has been written,
// whether successful or not.
}

void onConfigurationStoreRead(bool success) {
void onSettingsLoaded(bool success) {
// Called after the entire EEPROM has been read,
// whether successful or not.
}
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ namespace ExtUI {

void onPostprocessSettings() {}

void onConfigurationStoreWritten(bool success) {
void onSettingsStored(bool success) {
dgus_screen_handler.ConfigurationStoreWritten(success);
}

void onConfigurationStoreRead(bool success) {
void onSettingsLoaded(bool success) {
dgus_screen_handler.ConfigurationStoreRead(success);
}

Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/lcd/extui/example/example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ namespace ExtUI {
// Called after loading or resetting stored settings
}

void onConfigurationStoreWritten(bool success) {
void onSettingsStored(bool success) {
// Called after the entire EEPROM has been written,
// whether successful or not.
}

void onConfigurationStoreRead(bool success) {
void onSettingsLoaded(bool success) {
// Called after the entire EEPROM has been read,
// whether successful or not.
}
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ namespace ExtUI {
void onLoadSettings(const char *buff) { InterfaceSettingsScreen::loadSettings(buff); }
void onPostprocessSettings() {} // Called after loading or resetting stored settings

void onConfigurationStoreWritten(bool success) {
void onSettingsStored(bool success) {
#ifdef ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE
if (success && InterfaceSettingsScreen::backupEEPROM()) {
SERIAL_ECHOLNPGM("EEPROM backed up to SPI Flash");
Expand All @@ -106,7 +106,7 @@ namespace ExtUI {
UNUSED(success);
#endif
}
void onConfigurationStoreRead(bool) {}
void onSettingsLoaded(bool) {}

void onPlayTone(const uint16_t frequency, const uint16_t duration) { sound.play_tone(frequency, duration); }

Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/lcd/extui/malyan/malyan_extui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ namespace ExtUI {
void onStoreSettings(char*) {}
void onLoadSettings(const char*) {}
void onPostprocessSettings() {}
void onConfigurationStoreWritten(bool) {}
void onConfigurationStoreRead(bool) {}
void onSettingsStored(bool) {}
void onSettingsLoaded(bool) {}

#if HAS_MESH
void onLevelingStart() {}
Expand Down
5 changes: 3 additions & 2 deletions Marlin/src/lcd/extui/nextion/nextion_extui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ namespace ExtUI {
// Called after loading or resetting stored settings
}

void onConfigurationStoreWritten(bool success) {
void onSettingsStored(bool success) {
// Called after the entire EEPROM has been written,
// whether successful or not.
}

void onConfigurationStoreRead(bool success) {
void onSettingsLoaded(bool success) {
// Called after the entire EEPROM has been read,
// whether successful or not.
}
Expand Down Expand Up @@ -117,6 +117,7 @@ namespace ExtUI {

void onSteppersDisabled() {}
void onSteppersEnabled() {}

}

#endif // NEXTION_TFT
4 changes: 2 additions & 2 deletions Marlin/src/lcd/extui/ui_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,8 @@ namespace ExtUI {
void onStoreSettings(char *);
void onLoadSettings(const char *);
void onPostprocessSettings();
void onConfigurationStoreWritten(bool success);
void onConfigurationStoreRead(bool success);
void onSettingsStored(bool success);
void onSettingsLoaded(bool success);
#if ENABLED(POWER_LOSS_RECOVERY)
void onPowerLossResume();
#endif
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/module/printcounter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ void PrintCounter::saveStats() {
persistentStore.write_data(address + sizeof(uint8_t), (uint8_t*)&data, sizeof(printStatistics));
persistentStore.access_finish();

TERN_(EXTENSIBLE_UI, ExtUI::onConfigurationStoreWritten(true));
TERN_(EXTENSIBLE_UI, ExtUI::onSettingsStored(true));
}

#if HAS_SERVICE_INTERVALS
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/module/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1595,7 +1595,7 @@ void MarlinSettings::postprocess() {
TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_SETTINGS_STORED)));
}

TERN_(EXTENSIBLE_UI, ExtUI::onConfigurationStoreWritten(!eeprom_error));
TERN_(EXTENSIBLE_UI, ExtUI::onSettingsStored(!eeprom_error));

return !eeprom_error;
}
Expand Down Expand Up @@ -2598,7 +2598,7 @@ void MarlinSettings::postprocess() {
bool MarlinSettings::load() {
if (validate()) {
const bool success = _load();
TERN_(EXTENSIBLE_UI, ExtUI::onConfigurationStoreRead(success));
TERN_(EXTENSIBLE_UI, ExtUI::onSettingsLoaded(success));
return success;
}
reset();
Expand Down

0 comments on commit d6fcae4

Please sign in to comment.