Git: Add "Show HEAD" link in amend commit editor

Fixes: QTCREATORBUG-25004
Change-Id: Idac181c8821da41a21d86cb1760691d51158daee
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
Orgad Shaneh
2021-09-27 14:57:38 +03:00
committed by Orgad Shaneh
parent d341ab6371
commit 6564325081
2 changed files with 11 additions and 0 deletions

View File

@@ -65,6 +65,8 @@ GitSubmitEditorWidget::GitSubmitEditorWidget() :
this, &GitSubmitEditorWidget::authorInformationChanged);
connect(m_gitSubmitPanelUi.emailLineEdit, &QLineEdit::textChanged,
this, &GitSubmitEditorWidget::authorInformationChanged);
connect(m_gitSubmitPanelUi.showHeadLabel, &QLabel::linkActivated,
this, [this] { emit showRequested("HEAD"); });
}
void GitSubmitEditorWidget::setPanelInfo(const GitSubmitEditorPanelInfo &info)
@@ -99,6 +101,8 @@ void GitSubmitEditorWidget::initialize(CommitType commitType,
if (m_isInitialized)
return;
m_isInitialized = true;
if (commitType != AmendCommit)
m_gitSubmitPanelUi.showHeadLabel->hide();
if (commitType == FixupCommit) {
auto logChangeGroupBox = new QGroupBox(tr("Select Change"));
auto logChangeLayout = new QVBoxLayout;

View File

@@ -60,6 +60,13 @@
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QLabel" name="showHeadLabel">
<property name="text">
<string>&lt;a href=&quot;head&quot;&gt;Show HEAD&lt;/a&gt;</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>