]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/Dialogs2.C
Use PanelStack for the document dialog too
[lyx.git] / src / frontends / qt2 / Dialogs2.C
1 /**
2  * \file qt2/Dialogs2.C
3  * Copyright 1995 Matthias Ettrich
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Allan Rae
8  * \author Angus Leeming
9  *
10  * Full author contact details are available in file CREDITS
11  */
12
13 #include <config.h>
14
15 #include "Dialogs.h"
16 #include "controllers/GUI.h"
17 #include "ButtonController.h"
18
19 #include "ControlDocument.h"
20 #include "ControlForks.h"
21 #include "ControlPrefs.h"
22 #include "ControlPrint.h"
23 #include "ControlSearch.h"
24 #include "ControlSendto.h"
25 #include "ControlSpellchecker.h"
26 #include "ControlTexinfo.h"
27
28 #include "QCharacter.h"
29 #include "QCharacterDialog.h"
30 #include "QDocument.h"
31 #include "QDocumentDialog.h"
32 //#include "QForks.h"
33 // Here would be an appropriate point to lecture on the evils
34 // of the Qt headers, those most fucked up of disgusting ratholes.
35 // But I won't.
36 #undef signals
37 #include "QPrefs.h"
38 #include "QPrefsDialog.h"
39 #include "QPrint.h"
40 #include "QLPrintDialog.h"
41 #include "QSearch.h"
42 #include "QSearchDialog.h"
43 #include "QSendto.h"
44 #include "QSendtoDialog.h"
45 #include "QSpellchecker.h"
46 #include "QSpellcheckerDialog.h"
47 #include "QTexinfo.h"
48 #include "QTexinfoDialog.h"
49
50 #include "Qt2BC.h"
51
52
53
54 typedef GUI<ControlDocument, QDocument, NoRepeatedApplyReadOnlyPolicy, Qt2BC>
55 DocumentDialog;
56
57 typedef GUI<ControlPrefs, QPrefs, OkApplyCancelPolicy, Qt2BC>
58 PrefsDialog;
59
60 typedef GUI<ControlPrint, QPrint, OkApplyCancelPolicy, Qt2BC>
61 PrintDialog;
62
63 typedef GUI<ControlSearch, QSearch, NoRepeatedApplyReadOnlyPolicy, Qt2BC>
64 SearchDialog;
65
66 typedef GUI<ControlSendto, QSendto, OkApplyCancelPolicy, Qt2BC>
67 SendtoDialog;
68
69 typedef GUI<ControlSpellchecker, QSpellchecker, NoRepeatedApplyReadOnlyPolicy, Qt2BC>
70 SpellcheckerDialog;
71
72 typedef GUI<ControlTexinfo, QTexinfo, OkCancelPolicy, Qt2BC>
73 TexinfoDialog;
74
75 struct Dialogs::Impl {
76         Impl(LyXView & lv, Dialogs & d);
77
78         DocumentDialog      document;
79         PrefsDialog         prefs;
80         PrintDialog         print;
81         SearchDialog        search;
82         SendtoDialog        sendto;
83         SpellcheckerDialog  spellchecker;
84         TexinfoDialog       texinfo;
85 };
86
87
88 Dialogs::Impl::Impl(LyXView & lv, Dialogs & d)
89         : document(lv, d),
90           prefs(lv, d),
91           print(lv, d),
92           search(lv, d),
93           sendto(lv, d),
94           spellchecker(lv, d),
95           texinfo(lv, d)
96 {}
97
98
99 void Dialogs::init_pimpl()
100 {
101         pimpl_ = new Impl(lyxview_, *this);
102 }
103
104
105 Dialogs::~Dialogs()
106 {
107         delete pimpl_;
108 }
109
110
111 void Dialogs::showDocument()
112 {
113         pimpl_->document.controller().show();
114 }
115
116
117 void Dialogs::showForks()
118 {}
119
120
121 void Dialogs::showMathPanel()
122 {
123         // FIXME FIXME FIXME
124         extern void createMathPanel();
125
126         createMathPanel();
127 }
128
129
130 void Dialogs::showPreamble()
131 {
132         pimpl_->document.controller().show();
133         // Oh Angus, won't you help a poor child ?
134         //pimpl_->document.view()->showPreamble();
135 }
136
137
138 void Dialogs::showPreferences()
139 {
140         pimpl_->prefs.controller().show();
141 }
142
143
144 void Dialogs::showPrint()
145 {
146         pimpl_->print.controller().show();
147 }
148
149
150 void Dialogs::showSearch()
151 {
152         pimpl_->search.controller().show();
153 }
154
155
156 void Dialogs::showSendto()
157 {
158         pimpl_->sendto.controller().show();
159 }
160
161
162 void Dialogs::showSpellchecker()
163 {
164         pimpl_->spellchecker.controller().show();
165 }
166
167
168 void Dialogs::showTexinfo()
169 {
170         pimpl_->texinfo.controller().show();
171 }