Git: add reload button for 'git blame' and 'git log' windows

Change-Id: I64685e779bed91d41e38bdc1454571dbbcd7f177
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Przemyslaw Gorszkowski
2017-12-05 22:39:27 +01:00
parent 6bb7da79de
commit e25edc5020
3 changed files with 24 additions and 3 deletions

View File

@@ -132,6 +132,14 @@ void VcsBaseEditorConfig::setBaseArguments(const QStringList &b)
d->m_baseArguments = b;
}
QAction *VcsBaseEditorConfig::addButton(const QString &label, const QIcon &icon)
{
auto action = new QAction(icon, label, d->m_toolBar);
connect(action, &QAction::triggered, this, &VcsBaseEditorConfig::argumentsChanged);
addAction(action);
return action;
}
QStringList VcsBaseEditorConfig::arguments() const
{
// Compile effective arguments
@@ -156,9 +164,7 @@ QAction *VcsBaseEditorConfig::addToggleButton(const QStringList &options,
action->setToolTip(tooltip);
action->setCheckable(true);
connect(action, &QAction::toggled, this, &VcsBaseEditorConfig::argumentsChanged);
const QList<QAction *> actions = d->m_toolBar->actions();
// Insert the action before line/column and split actions.
d->m_toolBar->insertAction(actions.at(qMax(actions.count() - 2, 0)), action);
addAction(action);
d->m_optionMappings.append(OptionMapping(options, action));
return action;
}
@@ -293,4 +299,11 @@ void VcsBaseEditorConfig::updateMappedSettings()
}
}
void VcsBaseEditorConfig::addAction(QAction *action)
{
const QList<QAction *> actions = d->m_toolBar->actions();
// Insert the action before line/column and split actions.
d->m_toolBar->insertAction(actions.at(qMax(actions.count() - 2, 0)), action);
}
} // namespace VcsBase