Version: CVS (using KDE KDE 3.1.1a) Installed from: Compiled From Sources Compiler: gcc 3.2 OS: Linux When one works with multiple related projects and even more when debugging a project using files of another opened project, one should be able to know easily what kdevelop instance she his working on. One way to do that would be to display the project name in the title of the window along with the active filename and the application name
Subject: kdevelop/src CVS commit by dagerbo: Show project name in window caption. Very useful for those of us who keep ending up with multiple KDevelop windows open.. ;) CCMAIL: 62375-done@bugs.kde.org M +17 -0 mainwindow.cpp 1.69 M +1 -0 mainwindow.h 1.21 --- kdevelop/src/mainwindow.cpp #1.68:1.69 @@ -41,4 +41,5 @@ #include <kiconloader.h> +#include <kdevproject.h> #include "projectmanager.h" #include "partcontroller.h" @@ -1425,3 +1426,19 @@ void MainWindow::setWindowMenu(QPopupMen } +void MainWindow::setCaption( const QString & caption ) +{ + if ( KDevProject * project = API::getInstance()->project() ) + { + QString projectname = project->projectName(); + + QString suffix(".kdevelop"); + if ( projectname.endsWith( suffix ) ) + { + projectname.truncate( projectname.length() - suffix.length() ); + } + + KMdiMainFrm::setCaption( projectname + " - " + caption ); + } +} + #include "mainwindow.moc" --- kdevelop/src/mainwindow.h #1.20:1.21 @@ -88,4 +88,5 @@ public: public slots: + void setCaption( const QString &); void createGUI(KParts::Part *part); void gotoNextWindow();
Thank you Jens, it's quite exactly the solving of my wish. But one case is not treated: when all editor windows are closed, the only caption is "Kdevelop" while it should, for example, "Kdevelop - Project name" or maybe only "Project name"