]> git.sven.stormbind.net Git - sven/vym.git/blob - dockeditor.cpp
c6ef3eff14d02ee23a6a679c89a67d1299cf82af
[sven/vym.git] / dockeditor.cpp
1 #include "dockeditor.h"
2
3 #include "vymmodel.h"
4
5 DockEditor::DockEditor () { init (); }
6 DockEditor::DockEditor ( QString title, QWidget *p, VymModel *m):QDockWidget (title,p) 
7 {
8     editorTitle=title;
9     model=m;
10     init();
11 }
12
13 void DockEditor::init()
14 {
15     connect ( this, SIGNAL ( topLevelChanged ( bool ) ),
16               this, SLOT (changeTopLevel ( bool ) ) );
17 }
18
19 void DockEditor::changeTopLevel (bool topLevel) 
20 {
21     if (topLevel && model)
22         setWindowTitle (editorTitle+": "+model->getFileName() );
23     else        
24         setWindowTitle (editorTitle);
25 }