@@ -204,12 +204,36 @@ namespace Core {
204204 SVS::StatusTextContext::setStatusContext (win, new SVS::StatusTextContext (win));
205205 SVS::StatusTextContext::setContextHelpContext (win, new SVS::StatusTextContext (win));
206206 d->projectDocumentContext ->openSaveProjectFileScenario ()->setWindow (win);
207+ static QIcon dspxIcon = [] {
208+ QIcon icon;
209+ for (const auto &file : QDir (" :/diffscope/icons/dspx" ).entryInfoList (QDir::Files)) {
210+ icon.addFile (file.absoluteFilePath ());
211+ }
212+ return icon;
213+ }();
214+ win->setIcon (QIcon (" :/diffscope/icons/dspx/24x24.png" ));
215+ QString path;
216+ if (d->projectDocumentContext ->fileLocker () && !d->projectDocumentContext ->fileLocker ()->path ().isEmpty ()) {
217+ path = d->projectDocumentContext ->fileLocker ()->path ();
218+ } else {
219+ path = tr (" Untitled" ) + " .dspx" ;
220+ }
221+ win->setFilePath (path);
207222 return win;
208223 }
209224 ProjectWindowInterface::ProjectWindowInterface (ProjectDocumentContext *projectDocumentContext, QObject *parent) : ProjectWindowInterface(*new ProjectWindowInterfacePrivate, parent) {
210225 Q_D (ProjectWindowInterface);
211226 m_instance = this ;
212227 d->projectDocumentContext = projectDocumentContext;
228+ if (d->projectDocumentContext ->fileLocker ()) {
229+ connect (d->projectDocumentContext ->fileLocker (), &FileLocker::pathChanged, this , [=, this ] {
230+ auto win = window ();
231+ if (!win)
232+ return ;
233+ auto path = d->projectDocumentContext ->fileLocker ()->path ();
234+ win->setFilePath (path.isEmpty () ? tr (" Untitled" ) + " .dspx" : path);
235+ });
236+ }
213237 }
214238 ProjectWindowInterface::ProjectWindowInterface (ProjectWindowInterfacePrivate &d, QObject *parent) : ActionWindowInterfaceBase(parent), d_ptr(&d) {
215239 d.q_ptr = this ;
0 commit comments