forked from qt-creator/qt-creator
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user