From fa634748980d22a1460bb849268904034e485118 Mon Sep 17 00:00:00 2001 From: mae <qt-info@nokia.com> Date: Fri, 3 Apr 2009 15:32:33 +0200 Subject: [PATCH] emacs functionality, but more creator-style names --- src/plugins/coreplugin/coreconstants.h | 6 ++-- .../editormanager/editormanager.cpp | 36 +++++++++---------- .../coreplugin/editormanager/editormanager.h | 6 ++-- .../coreplugin/editormanager/editorview.cpp | 1 - 4 files changed, 24 insertions(+), 25 deletions(-) diff --git a/src/plugins/coreplugin/coreconstants.h b/src/plugins/coreplugin/coreconstants.h index a93027ae98e..3c3903376a0 100644 --- a/src/plugins/coreplugin/coreconstants.h +++ b/src/plugins/coreplugin/coreconstants.h @@ -123,9 +123,9 @@ const char * const ZOOM_WINDOW = "QtCreator.ZoomWindow"; const char * const SPLIT = "QtCreator.Split"; const char * const SPLIT_SIDE_BY_SIDE = "QtCreator.SplitSideBySide"; -const char * const DELETE_WINDOW = "QtCreator.DeleteWindow"; -const char * const DELETE_OTHER_WINDOWS = "QtCreator.DeleteOtherWindows"; -const char * const GOTO_OTHER_WINDOW = "QtCreator.GotoOtherWindow"; +const char * const REMOVE_CURRENT_SPLIT = "QtCreator.RemoveCurrentSplit"; +const char * const REMOVE_ALL_SPLITS = "QtCreator.RemoveAllSplits"; +const char * const GOTO_OTHER_SPLIT = "QtCreator.GotoOtherSplit"; const char * const SAVEASDEFAULT = "QtCreator.SaveAsDefaultLayout"; const char * const RESTOREDEFAULT = "QtCreator.RestoreDefaultLayout"; const char * const CLOSE = "QtCreator.Close"; diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 00453003e43..8e79b50f6aa 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -154,9 +154,9 @@ struct EditorManagerPrivate { QAction *m_openInExternalEditorAction; QAction *m_splitAction; QAction *m_splitSideBySideAction; - QAction *m_deleteWindowAction; - QAction *m_deleteOtherWindowsAction; - QAction *m_gotoOtherWindowAction; + QAction *m_removeCurrentSplitAction; + QAction *m_removeAllSplitsAction; + QAction *m_gotoOtherSplitAction; QList<IEditor *> m_editorHistory; QList<EditLocation *> m_navigationHistory; @@ -342,23 +342,23 @@ EditorManager::EditorManager(ICore *core, QWidget *parent) : mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT); connect(m_d->m_splitSideBySideAction, SIGNAL(triggered()), this, SLOT(splitSideBySide())); - m_d->m_deleteWindowAction = new QAction(tr("Delete Window"), this); - cmd = am->registerAction(m_d->m_deleteWindowAction, Constants::DELETE_WINDOW, editManagerContext); + m_d->m_removeCurrentSplitAction = new QAction(tr("Remove Current Split"), this); + cmd = am->registerAction(m_d->m_removeCurrentSplitAction, Constants::REMOVE_CURRENT_SPLIT, editManagerContext); cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+E,0"))); mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT); - connect(m_d->m_deleteWindowAction, SIGNAL(triggered()), this, SLOT(deleteWindow())); + connect(m_d->m_removeCurrentSplitAction, SIGNAL(triggered()), this, SLOT(removeCurrentSplit())); - m_d->m_deleteOtherWindowsAction = new QAction(tr("Delete Other Windows"), this); - cmd = am->registerAction(m_d->m_deleteOtherWindowsAction, Constants::DELETE_OTHER_WINDOWS, editManagerContext); + m_d->m_removeAllSplitsAction = new QAction(tr("Remove All Splits"), this); + cmd = am->registerAction(m_d->m_removeAllSplitsAction, Constants::REMOVE_ALL_SPLITS, editManagerContext); cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+E,1"))); mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT); - connect(m_d->m_deleteOtherWindowsAction, SIGNAL(triggered()), this, SLOT(deleteOtherWindows())); + connect(m_d->m_removeAllSplitsAction, SIGNAL(triggered()), this, SLOT(removeAllSplits())); - m_d->m_gotoOtherWindowAction = new QAction(tr("Goto other window"), this); - cmd = am->registerAction(m_d->m_gotoOtherWindowAction, Constants::GOTO_OTHER_WINDOW, editManagerContext); + m_d->m_gotoOtherSplitAction = new QAction(tr("Goto Other Split"), this); + cmd = am->registerAction(m_d->m_gotoOtherSplitAction, Constants::GOTO_OTHER_SPLIT, editManagerContext); cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+E,o"))); mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT); - connect(m_d->m_gotoOtherWindowAction, SIGNAL(triggered()), this, SLOT(gotoOtherWindow())); + connect(m_d->m_gotoOtherSplitAction, SIGNAL(triggered()), this, SLOT(gotoOtherSplit())); ActionContainer *medit = am->actionContainer(Constants::M_EDIT); @@ -1351,9 +1351,9 @@ void EditorManager::updateActions() m_d->m_goForwardAction->setEnabled(m_d->currentNavigationHistoryPosition < m_d->m_navigationHistory.size()-1); bool hasSplitter = m_d->m_splitter->isSplitter(); - m_d->m_deleteWindowAction->setEnabled(hasSplitter); - m_d->m_deleteOtherWindowsAction->setEnabled(hasSplitter); - m_d->m_gotoOtherWindowAction->setEnabled(hasSplitter); + m_d->m_removeCurrentSplitAction->setEnabled(hasSplitter); + m_d->m_removeAllSplitsAction->setEnabled(hasSplitter); + m_d->m_gotoOtherSplitAction->setEnabled(hasSplitter); m_d->m_openInExternalEditorAction->setEnabled(curEditor != 0); } @@ -1796,7 +1796,7 @@ void EditorManager::splitSideBySide() split(Qt::Horizontal); } -void EditorManager::deleteWindow() +void EditorManager::removeCurrentSplit() { SplitterOrView *viewToClose = m_d->m_currentView; if (!viewToClose && m_d->m_currentEditor) @@ -1809,7 +1809,7 @@ void EditorManager::deleteWindow() updateActions(); } -void EditorManager::deleteOtherWindows() +void EditorManager::removeAllSplits() { IEditor *editor = m_d->m_currentEditor; if (editor && m_d->m_editorModel->isDuplicate(editor)) @@ -1820,7 +1820,7 @@ void EditorManager::deleteOtherWindows() activateEditor(editor); } -void EditorManager::gotoOtherWindow() +void EditorManager::gotoOtherSplit() { if (m_d->m_splitter->isSplitter()) { SplitterOrView *currentView = m_d->m_currentView; diff --git a/src/plugins/coreplugin/editormanager/editormanager.h b/src/plugins/coreplugin/editormanager/editormanager.h index d30390e593a..fa4b05740e7 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.h +++ b/src/plugins/coreplugin/editormanager/editormanager.h @@ -211,9 +211,9 @@ private slots: void split(Qt::Orientation orientation); void split(); void splitSideBySide(); - void deleteWindow(); - void deleteOtherWindows(); - void gotoOtherWindow(); + void removeCurrentSplit(); + void removeAllSplits(); + void gotoOtherSplit(); private: QList<IFile *> filesForEditors(QList<IEditor *> editors) const; diff --git a/src/plugins/coreplugin/editormanager/editorview.cpp b/src/plugins/coreplugin/editormanager/editorview.cpp index d77fa22b041..92ed402dcbc 100644 --- a/src/plugins/coreplugin/editormanager/editorview.cpp +++ b/src/plugins/coreplugin/editormanager/editorview.cpp @@ -520,7 +520,6 @@ void EditorView::removeEditor(IEditor *editor) m_container->removeWidget(editor->widget()); m_widgetEditorMap.remove(editor->widget()); - qDebug() << "EditorView::removeEditor" << editor << " set 0 parent on widget" << editor->widget(); editor->widget()->setParent(0); disconnect(editor, SIGNAL(changed()), this, SLOT(updateEditorStatus())); QToolBar *toolBar = editor->toolBar(); -- GitLab