Save screen settings when leaving screen (only)

This commit is contained in:
Raphael Coeffic
2021-04-18 09:41:15 +02:00
parent 0e684058e4
commit b259d0baeb
2 changed files with 2 additions and 7 deletions
+2
View File
@@ -22,6 +22,7 @@
#include "menu_screen.h" #include "menu_screen.h"
#include "screen_setup.h" #include "screen_setup.h"
#include "view_main.h" #include "view_main.h"
#include "storage/storage.h"
ScreenMenu::ScreenMenu(): ScreenMenu::ScreenMenu():
TabsGroup(ICON_THEME) TabsGroup(ICON_THEME)
@@ -30,6 +31,7 @@ ScreenMenu::ScreenMenu():
setCloseHandler([]{ setCloseHandler([]{
ViewMain::instance()->updateTopbarVisibility(); ViewMain::instance()->updateTopbarVisibility();
storageDirty(EE_MODEL);
}); });
} }
-7
View File
@@ -222,7 +222,6 @@ class SetupWidgetsPage: public FormWindow
if (event == EVT_KEY_LONG(KEY_EXIT) || event == EVT_KEY_BREAK(KEY_EXIT)) { if (event == EVT_KEY_LONG(KEY_EXIT) || event == EVT_KEY_BREAK(KEY_EXIT)) {
killEvents(event); killEvents(event);
deleteLater(); deleteLater();
SET_DIRTY();
} }
} }
#endif #endif
@@ -327,8 +326,6 @@ void ScreenAddPage::build(FormWindow * window)
if (menu->getTabs() < MAX_CUSTOM_SCREENS) { if (menu->getTabs() < MAX_CUSTOM_SCREENS) {
menu->addTab(new ScreenAddPage(menu, menu->getTabs())); menu->addTab(new ScreenAddPage(menu, menu->getTabs()));
} }
storageDirty(EE_MODEL);
} }
else { else {
TRACE("Add main view: factory is NULL"); TRACE("Add main view: factory is NULL");
@@ -417,7 +414,6 @@ void ScreenSetupPage::build(FormWindow * window)
optionsWindow->clear(); optionsWindow->clear();
createCustomScreen(factory, idx); createCustomScreen(factory, idx);
updateLayoutOptions(optionsWindow, idx); updateLayoutOptions(optionsWindow, idx);
SET_DIRTY();
}; };
auto layoutChoice = new LayoutChoice(window, layoutSlot, getFactory, setLayout); auto layoutChoice = new LayoutChoice(window, layoutSlot, getFactory, setLayout);
@@ -470,9 +466,6 @@ void ScreenSetupPage::build(FormWindow * window)
pageIdx = menu->getTabs() - 2; pageIdx = menu->getTabs() - 2;
} }
menu->setCurrentTab(pageIdx); menu->setCurrentTab(pageIdx);
// save the changes
storageDirty(EE_MODEL);
return 0; return 0;
}); });