forked from qt-creator/qt-creator
GitLab: Register open view action using ActionBuilder
Change-Id: Id0bb3b2a3e5da266ce9014ffe2c81f9b0d0d442d Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -30,10 +30,9 @@
|
|||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
|
using namespace Core;
|
||||||
|
|
||||||
namespace GitLab {
|
namespace GitLab {
|
||||||
namespace Constants {
|
|
||||||
const char GITLAB_OPEN_VIEW[] = "GitLab.OpenView";
|
|
||||||
} // namespace Constants
|
|
||||||
|
|
||||||
class GitLabPluginPrivate : public QObject
|
class GitLabPluginPrivate : public QObject
|
||||||
{
|
{
|
||||||
@@ -78,12 +77,11 @@ void GitLabPlugin::initialize()
|
|||||||
|
|
||||||
setupGitlabProjectPanel();
|
setupGitlabProjectPanel();
|
||||||
|
|
||||||
QAction *openViewAction = new QAction(Tr::tr("GitLab..."), this);
|
ActionBuilder(this, "GitLab.OpenView")
|
||||||
auto gitlabCommand = Core::ActionManager::registerAction(openViewAction,
|
.setText(Tr::tr("GitLab..."))
|
||||||
Constants::GITLAB_OPEN_VIEW);
|
.addOnTriggered(this, &GitLabPlugin::openView)
|
||||||
connect(openViewAction, &QAction::triggered, this, &GitLabPlugin::openView);
|
.addToContainer(Core::Constants::M_TOOLS);
|
||||||
Core::ActionContainer *ac = Core::ActionManager::actionContainer(Core::Constants::M_TOOLS);
|
|
||||||
ac->addAction(gitlabCommand);
|
|
||||||
connect(ProjectExplorer::ProjectManager::instance(),
|
connect(ProjectExplorer::ProjectManager::instance(),
|
||||||
&ProjectExplorer::ProjectManager::startupProjectChanged,
|
&ProjectExplorer::ProjectManager::startupProjectChanged,
|
||||||
this, &GitLabPlugin::onStartupProjectChanged);
|
this, &GitLabPlugin::onStartupProjectChanged);
|
||||||
|
Reference in New Issue
Block a user