@@ -129,6 +129,7 @@ enum MenuAction {
|
|||||||
// Administration
|
// Administration
|
||||||
RESET_NODEDB_ALL,
|
RESET_NODEDB_ALL,
|
||||||
RESET_NODEDB_KEEP_FAVORITES,
|
RESET_NODEDB_KEEP_FAVORITES,
|
||||||
|
WIPE_MESSAGES_ALL,
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace NicheGraphics::InkHUD
|
} // namespace NicheGraphics::InkHUD
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
#include "GPS.h"
|
#include "GPS.h"
|
||||||
#include "MeshRadio.h"
|
#include "MeshRadio.h"
|
||||||
#include "MeshService.h"
|
#include "MeshService.h"
|
||||||
|
#include "MessageStore.h"
|
||||||
#include "RTC.h"
|
#include "RTC.h"
|
||||||
#include "Router.h"
|
#include "Router.h"
|
||||||
#include "airtime.h"
|
#include "airtime.h"
|
||||||
@@ -1013,6 +1014,13 @@ void InkHUD::MenuApplet::execute(MenuItem item)
|
|||||||
rebootAtMsec = millis() + DEFAULT_REBOOT_SECONDS * 1000;
|
rebootAtMsec = millis() + DEFAULT_REBOOT_SECONDS * 1000;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case WIPE_MESSAGES_ALL:
|
||||||
|
LOG_INFO("Wiping all messages from menu");
|
||||||
|
messageStore.clearAllMessages();
|
||||||
|
inkhud->persistence->loadLatestMessage();
|
||||||
|
inkhud->forceUpdate(Drivers::EInk::UpdateTypes::FULL, true);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
LOG_WARN("Action not implemented");
|
LOG_WARN("Action not implemented");
|
||||||
}
|
}
|
||||||
@@ -1130,6 +1138,7 @@ void InkHUD::MenuApplet::showPage(MenuPage page)
|
|||||||
// Administration Section
|
// Administration Section
|
||||||
items.push_back(MenuItem::Header("Administration"));
|
items.push_back(MenuItem::Header("Administration"));
|
||||||
items.push_back(MenuItem("Reset NodeDB", MenuPage::NODE_CONFIG_ADMIN_RESET));
|
items.push_back(MenuItem("Reset NodeDB", MenuPage::NODE_CONFIG_ADMIN_RESET));
|
||||||
|
items.push_back(MenuItem("Wipe Messages", MenuPage::NODE_CONFIG_ADMIN_MESSAGES));
|
||||||
|
|
||||||
// Exit
|
// Exit
|
||||||
items.push_back(MenuItem("Exit", MenuPage::EXIT));
|
items.push_back(MenuItem("Exit", MenuPage::EXIT));
|
||||||
@@ -1534,6 +1543,13 @@ void InkHUD::MenuApplet::showPage(MenuPage page)
|
|||||||
items.push_back(MenuItem("Exit", MenuPage::EXIT));
|
items.push_back(MenuItem("Exit", MenuPage::EXIT));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case NODE_CONFIG_ADMIN_MESSAGES:
|
||||||
|
previousPage = MenuPage::NODE_CONFIG;
|
||||||
|
items.push_back(MenuItem("Back", previousPage));
|
||||||
|
items.push_back(MenuItem("Wipe All Messages", MenuAction::WIPE_MESSAGES_ALL, MenuPage::EXIT));
|
||||||
|
items.push_back(MenuItem("Exit", MenuPage::EXIT));
|
||||||
|
break;
|
||||||
|
|
||||||
// Exit
|
// Exit
|
||||||
case EXIT:
|
case EXIT:
|
||||||
sendToBackground(); // Menu applet dismissed, allow normal behavior to resume
|
sendToBackground(); // Menu applet dismissed, allow normal behavior to resume
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ enum MenuPage : uint8_t {
|
|||||||
NODE_CONFIG_BLUETOOTH,
|
NODE_CONFIG_BLUETOOTH,
|
||||||
NODE_CONFIG_POSITION,
|
NODE_CONFIG_POSITION,
|
||||||
NODE_CONFIG_ADMIN_RESET,
|
NODE_CONFIG_ADMIN_RESET,
|
||||||
|
NODE_CONFIG_ADMIN_MESSAGES,
|
||||||
TIMEZONE,
|
TIMEZONE,
|
||||||
APPLETS,
|
APPLETS,
|
||||||
AUTOSHOW,
|
AUTOSHOW,
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ void InkHUD::Persistence::loadSettings()
|
|||||||
// are immediately available to applets (DMApplet, AllMessageApplet, NotificationApplet).
|
// are immediately available to applets (DMApplet, AllMessageApplet, NotificationApplet).
|
||||||
void InkHUD::Persistence::loadLatestMessage()
|
void InkHUD::Persistence::loadLatestMessage()
|
||||||
{
|
{
|
||||||
|
latestMessage = LatestMessage();
|
||||||
|
|
||||||
int lastBroadcastPos = -1, lastDMPos = -1, pos = 0;
|
int lastBroadcastPos = -1, lastDMPos = -1, pos = 0;
|
||||||
for (const StoredMessage &m : messageStore.getLiveMessages()) {
|
for (const StoredMessage &m : messageStore.getLiveMessages()) {
|
||||||
if (m.type == MessageType::BROADCAST) {
|
if (m.type == MessageType::BROADCAST) {
|
||||||
@@ -75,4 +77,4 @@ void InkHUD::Persistence::printSettings(Settings *settings)
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user