summaryrefslogtreecommitdiff
path: root/src/plugins/clearcase
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@digia.com>2013-05-31 12:52:53 +0200
committerEike Ziller <eike.ziller@digia.com>2013-06-05 09:43:14 +0200
commit7c8db79817ed436176f6055b5c6f8ccf6df16c4c (patch)
tree28c65055a97c872468055db6e96fb51f70e83f1d /src/plugins/clearcase
parentf99ce422b475c000e1bbdadf13da232dd54d9cca (diff)
downloadqt-creator-7c8db79817ed436176f6055b5c6f8ccf6df16c4c.tar.gz
Switch less often to edit mode
This change * Removes IMode::type, ModeManager::activateModeType, and IEditor::preferredModeType, and adds IEditor::isDesignModePreferred instead * Adapts the mode switching code in EditorManager to handle multiple windows, for example switching to edit mode should only happen if the editor/view is in the main window. Otherwise the editor window should be raised and focused * Renames EditorManager::NoActivate --> DoNotChangeCurrentEditor * Reverts the EditorManager::ModeSwitch logic to switch mode or make the current editor visible by default, introducing DoNotMakeVisible flag instead * Fixes a few instances where EditorManager::ModeSwitch should have been used One non-trivial problem left: If you open a .ui file and switch to an external editor window, edit mode is activated, because the current editor no longer is a .ui file, which means that the design mode gets deactivated. Change-Id: I76c5c2391eb4090143b778fb103acff3a5a1ff41 Reviewed-by: David Schulz <david.schulz@digia.com>
Diffstat (limited to 'src/plugins/clearcase')
-rw-r--r--src/plugins/clearcase/clearcaseplugin.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/plugins/clearcase/clearcaseplugin.cpp b/src/plugins/clearcase/clearcaseplugin.cpp
index d7614bf67e..ee881e3e4b 100644
--- a/src/plugins/clearcase/clearcaseplugin.cpp
+++ b/src/plugins/clearcase/clearcaseplugin.cpp
@@ -687,9 +687,7 @@ QString ClearCasePlugin::ccGetFileActivity(const QString &workingDir, const QStr
ClearCaseSubmitEditor *ClearCasePlugin::openClearCaseSubmitEditor(const QString &fileName, bool isUcm)
{
Core::IEditor *editor =
- Core::EditorManager::openEditor(fileName,
- Constants::CLEARCASECHECKINEDITOR_ID,
- Core::EditorManager::ModeSwitch);
+ Core::EditorManager::openEditor(fileName, Constants::CLEARCASECHECKINEDITOR_ID);
ClearCaseSubmitEditor *submitEditor = qobject_cast<ClearCaseSubmitEditor*>(editor);
QTC_CHECK(submitEditor);
submitEditor->registerActions(m_submitUndoAction, m_submitRedoAction, m_checkInSelectedAction, m_checkInDiffAction);
@@ -932,7 +930,7 @@ void ClearCasePlugin::ccDiffWithPred(const QString &workingDir, const QStringLis
// Show in the same editor if diff has been executed before
if (Core::IEditor *existingEditor = VcsBase::VcsBaseEditorWidget::locateEditorByTag(tag)) {
existingEditor->createNew(result);
- Core::EditorManager::activateEditor(existingEditor, Core::EditorManager::ModeSwitch);
+ Core::EditorManager::activateEditor(existingEditor);
setDiffBaseDirectory(existingEditor, workingDir);
return;
}
@@ -1192,7 +1190,7 @@ void ClearCasePlugin::history(const QString &workingDir,
const QString tag = VcsBase::VcsBaseEditorWidget::editorTag(VcsBase::LogOutput, workingDir, files);
if (Core::IEditor *editor = VcsBase::VcsBaseEditorWidget::locateEditorByTag(tag)) {
editor->createNew(response.stdOut);
- Core::EditorManager::activateEditor(editor, Core::EditorManager::ModeSwitch);
+ Core::EditorManager::activateEditor(editor);
} else {
const QString title = QString::fromLatin1("cc history %1").arg(id);
const QString source = VcsBase::VcsBaseEditorWidget::getSource(workingDir, files);
@@ -1305,7 +1303,7 @@ void ClearCasePlugin::vcsAnnotate(const QString &workingDir, const QString &file
if (Core::IEditor *editor = VcsBase::VcsBaseEditorWidget::locateEditorByTag(tag)) {
editor->createNew(res);
VcsBase::VcsBaseEditorWidget::gotoLineOfEditor(editor, lineNumber);
- Core::EditorManager::activateEditor(editor, Core::EditorManager::ModeSwitch);
+ Core::EditorManager::activateEditor(editor);
} else {
const QString title = QString::fromLatin1("cc annotate %1").arg(id);
Core::IEditor *newEditor = showOutputInEditor(title, res, VcsBase::AnnotateOutput, source, codec);
@@ -1341,7 +1339,7 @@ void ClearCasePlugin::describe(const QString &source, const QString &changeNr)
const QString tag = VcsBase::VcsBaseEditorWidget::editorTag(VcsBase::DiffOutput, source, QStringList(), changeNr);
if (Core::IEditor *editor = VcsBase::VcsBaseEditorWidget::locateEditorByTag(tag)) {
editor->createNew(description);
- Core::EditorManager::activateEditor(editor, Core::EditorManager::ModeSwitch);
+ Core::EditorManager::activateEditor(editor);
} else {
const QString title = QString::fromLatin1("cc describe %1").arg(id);
Core::IEditor *newEditor = showOutputInEditor(title, description, VcsBase::DiffOutput, source, codec);
@@ -1413,7 +1411,7 @@ Core::IEditor *ClearCasePlugin::showOutputInEditor(const QString& title, const Q
if (codec)
e->setCodec(codec);
Core::IEditor *ie = e->editor();
- Core::EditorManager::activateEditor(ie, Core::EditorManager::ModeSwitch);
+ Core::EditorManager::activateEditor(ie);
return ie;
}