Git: Set default button for change-related actions by triggering action

Change-Id: I536618e9b80f3ed213c6c54dd6c2becbb64c709b
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Orgad Shaneh
2013-09-30 11:30:13 +03:00
committed by Orgad Shaneh
parent 63e7fe19b9
commit e81152acd5
3 changed files with 17 additions and 3 deletions

View File

@@ -249,6 +249,7 @@ ActionCommandPair
{
const ActionCommandPair rc = createRepositoryAction(ac, text, id, context, addToLocator);
connect(rc.first, SIGNAL(triggered()), this, pluginSlot);
rc.first->setData(id.uniqueIdentifier());
return rc;
}
@@ -852,7 +853,9 @@ void GitPlugin::startChangeRelatedAction()
if (!state.hasTopLevel())
return;
ChangeSelectionDialog dialog(state.topLevel(), Core::ICore::mainWindow());
QAction *action = qobject_cast<QAction *>(sender());
Core::Id id = action ? Core::Id::fromUniqueIdentifier(action->data().toInt()) : Core::Id();
ChangeSelectionDialog dialog(state.topLevel(), id, Core::ICore::mainWindow());
int result = dialog.exec();