forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/3.2'
Conflicts: qtcreator.pri qtcreator.qbs src/plugins/coreplugin/editormanager/editormanager.cpp src/plugins/projectexplorer/editorconfiguration.cpp src/plugins/projectexplorer/projectfilewizardextension.cpp src/plugins/qmakeandroidsupport/createandroidmanifestwizard.cpp Change-Id: I8de0f6fcdd8d214fbc14e79f74cb0206e6e2c6c1
This commit is contained in:
@@ -154,6 +154,8 @@ public:
|
||||
|
||||
public slots:
|
||||
void setDisplaySettings(const DisplaySettings &ds);
|
||||
void saveStateRequested();
|
||||
void restoreStateRequested();
|
||||
|
||||
signals:
|
||||
void jumpToOriginalFileRequested(int diffFileIndex,
|
||||
@@ -205,6 +207,7 @@ private:
|
||||
QColor m_fileLineForeground;
|
||||
QColor m_chunkLineForeground;
|
||||
QColor m_textForeground;
|
||||
QByteArray m_state;
|
||||
// MultiHighlighter *m_highlighter;
|
||||
};
|
||||
|
||||
@@ -338,6 +341,23 @@ SideDiffEditorWidget::SideDiffEditorWidget(QWidget *parent)
|
||||
// baseTextDocument()->setSyntaxHighlighter(m_highlighter);
|
||||
}
|
||||
|
||||
void SideDiffEditorWidget::saveStateRequested()
|
||||
{
|
||||
if (!m_state.isNull())
|
||||
return;
|
||||
|
||||
m_state = saveState();
|
||||
}
|
||||
|
||||
void SideDiffEditorWidget::restoreStateRequested()
|
||||
{
|
||||
if (m_state.isNull())
|
||||
return;
|
||||
|
||||
restoreState(m_state);
|
||||
m_state.clear();
|
||||
}
|
||||
|
||||
void SideDiffEditorWidget::setDisplaySettings(const DisplaySettings &ds)
|
||||
{
|
||||
DisplaySettings settings = displaySettings();
|
||||
@@ -836,6 +856,7 @@ SideBySideDiffEditorWidget::SideBySideDiffEditorWidget(QWidget *parent)
|
||||
QVBoxLayout *l = new QVBoxLayout(this);
|
||||
l->setMargin(0);
|
||||
l->addWidget(m_splitter);
|
||||
setFocusProxy(m_rightEditor);
|
||||
|
||||
clear(tr("No controller"));
|
||||
}
|
||||
@@ -856,6 +877,14 @@ void SideBySideDiffEditorWidget::setDiffEditorGuiController(
|
||||
this, SLOT(clearAll(QString)));
|
||||
disconnect(m_controller, SIGNAL(diffFilesChanged(QList<FileData>,QString)),
|
||||
this, SLOT(setDiff(QList<FileData>,QString)));
|
||||
disconnect(m_controller, SIGNAL(saveStateRequested()),
|
||||
m_leftEditor, SLOT(saveStateRequested()));
|
||||
disconnect(m_controller, SIGNAL(saveStateRequested()),
|
||||
m_rightEditor, SLOT(saveStateRequested()));
|
||||
disconnect(m_controller, SIGNAL(restoreStateRequested()),
|
||||
m_leftEditor, SLOT(restoreStateRequested()));
|
||||
disconnect(m_controller, SIGNAL(restoreStateRequested()),
|
||||
m_rightEditor, SLOT(restoreStateRequested()));
|
||||
|
||||
disconnect(m_guiController, SIGNAL(currentDiffFileIndexChanged(int)),
|
||||
this, SLOT(setCurrentDiffFileIndex(int)));
|
||||
@@ -871,6 +900,14 @@ void SideBySideDiffEditorWidget::setDiffEditorGuiController(
|
||||
this, SLOT(clearAll(QString)));
|
||||
connect(m_controller, SIGNAL(diffFilesChanged(QList<FileData>,QString)),
|
||||
this, SLOT(setDiff(QList<FileData>,QString)));
|
||||
connect(m_controller, SIGNAL(saveStateRequested()),
|
||||
m_leftEditor, SLOT(saveStateRequested()));
|
||||
connect(m_controller, SIGNAL(saveStateRequested()),
|
||||
m_rightEditor, SLOT(saveStateRequested()));
|
||||
connect(m_controller, SIGNAL(restoreStateRequested()),
|
||||
m_leftEditor, SLOT(restoreStateRequested()));
|
||||
connect(m_controller, SIGNAL(restoreStateRequested()),
|
||||
m_rightEditor, SLOT(restoreStateRequested()));
|
||||
|
||||
connect(m_guiController, SIGNAL(currentDiffFileIndexChanged(int)),
|
||||
this, SLOT(setCurrentDiffFileIndex(int)));
|
||||
@@ -936,11 +973,6 @@ void SideBySideDiffEditorWidget::setCurrentDiffFileIndex(int diffFileIndex)
|
||||
|
||||
void SideBySideDiffEditorWidget::showDiff()
|
||||
{
|
||||
// TODO: remember the line number of the line in the middle
|
||||
const int verticalValue = m_leftEditor->verticalScrollBar()->value();
|
||||
const int leftHorizontalValue = m_leftEditor->horizontalScrollBar()->value();
|
||||
const int rightHorizontalValue = m_rightEditor->horizontalScrollBar()->value();
|
||||
|
||||
clear(tr("No difference"));
|
||||
|
||||
QMap<int, QList<DiffSelection> > leftFormats;
|
||||
@@ -1151,11 +1183,6 @@ void SideBySideDiffEditorWidget::showDiff()
|
||||
}
|
||||
m_foldingBlocker = false;
|
||||
*/
|
||||
m_leftEditor->verticalScrollBar()->setValue(verticalValue);
|
||||
m_rightEditor->verticalScrollBar()->setValue(verticalValue);
|
||||
m_leftEditor->horizontalScrollBar()->setValue(leftHorizontalValue);
|
||||
m_rightEditor->horizontalScrollBar()->setValue(rightHorizontalValue);
|
||||
|
||||
// m_leftEditor->updateFoldingHighlight(QPoint(-1, -1));
|
||||
// m_rightEditor->updateFoldingHighlight(QPoint(-1, -1));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user