]> git.lyx.org Git - lyx.git/blob - src/frontends/gtk/Dialogs.C
1b23991f9b83f80e161c1cbf0b14a5542269365b
[lyx.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, 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, name));
264                 // FIXME UNICODE
265                 dialog->setView(new GText(*dialog,
266                                           lyx::to_utf8(_("Index Entry")),
267                                           lyx::to_utf8(_("Keyword:|#K"))));
268                 dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
269         } else if (name == "label") {
270                 dialog->bc().view(new GBC(dialog->bc()));
271                 dialog->setController(new ControlCommand(*dialog, name, name));
272                 // FIXME UNICODE
273                 dialog->setView(new GText(*dialog,
274                                           lyx::to_utf8(_("Label")),
275                                           lyx::to_utf8(_("Label:|#L"))));
276                 dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
277         } else if (name == "log") {
278                 dialog->bc().view(new GBC(dialog->bc()));
279                 dialog->setController(new ControlLog(*dialog));
280                 dialog->setView(new GLog(*dialog));
281                 dialog->bc().bp(new OkCancelPolicy);
282
283         } else if (name == "mathpanel") {
284                 dialog->bc().view(new GBC(dialog->bc()));
285                 dialog->setController(new ControlMath(*dialog));
286                 dialog->setView(new GMathPanel(*dialog));
287                 dialog->bc().bp(new IgnorantPolicy);
288
289         } else if (name == "mathaccents") {
290 //              FormMathsBitmap * bitmap =
291 //                      createFormBitmap(*dialog, lyx::to_utf8(_("Maths Decorations & Accents")),
292 //                                       latex_deco, nr_latex_deco);
293 //              bitmap->addBitmap(
294 //                      BitmapStore(12, 3, 4, deco1_width, deco1_height, deco1_bits, true));
295 //              bitmap->addBitmap(
296 //                      BitmapStore(10, 4, 3, deco2_width, deco2_height, deco2_bits, true));
297
298 //              dialog->bc().view(new xformsBC(dialog->bc()));
299                 dialog->setController(new ControlMath(*dialog));
300 //              dialog->setView(bitmap);
301                 dialog->bc().bp(new IgnorantPolicy);
302
303         } else if (name == "matharrows") {
304 //              FormMathsBitmap * bitmap =
305 //                      createFormBitmap(*dialog, lyx::to_utf8(_("Arrows"), latex_arrow, nr_latex_arrow));
306 //              bitmap->addBitmap(
307 //                      BitmapStore(20, 5, 4, arrow_width,  arrow_height,  arrow_bits, true));
308 //              bitmap->addBitmap(
309 //                      BitmapStore(7,  2, 4, larrow_width, larrow_height, larrow_bits, false));
310 //              bitmap->addBitmap(
311 //                      BitmapStore(4,  2, 2, darrow_width,  darrow_height, darrow_bits, true));
312
313 //              dialog->bc().view(new xformsBC(dialog->bc()));
314                 dialog->setController(new ControlMath(*dialog));
315 //              dialog->setView(bitmap);
316                 dialog->bc().bp(new IgnorantPolicy);
317
318         } else if (name == "mathoperators") {
319 //              FormMathsBitmap * bitmap =
320 //                      createFormBitmap(*dialog, lyx::to_utf8(_("Binary Ops")),
321 //                                       latex_bop, nr_latex_bop);
322 //              bitmap->addBitmap(
323 //                      BitmapStore(31, 4, 8, bop_width, bop_height, bop_bits, true));
324
325 //              dialog->bc().view(new xformsBC(dialog->bc()));
326                 dialog->setController(new ControlMath(*dialog));
327 //              dialog->setView(bitmap);
328                 dialog->bc().bp(new IgnorantPolicy);
329
330         } else if (name == "mathrelations") {
331 //              FormMathsBitmap * bitmap =
332 //                      createFormBitmap(*dialog, lyx::to_utf8(_("Binary Relations")),
333 //                                       latex_brel, nr_latex_brel);
334 //              bitmap->addBitmap(
335 //                      BitmapStore(35, 4, 9, brel_width, brel_height, brel_bits, true));
336
337 //              dialog->bc().view(new xformsBC(dialog->bc()));
338                 dialog->setController(new ControlMath(*dialog));
339 //              dialog->setView(bitmap);
340                 dialog->bc().bp(new IgnorantPolicy);
341
342         } else if (name == "mathgreek") {
343 //              FormMathsBitmap * bitmap =
344 //                      createFormBitmap(*dialog, lyx::to_utf8(_("Greek")),
345 //                                       latex_greek, nr_latex_greek);
346 //              bitmap->addBitmap(
347 //                      BitmapStore(11, 6, 2, Greek_width, Greek_height, Greek_bits, true));
348 //              bitmap->addBitmap(
349 //                      BitmapStore(28, 7, 4, greek_width, greek_height, greek_bits, true));
350
351 //              dialog->bc().view(new xformsBC(dialog->bc()));
352                 dialog->setController(new ControlMath(*dialog));
353 //              dialog->setView(bitmap);
354                 dialog->bc().bp(new IgnorantPolicy);
355
356         } else if (name == "mathmisc") {
357 //              FormMathsBitmap * bitmap =
358 //                      createFormBitmap(*dialog, lyx::to_utf8(_("Misc")),
359 //                                       latex_misc, nr_latex_misc);
360 //              bitmap->addBitmap(
361 //                      BitmapStore(29, 5, 6, misc_width, misc_height, misc_bits, true));
362 //              bitmap->addBitmap(
363 //                      BitmapStore(5, 5, 1, misc4_width, misc4_height, misc4_bits, true));
364 //              bitmap->addBitmap(
365 //                      BitmapStore(6, 3, 2, misc2_width, misc2_height, misc2_bits, false));
366 //              bitmap->addBitmap(
367 //                      BitmapStore(4, 2, 2, misc3_width, misc3_height, misc3_bits, true));
368
369 //              dialog->bc().view(new xformsBC(dialog->bc()));
370                 dialog->setController(new ControlMath(*dialog));
371 //              dialog->setView(bitmap);
372                 dialog->bc().bp(new IgnorantPolicy);
373
374         } else if (name == "mathdots") {
375 //              FormMathsBitmap * bitmap =
376 //                      createFormBitmap(*dialog, lyx::to_utf8(_("Dots")),
377 //                                       latex_dots, nr_latex_dots);
378 //              bitmap->addBitmap(
379 //                      BitmapStore(4, 4, 1, dots_width, dots_height, dots_bits, true));
380
381 //              dialog->bc().view(new xformsBC(dialog->bc()));
382                 dialog->setController(new ControlMath(*dialog));
383 //              dialog->setView(bitmap);
384                 dialog->bc().bp(new IgnorantPolicy);
385
386         } else if (name == "mathbigoperators") {
387 //              FormMathsBitmap * bitmap =
388 //                      createFormBitmap(*dialog, lyx::to_utf8(_("Big Operators")),
389 //                                       latex_varsz, nr_latex_varsz);
390 //              bitmap->addBitmap(
391 //                      BitmapStore(14, 3, 5, varsz_width, varsz_height, varsz_bits, true));
392
393 //              dialog->bc().view(new xformsBC(dialog->bc()));
394                 dialog->setController(new ControlMath(*dialog));
395 //              dialog->setView(bitmap);
396                 dialog->bc().bp(new IgnorantPolicy);
397
398         } else if (name == "mathamsmisc") {
399 //              FormMathsBitmap * bitmap =
400 //                      createFormBitmap(*dialog, lyx::to_utf8(_("AMS Misc")),
401 //                                       latex_ams_misc, nr_latex_ams_misc);
402 //              bitmap->addBitmap(
403 //                      BitmapStore(9, 5, 2, ams1_width, ams1_height, ams1_bits, true));
404 //              bitmap->addBitmap(
405 //                      BitmapStore(26, 3, 9, ams7_width, ams7_height, ams7_bits, true));
406
407 //              dialog->bc().view(new xformsBC(dialog->bc()));
408                 dialog->setController(new ControlMath(*dialog));
409 //              dialog->setView(bitmap);
410                 dialog->bc().bp(new IgnorantPolicy);
411
412         } else if (name == "mathamsarrows") {
413 //              FormMathsBitmap * bitmap =
414 //                      createFormBitmap(*dialog, lyx::to_utf8(_("AMS Arrows")),
415 //                                       latex_ams_arrows, nr_latex_ams_arrows);
416 //              bitmap->addBitmap(
417 //                      BitmapStore(32, 3, 11, ams2_width, ams2_height, ams2_bits, true));
418 //              bitmap->addBitmap(
419 //                      BitmapStore(6, 3, 2, ams3_width, ams3_height, ams3_bits, true));
420
421 //              dialog->bc().view(new xformsBC(dialog->bc()));
422                 dialog->setController(new ControlMath(*dialog));
423 //              dialog->setView(bitmap);
424                 dialog->bc().bp(new IgnorantPolicy);
425
426         } else if (name == "mathamsrelations") {
427 //              FormMathsBitmap * bitmap =
428 //                      createFormBitmap(*dialog, lyx::to_utf8(_("AMS Relations")),
429 //                                       latex_ams_rel, nr_latex_ams_rel);
430 //              bitmap->addBitmap(
431 //                      BitmapStore(66, 6, 11, ams_rel_width, ams_rel_height, ams_rel_bits, true));
432
433 //              dialog->bc().view(new xformsBC(dialog->bc()));
434                 dialog->setController(new ControlMath(*dialog));
435 //              dialog->setView(bitmap);
436                 dialog->bc().bp(new IgnorantPolicy);
437
438         } else if (name == "mathamsnegatedrelations") {
439 //              FormMathsBitmap * bitmap =
440 //                      createFormBitmap(*dialog, lyx::to_utf8(_("AMS Negated Rel")),
441 //                                       latex_ams_nrel, nr_latex_ams_nrel);
442 //              bitmap->addBitmap(
443 //                      BitmapStore(51, 6, 9, ams_nrel_width, ams_nrel_height, ams_nrel_bits, true));
444
445 //              dialog->bc().view(new xformsBC(dialog->bc()));
446                 dialog->setController(new ControlMath(*dialog));
447 //              dialog->setView(bitmap);
448                 dialog->bc().bp(new IgnorantPolicy);
449
450         } else if (name == "mathamsoperators") {
451 //              FormMathsBitmap * bitmap =
452 //                      createFormBitmap(*dialog, lyx::to_utf8(_("AMS Operators")),
453 //                                       latex_ams_ops, nr_latex_ams_ops);
454 //              bitmap->addBitmap(
455 //                      BitmapStore(23, 3, 8, ams_ops_width, ams_ops_height, ams_ops_bits, true));
456
457 //              dialog->bc().view(new xformsBC(dialog->bc()));
458                 dialog->setController(new ControlMath(*dialog));
459 //              dialog->setView(bitmap);
460                 dialog->bc().bp(new IgnorantPolicy);
461
462         } else if (name == "mathdelimiter") {
463                 dialog->bc().view(new GBC(dialog->bc()));
464                 dialog->setController(new ControlMath(*dialog));
465                 dialog->setView(new GMathDelim(*dialog));
466                 dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
467         } else if (name == "mathmatrix") {
468                 dialog->bc().view(new GBC(dialog->bc()));
469                 dialog->setController(new ControlMath(*dialog));
470                 dialog->setView(new GMathsMatrix(*dialog));
471                 dialog->bc().bp(new OkCancelReadOnlyPolicy);
472         } else if (name == "mathspace") {
473 //              dialog->bc().view(new xformsBC(dialog->bc()));
474                 dialog->setController(new ControlMath(*dialog));
475 //              dialog->setView(new FormMathsSpace(*dialog));
476                 dialog->bc().bp(new IgnorantPolicy);
477         } else if (name == "mathstyle") {
478 //              dialog->bc().view(new xformsBC(dialog->bc()));
479                 dialog->setController(new ControlMath(*dialog));
480 //              dialog->setView(new FormMathsStyle(*dialog));
481                 dialog->bc().bp(new IgnorantPolicy);
482         } else if (name == "note") {
483                 dialog->bc().view(new GBC(dialog->bc()));
484                 dialog->setController(new ControlNote(*dialog));
485                 dialog->setView(new GNote(*dialog));
486                 dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
487         } else if (name == "branch") {
488                 dialog->bc().view(new GBC(dialog->bc()));
489                 dialog->setController(new ControlBranch(*dialog));
490                 dialog->setView(new GBranch(*dialog));
491                 dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
492         } else if (name == "paragraph") {
493                 dialog->bc().view(new GBC(dialog->bc()));
494                 dialog->setController(new ControlParagraph(*dialog));
495                 dialog->setView(new GParagraph(*dialog));
496                 dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
497         } else if (name == "prefs") {
498                 dialog->bc().view(new GBC(dialog->bc()));
499                 dialog->setController(new ControlPrefs(*dialog));
500                 dialog->setView(new GPreferences(*dialog));
501                 dialog->bc().bp(new PreferencesPolicy);
502         } else if (name == "print") {
503                 dialog->bc().view(new GBC(dialog->bc()));
504                 dialog->setController(new ControlPrint(*dialog));
505                 dialog->setView(new GPrint(*dialog));
506                 dialog->bc().bp(new OkCancelPolicy);
507         } else if (name == "ref") {
508                 dialog->bc().view(new GBC(dialog->bc()));
509                 dialog->setController(new ControlRef(*dialog));
510                 dialog->setView(new GRef(*dialog));
511                 dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
512         } else if (name == "sendto") {
513                 dialog->bc().view(new GBC(dialog->bc()));
514                 dialog->setController(new ControlSendto(*dialog));
515                 dialog->setView(new GSendto(*dialog));
516                 dialog->bc().bp(new OkApplyCancelPolicy);
517         } else if (name == "spellchecker") {
518                 dialog->bc().view(new GBC(dialog->bc()));
519                 dialog->setController(new ControlSpellchecker(*dialog));
520                 dialog->setView(new GSpellchecker(*dialog));
521                 dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
522         } else if (name == "tabular") {
523                 dialog->bc().view(new GBC(dialog->bc()));
524                 dialog->setController(new ControlTabular(*dialog));
525                 dialog->setView(new GTabular(*dialog));
526                 dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
527         } else if (name == "tabularcreate") {
528                 dialog->bc().view(new GBC(dialog->bc()));
529                 dialog->setController(new ControlTabularCreate(*dialog));
530                 dialog->setView(new GTableCreate(*dialog));
531                 dialog->bc().bp(new IgnorantPolicy);
532         } else if (name == "texinfo") {
533                 dialog->bc().view(new GBC(dialog->bc()));
534                 dialog->setController(new ControlTexinfo(*dialog));
535                 dialog->setView(new GTexinfo(*dialog));
536                 dialog->bc().bp(new OkCancelPolicy);
537 #ifdef HAVE_LIBAIKSAURUS
538         } else if (name == "thesaurus") {
539                 dialog->bc().view(new GBC(dialog->bc()));
540                 dialog->setController(new ControlThesaurus(*dialog));
541                 dialog->setView(new GThesaurus(*dialog));
542                 dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
543 #endif
544         } else if (name == "toc") {
545                 dialog->bc().view(new GBC(dialog->bc()));
546                 dialog->setController(new ControlToc(*dialog));
547                 dialog->setView(new GToc(*dialog));
548                 dialog->bc().bp(new OkCancelPolicy);
549         } else if (name == "url") {
550                 dialog->bc().view(new GBC(dialog->bc()));
551                 dialog->setController(new ControlCommand(*dialog, name, name));
552                 dialog->setView(new GUrl(*dialog));
553                 dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
554         } else if (name == "vspace") {
555                 dialog->bc().view(new GBC(dialog->bc()));
556                 dialog->setController(new ControlVSpace(*dialog));
557                 dialog->setView(new GVSpace(*dialog));
558                 dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
559         } else if (name == "wrap") {
560                 dialog->bc().view(new GBC(dialog->bc()));
561                 dialog->setController(new ControlWrap(*dialog));
562                 dialog->setView(new GWrap(*dialog));
563                 dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
564         }
565
566         return dialog;
567 }
568
569
570 /// Are the tooltips on or off?
571 bool Dialogs::tooltipsEnabled()
572 {
573         //return Tooltips::enabled();
574         return true;
575 }