diff options
author | hjk <hjk@theqtcompany.com> | 2016-07-22 15:53:01 +0200 |
---|---|---|
committer | hjk <hjk@qt.io> | 2016-07-26 10:00:09 +0000 |
commit | 245965223450e6936d9a6b250bff777e633bbcc6 (patch) | |
tree | d2c029881338cc3ad34046284dcbbdc73b54afba /src/plugins/todo | |
parent | d258d47b426dcf3e58dab8e46456bc4e396890b7 (diff) | |
download | qt-creator-245965223450e6936d9a6b250bff777e633bbcc6.tar.gz |
ProjectExplorer: Rework mode main window
The existing solution with the special-style horizontal
kit selector comes from a time when there was typically
one, at most four targets. Today's setup can easily
reach half a dozen targets with several toolchain versions
each and can't be sensibly handled with the overflowing
horizontal bar.
This here replaces the horizontal kit selector bar as
well as the top level project "tab bar" with a normal
tree view. All targets are visible (but possibly disabled)
at once, and can be enabled/disabled using the context
menu on the tree items.
Change-Id: I1ce7401ca96109bf34bc8c0ae19d265e5845aa88
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Diffstat (limited to 'src/plugins/todo')
-rw-r--r-- | src/plugins/todo/todoplugin.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/plugins/todo/todoplugin.cpp b/src/plugins/todo/todoplugin.cpp index 6e3856039d..b55b2b2616 100644 --- a/src/plugins/todo/todoplugin.cpp +++ b/src/plugins/todo/todoplugin.cpp @@ -35,7 +35,9 @@ #include <coreplugin/icore.h> #include <coreplugin/editormanager/editormanager.h> #include <coreplugin/editormanager/ieditor.h> + #include <projectexplorer/projectpanelfactory.h> +#include <projectexplorer/propertiespanel.h> #include <QtPlugin> #include <QFileInfo> @@ -68,20 +70,14 @@ bool TodoPlugin::initialize(const QStringList& args, QString *errMsg) createItemsProvider(); createTodoOutputPane(); - auto panelFactory = new ProjectExplorer::ProjectPanelFactory(); + auto panelFactory = new ProjectExplorer::ProjectPanelFactory; panelFactory->setPriority(100); panelFactory->setDisplayName(TodoProjectSettingsWidget::tr("To-Do")); - panelFactory->setCreateWidgetFunction([this, panelFactory](ProjectExplorer::Project *project) -> QWidget * { - auto *panel = new ProjectExplorer::PropertiesPanel; - panel->setDisplayName(panelFactory->displayName()); - auto *widget = new TodoProjectSettingsWidget(project); + panelFactory->setCreateWidgetFunction([this, panelFactory](ProjectExplorer::Project *project) { + auto widget = new TodoProjectSettingsWidget(project); connect(widget, &TodoProjectSettingsWidget::projectSettingsChanged, - m_todoItemsProvider, [this, project](){m_todoItemsProvider->projectSettingsChanged(project);}); - panel->setWidget(widget); - auto *panelsWidget = new ProjectExplorer::PanelsWidget(); - panelsWidget->addPropertiesPanel(panel); - panelsWidget->setFocusProxy(widget); - return panelsWidget; + m_todoItemsProvider, [this, project] { m_todoItemsProvider->projectSettingsChanged(project); }); + return widget; }); ProjectExplorer::ProjectPanelFactory::registerFactory(panelFactory); |