forked from qt-creator/qt-creator
Adapt to 4.9
Change-Id: I9c413eaf6d70eaf09640aed349c876c040ef55ba Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -141,12 +141,15 @@ bool FossilCommitWidget::isPrivateOptionEnabled() const
|
|||||||
return m_commitPanelUi.isPrivateCheckBox->isChecked();
|
return m_commitPanelUi.isPrivateCheckBox->isChecked();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FossilCommitWidget::canSubmit() const
|
bool FossilCommitWidget::canSubmit(QString *whyNot) const
|
||||||
{
|
{
|
||||||
QString message = cleanupDescription(descriptionText()).trimmed();
|
QString message = cleanupDescription(descriptionText()).trimmed();
|
||||||
|
|
||||||
if (m_commitPanelUi.invalidBranchLabel->isVisible() || message.isEmpty())
|
if (m_commitPanelUi.invalidBranchLabel->isVisible() || message.isEmpty()) {
|
||||||
|
if (whyNot)
|
||||||
|
*whyNot = tr("Message check failed.");
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return VcsBase::SubmitEditorWidget::canSubmit();
|
return VcsBase::SubmitEditorWidget::canSubmit();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public:
|
|||||||
bool isPrivateOptionEnabled() const;
|
bool isPrivateOptionEnabled() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool canSubmit() const;
|
bool canSubmit(QString *whyNot = nullptr) const;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void branchChanged();
|
void branchChanged();
|
||||||
|
|||||||
@@ -663,10 +663,8 @@ bool FossilPlugin::submitEditorAboutToClose()
|
|||||||
QTC_ASSERT(editorDocument, return true);
|
QTC_ASSERT(editorDocument, return true);
|
||||||
|
|
||||||
bool promptOnSubmit = false;
|
bool promptOnSubmit = false;
|
||||||
const VcsBase::VcsBaseSubmitEditor::PromptSubmitResult response =
|
const VcsBase::VcsBaseSubmitEditor::PromptSubmitResult response
|
||||||
commitEditor->promptSubmit(tr("Close Commit Editor"), tr("Do you want to commit the changes?"),
|
= commitEditor->promptSubmit(this, &promptOnSubmit, !m_submitActionTriggered);
|
||||||
tr("Message check failed. Do you want to proceed?"),
|
|
||||||
&promptOnSubmit, !m_submitActionTriggered);
|
|
||||||
m_submitActionTriggered = false;
|
m_submitActionTriggered = false;
|
||||||
|
|
||||||
switch (response) {
|
switch (response) {
|
||||||
|
|||||||
Reference in New Issue
Block a user