40 #include <QDesktopServices>
42 #include <QtCore/QSettings>
43 #include <QtCore/QUrl>
44 #include <QtCore/QDebug>
49 #include <QQmlContext>
53 using namespace ExtensionSystem;
54 using namespace Utils;
65 WelcomeModePrivate::WelcomeModePrivate()
73 WelcomeMode::WelcomeMode(QString instUUID)
78 m_d->
quickView->setResizeMode(QQuickView::SizeRootObjectToView);
80 m_d->
quickView->engine()->rootContext()->setContextProperty(
"welcomePlugin",
this);
81 m_d->
quickView->engine()->rootContext()->setContextProperty(
"instHash",
82 QVariant(
qHash(instUUID)));
83 m_d->
quickView->engine()->rootContext()->setContextProperty(
87 m_d->
quickView->setSource(QUrl::fromLocalFile(fn));
91 &WelcomeMode::modesChanged);
103 return tr(
"Welcome");
108 return QIcon(QLatin1String(
":/core/gcs_logo_64"));
119 m_container = QWidget::createWindowContainer(m_d->
quickView);
120 m_container->setMinimumSize(64, 64);
121 m_container->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
148 void WelcomeMode::modesChanged()
151 QStringList modeNames;
153 foreach (
IMode *mode, modes)
154 modeNames.append(mode->name());
156 auto buttons = m_d->
quickView->rootObject()->findChild<QObject *>(
"modeButtons");
158 buttons->setProperty(
"modeNames", modeNames);
160 qWarning() <<
"[WelcomeMode::modesChanged] Can't find mode buttons";
static UniqueIDManager * instance()
int uniqueIdentifier(const QString &id)
IMode(QObject *parent=nullptr)
static ModeManager * instance()
void triggerAction(const QString &actionId)
const char *const C_WELCOME_MODE
QVector< IMode * > modes() const
const char *const GCS_REVISION_SHORT_STR
const char *const MODE_WELCOME
void activateModeByWorkspaceName(const QString &id)
const char * uniqueModeName() const
QList< int > context() const
void openPage(const QString &page)
void triggerAction(const QString &actionId)
static QString InsertDataPath(QString path)