Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
eca8e2fa
Commit
eca8e2fa
authored
Oct 28, 2014
by
Christian Stenger
Committed by
Christian Stenger
Dec 04, 2014
Browse files
Add license validation with LicenseChecker plugin
parent
eba497d9
Changes
2
Hide whitespace changes
Inline
Side-by-side
plugins/autotest/autotest_dependencies.pri
View file @
eca8e2fa
...
...
@@ -3,7 +3,8 @@ QTC_PLUGIN_NAME = AutoTest
QTC_PLUGIN_DEPENDS += \
coreplugin \
projectexplorer \
cpptools
cpptools \
licensechecker
QTC_LIB_DEPENDS += \
cplusplus \
...
...
plugins/autotest/autotestplugin.cpp
View file @
eca8e2fa
...
...
@@ -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
));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment