ui: Added tabs UI to top of main window (issue #215)
* 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!
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#include "MessageIndexingStatus.h"
|
||||
#include "MessageRefresh.h"
|
||||
#include "MessageStatus.h"
|
||||
#include "TabId.h"
|
||||
#include "TaskDecoratorRepeat.h"
|
||||
#include "TaskFindKeyOnBlackboard.h"
|
||||
#include "TaskGroupSelector.h"
|
||||
@@ -71,6 +72,23 @@ std::string Project::getDescription() const
|
||||
return m_settings->getDescription();
|
||||
}
|
||||
|
||||
bool Project::isLoaded() const
|
||||
{
|
||||
switch (m_state)
|
||||
{
|
||||
case PROJECT_STATE_EMPTY:
|
||||
case PROJECT_STATE_LOADED:
|
||||
case PROJECT_STATE_OUTDATED:
|
||||
case PROJECT_STATE_NEEDS_MIGRATION:
|
||||
return true;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Project::isIndexing() const
|
||||
{
|
||||
return m_refreshStage == RefreshStageType::INDEXING;
|
||||
@@ -238,8 +256,6 @@ void Project::refresh(RefreshMode refreshMode, std::shared_ptr<DialogView> dialo
|
||||
return;
|
||||
}
|
||||
|
||||
m_refreshStage = RefreshStageType::REFRESHING;
|
||||
|
||||
if (m_state == PROJECT_STATE_NOT_LOADED)
|
||||
{
|
||||
return;
|
||||
@@ -312,6 +328,8 @@ void Project::refresh(RefreshMode refreshMode, std::shared_ptr<DialogView> dialo
|
||||
}
|
||||
}
|
||||
|
||||
m_refreshStage = RefreshStageType::REFRESHING;
|
||||
|
||||
if (m_state == PROJECT_STATE_NEEDS_MIGRATION)
|
||||
{
|
||||
m_settings->migrate();
|
||||
@@ -324,6 +342,7 @@ void Project::refresh(RefreshMode refreshMode, std::shared_ptr<DialogView> dialo
|
||||
{
|
||||
if (!sourceGroup->prepareIndexing())
|
||||
{
|
||||
m_refreshStage = RefreshStageType::NONE;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -554,7 +573,7 @@ void Project::buildIndex(const RefreshInfo& info, std::shared_ptr<DialogView> di
|
||||
std::make_shared<TaskGroupSequence>()->addChildTasks(
|
||||
std::make_shared<TaskFindKeyOnBlackboard>("keep_database"),
|
||||
std::make_shared<TaskLambda>([dialogView, this]() {
|
||||
Task::dispatch(std::make_shared<TaskLambda>([dialogView, this]() {
|
||||
Task::dispatch(TabId::app(), std::make_shared<TaskLambda>([dialogView, this]() {
|
||||
swapToTempStorage(dialogView);
|
||||
}));
|
||||
})
|
||||
@@ -562,7 +581,7 @@ void Project::buildIndex(const RefreshInfo& info, std::shared_ptr<DialogView> di
|
||||
std::make_shared<TaskGroupSequence>()->addChildTasks(
|
||||
std::make_shared<TaskFindKeyOnBlackboard>("discard_database"),
|
||||
std::make_shared<TaskLambda>([this]() {
|
||||
Task::dispatch(std::make_shared<TaskLambda>([this]() {
|
||||
Task::dispatch(TabId::app(), std::make_shared<TaskLambda>([this]() {
|
||||
discardTempStorage();
|
||||
}));
|
||||
})
|
||||
@@ -575,7 +594,7 @@ void Project::buildIndex(const RefreshInfo& info, std::shared_ptr<DialogView> di
|
||||
}));
|
||||
|
||||
taskSequential->setIsBackgroundTask(true);
|
||||
Task::dispatch(taskSequential);
|
||||
Task::dispatch(TabId::app(), taskSequential);
|
||||
|
||||
m_refreshStage = RefreshStageType::INDEXING;
|
||||
MessageIndexingStarted().dispatch();
|
||||
|
||||
Reference in New Issue
Block a user