Commit fa634748 authored by mae's avatar mae

emacs functionality, but more creator-style names

parent be736edd
......@@ -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";
......
......@@ -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;
......
......@@ -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;
......
......@@ -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();
......
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