forked from qt-creator/qt-creator
Add general UI introduction
Adds a Help > UI Introduction, which highlights basic aspects of the Qt Creator UI. The pages to show are defined in a format that can later move into a text based configuration file like JSON. It specifies an optional object name of a widget to highlight, a title, a brief description and a longer description (potentially with tables, lists and other simple HTML). Fixes: QTCREATORBUG-21585 Change-Id: Idb64c87e1d752bc24437588278093a96be0eeddb Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
This commit is contained in:
@@ -23,11 +23,14 @@
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "introductionwidget.h"
|
||||
|
||||
#include <extensionsystem/iplugin.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
#include <app/app_version.h>
|
||||
|
||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||
#include <coreplugin/actionmanager/actionmanager.h>
|
||||
#include <coreplugin/actionmanager/command.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
@@ -139,6 +142,18 @@ public:
|
||||
{
|
||||
m_welcomeMode->initPlugins();
|
||||
ModeManager::activateMode(m_welcomeMode->id());
|
||||
auto introAction = new QAction(tr("UI Tour"), this);
|
||||
connect(introAction, &QAction::triggered, this, []() {
|
||||
auto intro = new IntroductionWidget(ICore::mainWindow());
|
||||
intro->show();
|
||||
});
|
||||
Command *cmd = ActionManager::registerAction(introAction, "Welcome.UITour");
|
||||
ActionContainer *mhelp = ActionManager::actionContainer(Core::Constants::M_HELP);
|
||||
if (QTC_GUARD(mhelp))
|
||||
mhelp->addAction(cmd, Core::Constants::G_HELP_HELP);
|
||||
connect(ICore::instance(), &ICore::coreOpened, this, []() {
|
||||
IntroductionWidget::askUserAboutIntroduction(ICore::mainWindow(), ICore::settings());
|
||||
}, Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
WelcomeMode *m_welcomeMode = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user