logic: Split MessageRefresh into index and UI

This commit is contained in:
Eberhard Graether
2018-10-28 12:11:53 +01:00
parent 27627b6d05
commit e2dd26ee5a
15 changed files with 116 additions and 108 deletions
@@ -7,22 +7,14 @@ class MessageRefresh
: public Message<MessageRefresh>
{
public:
MessageRefresh()
: uiOnly(false)
, all(false)
, loadStyle(true)
{
}
static const std::string getStaticType()
{
return "MessageRefresh";
}
MessageRefresh& refreshUiOnly()
MessageRefresh()
: all(false)
{
uiOnly = true;
return *this;
}
MessageRefresh& refreshAll()
@@ -31,28 +23,15 @@ public:
return *this;
}
MessageRefresh& noReloadStyle()
void print(std::wostream& os) const override
{
loadStyle = false;
return *this;
}
virtual void print(std::wostream& os) const
{
if (uiOnly)
{
os << "ui ";
}
if (all)
{
os << "all";
}
}
bool uiOnly;
bool all;
bool loadStyle;
};
#endif // MESSAGE_REFRESH_H
@@ -0,0 +1,37 @@
#ifndef MESSAGE_REFRESH_UI_H
#define MESSAGE_REFRESH_UI_H
#include "Message.h"
class MessageRefreshUI
: public Message<MessageRefreshUI>
{
public:
static const std::string getStaticType()
{
return "MessageRefreshUI";
}
MessageRefreshUI()
: loadStyle(true)
{
}
MessageRefreshUI& noStyleReload()
{
loadStyle = false;
return *this;
}
void print(std::wostream& os) const override
{
if (loadStyle)
{
os << "reload style";
}
}
bool loadStyle;
};
#endif // MESSAGE_REFRESH_UI_H