Skip to content

Commit

Permalink
removed some info message when change is successful
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Oct 1, 2019
1 parent 6b59fa1 commit 34b36da
Show file tree
Hide file tree
Showing 11 changed files with 135 additions and 275 deletions.
52 changes: 16 additions & 36 deletions src/eez/apps/psu/gui/page_sys_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ void SysSettingsDateTimePage::doSet() {
}

popPage();
infoMessage("Date and time settings saved!");

return;
}

Expand Down Expand Up @@ -434,37 +434,25 @@ void SysSettingsEthernetStaticPage::set() {

void SysSettingsProtectionsPage::toggleOutputProtectionCouple() {
if (persist_conf::isOutputProtectionCoupleEnabled()) {
if (persist_conf::enableOutputProtectionCouple(false)) {
infoMessage("Output protection decoupled!");
}
persist_conf::enableOutputProtectionCouple(false);
} else {
if (persist_conf::enableOutputProtectionCouple(true)) {
infoMessage("Output protection coupled!");
}
persist_conf::enableOutputProtectionCouple(true);
}
}

void SysSettingsProtectionsPage::toggleShutdownWhenProtectionTripped() {
if (persist_conf::isShutdownWhenProtectionTrippedEnabled()) {
if (persist_conf::enableShutdownWhenProtectionTripped(false)) {
infoMessage("Shutdown when tripped disabled!");
}
persist_conf::enableShutdownWhenProtectionTripped(false);
} else {
if (persist_conf::enableShutdownWhenProtectionTripped(true)) {
infoMessage("Shutdown when tripped enabled!");
}
persist_conf::enableShutdownWhenProtectionTripped(true);
}
}

void SysSettingsProtectionsPage::toggleForceDisablingAllOutputsOnPowerUp() {
if (persist_conf::isForceDisablingAllOutputsOnPowerUpEnabled()) {
if (persist_conf::enableForceDisablingAllOutputsOnPowerUp(false)) {
infoMessage("Force disabling outputs disabled!");
}
persist_conf::enableForceDisablingAllOutputsOnPowerUp(false);
} else {
if (persist_conf::enableForceDisablingAllOutputsOnPowerUp(true)) {
infoMessage("Force disabling outputs enabled!");
}
persist_conf::enableForceDisablingAllOutputsOnPowerUp(true);
}
}

Expand Down Expand Up @@ -566,25 +554,17 @@ void SysSettingsAuxOtpPage::clear() {

void SysSettingsSoundPage::toggleSound() {
if (persist_conf::isSoundEnabled()) {
if (persist_conf::enableSound(false)) {
infoMessage("Sound disabled!");
}
persist_conf::enableSound(false);
} else {
if (persist_conf::enableSound(true)) {
infoMessage("Sound enabled!");
}
persist_conf::enableSound(true);
}
}

void SysSettingsSoundPage::toggleClickSound() {
if (persist_conf::isClickSoundEnabled()) {
if (persist_conf::enableClickSound(false)) {
infoMessage("Click sound disabled!");
}
persist_conf::enableClickSound(false);
} else {
if (persist_conf::enableClickSound(true)) {
infoMessage("Click sound enabled!");
}
persist_conf::enableClickSound(true);
}
}

Expand Down Expand Up @@ -682,7 +662,8 @@ void SysSettingsTriggerPage::set() {
persist_conf::saveDevice2();

popPage();
infoMessage("Trigger settings saved!");

// infoMessage("Trigger settings saved!");
}
}

Expand Down Expand Up @@ -730,10 +711,9 @@ void SysSettingsIOPinsPage::set() {
persist_conf::devConf2.ioPins[i].function = m_function[i];
}

if (persist_conf::saveDevice2()) {
popPage();
infoMessage("Digital I/O pin settings saved!");
}
persist_conf::saveDevice2();

popPage();

io_pins::refresh();
}
Expand Down
8 changes: 2 additions & 6 deletions src/eez/apps/psu/gui/page_user_profiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,12 @@ void UserProfilesPage::showProfile() {

void UserProfilesPage::toggleAutoRecall() {
bool enable = persist_conf::isProfileAutoRecallEnabled() ? false : true;
if (!persist_conf::enableProfileAutoRecall(enable)) {
errorMessage("Failed!");
}
persist_conf::enableProfileAutoRecall(enable);
}

void UserProfilesPage::toggleIsAutoRecallLocation() {
if (profile::isValid(g_selectedProfileLocation)) {
if (!persist_conf::setProfileAutoRecallLocation(g_selectedProfileLocation)) {
errorMessage("Failed!");
}
persist_conf::setProfileAutoRecallLocation(g_selectedProfileLocation);
}
}

Expand Down
14 changes: 2 additions & 12 deletions src/eez/apps/psu/gui/password.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,23 +67,13 @@ static void onRetypeNewPasswordOk(char *text) {
return;
}

bool isChanged;

if (g_oldPassword == persist_conf::devConf2.systemPassword) {
isChanged = persist_conf::changeSystemPassword(g_newPassword, strlen(g_newPassword));
persist_conf::changeSystemPassword(g_newPassword, strlen(g_newPassword));
} else {
isChanged = persist_conf::changeCalibrationPassword(g_newPassword, strlen(g_newPassword));
persist_conf::changeCalibrationPassword(g_newPassword, strlen(g_newPassword));
}

popPage();

if (isChanged) {
// success
infoMessage("Password changed!");
} else{
// failed to save changed password
errorMessage("Failed to change password!");
}
}

static void onNewPasswordOk(char *text) {
Expand Down
Loading

0 comments on commit 34b36da

Please sign in to comment.