[EGD-3442] Fix list empty window unhandled behaviours, in place rebuild handling, notes rebuild on note deletion and changed call Icon name to stateIcon. (#1160)

This commit is contained in:
PrzeBrudny
2020-12-14 21:56:11 +01:00
committed by GitHub
parent b0fae5c4b8
commit d46139195c
21 changed files with 132 additions and 87 deletions

View File

@@ -18,6 +18,7 @@
#include <module-apps/application-notes/presenter/NoteEditWindowPresenter.hpp>
#include <module-apps/windows/OptionWindow.hpp>
#include <module-apps/windows/Dialog.hpp>
#include <module-services/service-db/service-db/DBNotificationMessage.hpp>
namespace app
{
@@ -28,7 +29,9 @@ namespace app
ApplicationNotes::ApplicationNotes(std::string name, std::string parent, StartInBackground startInBackground)
: Application(name, parent, startInBackground, NotesStackSize)
{}
{
busChannels.push_back(sys::BusChannels::ServiceDBNotifications);
}
// Invoked upon receiving data message
sys::MessagePointer ApplicationNotes::DataReceivedHandler(sys::DataMessage *msgl, sys::ResponseMessage *resp)
@@ -39,6 +42,19 @@ namespace app
return retMsg;
}
if (msgl->messageType == MessageType::DBServiceNotification) {
auto msg = dynamic_cast<db::NotificationMessage *>(msgl);
if (msg != nullptr) {
// window-specific actions
if (msg->interface == db::Interface::Name::Notes) {
for (auto &[name, window] : windowsStack) {
window->onDatabaseMessage(msg);
}
}
return std::make_shared<sys::ResponseMessage>();
}
}
if (resp != nullptr) {
switch (resp->responseTo) {
case MessageType::DBQuery: