Files
Sourcetrail/src/lib_gui/qt/view/QtViewFactory.cpp
T
Eberhard Graether f13aec70dd 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!
2018-11-05 01:28:12 +01:00

124 lines
3.7 KiB
C++

#include "QtViewFactory.h"
#include "GraphViewStyle.h"
#include "QtBookmarkButtonsView.h"
#include "QtBookmarkView.h"
#include "QtCodeView.h"
#include "QtCompositeView.h"
#include "QtDialogView.h"
#include "QtErrorView.h"
#include "QtGraphView.h"
#include "QtGraphViewStyleImpl.h"
#include "QtMainView.h"
#include "QtRefreshView.h"
#include "QtScreenSearchView.h"
#include "QtSearchView.h"
#include "QtStatusBarView.h"
#include "QtStatusView.h"
#include "QtTabbedView.h"
#include "QtTabsView.h"
#include "QtTooltipView.h"
#include "QtUndoRedoView.h"
QtViewFactory::QtViewFactory()
{
}
std::shared_ptr<MainView> QtViewFactory::createMainView(StorageAccess* storageAccess) const
{
return std::make_shared<QtMainView>(this, storageAccess);
}
std::shared_ptr<CompositeView> QtViewFactory::createCompositeView(
ViewLayout* viewLayout, CompositeView::CompositeDirection direction, const std::string& name
) const {
std::shared_ptr<CompositeView> ptr = std::make_shared<QtCompositeView>(viewLayout, direction, name);
ptr->init();
ptr->addToLayout();
return ptr;
}
std::shared_ptr<TabbedView> QtViewFactory::createTabbedView(ViewLayout* viewLayout, const std::string& name) const
{
std::shared_ptr<TabbedView> ptr = std::make_shared<QtTabbedView>(viewLayout, name);
ptr->init();
ptr->addToLayout();
return ptr;
}
std::shared_ptr<BookmarkButtonsView> QtViewFactory::createBookmarkButtonsView(ViewLayout* viewLayout) const
{
return View::createInitAndAddToLayout<QtBookmarkButtonsView>(viewLayout);
}
std::shared_ptr<BookmarkView> QtViewFactory::createBookmarkView(ViewLayout* viewLayout) const
{
return View::createAndInit<QtBookmarkView>(viewLayout);
}
std::shared_ptr<CodeView> QtViewFactory::createCodeView(ViewLayout* viewLayout) const
{
return View::createInitAndAddToLayout<QtCodeView>(viewLayout);
}
std::shared_ptr<ErrorView> QtViewFactory::createErrorView(ViewLayout* viewLayout) const
{
return View::createInitAndAddToLayout<QtErrorView>(viewLayout);
}
std::shared_ptr<StatusView> QtViewFactory::createStatusView(ViewLayout* viewLayout) const
{
return View::createInitAndAddToLayout<QtStatusView>(viewLayout);
}
std::shared_ptr<GraphView> QtViewFactory::createGraphView(ViewLayout* viewLayout) const
{
return View::createInitAndAddToLayout<QtGraphView>(viewLayout);
}
std::shared_ptr<RefreshView> QtViewFactory::createRefreshView(ViewLayout* viewLayout) const
{
return View::createInitAndAddToLayout<QtRefreshView>(viewLayout);
}
std::shared_ptr<ScreenSearchView> QtViewFactory::createScreenSearchView(ViewLayout* viewLayout) const
{
return View::createAndInit<QtScreenSearchView>(viewLayout);
}
std::shared_ptr<SearchView> QtViewFactory::createSearchView(ViewLayout* viewLayout) const
{
return View::createInitAndAddToLayout<QtSearchView>(viewLayout);
}
std::shared_ptr<StatusBarView> QtViewFactory::createStatusBarView(ViewLayout* viewLayout) const
{
return View::createAndInit<QtStatusBarView>(viewLayout);
}
std::shared_ptr<TabsView> QtViewFactory::createTabsView(ViewLayout* viewLayout) const
{
return View::createInitAndAddToLayout<QtTabsView>(viewLayout);
}
std::shared_ptr<TooltipView> QtViewFactory::createTooltipView(ViewLayout* viewLayout) const
{
return View::createAndInit<QtTooltipView>(viewLayout);
}
std::shared_ptr<UndoRedoView> QtViewFactory::createUndoRedoView(ViewLayout* viewLayout) const
{
return View::createInitAndAddToLayout<QtUndoRedoView>(viewLayout);
}
std::shared_ptr<DialogView> QtViewFactory::createDialogView(
ViewLayout* viewLayout, DialogView::UseCase useCase, StorageAccess* storageAccess) const
{
return std::make_shared<QtDialogView>(dynamic_cast<QtMainView*>(viewLayout)->getMainWindow(), useCase, storageAccess);
}
std::shared_ptr<GraphViewStyleImpl> QtViewFactory::createGraphStyleImpl() const
{
return std::make_shared<QtGraphViewStyleImpl>();
}