Welcome: Add a -notour argument

Helpful for a quick startup, e.g. in cases of forced clean settings.

Change-Id: I5b247d77e1157448187453c71b6c2a07b77f3889
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2019-03-18 12:25:30 +01:00
parent ded650108c
commit a19be8b091
2 changed files with 22 additions and 10 deletions

View File

@@ -14,6 +14,12 @@
],
\"Category\" : \"Core\",
\"Description\" : \"Secondary Welcome Screen Plugin.\",
\"Arguments\" : [
{
\"Name\" : \"-notour\",
\"Description\" : \"Do not ask for taking a UI tour on startup\"
}
],
\"Url\" : \"http://www.qt.io\",
$$dependencyList
}

View File

@@ -132,16 +132,10 @@ class WelcomePlugin : public ExtensionSystem::IPlugin
public:
~WelcomePlugin() final { delete m_welcomeMode; }
bool initialize(const QStringList &, QString *) final
bool initialize(const QStringList &arguments, QString *) final
{
m_welcomeMode = new WelcomeMode;
return true;
}
void extensionsInitialized() final
{
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());
@@ -151,9 +145,21 @@ public:
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);
if (!arguments.contains("-notour")) {
connect(ICore::instance(), &ICore::coreOpened, this, []() {
IntroductionWidget::askUserAboutIntroduction(ICore::mainWindow(),
ICore::settings());
}, Qt::QueuedConnection);
}
return true;
}
void extensionsInitialized() final
{
m_welcomeMode->initPlugins();
ModeManager::activateMode(m_welcomeMode->id());
}
WelcomeMode *m_welcomeMode = nullptr;