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