]> git.sven.stormbind.net Git - sven/vym.git/blob - src/dockeditor.cpp
Replace Pierre as the maintainer
[sven/vym.git] / src / 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)
7     : QDockWidget(title, p)
8 {
9     editorTitle = title;
10     model = m;
11     init();
12 }
13
14 void DockEditor::init()
15 {
16     connect(this, SIGNAL(topLevelChanged(bool)), this,
17             SLOT(changeTopLevel(bool)));
18 }
19
20 void DockEditor::changeTopLevel(bool topLevel)
21 {
22     if (topLevel && model)
23         setWindowTitle(editorTitle + ": " + model->getFileName());
24     else
25         setWindowTitle(editorTitle);
26 }