summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hartmann <thomas.hartmann@qt.io>2022-01-18 19:46:28 +0100
committerThomas Hartmann <thomas.hartmann@qt.io>2022-01-18 22:57:47 +0000
commit81dd1ba294ba7a3e438eedab4e0e250793027afa (patch)
tree7ac4136b122514ae6d9fd6ae91d6f39250052742
parentc57573708a12b05d0332363e5f17fea6a71d6c82 (diff)
downloadqt-creator-81dd1ba294ba7a3e438eedab4e0e250793027afa.tar.gz
StudioWelcome: Show text for correct version
Task-number: QDS-5725 Change-Id: I040d9f1f0817fc719da060dd31ee6a04981199e3 Reviewed-by: Henning Gründl <henning.gruendl@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
-rw-r--r--src/plugins/studiowelcome/qml/splashscreen/Welcome_splash.qml10
-rw-r--r--src/plugins/studiowelcome/studiowelcomeplugin.cpp45
2 files changed, 48 insertions, 7 deletions
diff --git a/src/plugins/studiowelcome/qml/splashscreen/Welcome_splash.qml b/src/plugins/studiowelcome/qml/splashscreen/Welcome_splash.qml
index 86a1dae392..a145cbcabe 100644
--- a/src/plugins/studiowelcome/qml/splashscreen/Welcome_splash.qml
+++ b/src/plugins/studiowelcome/qml/splashscreen/Welcome_splash.qml
@@ -341,10 +341,16 @@ Rectangle {
x: 15
y: 65
color: "#ffffff"
- text: qsTr("Community Edition")
+
font.pixelSize: 13
font.family: StudioFonts.titilliumWeb_light
- visible: projectModel.communityVersion
+ text: {
+ if (projectModel.communityVersion)
+ return qsTr("Community Edition")
+ if (projectModel.enterpriseVersion)
+ return qsTr("Enterprise Edition")
+ return qsTr("Professional Edition")
+ }
ProjectModel {
id: projectModel
diff --git a/src/plugins/studiowelcome/studiowelcomeplugin.cpp b/src/plugins/studiowelcome/studiowelcomeplugin.cpp
index 424374b8e7..67d02c78f7 100644
--- a/src/plugins/studiowelcome/studiowelcomeplugin.cpp
+++ b/src/plugins/studiowelcome/studiowelcomeplugin.cpp
@@ -197,6 +197,7 @@ public:
enum { FilePathRole = Qt::UserRole + 1, PrettyFilePathRole, PreviewUrl, TagData, Description };
Q_PROPERTY(bool communityVersion MEMBER m_communityVersion NOTIFY communityVersionChanged)
+ Q_PROPERTY(bool enterpriseVersion MEMBER m_enterpriseVersion NOTIFY enterpriseVersionChanged)
explicit ProjectModel(QObject *parent = nullptr);
@@ -273,11 +274,48 @@ public slots:
signals:
void communityVersionChanged();
+ void enterpriseVersionChanged();
private:
- bool m_communityVersion = false;
+ void setupVersion();
+
+ bool m_communityVersion = true;
+ bool m_enterpriseVersion = false;
};
+void ProjectModel::setupVersion()
+{
+ const ExtensionSystem::PluginSpec *pluginSpec = Utils::findOrDefault(
+ ExtensionSystem::PluginManager::plugins(),
+ Utils::equal(&ExtensionSystem::PluginSpec::name, QString("LicenseChecker")));
+
+ if (!pluginSpec)
+ return;
+
+ ExtensionSystem::IPlugin *plugin = pluginSpec->plugin();
+
+ if (!plugin)
+ return;
+
+ m_communityVersion = false;
+
+ bool retVal = false;
+ bool success = QMetaObject::invokeMethod(plugin,
+ "qdsEnterpriseLicense",
+ Qt::DirectConnection,
+ Q_RETURN_ARG(bool, retVal));
+
+ if (!success) {
+ qWarning("Check for Qt Design Studio Enterprise License failed.");
+ return;
+ }
+ if (!retVal) {
+ qWarning("No Qt Design Studio Enterprise License. Disabling asset importer.");
+ return;
+ }
+ m_enterpriseVersion = true;
+}
+
ProjectModel::ProjectModel(QObject *parent)
: QAbstractListModel(parent)
{
@@ -286,10 +324,7 @@ ProjectModel::ProjectModel(QObject *parent)
this,
&ProjectModel::resetProjects);
- if (!Utils::findOrDefault(ExtensionSystem::PluginManager::plugins(),
- Utils::equal(&ExtensionSystem::PluginSpec::name,
- QString("LicenseChecker"))))
- m_communityVersion = true;
+ setupVersion();
}
int ProjectModel::rowCount(const QModelIndex &) const