3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
8 * \author Abdelrazak Younes
11 * Full author contact details are available in file CREDITS.
18 #include "GuiImplementation.h"
19 #include "GuiWorkArea.h"
20 #include "GuiKeySymbol.h"
21 #include "GuiMenubar.h"
22 #include "GuiToolbar.h"
23 #include "GuiToolbars.h"
24 #include "qt_helpers.h"
26 #include "frontends/Application.h"
27 #include "frontends/Dialogs.h"
28 #include "frontends/Gui.h"
29 #include "frontends/WorkArea.h"
31 #include "support/filetools.h"
32 #include "support/convert.h"
33 #include "support/lstrings.h"
34 #include "support/os.h"
37 #include "BufferParams.h"
38 #include "BufferView.h"
39 #include "BufferList.h"
42 #include "FuncRequest.h"
47 #include "MenuBackend.h"
48 #include "Paragraph.h"
50 #include "TextClass.h"
51 #include "ToolbarBackend.h"
55 #include <QApplication>
56 #include <QCloseEvent>
57 #include <QDesktopWidget>
58 #include <QDragEnterEvent>
64 #include <QPushButton>
66 #include <QStackedWidget>
71 #include <boost/current_function.hpp>
79 using support::makeDisplayPath;
87 int const statusbar_timer_value = 3000;
89 class BackgroundWidget : public QWidget
92 BackgroundWidget(QString const & file, QString const & text)
94 splash_ = new QPixmap(file);
96 lyxerr << "could not load splash screen: '" << fromqstr(file) << "'" << endl;
100 QPainter pain(splash_);
101 pain.setPen(QColor(255, 255, 0));
103 // The font used to display the version info
104 font.setStyleHint(QFont::SansSerif);
105 font.setWeight(QFont::Bold);
106 font.setPointSize(convert<int>(lyxrc.font_sizes[FONT_SIZE_LARGE]));
108 pain.drawText(260, 270, text);
111 void paintEvent(QPaintEvent *)
116 int x = (width() - splash_->width()) / 2;
117 int y = (height() - splash_->height()) / 2;
119 pain.drawPixmap(x, y, *splash_);
129 struct GuiView::GuiViewPrivate
136 GuiWorkArea * current_work_area_;
137 QSplitter * splitter_;
138 QStackedWidget * stack_widget_;
139 BackgroundWidget * bg_widget_;
141 GuiMenubar * menubar_;
143 GuiToolbars * toolbars_;
145 docstring current_layout;
148 : current_work_area_(0), posx_offset(0), posy_offset(0)
155 delete stack_widget_;
160 unsigned int smallIconSize;
161 unsigned int normalIconSize;
162 unsigned int bigIconSize;
163 // static needed by "New Window"
164 static unsigned int lastIconSize;
166 QMenu * toolBarPopup(GuiView * parent)
168 // FIXME: translation
169 QMenu * menu = new QMenu(parent);
170 QActionGroup * iconSizeGroup = new QActionGroup(parent);
172 QAction * smallIcons = new QAction(iconSizeGroup);
173 smallIcons->setText(qt_("Small-sized icons"));
174 smallIcons->setCheckable(true);
175 QObject::connect(smallIcons, SIGNAL(triggered()), parent, SLOT(smallSizedIcons()));
176 menu->addAction(smallIcons);
178 QAction * normalIcons = new QAction(iconSizeGroup);
179 normalIcons->setText(qt_("Normal-sized icons"));
180 normalIcons->setCheckable(true);
181 QObject::connect(normalIcons, SIGNAL(triggered()), parent, SLOT(normalSizedIcons()));
182 menu->addAction(normalIcons);
184 QAction * bigIcons = new QAction(iconSizeGroup);
185 bigIcons->setText(qt_("Big-sized icons"));
186 bigIcons->setCheckable(true);
187 QObject::connect(bigIcons, SIGNAL(triggered()), parent, SLOT(bigSizedIcons()));
188 menu->addAction(bigIcons);
190 unsigned int cur = parent->iconSize().width();
191 if ( cur == parent->d.smallIconSize)
192 smallIcons->setChecked(true);
193 else if (cur == parent->d.normalIconSize)
194 normalIcons->setChecked(true);
195 else if (cur == parent->d.bigIconSize)
196 bigIcons->setChecked(true);
201 void initBackground()
203 LYXERR(Debug::GUI) << "show banner: " << lyxrc.show_banner << endl;
204 /// The text to be written on top of the pixmap
205 QString const text = lyx_version ? QString(lyx_version) : qt_("unknown version");
206 bg_widget_ = new BackgroundWidget(":/images/banner.png", text);
211 stack_widget_->setCurrentWidget(bg_widget_);
212 bg_widget_->setUpdatesEnabled(true);
215 TabWorkArea * tabWorkArea(int i)
217 return dynamic_cast<TabWorkArea *>(splitter_->widget(i));
220 TabWorkArea * currentTabWorkArea()
222 if (splitter_->count() == 1)
223 // The first TabWorkArea is always the first one, if any.
224 return tabWorkArea(0);
226 TabWorkArea * tab_widget = 0;
227 for (int i = 0; i != splitter_->count(); ++i) {
228 QWidget * w = splitter_->widget(i);
231 tab_widget = dynamic_cast<TabWorkArea *>(w);
241 unsigned int GuiView::GuiViewPrivate::lastIconSize = 0;
244 GuiView::GuiView(int id)
245 : QMainWindow(), LyXView(id), quitting_by_menu_(false),
246 d(*new GuiViewPrivate)
248 // Qt bug? signal lastWindowClosed does not work
249 setAttribute(Qt::WA_QuitOnClose, false);
250 setAttribute(Qt::WA_DeleteOnClose, true);
252 // hardcode here the platform specific icon size
253 d.smallIconSize = 14; // scaling problems
254 d.normalIconSize = 20; // ok, default
255 d.bigIconSize = 26; // better for some math icons
258 // assign an icon to main form. We do not do it under Qt/Mac,
259 // since the icon is provided in the application bundle.
260 setWindowIcon(QPixmap(":/images/lyx.png"));
264 d.splitter_ = new QSplitter;
267 LYXERR(Debug::GUI) << "stack widget!" << endl;
268 d.stack_widget_ = new QStackedWidget;
269 d.stack_widget_->addWidget(d.bg_widget_);
270 d.stack_widget_->addWidget(d.splitter_);
271 setCentralWidget(d.stack_widget_);
274 setAcceptDrops(true);
284 void GuiView::close()
286 quitting_by_menu_ = true;
287 d.current_work_area_ = 0;
288 for (int i = 0; i != d.splitter_->count(); ++i) {
289 TabWorkArea * twa = d.tabWorkArea(i);
293 QMainWindow::close();
294 quitting_by_menu_ = false;
298 void GuiView::setFocus()
300 if (d.current_work_area_)
301 d.current_work_area_->setFocus();
307 QMenu* GuiView::createPopupMenu()
309 return d.toolBarPopup(this);
315 // GuiToolbars *must* be initialised before GuiMenubar.
316 d.toolbars_ = new GuiToolbars(*this);
317 // FIXME: GuiToolbars::init() cannot be integrated in the ctor
318 // because LyXFunc::getStatus() needs a properly initialized
319 // GuiToolbars object (for LFUN_TOOLBAR_TOGGLE).
321 d.menubar_ = new GuiMenubar(this, menubackend);
323 statusBar()->setSizeGripEnabled(true);
325 QObject::connect(&statusbar_timer_, SIGNAL(timeout()),
326 this, SLOT(update_view_state_qt()));
332 void GuiView::closeEvent(QCloseEvent * close_event)
334 // we may have been called through the close window button
335 // which bypasses the LFUN machinery.
336 if (!quitting_by_menu_ && theApp()->gui().viewIds().size() == 1) {
337 if (!theBufferList().quitWriteAll()) {
338 close_event->ignore();
343 // Make sure that no LFUN use this close to be closed View.
344 theLyXFunc().setLyXView(0);
345 // Make sure the timer time out will not trigger a statusbar update.
346 statusbar_timer_.stop();
348 theApp()->gui().unregisterView(id());
349 if (!theApp()->gui().viewIds().empty()) {
350 // Just close the window and do nothing else if this is not the
352 close_event->accept();
358 // this is the place where we leave the frontend.
359 // it is the only point at which we start quitting.
361 close_event->accept();
362 // quit the event loop
367 void GuiView::dragEnterEvent(QDragEnterEvent * event)
369 if (event->mimeData()->hasUrls())
371 /// \todo Ask lyx-devel is this is enough:
372 /// if (event->mimeData()->hasFormat("text/plain"))
373 /// event->acceptProposedAction();
377 void GuiView::dropEvent(QDropEvent* event)
379 QList<QUrl> files = event->mimeData()->urls();
383 LYXERR(Debug::GUI) << BOOST_CURRENT_FUNCTION
384 << " got URLs!" << endl;
385 for (int i = 0; i != files.size(); ++i) {
386 string const file = support::os::internal_path(fromqstr(
387 files.at(i).toLocalFile()));
389 dispatch(FuncRequest(LFUN_FILE_OPEN, file));
394 void GuiView::saveGeometry()
396 static bool done = false;
403 // change the ifdef to 'geometry = normalGeometry();' only
404 // when Trolltech has fixed the broken normalGeometry on X11:
405 // http://www.trolltech.com/developer/task-tracker/index_html?id=119684+&method=entry
406 // Then also the moveEvent, resizeEvent, and the
407 // code for floatingGeometry_ can be removed;
408 // adjust GuiView::setGeometry()
410 QRect normal_geometry;
413 normal_geometry = normalGeometry();
415 maximized = CompletelyMaximized;
417 maximized = NotMaximized;
420 normal_geometry = updateFloatingGeometry();
422 QDesktopWidget& dw = *qApp->desktop();
423 QRect desk = dw.availableGeometry(dw.primaryScreen());
424 // Qt bug on Linux: load completely maximized, vert max. save-> frameGeometry().height() is wrong
425 if (isMaximized() && desk.width() <= frameGeometry().width() && desk.height() <= frameGeometry().height()) {
426 maximized = CompletelyMaximized;
427 // maximizing does not work when the window is allready hor. or vert. maximized
428 // Tested only on KDE
429 int dh = frameGeometry().height() - height();
430 if (desk.height() <= normal_geometry.height() + dh)
431 normal_geometry.setHeight(normal_geometry.height() - 1);
432 int dw = frameGeometry().width() - width();
433 if (desk.width() <= normal_geometry.width() + dw)
434 normal_geometry.setWidth(normal_geometry.width() - 1);
435 } else if (desk.height() <= frameGeometry().height()) {
436 maximized = VerticallyMaximized;
437 } else if (desk.width() <= frameGeometry().width()) {
438 maximized = HorizontallyMaximized;
440 maximized = NotMaximized;
445 // save windows size and position
446 Session & session = LyX::ref().session();
447 session.sessionInfo().save("WindowWidth", convert<string>(normal_geometry.width()));
448 session.sessionInfo().save("WindowHeight", convert<string>(normal_geometry.height()));
449 session.sessionInfo().save("WindowMaximized", convert<string>(maximized));
450 session.sessionInfo().save("IconSizeXY", convert<string>(iconSize().width()));
451 if (lyxrc.geometry_xysaved) {
452 session.sessionInfo().save("WindowPosX", convert<string>(normal_geometry.x() + d.posx_offset));
453 session.sessionInfo().save("WindowPosY", convert<string>(normal_geometry.y() + d.posy_offset));
455 d.toolbars_->saveToolbarInfo();
459 void GuiView::setGeometry(unsigned int width,
463 unsigned int iconSizeXY,
464 const string & geometryArg)
466 // use last value (not at startup)
467 if (d.lastIconSize != 0)
468 setIconSize(d.lastIconSize);
469 else if (iconSizeXY != 0)
470 setIconSize(iconSizeXY);
472 setIconSize(d.normalIconSize);
474 // only true when the -geometry option was NOT used
475 if (width != 0 && height != 0) {
476 if (posx != -1 && posy != -1) {
477 // if there are startup positioning problems:
478 // http://doc.trolltech.com/4.2/qdesktopwidget.html
479 QDesktopWidget& dw = *qApp->desktop();
480 if (dw.isVirtualDesktop()) {
481 if(!dw.geometry().contains(posx, posy)) {
486 // Which system doesn't use a virtual desktop?
487 // TODO save also last screen number and check if it is still availabe.
490 // FIXME: use setGeometry only when Trolltech has fixed the qt4/X11 bug
491 QWidget::setGeometry(posx, posy, width, height);
493 resize(width, height);
497 resize(width, height);
500 // remember original size
501 floatingGeometry_ = QRect(posx, posy, width, height);
503 if (maximized != NotMaximized) {
504 if (maximized == CompletelyMaximized) {
505 setWindowState(Qt::WindowMaximized);
508 // TODO How to set by the window manager?
509 // setWindowState(Qt::WindowVerticallyMaximized);
511 QDesktopWidget& dw = *qApp->desktop();
512 QRect desk = dw.availableGeometry(dw.primaryScreen());
513 if (maximized == VerticallyMaximized)
514 resize(width, desk.height());
515 if (maximized == HorizontallyMaximized)
516 resize(desk.width(), height);
523 // FIXME: move this code into parse_geometry() (LyX.cpp)
527 QRegExp re( "[=]*(?:([0-9]+)[xX]([0-9]+)){0,1}[ ]*(?:([+-][0-9]*)([+-][0-9]*)){0,1}" );
528 re.indexIn(toqstr(geometryArg.c_str()));
529 w = re.cap(1).toInt();
530 h = re.cap(2).toInt();
531 x = re.cap(3).toInt();
532 y = re.cap(4).toInt();
533 QWidget::setGeometry( x, y, w, h );
544 // For an unknown reason, the Window title update is not effective for
545 // the second windows up until it is shown on screen (Qt bug?).
548 // after show geometry() has changed (Qt bug?)
549 // we compensate the drift when storing the position
552 if (width != 0 && height != 0)
553 if (posx != -1 && posy != -1) {
555 d.posx_offset = posx - normalGeometry().x();
556 d.posy_offset = posy - normalGeometry().y();
559 if (maximized == NotMaximized) {
560 d.posx_offset = posx - geometry().x();
561 d.posy_offset = posy - geometry().y();
569 void GuiView::setWindowTitle(docstring const & t, docstring const & it)
571 QString title = windowTitle();
572 QString new_title = toqstr(t);
573 if (title != new_title) {
574 QMainWindow::setWindowTitle(new_title);
575 QMainWindow::setWindowIconText(toqstr(it));
577 if (Buffer const * buf = buffer()) {
578 QString tabtext = toqstr(buf->fileName().displayName(30));
579 d.current_work_area_->setWindowTitle(tabtext);
580 TabWorkArea * twa = d.currentTabWorkArea();
581 twa->setTabText(twa->currentIndex(), tabtext);
586 void GuiView::message(docstring const & str)
588 statusBar()->showMessage(toqstr(str));
589 statusbar_timer_.stop();
590 statusbar_timer_.start(statusbar_timer_value);
594 void GuiView::clearMessage()
596 update_view_state_qt();
600 void GuiView::setIconSize(unsigned int size)
602 d.lastIconSize = size;
603 QMainWindow::setIconSize(QSize(size, size));
607 void GuiView::smallSizedIcons()
609 setIconSize(d.smallIconSize);
613 void GuiView::normalSizedIcons()
615 setIconSize(d.normalIconSize);
619 void GuiView::bigSizedIcons()
621 setIconSize(d.bigIconSize);
625 void GuiView::update_view_state_qt()
629 theLyXFunc().setLyXView(this);
630 statusBar()->showMessage(toqstr(theLyXFunc().viewStatusMessage()));
631 statusbar_timer_.stop();
635 void GuiView::on_currentWorkAreaChanged(GuiWorkArea * wa)
638 disconnectBufferView();
639 connectBufferView(wa->bufferView());
640 connectBuffer(wa->bufferView().buffer());
643 // Buffer-dependent dialogs should be updated or
644 // hidden. This should go here because some dialogs (eg ToC)
645 // require bv_->text.
646 getDialogs().updateBufferDependent(true);
648 updateLayoutChoice(false);
654 void GuiView::updateStatusBar()
656 // let the user see the explicit message
657 if (statusbar_timer_.isActive())
660 statusBar()->showMessage(toqstr(theLyXFunc().viewStatusMessage()));
664 void GuiView::activated(FuncRequest const & func)
670 bool GuiView::hasFocus() const
672 return qApp->activeWindow() == this;
676 QRect GuiView::updateFloatingGeometry()
678 QDesktopWidget& dw = *qApp->desktop();
679 QRect desk = dw.availableGeometry(dw.primaryScreen());
680 // remember only non-maximized sizes
681 if (!isMaximized() && desk.width() > frameGeometry().width() && desk.height() > frameGeometry().height()) {
682 floatingGeometry_ = QRect(x(), y(), width(), height());
684 return floatingGeometry_;
688 void GuiView::resizeEvent(QResizeEvent *)
690 updateFloatingGeometry();
694 void GuiView::moveEvent(QMoveEvent *)
696 updateFloatingGeometry();
700 bool GuiView::event(QEvent * e)
704 // Useful debug code:
705 //case QEvent::ActivationChange:
706 //case QEvent::WindowDeactivate:
707 //case QEvent::Paint:
708 //case QEvent::Enter:
709 //case QEvent::Leave:
710 //case QEvent::HoverEnter:
711 //case QEvent::HoverLeave:
712 //case QEvent::HoverMove:
713 //case QEvent::StatusTip:
714 //case QEvent::DragEnter:
715 //case QEvent::DragLeave:
719 case QEvent::WindowActivate: {
720 theApp()->setCurrentView(*this);
721 if (d.current_work_area_) {
722 BufferView & bv = d.current_work_area_->bufferView();
723 connectBufferView(bv);
724 connectBuffer(bv.buffer());
725 // The document structure, name and dialogs might have
726 // changed in another view.
728 getDialogs().updateBufferDependent(true);
730 return QMainWindow::event(e);
732 case QEvent::ShortcutOverride: {
733 QKeyEvent * ke = static_cast<QKeyEvent*>(e);
734 if (!d.current_work_area_) {
735 theLyXFunc().setLyXView(this);
737 setKeySymbol(&sym, ke);
738 theLyXFunc().processKeySym(sym, q_key_state(ke->modifiers()));
742 if (ke->key() == Qt::Key_Tab || ke->key() == Qt::Key_Backtab) {
744 setKeySymbol(&sym, ke);
745 d.current_work_area_->processKeySym(sym, NoModifier);
751 return QMainWindow::event(e);
756 bool GuiView::focusNextPrevChild(bool /*next*/)
763 void GuiView::showView()
765 QMainWindow::setWindowTitle(qt_("LyX"));
767 updateFloatingGeometry();
771 void GuiView::setBusy(bool yes)
773 if (d.current_work_area_) {
774 d.current_work_area_->setUpdatesEnabled(!yes);
776 d.current_work_area_->stopBlinkingCursor();
778 d.current_work_area_->startBlinkingCursor();
782 QApplication::setOverrideCursor(Qt::WaitCursor);
784 QApplication::restoreOverrideCursor();
788 GuiToolbar * GuiView::makeToolbar(ToolbarInfo const & tbinfo, bool newline)
790 GuiToolbar * toolBar = new GuiToolbar(tbinfo, *this);
792 if (tbinfo.flags & ToolbarInfo::TOP) {
794 addToolBarBreak(Qt::TopToolBarArea);
795 addToolBar(Qt::TopToolBarArea, toolBar);
798 if (tbinfo.flags & ToolbarInfo::BOTTOM) {
799 // Qt < 4.2.2 cannot handle ToolBarBreak on non-TOP dock.
800 #if (QT_VERSION >= 0x040202)
802 addToolBarBreak(Qt::BottomToolBarArea);
804 addToolBar(Qt::BottomToolBarArea, toolBar);
807 if (tbinfo.flags & ToolbarInfo::LEFT) {
808 // Qt < 4.2.2 cannot handle ToolBarBreak on non-TOP dock.
809 #if (QT_VERSION >= 0x040202)
811 addToolBarBreak(Qt::LeftToolBarArea);
813 addToolBar(Qt::LeftToolBarArea, toolBar);
816 if (tbinfo.flags & ToolbarInfo::RIGHT) {
817 // Qt < 4.2.2 cannot handle ToolBarBreak on non-TOP dock.
818 #if (QT_VERSION >= 0x040202)
820 addToolBarBreak(Qt::RightToolBarArea);
822 addToolBar(Qt::RightToolBarArea, toolBar);
825 // The following does not work so I cannot restore to exact toolbar location
827 ToolbarSection::ToolbarInfo & tbinfo = LyX::ref().session().toolbars().load(tbinfo.name);
828 toolBar->move(tbinfo.posx, tbinfo.posy);
835 WorkArea * GuiView::workArea(Buffer & buffer)
837 for (int i = 0; i != d.splitter_->count(); ++i) {
838 GuiWorkArea * wa = d.tabWorkArea(i)->workArea(buffer);
846 WorkArea * GuiView::addWorkArea(Buffer & buffer)
848 GuiWorkArea * wa = new GuiWorkArea(buffer, *this);
849 wa->setUpdatesEnabled(false);
851 // Automatically create a TabWorkArea if there are none yet.
852 if (!d.splitter_->count())
855 TabWorkArea * tab_widget = d.currentTabWorkArea();
856 tab_widget->addTab(wa, toqstr(buffer.fileName().displayName(30)));
857 wa->bufferView().updateMetrics();
859 // Hide tabbar if there's only one tab.
860 tab_widget->showBar(tab_widget->count() > 1);
865 void GuiView::addTabWorkArea()
867 TabWorkArea * twa = new TabWorkArea;
868 QObject::connect(twa, SIGNAL(currentWorkAreaChanged(GuiWorkArea *)),
869 this, SLOT(on_currentWorkAreaChanged(GuiWorkArea *)));
870 d.splitter_->addWidget(twa);
871 d.stack_widget_->setCurrentWidget(d.splitter_);
875 WorkArea * GuiView::currentWorkArea()
877 return d.current_work_area_;
881 WorkArea const * GuiView::currentWorkArea() const
883 return d.current_work_area_;
887 void GuiView::setCurrentWorkArea(WorkArea * work_area)
889 BOOST_ASSERT(work_area);
891 // Changing work area can result from opening a file so
892 // update the toc in any case.
895 GuiWorkArea * wa = static_cast<GuiWorkArea *>(work_area);
896 d.current_work_area_ = wa;
897 for (int i = 0; i != d.splitter_->count(); ++i) {
898 if (d.tabWorkArea(i)->setCurrentWorkArea(wa))
904 void GuiView::removeWorkArea(WorkArea * work_area)
906 BOOST_ASSERT(work_area);
907 GuiWorkArea * gwa = static_cast<GuiWorkArea *>(work_area);
908 if (gwa == d.current_work_area_) {
910 disconnectBufferView();
911 getDialogs().hideBufferDependent();
912 d.current_work_area_ = 0;
915 // removing a work area often results from closing a file so
916 // update the toc in any case.
919 for (int i = 0; i != d.splitter_->count(); ++i) {
920 TabWorkArea * twa = d.tabWorkArea(i);
921 if (!twa->removeWorkArea(gwa))
922 // Not found in this tab group.
925 // We found and removed the WorkArea.
927 // No more WorkAreas in this tab group, so delete it.
932 if (d.current_work_area_)
933 // This means that we are not closing the current WorkArea;
936 // Switch to the next WorkArea in the found TabWorkArea.
937 d.current_work_area_ = twa->currentWorkArea();
941 if (d.splitter_->count() == 0)
942 // No more work area, switch to the background widget.
947 void GuiView::showMiniBuffer(bool visible)
949 d.toolbars_->showCommandBuffer(visible);
953 void GuiView::openMenu(docstring const & name)
955 d.menubar_->openByName(toqstr(name));
959 void GuiView::openLayoutList()
961 d.toolbars_->openLayoutList();
965 void GuiView::updateLayoutChoice(bool force)
967 // Don't show any layouts without a buffer
969 d.toolbars_->clearLayoutList();
973 // Update the layout display
974 if (d.toolbars_->updateLayoutList(buffer()->params().getTextClassPtr(), force)) {
975 d.current_layout = buffer()->params().getTextClass().defaultLayoutName();
978 docstring const & layout = d.current_work_area_->bufferView().cursor().
979 innerParagraph().layout()->name();
981 if (layout != d.current_layout) {
982 d.toolbars_->setLayout(layout);
983 d.current_layout = layout;
988 bool GuiView::isToolbarVisible(std::string const & id)
990 return d.toolbars_->visible(id);
993 void GuiView::updateToolbars()
995 if (d.current_work_area_) {
997 d.current_work_area_->bufferView().cursor().inMathed();
999 lyx::getStatus(FuncRequest(LFUN_LAYOUT_TABULAR)).enabled();
1001 lyx::getStatus(FuncRequest(LFUN_CHANGES_TRACK)).enabled() &&
1002 lyx::getStatus(FuncRequest(LFUN_CHANGES_TRACK)).onoff(true);
1004 d.toolbars_->update(math, table, review);
1006 d.toolbars_->update(false, false, false);
1008 // update read-only status of open dialogs.
1009 getDialogs().checkStatus();
1013 ToolbarInfo * GuiView::getToolbarInfo(string const & name)
1015 return d.toolbars_->getToolbarInfo(name);
1019 void GuiView::toggleToolbarState(string const & name, bool allowauto)
1021 // it is possible to get current toolbar status like this,...
1022 // but I decide to obey the order of ToolbarBackend::flags
1023 // and disregard real toolbar status.
1024 // toolbars_->saveToolbarInfo();
1026 // toggle state on/off/auto
1027 d.toolbars_->toggleToolbarState(name, allowauto);
1033 } // namespace frontend
1036 #include "GuiView_moc.cpp"