ENH: [STUDIO-4029] sync printer config with cloud

Change-Id: Icffee9d5987131e1d78d51ccfcafeefff18f26cb
Jira: STUDIO-4029
(cherry picked from commit 5b58e5f2658753efbf11037f0b6cbb023070c0ea)
This commit is contained in:
chunmao.guo
2023-08-16 15:38:16 +08:00
committed by Lane.Wei
parent 11f0fb6016
commit 042e6bf991
8 changed files with 186 additions and 15 deletions

View File

@@ -27,6 +27,8 @@ using ExportGcodeNotificationClickedEvent = SimpleEvent;
wxDECLARE_EVENT(EVT_EXPORT_GCODE_NOTIFICAION_CLICKED, ExportGcodeNotificationClickedEvent);
using PresetUpdateAvailableClickedEvent = SimpleEvent;
wxDECLARE_EVENT(EVT_PRESET_UPDATE_AVAILABLE_CLICKED, PresetUpdateAvailableClickedEvent);
using PrinterConfigUpdateAvailableClickedEvent = SimpleEvent;
wxDECLARE_EVENT(EVT_PRINTER_CONFIG_UPDATE_AVAILABLE_CLICKED, PrinterConfigUpdateAvailableClickedEvent);
using CancelFn = std::function<void()>;
@@ -141,6 +143,7 @@ enum class NotificationType
BBLPluginInstallHint,
BBLPluginUpdateAvailable,
BBLPreviewOnlyMode,
BBLPrinterConfigUpdateAvailable,
};
class NotificationManager
@@ -914,6 +917,15 @@ private:
return true;
}},
NotificationData{NotificationType::BBLPrinterConfigUpdateAvailable, NotificationLevel::ImportantNotificationLevel, BBL_NOTICE_MAX_INTERVAL,
_u8L("New printer config available."),
_u8L("Details"),
[](wxEvtHandler* evnthndlr) {
if (evnthndlr != nullptr)
wxPostEvent(evnthndlr, PrinterConfigUpdateAvailableClickedEvent(EVT_PRINTER_CONFIG_UPDATE_AVAILABLE_CLICKED));
return true;
}},
NotificationData{NotificationType::UndoDesktopIntegrationFail, NotificationLevel::WarningNotificationLevel, 10,
_u8L("Undo integration failed.") },
NotificationData{NotificationType::ExportOngoing, NotificationLevel::RegularNotificationLevel, 0, _u8L("Exporting.")},