forked from qt-creator/qt-creator
add current editor filename (and, on macosx, proxy icon) to titlebar
This commit is contained in:
@@ -770,6 +770,8 @@ bool EditorManager::closeEditors(const QList<IEditor*> editorsToClose, bool askA
|
|||||||
setCurrentView(m_d->m_splitter->findView(currentView));
|
setCurrentView(m_d->m_splitter->findView(currentView));
|
||||||
if (IEditor *e = currentView->currentEditor())
|
if (IEditor *e = currentView->currentEditor())
|
||||||
activateEditor(currentView, e);
|
activateEditor(currentView, e);
|
||||||
|
else
|
||||||
|
emit currentEditorChanged(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return !closingFailed;
|
return !closingFailed;
|
||||||
|
|||||||
@@ -393,6 +393,8 @@ SessionManager::SessionManager(QObject *parent)
|
|||||||
this, SLOT(setEditorCodec(Core::IEditor *, QString)));
|
this, SLOT(setEditorCodec(Core::IEditor *, QString)));
|
||||||
connect(ProjectExplorerPlugin::instance(), SIGNAL(currentProjectChanged(ProjectExplorer::Project *)),
|
connect(ProjectExplorerPlugin::instance(), SIGNAL(currentProjectChanged(ProjectExplorer::Project *)),
|
||||||
this, SLOT(updateWindowTitle()));
|
this, SLOT(updateWindowTitle()));
|
||||||
|
connect(m_core->editorManager(), SIGNAL(currentEditorChanged(Core::IEditor*)),
|
||||||
|
this, SLOT(updateWindowTitle()));
|
||||||
}
|
}
|
||||||
|
|
||||||
SessionManager::~SessionManager()
|
SessionManager::~SessionManager()
|
||||||
@@ -921,6 +923,13 @@ void SessionManager::updateWindowTitle()
|
|||||||
if (Project *currentProject = ProjectExplorerPlugin::instance()->currentProject())
|
if (Project *currentProject = ProjectExplorerPlugin::instance()->currentProject())
|
||||||
windowTitle.prepend(currentProject->name() + " - ");
|
windowTitle.prepend(currentProject->name() + " - ");
|
||||||
}
|
}
|
||||||
|
if (m_core->editorManager()->currentEditor()) {
|
||||||
|
QFileInfo fi(m_core->editorManager()->currentEditor()->file()->fileName());
|
||||||
|
windowTitle.prepend(fi.fileName() + " - ");
|
||||||
|
m_core->mainWindow()->setWindowFilePath(fi.absoluteFilePath());
|
||||||
|
} else {
|
||||||
|
m_core->mainWindow()->setWindowFilePath(QString());
|
||||||
|
}
|
||||||
m_core->mainWindow()->setWindowTitle(windowTitle);
|
m_core->mainWindow()->setWindowTitle(windowTitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user