]> git.lyx.org Git - features.git/blob - src/frontends/qt/GuiToolbar.cpp
Guard against possible referencing null.
[features.git] / src / frontends / qt / GuiToolbar.cpp
1 /**
2  * \file qt/GuiToolbar.cpp
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Lars Gullik Bjønnes
7  * \author John Levon
8  * \author Jean-Marc Lasgouttes
9  * \author Angus Leeming
10  * \author Stefan Schimanski
11  * \author Abdelrazak Younes
12  *
13  * Full author contact details are available in file CREDITS.
14  */
15
16 #include <config.h>
17
18 #include "GuiToolbar.h"
19
20 #include "Action.h"
21 #include "Buffer.h"
22 #include "BufferParams.h"
23 #include "BufferView.h"
24 #include "Cursor.h"
25 #include "CutAndPaste.h"
26 #include "FuncRequest.h"
27 #include "FuncStatus.h"
28 #include "GuiApplication.h"
29 #include "GuiCommandBuffer.h"
30 #include "GuiView.h"
31 #include "IconPalette.h"
32 #include "InsertTableWidget.h"
33 #include "KeyMap.h"
34 #include "LayoutBox.h"
35 #include "LyX.h"
36 #include "LyXRC.h"
37 #include "qt_helpers.h"
38 #include "Session.h"
39 #include "Text.h"
40 #include "TextClass.h"
41 #include "Toolbars.h"
42
43 #include "insets/InsetText.h"
44
45 #include "support/convert.h"
46 #include "support/debug.h"
47 #include "support/docstring_list.h"
48 #include "support/gettext.h"
49 #include "support/lstrings.h"
50
51 #include <QSettings>
52 #include <QShowEvent>
53 #include <QString>
54 #include <QToolBar>
55 #include <QToolButton>
56
57 #include "support/lassert.h"
58
59 using namespace std;
60 using namespace lyx::support;
61
62 namespace lyx {
63 namespace frontend {
64
65 QIcon DynamicMenuButton::icon_textstyle_apply_;
66 QIcon DynamicMenuButton::icon_undo_;
67 QIcon DynamicMenuButton::icon_paste_;
68
69
70 GuiToolbar::GuiToolbar(ToolbarInfo const & tbinfo, GuiView & owner)
71         : QToolBar(toqstr(tbinfo.gui_name), &owner), visibility_(0),
72           owner_(owner), command_buffer_(nullptr), tbinfo_(tbinfo), filled_(false),
73           restored_(false)
74 {
75         setIconSize(owner.iconSize());
76         connect(&owner, SIGNAL(iconSizeChanged(QSize)), this,
77                 SLOT(setIconSize(QSize)));
78
79         // This is used by QMainWindow::restoreState for proper main window state
80         // restoration.
81         setObjectName(toqstr(tbinfo.name));
82         restoreSession();
83 }
84
85
86 void GuiToolbar::setVisible(bool visible)
87 {
88         // This is a hack to find out which toolbars have been restored by
89         // MainWindow::restoreState and which toolbars should be initialized
90         // by us (i.e., new toolbars)
91         restored_ = true;
92         // Record the actual visibility in toolbar state visibility_.
93         // This is useful to restore the visibility of toolbars when
94         // returning from full-screen. Therefore the recording is disabled
95         // while LyX is in full-screen state.
96         if (!owner_.isFullScreen()) {
97                 if (visible)
98                         visibility_ |= Toolbars::ON;
99                 else
100                         visibility_ &= ~Toolbars::ON;
101         }
102         QToolBar::setVisible(visible);
103 }
104
105
106 bool GuiToolbar::isRestored() const
107 {
108         return restored_;
109 }
110
111
112 void GuiToolbar::fill()
113 {
114         if (filled_)
115                 return;
116         ToolbarInfo::item_iterator it = tbinfo_.items.begin();
117         ToolbarInfo::item_iterator end = tbinfo_.items.end();
118         for (; it != end; ++it)
119                 add(*it);
120         filled_ = true;
121 }
122
123
124 void GuiToolbar::refill()
125 {
126         filled_ = false;
127         clear();
128         fill();
129 }
130
131
132 void GuiToolbar::showEvent(QShowEvent * ev)
133 {
134         fill();
135         ev->accept();
136 }
137
138
139 void GuiToolbar::setVisibility(int visibility)
140 {
141         visibility_ = visibility;
142 }
143
144
145 Action * GuiToolbar::addItem(ToolbarItem const & item)
146 {
147         QString text = toqstr(item.label);
148         // Get the keys bound to this action, but keep only the
149         // first one later
150         KeyMap::Bindings bindings = theTopLevelKeymap().findBindings(*item.func);
151         if (!bindings.empty())
152                 text += " [" + toqstr(bindings.begin()->print(KeySequence::ForGui)) + "]";
153
154         Action * act = new Action(item.func, getIcon(*item.func, false), text,
155                                                           text, this);
156         if (item.type == ToolbarItem::BIDICOMMAND)
157                 act->setRtlIcon(getIcon(*item.func, false, true));
158
159         actions_.append(act);
160         return act;
161 }
162
163 namespace {
164
165 class PaletteButton : public QToolButton
166 {
167 private:
168         GuiToolbar * bar_;
169         ToolbarItem const & tbitem_;
170         bool initialized_;
171 public:
172         PaletteButton(GuiToolbar * bar, ToolbarItem const & item)
173                 : QToolButton(bar), bar_(bar), tbitem_(item), initialized_(false)
174         {
175                 QString const label = qt_(to_ascii(tbitem_.label));
176                 setToolTip(label);
177                 setStatusTip(label);
178                 setText(label);
179                 connect(bar_, SIGNAL(iconSizeChanged(QSize)),
180                         this, SLOT(setIconSize(QSize)));
181                 setCheckable(true);
182                 ToolbarInfo const * tbinfo = guiApp->toolbars().info(tbitem_.name);
183                 if (tbinfo)
184                         // use the icon of first action for the toolbar button
185                         setIcon(getIcon(*tbinfo->items.begin()->func, true));
186         }
187
188         void mousePressEvent(QMouseEvent * e) override
189         {
190                 if (initialized_) {
191                         QToolButton::mousePressEvent(e);
192                         return;
193                 }
194
195                 initialized_ = true;
196
197                 ToolbarInfo const * tbinfo = guiApp->toolbars().info(tbitem_.name);
198                 if (!tbinfo) {
199                         LYXERR0("Unknown toolbar " << tbitem_.name);
200                         return;
201                 }
202                 IconPalette * panel = new IconPalette(this);
203                 QString const label = qt_(to_ascii(tbitem_.label));
204                 panel->setWindowTitle(label);
205                 connect(this, SIGNAL(clicked(bool)), panel, SLOT(setVisible(bool)));
206                 connect(panel, SIGNAL(visible(bool)), this, SLOT(setChecked(bool)));
207                 ToolbarInfo::item_iterator it = tbinfo->items.begin();
208                 ToolbarInfo::item_iterator const end = tbinfo->items.end();
209                 for (; it != end; ++it)
210                         if (!getStatus(*it->func).unknown())
211                                 panel->addButton(bar_->addItem(*it));
212
213                 QToolButton::mousePressEvent(e);
214         }
215 };
216
217 } // namespace
218
219
220 MenuButtonBase::MenuButtonBase(GuiToolbar * bar, ToolbarItem const & item)
221         : QToolButton(bar), bar_(bar), tbitem_(item)
222 {
223         setPopupMode(QToolButton::InstantPopup);
224         QString const label = qt_(to_ascii(tbitem_.label));
225         setToolTip(label);
226         setStatusTip(label);
227         setText(label);
228         QString const name = toqstr(tbitem_.name);
229         QStringList imagedirs;
230         imagedirs << "images/math/" << "images/";
231         for (int i = 0; i < imagedirs.size(); ++i) {
232                 QString imagedir = imagedirs.at(i);
233                 FileName const fname = imageLibFileSearch(imagedir, name, "svgz,png",
234                         theGuiApp()->imageSearchMode());
235                 if (fname.exists()) {
236                         setIcon(QIcon(getPixmap(imagedir, name, "svgz,png")));
237                         break;
238                 }
239         }
240 }
241
242
243 void MenuButtonBase::actionTriggered(QAction * action)
244 {
245         QToolButton::setDefaultAction(action);
246         setPopupMode(QToolButton::DelayedPopup);
247 }
248
249
250 StaticMenuButton::StaticMenuButton(
251     GuiToolbar * bar, ToolbarItem const & item, bool const sticky)
252         : MenuButtonBase(bar, item)
253 {
254         if (sticky)
255                 connect(this, SIGNAL(triggered(QAction *)),
256                         this, SLOT(actionTriggered(QAction *)));
257         connect(bar, SIGNAL(iconSizeChanged(QSize)),
258                 this, SLOT(setIconSize(QSize)));
259         initialize();
260 }
261
262
263 void StaticMenuButton::initialize()
264 {
265         QString const label = qt_(to_ascii(tbitem_.label));
266         ButtonMenu * m = new ButtonMenu(label, this);
267         m->setWindowTitle(label);
268         m->setTearOffEnabled(true);
269         connect(bar_, SIGNAL(updated()), m, SLOT(updateParent()));
270         connect(bar_, SIGNAL(updated()), this, SLOT(updateTriggered()));
271         ToolbarInfo const * tbinfo = guiApp->toolbars().info(tbitem_.name);
272         if (!tbinfo) {
273                 LYXERR0("Unknown toolbar " << tbitem_.name);
274                 return;
275         }
276         ToolbarInfo::item_iterator it = tbinfo->items.begin();
277         ToolbarInfo::item_iterator const end = tbinfo->items.end();
278         for (; it != end; ++it)
279                 if (!getStatus(*it->func).unknown())
280                         m->add(bar_->addItem(*it));
281         setMenu(m);
282 }
283
284
285 void StaticMenuButton::updateTriggered()
286 {
287         if (!menu())
288                 return;
289
290         bool enabled = false;
291         QList<QAction *> acts = menu()->actions();
292         for (auto const & act : acts)
293                 if (act->isEnabled()) {
294                         enabled = true;
295                         break;
296                 }
297         // Enable the MenuButton if at least one menu item is enabled
298         setEnabled(enabled);
299         // If a disabled item is default, switch to InstantPopup
300         // (this can happen if a user selects e.g. DVI and then
301         // turns non-TeX fonts on)
302         if (defaultAction() && !defaultAction()->isEnabled())
303                 setPopupMode(QToolButton::InstantPopup);
304 }
305
306
307 class DynamicMenuButton::Private
308 {
309         /// noncopyable
310         Private(Private const &);
311         void operator=(Private const &);
312 public:
313         Private() : inset_(nullptr) {}
314         ///
315         DocumentClassConstPtr text_class_;
316         ///
317         InsetText const * inset_;
318 };
319
320
321 DynamicMenuButton::DynamicMenuButton(GuiToolbar * bar, ToolbarItem const & item)
322         : MenuButtonBase(bar, item), d(new Private())
323 {
324         initialize();
325 }
326
327
328 DynamicMenuButton::~DynamicMenuButton() 
329
330         delete d;
331 }
332
333
334 void DynamicMenuButton::initialize()
335 {
336         QString const label = qt_(to_ascii(tbitem_.label));
337         ButtonMenu * m = new ButtonMenu(label, this);
338         m->setWindowTitle(label);
339         m->setTearOffEnabled(true);
340         connect(bar_, SIGNAL(updated()), m, SLOT(updateParent()));
341         connect(bar_, SIGNAL(updated()), this, SLOT(updateTriggered()));
342         connect(bar_, SIGNAL(iconSizeChanged(QSize)),
343                 this, SLOT(setIconSize(QSize)));
344         setMenu(m);
345 }
346
347
348 bool DynamicMenuButton::isMenuType(string const & s)
349 {
350         return s == "dynamic-custom-insets"
351                 || s == "dynamic-char-styles"
352                 || s == "textstyle-apply"
353                 || s == "paste";
354 }
355
356
357 void DynamicMenuButton::resetIconCache()
358 {
359         icon_textstyle_apply_ = getIcon(FuncRequest(LFUN_TEXTSTYLE_APPLY), false);
360         icon_undo_ =  getIcon(FuncRequest(LFUN_UNDO), false);
361         icon_paste_ = getIcon(FuncRequest(LFUN_PASTE), false);
362 }
363
364
365 void DynamicMenuButton::updateTriggered()
366 {
367         QMenu * m = menu();
368         // the menu should exist by this point
369         // if not, we can at least avoid crashing in release mode
370         LASSERT(m, return);
371         GuiView const & owner = bar_->owner();
372         BufferView const * bv = owner.currentBufferView();
373
374         string const & menutype = tbitem_.name;
375         if (menutype == "dynamic-custom-insets" || menutype == "dynamic-char-styles") {
376                 if (!bv) {
377                         m->clear();
378                         setEnabled(false);
379                         setMinimumWidth(sizeHint().width());
380                         d->text_class_.reset();
381                         d->inset_ = nullptr;
382                         return;
383                 }
384                 DocumentClassConstPtr text_class =
385                                 bv->buffer().params().documentClassPtr();
386                 InsetText const * inset = &(bv->cursor().innerText()->inset());
387                 // if the text class has changed, then we need to reload the menu
388                 if (d->text_class_ != text_class) {
389                         d->text_class_ = text_class;
390                         // at the moment, we can just call loadFlexInsets, and it will
391                         // handle both types. if there were more types of menus, then we
392                         // might need to have other options.
393                         loadFlexInsets();
394                 }
395                 // remember where we are
396                 d->inset_ = inset;
397                 // note that enabling here might need to be more subtle if there
398                 // were other kinds of menus.
399                 setEnabled(!bv->buffer().isReadonly()
400                            && !m->isEmpty()
401                            && inset->insetAllowed(FLEX_CODE));
402         } else if (menutype == "textstyle-apply") {
403                 m->clear();
404                 setPopupMode(QToolButton::MenuButtonPopup);
405                 if (!bv) {
406                         QToolButton::setIcon(icon_textstyle_apply_);
407                         setEnabled(false);
408                         return;
409                 }
410                 vector<docstring> ffList = bv->cursor().innerText()->getFreeFonts();
411                 unsigned int i = 0;
412                 Action * default_act = nullptr;
413                 for (auto const & f : ffList) {
414                         FuncRequest func(LFUN_TEXTSTYLE_APPLY, convert<docstring>(i),
415                                          FuncRequest::TOOLBAR);
416                         docstring const lb = char_type('&') + convert<docstring>(i)
417                                 + from_ascii(". ") + f ;
418                         Action * act = new Action(func, QIcon(), toqstr(lb), toqstr(f), this);
419                         m->addAction(act);
420                         // The most recent one is the default
421                         if (i == 0)
422                                 default_act = act;
423                         ++i;
424                 }
425                 // Add item to reset to defaults
426                 Action * reset_act = new Action(FuncRequest(LFUN_FONT_DEFAULT, FuncRequest::TOOLBAR),
427                                                 icon_undo_,
428                                                 qt_("&Reset to default"),
429                                                 qt_("Reset all font settings to their defaults"), this);
430                 m->addAction(reset_act);
431                 if (default_act)
432                         QToolButton::setDefaultAction(default_act);
433                 QToolButton::setIcon(icon_textstyle_apply_);
434                 setEnabled(lyx::getStatus(FuncRequest(LFUN_TEXTSTYLE_APPLY)).enabled()
435                            || lyx::getStatus(FuncRequest(LFUN_FONT_DEFAULT)).enabled());
436         } else if (menutype == "paste") {
437                 m->clear();
438                 setPopupMode(QToolButton::MenuButtonPopup);
439                 Action * default_action = new Action(FuncRequest(LFUN_PASTE),
440                                                      icon_paste_,
441                                                      qt_("Paste"), qt_("Paste"), this);
442                 if (!bv) {
443                         setEnabled(false);
444                         QToolButton::setDefaultAction(default_action);
445                         return;
446                 }
447                 docstring_list const sel = cap::availableSelections(&bv->buffer());
448
449                 docstring_list::const_iterator cit = sel.begin();
450                 docstring_list::const_iterator end = sel.end();
451
452                 for (unsigned int index = 0; cit != end; ++cit, ++index) {
453                         docstring const s = *cit;
454                         FuncRequest func(LFUN_PASTE, convert<docstring>(index),
455                                          FuncRequest::TOOLBAR);
456                         docstring const lb = char_type('&') + convert<docstring>(index)
457                                 + from_ascii(". ") + s ;
458                         Action * act = new Action(func, QIcon(), toqstr(lb), toqstr(s), this);
459                         m->addAction(act);
460                 }
461                 QToolButton::setDefaultAction(default_action);
462                 setEnabled(lyx::getStatus(FuncRequest(LFUN_PASTE)).enabled());
463         }
464 }
465
466
467 void DynamicMenuButton::loadFlexInsets()
468 {
469         QMenu * m = menu();
470         m->clear();
471         string const & menutype = tbitem_.name;
472         InsetLyXType ftype;
473         if (menutype == "dynamic-custom-insets")
474                 ftype = InsetLyXType::CUSTOM;
475         else if (menutype == "dynamic-char-styles")
476                 ftype = InsetLyXType::CHARSTYLE;
477         else {
478                 // this should have been taken care of earlier
479                 LASSERT(false, return);
480         }
481
482         TextClass::InsetLayouts const & inset_layouts = 
483                         d->text_class_->insetLayouts();
484         for (auto const & iit : inset_layouts) {
485                 InsetLayout const & il = iit.second;
486                 if (il.lyxtype() != ftype)
487                         continue;
488                 docstring const name = iit.first;
489                 QString const loc_item = toqstr(translateIfPossible(
490                                 prefixIs(name, from_ascii("Flex:")) ? 
491                                 name.substr(5) : name));
492                 FuncRequest func(LFUN_FLEX_INSERT, 
493                                 from_ascii("\"") + name + from_ascii("\""), FuncRequest::TOOLBAR);
494                 Action * act = 
495                                 new Action(func, getIcon(func, false), loc_item, loc_item, this);
496                 m->addAction(act);
497         }
498 }
499
500
501 void GuiToolbar::add(ToolbarItem const & item)
502 {
503         switch (item.type) {
504         case ToolbarItem::SEPARATOR:
505                 addSeparator();
506                 break;
507         case ToolbarItem::LAYOUTS: {
508                 LayoutBox * layout = owner_.getLayoutDialog();
509                 QObject::connect(this, SIGNAL(iconSizeChanged(QSize)),
510                         layout, SLOT(setIconSize(QSize)));
511                 QAction * action = addWidget(layout);
512                 action->setVisible(true);
513                 break;
514         }
515         case ToolbarItem::MINIBUFFER:
516                 command_buffer_ = new GuiCommandBuffer(&owner_);
517                 addWidget(command_buffer_);
518                 /// \todo find a Qt4 equivalent to setHorizontalStretchable(true);
519                 //setHorizontalStretchable(true);
520                 break;
521         case ToolbarItem::TABLEINSERT: {
522                 QToolButton * tb = new QToolButton;
523                 tb->setCheckable(true);
524                 tb->setIcon(getIcon(FuncRequest(LFUN_TABULAR_INSERT), true));
525                 QString const label = qt_(to_ascii(item.label));
526                 tb->setToolTip(label);
527                 tb->setStatusTip(label);
528                 tb->setText(label);
529                 InsertTableWidget * iv = new InsertTableWidget(tb);
530                 connect(tb, SIGNAL(clicked(bool)), iv, SLOT(show(bool)));
531                 connect(iv, SIGNAL(visible(bool)), tb, SLOT(setChecked(bool)));
532                 connect(this, SIGNAL(updated()), iv, SLOT(updateParent()));
533                 addWidget(tb);
534                 break;
535                 }
536         case ToolbarItem::ICONPALETTE:
537                 addWidget(new PaletteButton(this, item));
538                 break;
539         case ToolbarItem::POPUPMENU: {
540                 addWidget(new StaticMenuButton(this, item, false));
541                 break;
542                 }
543         case ToolbarItem::STICKYPOPUPMENU: {
544                 addWidget(new StaticMenuButton(this, item, true));
545                 break;
546                 }
547         case ToolbarItem::DYNAMICMENU: {
548                 // we only handle certain things
549                 if (DynamicMenuButton::isMenuType(item.name))
550                         addWidget(new DynamicMenuButton(this, item));
551                 else
552                         LYXERR0("Unknown dynamic menu type: " << item.name);
553                 break;
554         }
555         case ToolbarItem::BIDICOMMAND: {
556                 if (!getStatus(*item.func).unknown())
557                         addAction(addItem(item));
558                 break;
559                 }
560         case ToolbarItem::COMMAND: {
561                 if (!getStatus(*item.func).unknown())
562                         addAction(addItem(item));
563                 break;
564                 }
565         default:
566                 break;
567         }
568 }
569
570
571 void GuiToolbar::update(int context)
572 {
573         if (visibility_ & Toolbars::AUTO) {
574                 setVisible(visibility_ & context & Toolbars::ALLOWAUTO);
575                 if (isVisible() && commandBuffer() && (context & Toolbars::MINIBUFFER_FOCUS))
576                         commandBuffer()->setFocus();
577         }
578
579         // update visible toolbars only
580         if (!isVisible())
581                 return;
582
583         // This is a speed bottleneck because this is called on every keypress
584         // and update calls getStatus, which copies the cursor at least two times
585         for (auto const & action : actions_)
586                 action->update();
587
588         LayoutBox * layout = owner_.getLayoutDialog();
589         if (layout)
590                 layout->setEnabled(lyx::getStatus(FuncRequest(LFUN_LAYOUT)).enabled());
591
592         // emit signal
593         updated();
594 }
595
596
597 QString GuiToolbar::sessionKey() const
598 {
599         return "views/" + QString::number(owner_.id()) + "/" + objectName();
600 }
601
602
603 void GuiToolbar::saveSession(QSettings & settings) const
604 {
605         settings.setValue(sessionKey() + "/visibility", visibility_);
606         settings.setValue(sessionKey() + "/movability", isMovable());
607 }
608
609
610 void GuiToolbar::restoreSession()
611 {
612         QSettings settings;
613         int const error_val = -1;
614         int visibility =
615                 settings.value(sessionKey() + "/visibility", error_val).toInt();
616         if (visibility == error_val || visibility == 0) {
617                 // This should not happen, but in case we use the defaults
618                 LYXERR(Debug::GUI, "Session settings could not be found! Defaults are used instead.");
619                 visibility =
620                         guiApp->toolbars().defaultVisibility(fromqstr(objectName()));
621         }
622         setVisibility(visibility);
623
624         int movability = settings.value(sessionKey() + "/movability", true).toBool();
625         setMovable(movability);
626 }
627
628
629 bool GuiToolbar::isVisibilityOn() const
630 {
631         return visibility_ & Toolbars::ON;
632 }
633
634
635 void GuiToolbar::setState(string const state)
636 {
637         docstring newstate;
638         if (state == "auto") {
639                 if (visibility_ & Toolbars::ALLOWAUTO) {
640                         visibility_ |= Toolbars::AUTO;
641                         hide();
642                         newstate = _("auto");
643                 } else
644                         owner_.message(bformat(_("Toolbar \"%1$s\" does not support state \"auto\""),
645                                 qstring_to_ucs4(windowTitle())));
646         } else {
647                 if (visibility_ & Toolbars::AUTO)
648                         visibility_ &= ~Toolbars::AUTO;
649                 if (state == "off") {
650                         hide();
651                         newstate = _("off");
652                 } else if (state == "on") {
653                         show();
654                         newstate = _("on");
655                 }
656         }
657
658         owner_.message(bformat(_("Toolbar \"%1$s\" state set to %2$s"),
659                 qstring_to_ucs4(windowTitle()), newstate));
660 }
661
662
663 void GuiToolbar::toggle()
664 {
665         if (visibility_ & Toolbars::ALLOWAUTO) {
666                 if (!(visibility_ & Toolbars::AUTO) && !isVisibilityOn()) {
667                         setState("auto");
668                 } else {
669                         if (isVisibilityOn())
670                                 setState("off");
671                         else
672                                 setState("on");
673                 }
674         } else {
675                 if (isVisible())
676                         setState("off");
677                 else
678                         setState("on");
679         }
680 }
681
682 void GuiToolbar::movable(bool silent)
683 {
684         // toggle movability
685         setMovable(!isMovable());
686
687         // manual update avoids bug in qt that the drag handle is not removed
688         // properly, e.g. in Windows
689         Q_EMIT update();
690
691         // silence for toggling of many toolbars for performance
692         if (!silent) {
693                 docstring state;
694                 if (isMovable())
695                         state = _("movable");
696                 else
697                         state = _("immovable");
698                 owner_.message(bformat(_("Toolbar \"%1$s\" state set to %2$s"),
699                         qstring_to_ucs4(windowTitle()), state));
700         }
701 }
702
703 } // namespace frontend
704 } // namespace lyx
705
706 #include "moc_GuiToolbar.cpp"