]> git.lyx.org Git - features.git/blob - src/frontends/gtk/Dialogs.C
* remove various xforms relicts, in particular:
[features.git] / src / frontends / gtk / Dialogs.C
1 /**
2 // * \file gtk/Dialogs.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Angus Leeming
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 // Too hard to make concept checks work with this file
14 #ifdef _GLIBCXX_CONCEPT_CHECKS
15 #undef _GLIBCXX_CONCEPT_CHECKS
16 #endif
17 #ifdef _GLIBCPP_CONCEPT_CHECKS
18 #undef _GLIBCPP_CONCEPT_CHECKS
19 #endif
20
21 #include "Dialogs.h"
22 #include "Dialog.h"
23
24 #include "ControlAboutlyx.h"
25 #include "ControlBibtex.h"
26 #include "ControlBox.h"
27 #include "ControlBranch.h"
28 #include "ControlChanges.h"
29 #include "ControlCharacter.h"
30 #include "ControlCitation.h"
31 #include "ControlCommand.h"
32 #include "ControlDocument.h"
33 #include "ControlErrorList.h"
34 #include "ControlERT.h"
35 #include "ControlExternal.h"
36 #include "ControlFloat.h"
37 #include "ControlGraphics.h"
38 #include "ControlInclude.h"
39 #include "ControlLog.h"
40 #include "ControlMath.h"
41 #include "ControlNote.h"
42 #include "ControlParagraph.h"
43 #include "ControlPrefs.h"
44 #include "ControlPrint.h"
45 #include "ControlRef.h"
46 #include "ControlSearch.h"
47 #include "ControlSendto.h"
48 #include "ControlShowFile.h"
49 #include "ControlSpellchecker.h"
50 #include "ControlTabular.h"
51 #include "ControlTabularCreate.h"
52 #include "ControlTexinfo.h"
53 #include "ControlToc.h"
54 #include "ControlVSpace.h"
55 #include "ControlWrap.h"
56
57 #include "GAboutlyx.h"
58 #include "GText.h"
59 #include "GMathDelim.h"
60 #include "GBibItem.h"
61 #include "GBibtex.h"
62 #include "GBox.h"
63 #include "GBranch.h"
64 #include "GChanges.h"
65 #include "GCharacter.h"
66 #include "GCitation.h"
67 #include "GDocument.h"
68 #include "GErrorList.h"
69 #include "GERT.h"
70 #include "GExternal.h"
71 #include "GFloat.h"
72 #include "GGraphics.h"
73 #include "GInclude.h"
74 #include "GLog.h"
75 #include "GMathPanel.h"
76 //#include "FormMathsBitmap.h"
77 #include "GMathsMatrix.h"
78 //#include "FormMathsSpace.h"
79 //#include "FormMathsStyle.h"
80 #include "GNote.h"
81 #include "GParagraph.h"
82 #include "GPreferences.h"
83 #include "GPrint.h"
84 #include "GRef.h"
85 #include "GSearch.h"
86 #include "GSendto.h"
87 #include "GTabular.h"
88 #include "GTexinfo.h"
89 #include "GShowFile.h"
90 #include "GSpellchecker.h"
91 #include "GTableCreate.h"
92 #include "GToc.h"
93 #include "GUrl.h"
94 #include "GVSpace.h"
95 #include "GWrap.h"
96
97 #ifdef HAVE_LIBAIKSAURUS
98 #include "ControlThesaurus.h"
99 #include "GThesaurus.h"
100 #endif
101
102 #include "ButtonController.h"
103
104 #include "arrows.xbm"
105 #include "bop.xbm"
106 #include "brel.xbm"
107 #include "deco.xbm"
108 #include "dots.xbm"
109 #include "greek.xbm"
110 #include "misc.xbm"
111 #include "varsz.xbm"
112
113 #include "ams_misc.xbm"
114 #include "ams_arrows.xbm"
115 #include "ams_rel.xbm"
116 #include "ams_nrel.xbm"
117 #include "ams_ops.xbm"
118
119 #include <boost/assert.hpp>
120 #include <vector>
121
122 using std::string;
123
124 using namespace lyx::frontend;
125
126 namespace {
127
128 //FormMathsBitmap * createFormBitmap(Dialog & parent, string const & title,
129 //                                 char const * const * data, int size)
130 //{
131 //      char const * const * const end = data + size;
132 //      return new FormMathsBitmap(parent, title, std::vector<string>(data, end));
133 //}
134
135
136 char const * const dialognames[] = {
137 "aboutlyx", "bibitem", "bibtex", "box", "branch", "changes", "character",
138 "citation", "document", "errorlist" , "ert", "external", "file",
139 "findreplace", "float", "graphics", "include", "index", "label", "log",
140 "mathpanel", "mathaccents", "matharrows", "mathoperators", "mathrelations",
141 "mathgreek", "mathmisc", "mathdots", "mathbigoperators", "mathamsmisc",
142 "mathamsarrows", "mathamsrelations", "mathamsnegatedrelations",
143 "mathamsoperators", "mathdelimiter", "mathmatrix", "mathspace", "mathstyle",
144 "note", "paragraph", "prefs", "print", "ref", "sendto",
145 "spellchecker", "tabular", "tabularcreate", "texinfo",
146
147 #ifdef HAVE_LIBAIKSAURUS
148 "thesaurus",
149 #endif
150
151 "toc", "url", "vspace", "wrap" };
152
153 char const * const * const end_dialognames =
154         dialognames + (sizeof(dialognames) / sizeof(char *));
155
156 struct cmpCStr {
157         cmpCStr(char const * name) : name_(name) {}
158         bool operator()(char const * other) {
159                 return strcmp(other, name_) == 0;
160         }
161 private:
162         char const * name_;
163 };
164
165 } // namespace anon
166
167
168 bool Dialogs::isValidName(string const & name) const
169 {
170         return std::find_if(dialognames, end_dialognames,
171                             cmpCStr(name.c_str())) != end_dialognames;
172 }
173
174
175 Dialogs::DialogPtr Dialogs::build(string const & name)
176 {
177         BOOST_ASSERT(isValidName(name));
178
179         DialogPtr dialog(new Dialog(lyxview_, name));
180
181         if (name == "aboutlyx") {
182                 dialog->bc().view(new GBC(dialog->bc()));
183                 dialog->setController(new ControlAboutlyx(*dialog));
184                 dialog->setView(new GAboutlyx(*dialog));
185                 dialog->bc().bp(new OkCancelPolicy);
186         } else if (name == "bibitem") {
187                 dialog->bc().view(new GBC(dialog->bc()));
188                 dialog->setController(new ControlCommand(*dialog, name));
189                 dialog->setView(new GBibItem(*dialog));
190                 dialog->bc().bp(new OkCancelReadOnlyPolicy);
191         } else if (name == "bibtex") {
192                 dialog->bc().view(new GBC(dialog->bc()));
193                 dialog->setController(new ControlBibtex(*dialog));
194                 dialog->setView(new GBibtex(*dialog));
195                 dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
196         } else if (name == "box") {
197                 dialog->bc().view(new GBC(dialog->bc()));
198                 dialog->setController(new ControlBox(*dialog));
199                 dialog->setView(new GBox(*dialog));
200                 dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
201         } else if (name == "changes") {
202                 dialog->bc().view(new GBC(dialog->bc()));
203                 dialog->setController(new ControlChanges(*dialog));
204                 dialog->setView(new GChanges(*dialog));
205                 dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
206         } else if (name == "character") {
207                 dialog->bc().view(new GBC(dialog->bc()));
208                 dialog->setController(new ControlCharacter(*dialog));
209                 dialog->setView(new GCharacter(*dialog));
210                 dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
211         } else if (name == "citation") {
212                 dialog->bc().view(new GBC(dialog->bc()));
213                 dialog->setController(new ControlCitation(*dialog));
214                 dialog->setView(new GCitation(*dialog));
215                 dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
216         } else if (name == "document") {
217                 dialog->bc().view(new GBC(dialog->bc()));
218                 dialog->setController(new ControlDocument(*dialog));
219                 dialog->setView(new GDocument(*dialog));
220                 dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
221         } else if (name == "errorlist") {
222                 dialog->bc().view(new GBC(dialog->bc()));
223                 dialog->setController(new ControlErrorList(*dialog));
224                 dialog->setView(new GErrorList(*dialog));
225                 dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
226         } else if (name == "ert") {
227                 dialog->bc().view(new GBC(dialog->bc()));
228                 dialog->setController(new ControlERT(*dialog));
229                 dialog->setView(new GERT(*dialog));
230                 dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
231         } else if (name == "external") {
232                 dialog->bc().view(new GBC(dialog->bc()));
233                 dialog->setController(new ControlExternal(*dialog));
234                 dialog->setView(new GExternal(*dialog));
235                 dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
236         } else if (name == "file") {
237                 dialog->bc().view(new GBC(dialog->bc()));
238                 dialog->setController(new ControlShowFile(*dialog));
239                 dialog->setView(new GShowFile(*dialog));
240                 dialog->bc().bp(new OkCancelPolicy);
241         } else if (name == "findreplace") {
242                 dialog->bc().view(new GBC(dialog->bc()));
243                 dialog->setController(new ControlSearch(*dialog));
244                 dialog->setView(new GSearch(*dialog));
245                 dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
246         } else if (name == "float") {
247                 dialog->bc().view(new GBC(dialog->bc()));
248                 dialog->setController(new ControlFloat(*dialog));
249                 dialog->setView(new GFloat(*dialog));
250                 dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
251         } else if (name == "graphics") {
252                 dialog->bc().view(new GBC(dialog->bc()));
253                 dialog->setController(new ControlGraphics(*dialog));
254                 dialog->setView(new GGraphics(*dialog));
255                 dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
256         } else if (name == "include") {
257                 dialog->bc().view(new GBC(dialog->bc()));
258                 dialog->setController(new ControlInclude(*dialog));
259                 dialog->setView(new GInclude(*dialog));
260                 dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
261         } else if (name == "index") {
262                 dialog->bc().view(new GBC(dialog->bc()));
263                 dialog->setController(new ControlCommand(*dialog, name));
264                 dialog->setView(new GText(*dialog,
265                                           _("Index Entry"), _("Keyword:|#K")));
266                 dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
267         } else if (name == "label") {
268                 dialog->bc().view(new GBC(dialog->bc()));
269                 dialog->setController(new ControlCommand(*dialog, name));
270                 dialog->setView(new GText(*dialog,
271                                           _("Label"), _("Label:|#L")));
272                 dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
273         } else if (name == "log") {
274                 dialog->bc().view(new GBC(dialog->bc()));
275                 dialog->setController(new ControlLog(*dialog));
276                 dialog->setView(new GLog(*dialog));
277                 dialog->bc().bp(new OkCancelPolicy);
278
279         } else if (name == "mathpanel") {
280                 dialog->bc().view(new GBC(dialog->bc()));
281                 dialog->setController(new ControlMath(*dialog));
282                 dialog->setView(new GMathPanel(*dialog));
283                 dialog->bc().bp(new IgnorantPolicy);
284
285         } else if (name == "mathaccents") {
286 //              FormMathsBitmap * bitmap =
287 //                      createFormBitmap(*dialog, _("Maths Decorations & Accents"),
288 //                                       latex_deco, nr_latex_deco);
289 //              bitmap->addBitmap(
290 //                      BitmapStore(12, 3, 4, deco1_width, deco1_height, deco1_bits, true));
291 //              bitmap->addBitmap(
292 //                      BitmapStore(10, 4, 3, deco2_width, deco2_height, deco2_bits, true));
293
294 //              dialog->bc().view(new xformsBC(dialog->bc()));
295                 dialog->setController(new ControlMath(*dialog));
296 //              dialog->setView(bitmap);
297                 dialog->bc().bp(new IgnorantPolicy);
298
299         } else if (name == "matharrows") {
300 //              FormMathsBitmap * bitmap =
301 //                      createFormBitmap(*dialog, _("Arrows"), latex_arrow, nr_latex_arrow);
302 //              bitmap->addBitmap(
303 //                      BitmapStore(20, 5, 4, arrow_width,  arrow_height,  arrow_bits, true));
304 //              bitmap->addBitmap(
305 //                      BitmapStore(7,  2, 4, larrow_width, larrow_height, larrow_bits, false));
306 //              bitmap->addBitmap(
307 //                      BitmapStore(4,  2, 2, darrow_width,  darrow_height, darrow_bits, true));
308
309 //              dialog->bc().view(new xformsBC(dialog->bc()));
310                 dialog->setController(new ControlMath(*dialog));
311 //              dialog->setView(bitmap);
312                 dialog->bc().bp(new IgnorantPolicy);
313
314         } else if (name == "mathoperators") {
315 //              FormMathsBitmap * bitmap =
316 //                      createFormBitmap(*dialog, _("Binary Ops"),
317 //                                       latex_bop, nr_latex_bop);
318 //              bitmap->addBitmap(
319 //                      BitmapStore(31, 4, 8, bop_width, bop_height, bop_bits, true));
320
321 //              dialog->bc().view(new xformsBC(dialog->bc()));
322                 dialog->setController(new ControlMath(*dialog));
323 //              dialog->setView(bitmap);
324                 dialog->bc().bp(new IgnorantPolicy);
325
326         } else if (name == "mathrelations") {
327 //              FormMathsBitmap * bitmap =
328 //                      createFormBitmap(*dialog, _("Binary Relations"),
329 //                                       latex_brel, nr_latex_brel);
330 //              bitmap->addBitmap(
331 //                      BitmapStore(35, 4, 9, brel_width, brel_height, brel_bits, true));
332
333 //              dialog->bc().view(new xformsBC(dialog->bc()));
334                 dialog->setController(new ControlMath(*dialog));
335 //              dialog->setView(bitmap);
336                 dialog->bc().bp(new IgnorantPolicy);
337
338         } else if (name == "mathgreek") {
339 //              FormMathsBitmap * bitmap =
340 //                      createFormBitmap(*dialog, _("Greek"),
341 //                                       latex_greek, nr_latex_greek);
342 //              bitmap->addBitmap(
343 //                      BitmapStore(11, 6, 2, Greek_width, Greek_height, Greek_bits, true));
344 //              bitmap->addBitmap(
345 //                      BitmapStore(28, 7, 4, greek_width, greek_height, greek_bits, true));
346
347 //              dialog->bc().view(new xformsBC(dialog->bc()));
348                 dialog->setController(new ControlMath(*dialog));
349 //              dialog->setView(bitmap);
350                 dialog->bc().bp(new IgnorantPolicy);
351
352         } else if (name == "mathmisc") {
353 //              FormMathsBitmap * bitmap =
354 //                      createFormBitmap(*dialog, _("Misc"),
355 //                                       latex_misc, nr_latex_misc);
356 //              bitmap->addBitmap(
357 //                      BitmapStore(29, 5, 6, misc_width, misc_height, misc_bits, true));
358 //              bitmap->addBitmap(
359 //                      BitmapStore(5, 5, 1, misc4_width, misc4_height, misc4_bits, true));
360 //              bitmap->addBitmap(
361 //                      BitmapStore(6, 3, 2, misc2_width, misc2_height, misc2_bits, false));
362 //              bitmap->addBitmap(
363 //                      BitmapStore(4, 2, 2, misc3_width, misc3_height, misc3_bits, true));
364
365 //              dialog->bc().view(new xformsBC(dialog->bc()));
366                 dialog->setController(new ControlMath(*dialog));
367 //              dialog->setView(bitmap);
368                 dialog->bc().bp(new IgnorantPolicy);
369
370         } else if (name == "mathdots") {
371 //              FormMathsBitmap * bitmap =
372 //                      createFormBitmap(*dialog, _("Dots"),
373 //                                       latex_dots, nr_latex_dots);
374 //              bitmap->addBitmap(
375 //                      BitmapStore(4, 4, 1, dots_width, dots_height, dots_bits, true));
376
377 //              dialog->bc().view(new xformsBC(dialog->bc()));
378                 dialog->setController(new ControlMath(*dialog));
379 //              dialog->setView(bitmap);
380                 dialog->bc().bp(new IgnorantPolicy);
381
382         } else if (name == "mathbigoperators") {
383 //              FormMathsBitmap * bitmap =
384 //                      createFormBitmap(*dialog, _("Big Operators"),
385 //                                       latex_varsz, nr_latex_varsz);
386 //              bitmap->addBitmap(
387 //                      BitmapStore(14, 3, 5, varsz_width, varsz_height, varsz_bits, true));
388
389 //              dialog->bc().view(new xformsBC(dialog->bc()));
390                 dialog->setController(new ControlMath(*dialog));
391 //              dialog->setView(bitmap);
392                 dialog->bc().bp(new IgnorantPolicy);
393
394         } else if (name == "mathamsmisc") {
395 //              FormMathsBitmap * bitmap =
396 //                      createFormBitmap(*dialog, _("AMS Misc"),
397 //                                       latex_ams_misc, nr_latex_ams_misc);
398 //              bitmap->addBitmap(
399 //                      BitmapStore(9, 5, 2, ams1_width, ams1_height, ams1_bits, true));
400 //              bitmap->addBitmap(
401 //                      BitmapStore(26, 3, 9, ams7_width, ams7_height, ams7_bits, true));
402
403 //              dialog->bc().view(new xformsBC(dialog->bc()));
404                 dialog->setController(new ControlMath(*dialog));
405 //              dialog->setView(bitmap);
406                 dialog->bc().bp(new IgnorantPolicy);
407
408         } else if (name == "mathamsarrows") {
409 //              FormMathsBitmap * bitmap =
410 //                      createFormBitmap(*dialog, _("AMS Arrows"),
411 //                                       latex_ams_arrows, nr_latex_ams_arrows);
412 //              bitmap->addBitmap(
413 //                      BitmapStore(32, 3, 11, ams2_width, ams2_height, ams2_bits, true));
414 //              bitmap->addBitmap(
415 //                      BitmapStore(6, 3, 2, ams3_width, ams3_height, ams3_bits, true));
416
417 //              dialog->bc().view(new xformsBC(dialog->bc()));
418                 dialog->setController(new ControlMath(*dialog));
419 //              dialog->setView(bitmap);
420                 dialog->bc().bp(new IgnorantPolicy);
421
422         } else if (name == "mathamsrelations") {
423 //              FormMathsBitmap * bitmap =
424 //                      createFormBitmap(*dialog, _("AMS Relations"),
425 //                                       latex_ams_rel, nr_latex_ams_rel);
426 //              bitmap->addBitmap(
427 //                      BitmapStore(66, 6, 11, ams_rel_width, ams_rel_height, ams_rel_bits, true));
428
429 //              dialog->bc().view(new xformsBC(dialog->bc()));
430                 dialog->setController(new ControlMath(*dialog));
431 //              dialog->setView(bitmap);
432                 dialog->bc().bp(new IgnorantPolicy);
433
434         } else if (name == "mathamsnegatedrelations") {
435 //              FormMathsBitmap * bitmap =
436 //                      createFormBitmap(*dialog, _("AMS Negated Rel"),
437 //                                       latex_ams_nrel, nr_latex_ams_nrel);
438 //              bitmap->addBitmap(
439 //                      BitmapStore(51, 6, 9, ams_nrel_width, ams_nrel_height, ams_nrel_bits, true));
440
441 //              dialog->bc().view(new xformsBC(dialog->bc()));
442                 dialog->setController(new ControlMath(*dialog));
443 //              dialog->setView(bitmap);
444                 dialog->bc().bp(new IgnorantPolicy);
445
446         } else if (name == "mathamsoperators") {
447 //              FormMathsBitmap * bitmap =
448 //                      createFormBitmap(*dialog, _("AMS Operators"),
449 //                                       latex_ams_ops, nr_latex_ams_ops);
450 //              bitmap->addBitmap(
451 //                      BitmapStore(23, 3, 8, ams_ops_width, ams_ops_height, ams_ops_bits, true));
452
453 //              dialog->bc().view(new xformsBC(dialog->bc()));
454                 dialog->setController(new ControlMath(*dialog));
455 //              dialog->setView(bitmap);
456                 dialog->bc().bp(new IgnorantPolicy);
457
458         } else if (name == "mathdelimiter") {
459                 dialog->bc().view(new GBC(dialog->bc()));
460                 dialog->setController(new ControlMath(*dialog));
461                 dialog->setView(new GMathDelim(*dialog));
462                 dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
463         } else if (name == "mathmatrix") {
464                 dialog->bc().view(new GBC(dialog->bc()));
465                 dialog->setController(new ControlMath(*dialog));
466                 dialog->setView(new GMathsMatrix(*dialog));
467                 dialog->bc().bp(new OkCancelReadOnlyPolicy);
468         } else if (name == "mathspace") {
469 //              dialog->bc().view(new xformsBC(dialog->bc()));
470                 dialog->setController(new ControlMath(*dialog));
471 //              dialog->setView(new FormMathsSpace(*dialog));
472                 dialog->bc().bp(new IgnorantPolicy);
473         } else if (name == "mathstyle") {
474 //              dialog->bc().view(new xformsBC(dialog->bc()));
475                 dialog->setController(new ControlMath(*dialog));
476 //              dialog->setView(new FormMathsStyle(*dialog));
477                 dialog->bc().bp(new IgnorantPolicy);
478         } else if (name == "note") {
479                 dialog->bc().view(new GBC(dialog->bc()));
480                 dialog->setController(new ControlNote(*dialog));
481                 dialog->setView(new GNote(*dialog));
482                 dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
483         } else if (name == "branch") {
484                 dialog->bc().view(new GBC(dialog->bc()));
485                 dialog->setController(new ControlBranch(*dialog));
486                 dialog->setView(new GBranch(*dialog));
487                 dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
488         } else if (name == "paragraph") {
489                 dialog->bc().view(new GBC(dialog->bc()));
490                 dialog->setController(new ControlParagraph(*dialog));
491                 dialog->setView(new GParagraph(*dialog));
492                 dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
493         } else if (name == "prefs") {
494                 dialog->bc().view(new GBC(dialog->bc()));
495                 dialog->setController(new ControlPrefs(*dialog));
496                 dialog->setView(new GPreferences(*dialog));
497                 dialog->bc().bp(new PreferencesPolicy);
498         } else if (name == "print") {
499                 dialog->bc().view(new GBC(dialog->bc()));
500                 dialog->setController(new ControlPrint(*dialog));
501                 dialog->setView(new GPrint(*dialog));
502                 dialog->bc().bp(new OkCancelPolicy);
503         } else if (name == "ref") {
504                 dialog->bc().view(new GBC(dialog->bc()));
505                 dialog->setController(new ControlRef(*dialog));
506                 dialog->setView(new GRef(*dialog));
507                 dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
508         } else if (name == "sendto") {
509                 dialog->bc().view(new GBC(dialog->bc()));
510                 dialog->setController(new ControlSendto(*dialog));
511                 dialog->setView(new GSendto(*dialog));
512                 dialog->bc().bp(new OkApplyCancelPolicy);
513         } else if (name == "spellchecker") {
514                 dialog->bc().view(new GBC(dialog->bc()));
515                 dialog->setController(new ControlSpellchecker(*dialog));
516                 dialog->setView(new GSpellchecker(*dialog));
517                 dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
518         } else if (name == "tabular") {
519                 dialog->bc().view(new GBC(dialog->bc()));
520                 dialog->setController(new ControlTabular(*dialog));
521                 dialog->setView(new GTabular(*dialog));
522                 dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
523         } else if (name == "tabularcreate") {
524                 dialog->bc().view(new GBC(dialog->bc()));
525                 dialog->setController(new ControlTabularCreate(*dialog));
526                 dialog->setView(new GTableCreate(*dialog));
527                 dialog->bc().bp(new IgnorantPolicy);
528         } else if (name == "texinfo") {
529                 dialog->bc().view(new GBC(dialog->bc()));
530                 dialog->setController(new ControlTexinfo(*dialog));
531                 dialog->setView(new GTexinfo(*dialog));
532                 dialog->bc().bp(new OkCancelPolicy);
533 #ifdef HAVE_LIBAIKSAURUS
534         } else if (name == "thesaurus") {
535                 dialog->bc().view(new GBC(dialog->bc()));
536                 dialog->setController(new ControlThesaurus(*dialog));
537                 dialog->setView(new GThesaurus(*dialog));
538                 dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
539 #endif
540         } else if (name == "toc") {
541                 dialog->bc().view(new GBC(dialog->bc()));
542                 dialog->setController(new ControlToc(*dialog));
543                 dialog->setView(new GToc(*dialog));
544                 dialog->bc().bp(new OkCancelPolicy);
545         } else if (name == "url") {
546                 dialog->bc().view(new GBC(dialog->bc()));
547                 dialog->setController(new ControlCommand(*dialog, name));
548                 dialog->setView(new GUrl(*dialog));
549                 dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
550         } else if (name == "vspace") {
551                 dialog->bc().view(new GBC(dialog->bc()));
552                 dialog->setController(new ControlVSpace(*dialog));
553                 dialog->setView(new GVSpace(*dialog));
554                 dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
555         } else if (name == "wrap") {
556                 dialog->bc().view(new GBC(dialog->bc()));
557                 dialog->setController(new ControlWrap(*dialog));
558                 dialog->setView(new GWrap(*dialog));
559                 dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
560         }
561
562         return dialog;
563 }
564
565
566 void Dialogs::toggleTooltips()
567 {
568         // Turning off tooltips is not necessary and will
569         // not be implemented by me - jcs
570         //Tooltips::toggleEnabled();
571 }
572
573
574 /// Are the tooltips on or off?
575 bool Dialogs::tooltipsEnabled()
576 {
577         //return Tooltips::enabled();
578         return true;
579 }