* Added tab bar to top of main window with UI/shortcuts similar to web browsers * ComponentManager offers components for 2 use-cases: application and tab * Application components: log view (status/errors), bookmarks, screen search, status bar, tabs, tooltips, dialogs and all tab views disabled * Tab components: graph, code, history and search * When a project is loaded there is always at least one tab, otherwise there is none * Each tab replaces the application views of the same name in the main layout when activated * Each tab has it's own TaskScheduler, to process tasks independent from other tabs * The application has a global TaskScheduler for application wide tasks * The singloton class TaskManager is responsible for managing the TaskSchedulers * MessageListeners and Messages hold an optional schedulerId, both must be set to only send to a specific TaskScheduler * Bookmark buttons where split off into a separate view per tab, bookmark managemement is done in the application * History menu processing is done by the QtMainWindow now * Screen search is an application component, the responders are always changed to the active tab * Plugin messages are opened in a new tab * Symbols can be opened in a new tab via middle click/context menu in graph, code, history dropdown * Full text index creation is mutexed now in PersistenStorage to make it fully thread-safe * All tabs are closed when switching projects * Tab contents are only animated when visible fortune cookie message = Catch your lucky star!
132 lines
1.7 KiB
C++
132 lines
1.7 KiB
C++
#ifndef MESSAGE_BASE_H
|
|
#define MESSAGE_BASE_H
|
|
|
|
#include <ostream>
|
|
#include <sstream>
|
|
|
|
#include "types.h"
|
|
#include "utilityString.h"
|
|
|
|
class MessageBase
|
|
{
|
|
public:
|
|
MessageBase()
|
|
: m_id(s_nextId++)
|
|
, m_schedulerId(0)
|
|
, m_isParallel(false)
|
|
, m_isReplayed(false)
|
|
, m_sendAsTask(true)
|
|
, m_keepContent(false)
|
|
, m_isLast(true)
|
|
, m_isLogged(true)
|
|
{
|
|
}
|
|
|
|
virtual ~MessageBase() = default;
|
|
|
|
virtual std::string getType() const = 0;
|
|
virtual void dispatch() = 0;
|
|
|
|
Id getId() const
|
|
{
|
|
return m_id;
|
|
}
|
|
|
|
Id getSchedulerId() const
|
|
{
|
|
return m_schedulerId;
|
|
}
|
|
|
|
void setSchedulerId(Id schedulerId)
|
|
{
|
|
m_schedulerId = schedulerId;
|
|
}
|
|
|
|
bool sendAsTask() const
|
|
{
|
|
return m_sendAsTask;
|
|
}
|
|
|
|
void setSendAsTask(bool sendAsTask)
|
|
{
|
|
m_sendAsTask = sendAsTask;
|
|
}
|
|
|
|
bool isParallel() const
|
|
{
|
|
return m_isParallel;
|
|
}
|
|
|
|
void setIsParallel(bool isParallel)
|
|
{
|
|
m_isParallel = isParallel;
|
|
}
|
|
|
|
bool isReplayed() const
|
|
{
|
|
return m_isReplayed;
|
|
}
|
|
|
|
void setIsReplayed(bool isReplayed)
|
|
{
|
|
m_isReplayed = isReplayed;
|
|
}
|
|
|
|
bool isLast() const
|
|
{
|
|
return m_isLast;
|
|
}
|
|
|
|
void setIsLast(bool isLast)
|
|
{
|
|
m_isLast = isLast;
|
|
}
|
|
|
|
bool isLogged() const
|
|
{
|
|
return m_isLogged;
|
|
}
|
|
|
|
void setIsLogged(bool isLogged)
|
|
{
|
|
m_isLogged = isLogged;
|
|
}
|
|
|
|
void setKeepContent(bool keepContent)
|
|
{
|
|
m_keepContent = keepContent;
|
|
}
|
|
|
|
bool keepContent() const
|
|
{
|
|
return m_keepContent;
|
|
}
|
|
|
|
virtual void print(std::wostream& os) const = 0;
|
|
|
|
std::wstring str() const
|
|
{
|
|
std::wstringstream ss;
|
|
ss << utility::decodeFromUtf8(getType()) << L" ";
|
|
print(ss);
|
|
return ss.str();
|
|
}
|
|
|
|
private:
|
|
static Id s_nextId;
|
|
|
|
Id m_id;
|
|
Id m_schedulerId;
|
|
|
|
bool m_isParallel;
|
|
bool m_isReplayed;
|
|
|
|
bool m_sendAsTask;
|
|
bool m_keepContent;
|
|
|
|
bool m_isLast;
|
|
bool m_isLogged;
|
|
};
|
|
|
|
#endif // MESSAGE_BASE_H
|