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"
41 #include "FuncRequest.h"
46 #include "MenuBackend.h"
47 #include "Paragraph.h"
51 #include <boost/current_function.hpp>
54 #include <QApplication>
55 #include <QCloseEvent>
56 #include <QDesktopWidget>
57 #include <QDragEnterEvent>
63 #include <QPushButton>
64 #include <QStackedWidget>
75 using support::FileName;
76 using support::libFileSearch;
77 using support::makeDisplayPath;
85 int const statusbar_timer_value = 3000;
87 class BackgroundWidget : public QWidget
90 BackgroundWidget(QString const & file, QString const & text)
92 splash_ = new QPixmap(file);
94 lyxerr << "could not load splash screen: '" << fromqstr(file) << "'" << endl;
98 QPainter pain(splash_);
99 pain.setPen(QColor(255, 255, 0));
101 // The font used to display the version info
102 font.setStyleHint(QFont::SansSerif);
103 font.setWeight(QFont::Bold);
104 font.setPointSize(convert<int>(lyxrc.font_sizes[Font::SIZE_LARGE]));
106 pain.drawText(260, 270, text);
109 void paintEvent(QPaintEvent *)
114 int x = (width() - splash_->width()) / 2;
115 int y = (height() - splash_->height()) / 2;
117 pain.drawPixmap(x, y, *splash_);
127 struct GuiViewBase::GuiViewPrivate
134 TabWorkArea * tab_widget_;
135 QStackedWidget * stack_widget_;
136 BackgroundWidget * bg_widget_;
138 GuiMenubar * menubar_;
140 GuiToolbars * toolbars_;
142 docstring current_layout;
144 GuiViewPrivate() : posx_offset(0), posy_offset(0) {}
146 unsigned int smallIconSize;
147 unsigned int normalIconSize;
148 unsigned int bigIconSize;
149 // static needed by "New Window"
150 static unsigned int lastIconSize;
152 QMenu * toolBarPopup(GuiViewBase * parent)
154 // FIXME: translation
155 QMenu * menu = new QMenu(parent);
156 QActionGroup * iconSizeGroup = new QActionGroup(parent);
158 QAction * smallIcons = new QAction(iconSizeGroup);
159 smallIcons->setText(qt_("Small-sized icons"));
160 smallIcons->setCheckable(true);
161 QObject::connect(smallIcons, SIGNAL(triggered()), parent, SLOT(smallSizedIcons()));
162 menu->addAction(smallIcons);
164 QAction * normalIcons = new QAction(iconSizeGroup);
165 normalIcons->setText(qt_("Normal-sized icons"));
166 normalIcons->setCheckable(true);
167 QObject::connect(normalIcons, SIGNAL(triggered()), parent, SLOT(normalSizedIcons()));
168 menu->addAction(normalIcons);
170 QAction * bigIcons = new QAction(iconSizeGroup);
171 bigIcons->setText(qt_("Big-sized icons"));
172 bigIcons->setCheckable(true);
173 QObject::connect(bigIcons, SIGNAL(triggered()), parent, SLOT(bigSizedIcons()));
174 menu->addAction(bigIcons);
176 unsigned int cur = parent->iconSize().width();
177 if ( cur == parent->d.smallIconSize)
178 smallIcons->setChecked(true);
179 else if (cur == parent->d.normalIconSize)
180 normalIcons->setChecked(true);
181 else if (cur == parent->d.bigIconSize)
182 bigIcons->setChecked(true);
187 void initBackground()
190 LYXERR(Debug::GUI) << "show banner: " << lyxrc.show_banner << endl;
191 /// The text to be written on top of the pixmap
192 QString const text = lyx_version ? QString(lyx_version) : qt_("unknown version");
193 FileName const file = support::libFileSearch("images", "banner", "png");
197 bg_widget_ = new BackgroundWidget(toqstr(file.absFilename()), text);
205 stack_widget_->setCurrentWidget(bg_widget_);
206 bg_widget_->setUpdatesEnabled(true);
211 unsigned int GuiViewBase::GuiViewPrivate::lastIconSize = 0;
214 GuiViewBase::GuiViewBase(int id)
215 : QMainWindow(), LyXView(id), quitting_by_menu_(false),
216 d(*new GuiViewPrivate)
218 // Qt bug? signal lastWindowClosed does not work
219 setAttribute(Qt::WA_QuitOnClose, false);
220 setAttribute(Qt::WA_DeleteOnClose, true);
222 // hardcode here the platform specific icon size
223 d.smallIconSize = 14; // scaling problems
224 d.normalIconSize = 20; // ok, default
225 d.bigIconSize = 26; // better for some math icons
228 // assign an icon to main form. We do not do it under Qt/Mac,
229 // since the icon is provided in the application bundle.
230 FileName const iconname = libFileSearch("images", "lyx", "png");
231 if (!iconname.empty())
232 setWindowIcon(QPixmap(toqstr(iconname.absFilename())));
235 d.tab_widget_ = new TabWorkArea;
236 QObject::connect(d.tab_widget_, SIGNAL(currentWorkAreaChanged(GuiWorkArea *)),
237 this, SLOT(on_currentWorkAreaChanged(GuiWorkArea *)));
241 LYXERR(Debug::GUI) << "stack widget!" << endl;
242 d.stack_widget_ = new QStackedWidget;
243 d.stack_widget_->addWidget(d.bg_widget_);
244 d.stack_widget_->addWidget(d.tab_widget_);
245 setCentralWidget(d.stack_widget_);
248 setCentralWidget(d.tab_widget_);
252 setAcceptDrops(true);
256 GuiViewBase::~GuiViewBase()
264 void GuiViewBase::close()
266 quitting_by_menu_ = true;
267 while (d.tab_widget_->count()) {
268 GuiWorkArea * wa = dynamic_cast<GuiWorkArea *>(d.tab_widget_->widget(0));
270 d.tab_widget_->removeTab(0);
273 QMainWindow::close();
274 quitting_by_menu_ = false;
278 void GuiViewBase::setFocus()
280 if (d.tab_widget_->count())
281 d.tab_widget_->currentWidget()->setFocus();
285 QMenu* GuiViewBase::createPopupMenu()
287 return d.toolBarPopup(this);
291 void GuiViewBase::init()
293 // GuiToolbars *must* be initialised before GuiMenubar.
294 d.toolbars_ = new GuiToolbars(*this);
295 // FIXME: GuiToolbars::init() cannot be integrated in the ctor
296 // because LyXFunc::getStatus() needs a properly initialized
297 // GuiToolbars object (for LFUN_TOOLBAR_TOGGLE).
299 d.menubar_ = new GuiMenubar(this, menubackend);
301 statusBar()->setSizeGripEnabled(true);
303 QObject::connect(&statusbar_timer_, SIGNAL(timeout()),
304 this, SLOT(update_view_state_qt()));
307 d.stack_widget_->setCurrentWidget(d.bg_widget_);
311 void GuiViewBase::closeEvent(QCloseEvent * close_event)
313 // we may have been called through the close window button
314 // which bypasses the LFUN machinery.
315 if (!quitting_by_menu_ && theApp()->gui().viewIds().size() == 1) {
316 if (!theBufferList().quitWriteAll()) {
317 close_event->ignore();
322 // Make sure that no LFUN use this close to be closed View.
323 theLyXFunc().setLyXView(0);
324 // Make sure the timer time out will not trigger a statusbar update.
325 statusbar_timer_.stop();
327 theApp()->gui().unregisterView(id());
328 if (!theApp()->gui().viewIds().empty()) {
329 // Just close the window and do nothing else if this is not the
331 close_event->accept();
337 // this is the place where we leave the frontend.
338 // it is the only point at which we start quitting.
340 close_event->accept();
341 // quit the event loop
346 void GuiViewBase::dragEnterEvent(QDragEnterEvent * event)
348 if (event->mimeData()->hasUrls())
350 /// \todo Ask lyx-devel is this is enough:
351 /// if (event->mimeData()->hasFormat("text/plain"))
352 /// event->acceptProposedAction();
356 void GuiViewBase::dropEvent(QDropEvent* event)
358 QList<QUrl> files = event->mimeData()->urls();
362 LYXERR(Debug::GUI) << BOOST_CURRENT_FUNCTION
363 << " got URLs!" << endl;
364 for (int i = 0; i != files.size(); ++i) {
365 string const file = support::os::internal_path(fromqstr(
366 files.at(i).toLocalFile()));
368 dispatch(FuncRequest(LFUN_FILE_OPEN, file));
373 void GuiViewBase::saveGeometry()
375 static bool done = false;
382 // change the ifdef to 'geometry = normalGeometry();' only
383 // when Trolltech has fixed the broken normalGeometry on X11:
384 // http://www.trolltech.com/developer/task-tracker/index_html?id=119684+&method=entry
385 // Then also the moveEvent, resizeEvent, and the
386 // code for floatingGeometry_ can be removed;
387 // adjust GuiViewBase::setGeometry()
389 QRect normal_geometry;
392 normal_geometry = normalGeometry();
394 maximized = CompletelyMaximized;
396 maximized = NotMaximized;
399 normal_geometry = updateFloatingGeometry();
401 QDesktopWidget& dw = *qApp->desktop();
402 QRect desk = dw.availableGeometry(dw.primaryScreen());
403 // Qt bug on Linux: load completely maximized, vert max. save-> frameGeometry().height() is wrong
404 if (isMaximized() && desk.width() <= frameGeometry().width() && desk.height() <= frameGeometry().height()) {
405 maximized = CompletelyMaximized;
406 // maximizing does not work when the window is allready hor. or vert. maximized
407 // Tested only on KDE
408 int dh = frameGeometry().height() - height();
409 if (desk.height() <= normal_geometry.height() + dh)
410 normal_geometry.setHeight(normal_geometry.height() - 1);
411 int dw = frameGeometry().width() - width();
412 if (desk.width() <= normal_geometry.width() + dw)
413 normal_geometry.setWidth(normal_geometry.width() - 1);
414 } else if (desk.height() <= frameGeometry().height()) {
415 maximized = VerticallyMaximized;
416 } else if (desk.width() <= frameGeometry().width()) {
417 maximized = HorizontallyMaximized;
419 maximized = NotMaximized;
424 // save windows size and position
425 Session & session = LyX::ref().session();
426 session.sessionInfo().save("WindowWidth", convert<string>(normal_geometry.width()));
427 session.sessionInfo().save("WindowHeight", convert<string>(normal_geometry.height()));
428 session.sessionInfo().save("WindowMaximized", convert<string>(maximized));
429 session.sessionInfo().save("IconSizeXY", convert<string>(iconSize().width()));
430 if (lyxrc.geometry_xysaved) {
431 session.sessionInfo().save("WindowPosX", convert<string>(normal_geometry.x() + d.posx_offset));
432 session.sessionInfo().save("WindowPosY", convert<string>(normal_geometry.y() + d.posy_offset));
434 d.toolbars_->saveToolbarInfo();
438 void GuiViewBase::setGeometry(unsigned int width,
442 unsigned int iconSizeXY,
443 const string & geometryArg)
445 // use last value (not at startup)
446 if (d.lastIconSize != 0)
447 setIconSize(d.lastIconSize);
448 else if (iconSizeXY != 0)
449 setIconSize(iconSizeXY);
451 setIconSize(d.normalIconSize);
453 // only true when the -geometry option was NOT used
454 if (width != 0 && height != 0) {
455 if (posx != -1 && posy != -1) {
456 // if there are startup positioning problems:
457 // http://doc.trolltech.com/4.2/qdesktopwidget.html
458 QDesktopWidget& dw = *qApp->desktop();
459 if (dw.isVirtualDesktop()) {
460 if(!dw.geometry().contains(posx, posy)) {
465 // Which system doesn't use a virtual desktop?
466 // TODO save also last screen number and check if it is still availabe.
469 // FIXME: use setGeometry only when Trolltech has fixed the qt4/X11 bug
470 QWidget::setGeometry(posx, posy, width, height);
472 resize(width, height);
476 resize(width, height);
479 // remember original size
480 floatingGeometry_ = QRect(posx, posy, width, height);
482 if (maximized != NotMaximized) {
483 if (maximized == CompletelyMaximized) {
484 setWindowState(Qt::WindowMaximized);
487 // TODO How to set by the window manager?
488 // setWindowState(Qt::WindowVerticallyMaximized);
490 QDesktopWidget& dw = *qApp->desktop();
491 QRect desk = dw.availableGeometry(dw.primaryScreen());
492 if (maximized == VerticallyMaximized)
493 resize(width, desk.height());
494 if (maximized == HorizontallyMaximized)
495 resize(desk.width(), height);
502 // FIXME: move this code into parse_geometry() (LyX.cpp)
506 QRegExp re( "[=]*(?:([0-9]+)[xX]([0-9]+)){0,1}[ ]*(?:([+-][0-9]*)([+-][0-9]*)){0,1}" );
507 re.indexIn(toqstr(geometryArg.c_str()));
508 w = re.cap(1).toInt();
509 h = re.cap(2).toInt();
510 x = re.cap(3).toInt();
511 y = re.cap(4).toInt();
512 QWidget::setGeometry( x, y, w, h );
523 // For an unknown reason, the Window title update is not effective for
524 // the second windows up until it is shown on screen (Qt bug?).
527 // after show geometry() has changed (Qt bug?)
528 // we compensate the drift when storing the position
531 if (width != 0 && height != 0)
532 if (posx != -1 && posy != -1) {
534 d.posx_offset = posx - normalGeometry().x();
535 d.posy_offset = posy - normalGeometry().y();
538 if (maximized == NotMaximized) {
539 d.posx_offset = posx - geometry().x();
540 d.posy_offset = posy - geometry().y();
548 void GuiViewBase::setWindowTitle(docstring const & t, docstring const & it)
550 QString title = windowTitle();
551 QString new_title = toqstr(t);
552 if (title != new_title) {
553 QMainWindow::setWindowTitle(new_title);
554 QMainWindow::setWindowIconText(toqstr(it));
556 if (Buffer const * buf = buffer())
557 d.tab_widget_->setTabText(d.tab_widget_->currentIndex(),
558 toqstr(makeDisplayPath(buf->fileName(), 30)));
562 void GuiViewBase::message(docstring const & str)
564 statusBar()->showMessage(toqstr(str));
565 statusbar_timer_.stop();
566 statusbar_timer_.start(statusbar_timer_value);
570 void GuiViewBase::clearMessage()
572 update_view_state_qt();
576 void GuiViewBase::setIconSize(unsigned int size)
578 d.lastIconSize = size;
579 QMainWindow::setIconSize(QSize(size, size));
583 void GuiViewBase::smallSizedIcons()
585 setIconSize(d.smallIconSize);
589 void GuiViewBase::normalSizedIcons()
591 setIconSize(d.normalIconSize);
595 void GuiViewBase::bigSizedIcons()
597 setIconSize(d.bigIconSize);
601 void GuiViewBase::update_view_state_qt()
605 theLyXFunc().setLyXView(this);
606 statusBar()->showMessage(toqstr(theLyXFunc().viewStatusMessage()));
607 statusbar_timer_.stop();
611 void GuiViewBase::on_currentWorkAreaChanged(GuiWorkArea * wa)
614 disconnectBufferView();
615 connectBufferView(wa->bufferView());
616 connectBuffer(wa->bufferView().buffer());
619 // Buffer-dependent dialogs should be updated or
620 // hidden. This should go here because some dialogs (eg ToC)
621 // require bv_->text.
622 getDialogs().updateBufferDependent(true);
624 updateLayoutChoice();
630 void GuiViewBase::updateStatusBar()
632 // let the user see the explicit message
633 if (statusbar_timer_.isActive())
636 statusBar()->showMessage(toqstr(theLyXFunc().viewStatusMessage()));
640 void GuiViewBase::activated(FuncRequest const & func)
646 bool GuiViewBase::hasFocus() const
648 return qApp->activeWindow() == this;
652 QRect GuiViewBase::updateFloatingGeometry()
654 QDesktopWidget& dw = *qApp->desktop();
655 QRect desk = dw.availableGeometry(dw.primaryScreen());
656 // remember only non-maximized sizes
657 if (!isMaximized() && desk.width() > frameGeometry().width() && desk.height() > frameGeometry().height()) {
658 floatingGeometry_ = QRect(x(), y(), width(), height());
660 return floatingGeometry_;
664 void GuiViewBase::resizeEvent(QResizeEvent *)
666 updateFloatingGeometry();
670 void GuiViewBase::moveEvent(QMoveEvent *)
672 updateFloatingGeometry();
676 bool GuiViewBase::event(QEvent * e)
680 // Useful debug code:
681 //case QEvent::ActivationChange:
682 //case QEvent::WindowDeactivate:
683 //case QEvent::Paint:
684 //case QEvent::Enter:
685 //case QEvent::Leave:
686 //case QEvent::HoverEnter:
687 //case QEvent::HoverLeave:
688 //case QEvent::HoverMove:
689 //case QEvent::StatusTip:
690 //case QEvent::DragEnter:
691 //case QEvent::DragLeave:
695 case QEvent::WindowActivate:
696 theApp()->setCurrentView(*this);
697 if (d.tab_widget_->count()) {
698 GuiWorkArea * wa = dynamic_cast<GuiWorkArea *>(
699 d.tab_widget_->currentWidget());
701 BufferView & bv = wa->bufferView();
702 connectBufferView(bv);
703 connectBuffer(bv.buffer());
704 // The document structure, name and dialogs might have
705 // changed in another view.
708 getDialogs().updateBufferDependent(true);
710 return QMainWindow::event(e);
712 case QEvent::ShortcutOverride: {
713 QKeyEvent * ke = static_cast<QKeyEvent*>(e);
714 if (d.tab_widget_->count() == 0) {
715 theLyXFunc().setLyXView(this);
717 setKeySymbol(&sym, ke);
718 theLyXFunc().processKeySym(sym, q_key_state(ke->modifiers()));
722 if (ke->key() == Qt::Key_Tab || ke->key() == Qt::Key_Backtab) {
724 setKeySymbol(&sym, ke);
725 currentWorkArea()->processKeySym(sym, NoModifier);
731 return QMainWindow::event(e);
736 bool GuiViewBase::focusNextPrevChild(bool /*next*/)
743 void GuiViewBase::showView()
745 QMainWindow::setWindowTitle(qt_("LyX"));
747 updateFloatingGeometry();
751 void GuiViewBase::busy(bool yes)
753 if (d.tab_widget_->count()) {
754 GuiWorkArea * wa = dynamic_cast<GuiWorkArea *>(d.tab_widget_->currentWidget());
756 wa->setUpdatesEnabled(!yes);
758 wa->stopBlinkingCursor();
760 wa->startBlinkingCursor();
764 QApplication::setOverrideCursor(Qt::WaitCursor);
766 QApplication::restoreOverrideCursor();
770 GuiToolbar * GuiViewBase::makeToolbar(ToolbarInfo const & tbinfo, bool newline)
772 GuiToolbar * toolBar = new GuiToolbar(tbinfo, *this);
774 if (tbinfo.flags & ToolbarInfo::TOP) {
776 addToolBarBreak(Qt::TopToolBarArea);
777 addToolBar(Qt::TopToolBarArea, toolBar);
780 if (tbinfo.flags & ToolbarInfo::BOTTOM) {
781 // Qt < 4.2.2 cannot handle ToolBarBreak on non-TOP dock.
782 #if (QT_VERSION >= 0x040202)
784 addToolBarBreak(Qt::BottomToolBarArea);
786 addToolBar(Qt::BottomToolBarArea, toolBar);
789 if (tbinfo.flags & ToolbarInfo::LEFT) {
790 // Qt < 4.2.2 cannot handle ToolBarBreak on non-TOP dock.
791 #if (QT_VERSION >= 0x040202)
793 addToolBarBreak(Qt::LeftToolBarArea);
795 addToolBar(Qt::LeftToolBarArea, toolBar);
798 if (tbinfo.flags & ToolbarInfo::RIGHT) {
799 // Qt < 4.2.2 cannot handle ToolBarBreak on non-TOP dock.
800 #if (QT_VERSION >= 0x040202)
802 addToolBarBreak(Qt::RightToolBarArea);
804 addToolBar(Qt::RightToolBarArea, toolBar);
807 // The following does not work so I cannot restore to exact toolbar location
809 ToolbarSection::ToolbarInfo & tbinfo = LyX::ref().session().toolbars().load(tbinfo.name);
810 toolBar->move(tbinfo.posx, tbinfo.posy);
817 WorkArea * GuiViewBase::workArea(Buffer & buffer)
819 for (int i = 0; i != d.tab_widget_->count(); ++i) {
820 GuiWorkArea * wa = dynamic_cast<GuiWorkArea *>(d.tab_widget_->widget(i));
822 if (&wa->bufferView().buffer() == &buffer)
829 WorkArea * GuiViewBase::addWorkArea(Buffer & buffer)
831 GuiWorkArea * wa = new GuiWorkArea(buffer, *this);
832 wa->setUpdatesEnabled(false);
833 d.tab_widget_->addTab(wa, toqstr(makeDisplayPath(buffer.fileName(), 30)));
834 wa->bufferView().updateMetrics(false);
836 d.stack_widget_->setCurrentWidget(d.tab_widget_);
837 // Hide tabbar if there's only one tab.
838 d.tab_widget_->showBar(d.tab_widget_->count() > 1);
843 WorkArea * GuiViewBase::currentWorkArea()
845 if (d.tab_widget_->count() == 0)
847 BOOST_ASSERT(dynamic_cast<GuiWorkArea *>(d.tab_widget_->currentWidget()));
848 return dynamic_cast<GuiWorkArea *>(d.tab_widget_->currentWidget());
852 WorkArea const * GuiViewBase::currentWorkArea() const
854 if (d.tab_widget_->count() == 0)
856 BOOST_ASSERT(dynamic_cast<GuiWorkArea const *>(d.tab_widget_->currentWidget()));
857 return dynamic_cast<GuiWorkArea const *>(d.tab_widget_->currentWidget());
861 void GuiViewBase::setCurrentWorkArea(WorkArea * work_area)
863 BOOST_ASSERT(work_area);
865 // Changing work area can result from opening a file so
866 // update the toc in any case.
869 GuiWorkArea * wa = dynamic_cast<GuiWorkArea *>(work_area);
871 d.tab_widget_->setCurrentWorkArea(wa);
875 void GuiViewBase::removeWorkArea(WorkArea * work_area)
877 BOOST_ASSERT(work_area);
878 if (work_area == currentWorkArea()) {
880 disconnectBufferView();
883 // removing a work area often results from closing a file so
884 // update the toc in any case.
887 GuiWorkArea * gwa = dynamic_cast<GuiWorkArea *>(work_area);
889 d.tab_widget_->removeWorkArea(gwa);
891 getDialogs().hideBufferDependent();
893 if (d.tab_widget_->count() == 0 && d.stack_widget_)
894 // No more work area, switch to the background widget.
899 void GuiViewBase::showMiniBuffer(bool visible)
901 d.toolbars_->showCommandBuffer(visible);
905 void GuiViewBase::openMenu(docstring const & name)
907 d.menubar_->openByName(toqstr(name));
911 void GuiViewBase::openLayoutList()
913 d.toolbars_->openLayoutList();
917 void GuiViewBase::updateLayoutChoice()
919 // Don't show any layouts without a buffer
921 d.toolbars_->clearLayoutList();
925 // Update the layout display
926 if (d.toolbars_->updateLayoutList(buffer()->params().getTextClassPtr())) {
927 d.current_layout = buffer()->params().getTextClass().defaultLayoutName();
930 docstring const & layout = currentWorkArea()->bufferView().cursor().
931 innerParagraph().layout()->name();
933 if (layout != d.current_layout) {
934 d.toolbars_->setLayout(layout);
935 d.current_layout = layout;
940 bool GuiViewBase::isToolbarVisible(std::string const & id)
942 return d.toolbars_->visible(id);
945 void GuiViewBase::updateToolbars()
947 WorkArea * wa = currentWorkArea();
950 wa->bufferView().cursor().inMathed();
952 lyx::getStatus(FuncRequest(LFUN_LAYOUT_TABULAR)).enabled();
954 lyx::getStatus(FuncRequest(LFUN_CHANGES_TRACK)).enabled() &&
955 lyx::getStatus(FuncRequest(LFUN_CHANGES_TRACK)).onoff(true);
957 d.toolbars_->update(math, table, review);
959 d.toolbars_->update(false, false, false);
961 // update read-only status of open dialogs.
962 getDialogs().checkStatus();
966 ToolbarInfo * GuiViewBase::getToolbarInfo(string const & name)
968 return d.toolbars_->getToolbarInfo(name);
972 void GuiViewBase::toggleToolbarState(string const & name, bool allowauto)
974 // it is possible to get current toolbar status like this,...
975 // but I decide to obey the order of ToolbarBackend::flags
976 // and disregard real toolbar status.
977 // toolbars_->saveToolbarInfo();
979 // toggle state on/off/auto
980 d.toolbars_->toggleToolbarState(name, allowauto);
986 } // namespace frontend
989 #include "GuiView_moc.cpp"