Commit eca8e2fa authored by Christian Stenger's avatar Christian Stenger Committed by Christian Stenger
Browse files

Add license validation with LicenseChecker plugin

parent eba497d9
......@@ -3,7 +3,8 @@ QTC_PLUGIN_NAME = AutoTest
QTC_PLUGIN_DEPENDS += \
coreplugin \
projectexplorer \
cpptools
cpptools \
licensechecker
QTC_LIB_DEPENDS += \
cplusplus \
......
......@@ -30,6 +30,10 @@
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/coreconstants.h>
#include <extensionsystem/pluginmanager.h>
#include <licensechecker/licensecheckerplugin.h>
#include <QAction>
#include <QMessageBox>
#include <QMainWindow>
......@@ -66,6 +70,15 @@ bool AutotestPlugin::initialize(const QStringList &arguments, QString *errorStri
Q_UNUSED(arguments)
Q_UNUSED(errorString)
LicenseChecker::LicenseCheckerPlugin *licenseChecker
= ExtensionSystem::PluginManager::getObject<LicenseChecker::LicenseCheckerPlugin>();
if (!licenseChecker || !licenseChecker->hasValidLicense()) {
qWarning() << "Invalid license, disabling Qt Creator Enterprise Auto Test Add-on.";
return true;
} else if (!licenseChecker->enterpriseFeatures())
return true;
QAction *action = new QAction(tr("Autotest action"), this);
Core::Command *cmd = Core::ActionManager::registerAction(action, Constants::ACTION_ID,
Core::Context(Core::Constants::C_GLOBAL));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment