forked from qt-creator/qt-creator
Git: Keep panel data when editor is changed
Change-Id: I3c6a1ff6206b5b412c9ae89eb9b8f5a27dab2e62 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
7e7fb2244a
commit
70f0e168e4
@@ -111,9 +111,7 @@ void GitSubmitEditor::setCommitData(const CommitData &d)
|
|||||||
m_amendSHA1 = d.amendSHA1;
|
m_amendSHA1 = d.amendSHA1;
|
||||||
|
|
||||||
GitSubmitEditorWidget *w = submitEditorWidget();
|
GitSubmitEditorWidget *w = submitEditorWidget();
|
||||||
w->initialize(m_commitType, m_workingDirectory);
|
w->initialize(m_commitType, m_workingDirectory, d.panelData, d.panelInfo);
|
||||||
w->setPanelData(d.panelData);
|
|
||||||
w->setPanelInfo(d.panelInfo);
|
|
||||||
w->setHasUnmerged(false);
|
w->setHasUnmerged(false);
|
||||||
|
|
||||||
setEmptyFileListEnabled(m_commitType == AmendCommit); // Allow for just correcting the message
|
setEmptyFileListEnabled(m_commitType == AmendCommit); // Allow for just correcting the message
|
||||||
|
|||||||
@@ -82,7 +82,10 @@ void GitSubmitEditorWidget::setHasUnmerged(bool e)
|
|||||||
m_hasUnmerged = e;
|
m_hasUnmerged = e;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GitSubmitEditorWidget::initialize(CommitType commitType, const QString &repository)
|
void GitSubmitEditorWidget::initialize(CommitType commitType,
|
||||||
|
const QString &repository,
|
||||||
|
const GitSubmitEditorPanelData &data,
|
||||||
|
const GitSubmitEditorPanelInfo &info)
|
||||||
{
|
{
|
||||||
if (m_isInitialized)
|
if (m_isInitialized)
|
||||||
return;
|
return;
|
||||||
@@ -100,6 +103,8 @@ void GitSubmitEditorWidget::initialize(CommitType commitType, const QString &rep
|
|||||||
hideDescription();
|
hideDescription();
|
||||||
}
|
}
|
||||||
insertTopWidget(m_gitSubmitPanel);
|
insertTopWidget(m_gitSubmitPanel);
|
||||||
|
setPanelData(data);
|
||||||
|
setPanelInfo(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GitSubmitEditorWidget::refreshLog(const QString &repository)
|
void GitSubmitEditorWidget::refreshLog(const QString &repository)
|
||||||
|
|||||||
@@ -66,11 +66,12 @@ public:
|
|||||||
explicit GitSubmitEditorWidget(QWidget *parent = 0);
|
explicit GitSubmitEditorWidget(QWidget *parent = 0);
|
||||||
|
|
||||||
GitSubmitEditorPanelData panelData() const;
|
GitSubmitEditorPanelData panelData() const;
|
||||||
void setPanelData(const GitSubmitEditorPanelData &data);
|
|
||||||
void setPanelInfo(const GitSubmitEditorPanelInfo &info);
|
|
||||||
QString amendSHA1() const;
|
QString amendSHA1() const;
|
||||||
void setHasUnmerged(bool e);
|
void setHasUnmerged(bool e);
|
||||||
void initialize(CommitType commitType, const QString &repository);
|
void initialize(CommitType commitType,
|
||||||
|
const QString &repository,
|
||||||
|
const GitSubmitEditorPanelData &data,
|
||||||
|
const GitSubmitEditorPanelInfo &info);
|
||||||
void refreshLog(const QString &repository);
|
void refreshLog(const QString &repository);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -85,6 +86,8 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
bool emailIsValid() const;
|
bool emailIsValid() const;
|
||||||
|
void setPanelData(const GitSubmitEditorPanelData &data);
|
||||||
|
void setPanelInfo(const GitSubmitEditorPanelInfo &info);
|
||||||
|
|
||||||
QWidget *m_gitSubmitPanel;
|
QWidget *m_gitSubmitPanel;
|
||||||
LogChangeWidget *m_logChangeWidget;
|
LogChangeWidget *m_logChangeWidget;
|
||||||
|
|||||||
Reference in New Issue
Block a user