]> git.lyx.org Git - lyx.git/blob - src/frontends/qt/DialogView.cpp
Merged compilation does not exist anymore.
[lyx.git] / src / frontends / qt / DialogView.cpp
1 // -*- C++ -*-
2 /**
3  * \file DialogView.cpp
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Abdelrazak Younes
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #include <config.h>
13
14 #include "DialogView.h"
15 #include "GuiView.h"
16
17 #include <QCloseEvent>
18
19
20 namespace lyx {
21 namespace frontend {
22
23 DialogView::DialogView(GuiView & lv, QString const & name, QString const & title)
24         : QDialog(&lv), Dialog(lv, name, title)
25 {
26         connect(&lv, SIGNAL(bufferViewChanged()),
27                 this, SLOT(onBufferViewChanged()));
28         connect(&lv, SIGNAL(closing(int)),
29                 this, SLOT(onClosing(int)));
30
31         // remove question marks from Windows dialogs
32         setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
33 }
34
35
36 void DialogView::closeEvent(QCloseEvent * ev)
37 {
38         clearParams();
39         Dialog::disconnect();
40         ev->accept();
41 }
42
43
44 void DialogView::hideEvent(QHideEvent * ev)
45 {
46         if (!ev->spontaneous()) {
47                 clearParams();
48                 Dialog::disconnect();
49                 ev->accept();
50         }
51 }
52
53 } // namespace frontend
54 } // namespace lyx
55
56 #include "moc_DialogView.cpp"