dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
welcomeplugin.cpp
Go to the documentation of this file.
1 
14 /*
15  * This program is free software; you can redistribute it and/or modify
16  * it under the terms of the GNU General Public License as published by
17  * the Free Software Foundation; either version 3 of the License, or
18  * (at your option) any later version.
19  *
20  * This program is distributed in the hope that it will be useful, but
21  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23  * for more details.
24  *
25  * You should have received a copy of the GNU General Public License along
26  * with this program; if not, see <http://www.gnu.org/licenses/>
27  */
28 
29 #include "welcomeplugin.h"
30 
31 #include "welcomemode.h"
32 
34 #include <coreplugin/basemode.h>
36 #include <coreplugin/icore.h>
37 #include <coreplugin/modemanager.h>
39 
40 #include <QtCore/QDebug>
41 #include <QtCore/QtPlugin>
42 #include <QAction>
43 #include <QMenu>
44 #include <QPushButton>
45 
46 using namespace Welcome::Internal;
47 
48 WelcomePlugin::WelcomePlugin()
49  : m_welcomeMode(nullptr)
50 {
51 }
52 
53 WelcomePlugin::~WelcomePlugin()
54 {
55  if (m_welcomeMode) {
56  removeObject(m_welcomeMode);
57  m_welcomeMode->deleteLater();
58  }
59 }
60 
67 bool WelcomePlugin::initialize(const QStringList &arguments, QString *error_message)
68 {
69  Q_UNUSED(arguments)
70  Q_UNUSED(error_message)
71 
72  QSettings *qSettings = Core::ICore::instance()->settings();
73 
74  QString instUUID =
75  qSettings->value("Plugins/UsageStatsPlugin/data/UsageStatistics/InstallationUUID")
76  .toString();
77 
78  m_welcomeMode = new WelcomeMode(instUUID);
79  addObject(m_welcomeMode);
80 
81  return true;
82 }
83 
95 void WelcomePlugin::extensionsInitialized()
96 {
97  Core::ModeManager::instance()->activateMode(m_welcomeMode->uniqueModeName());
98 }
static ModeManager * instance()
Definition: modemanager.h:62
DataFields data
void activateMode(const QString &id)