Commit aa4dd98b authored by Robert Loehning's avatar Robert Loehning

Git: Always enable "Actions on Commits..."

User can provide a path to the dialog so this can be handy even without
an open project or file.

Change-Id: I1ed96fe56b6ab76ca98f8d81ef60b217e66d0661
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
parent 226eea92
......@@ -62,6 +62,7 @@
#include <utils/mimetypes/mimedatabase.h>
#include <utils/qtcassert.h>
#include <utils/parameteraction.h>
#include <utils/pathchooser.h>
#include <vcsbase/basevcseditorfactory.h>
#include <vcsbase/submitfilemodel.h>
......@@ -590,8 +591,12 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
// --------------
gitContainer->addSeparator(context);
createRepositoryAction(gitContainer, tr("Actions on Commits..."), "Git.ChangeActions",
context, false, [this] { startChangeRelatedAction("Git.ChangeActions"); });
QAction *actionsOnCommitsAction = new QAction(tr("Actions on Commits..."), this);
Command *actionsOnCommitsCommand = ActionManager::registerAction(
actionsOnCommitsAction, "Git.ChangeActions");
connect(actionsOnCommitsAction, &QAction::triggered, this,
[this] { startChangeRelatedAction("Git.ChangeActions"); });
gitContainer->addAction(actionsOnCommitsCommand);
QAction *createRepositoryAction = new QAction(tr("Create Repository..."), this);
Command *createRepositoryCommand = ActionManager::registerAction(
......@@ -756,10 +761,9 @@ void GitPlugin::startRebase()
void GitPlugin::startChangeRelatedAction(const Id &id)
{
const VcsBasePluginState state = currentState();
if (!state.hasTopLevel())
return;
ChangeSelectionDialog dialog(state.topLevel(), id, ICore::mainWindow());
ChangeSelectionDialog dialog(state.hasTopLevel() ? state.topLevel() : PathChooser::homePath(),
id, ICore::mainWindow());
int result = dialog.exec();
......
Markdown is supported
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