logic: Split MessageRefresh into index and UI
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user