Commit 70f0e168 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

Git: Keep panel data when editor is changed

Change-Id: I3c6a1ff6206b5b412c9ae89eb9b8f5a27dab2e62
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 7e7fb224
......@@ -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
......
......@@ -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)
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment