Git: Keep panel data when editor is changed

Change-Id: I3c6a1ff6206b5b412c9ae89eb9b8f5a27dab2e62
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Orgad Shaneh
2013-08-13 19:47:59 +03:00
committed by Orgad Shaneh
parent 7e7fb2244a
commit 70f0e168e4
3 changed files with 13 additions and 7 deletions

View File

@@ -111,9 +111,7 @@ void GitSubmitEditor::setCommitData(const CommitData &d)
m_amendSHA1 = d.amendSHA1;
GitSubmitEditorWidget *w = submitEditorWidget();
w->initialize(m_commitType, m_workingDirectory);
w->setPanelData(d.panelData);
w->setPanelInfo(d.panelInfo);
w->initialize(m_commitType, m_workingDirectory, d.panelData, d.panelInfo);
w->setHasUnmerged(false);
setEmptyFileListEnabled(m_commitType == AmendCommit); // Allow for just correcting the message

View File

@@ -82,7 +82,10 @@ void GitSubmitEditorWidget::setHasUnmerged(bool 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)
return;
@@ -100,6 +103,8 @@ void GitSubmitEditorWidget::initialize(CommitType commitType, const QString &rep
hideDescription();
}
insertTopWidget(m_gitSubmitPanel);
setPanelData(data);
setPanelInfo(info);
}
void GitSubmitEditorWidget::refreshLog(const QString &repository)

View File

@@ -66,11 +66,12 @@ public:
explicit GitSubmitEditorWidget(QWidget *parent = 0);
GitSubmitEditorPanelData panelData() const;
void setPanelData(const GitSubmitEditorPanelData &data);
void setPanelInfo(const GitSubmitEditorPanelInfo &info);
QString amendSHA1() const;
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);
protected:
@@ -85,6 +86,8 @@ private slots:
private:
bool emailIsValid() const;
void setPanelData(const GitSubmitEditorPanelData &data);
void setPanelInfo(const GitSubmitEditorPanelInfo &info);
QWidget *m_gitSubmitPanel;
LogChangeWidget *m_logChangeWidget;