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>
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 GuiView::GuiViewPrivate
134 GuiWorkArea * current_work_area_;
135 QSplitter * splitter_;
136 QStackedWidget * stack_widget_;
137 BackgroundWidget * bg_widget_;
139 GuiMenubar * menubar_;
141 GuiToolbars * toolbars_;
143 docstring current_layout;
146 : current_work_area_(0), posx_offset(0), posy_offset(0)
153 delete stack_widget_;
158 unsigned int smallIconSize;
159 unsigned int normalIconSize;
160 unsigned int bigIconSize;
161 // static needed by "New Window"
162 static unsigned int lastIconSize;
164 QMenu * toolBarPopup(GuiView * parent)
166 // FIXME: translation
167 QMenu * menu = new QMenu(parent);
168 QActionGroup * iconSizeGroup = new QActionGroup(parent);
170 QAction * smallIcons = new QAction(iconSizeGroup);
171 smallIcons->setText(qt_("Small-sized icons"));
172 smallIcons->setCheckable(true);
173 QObject::connect(smallIcons, SIGNAL(triggered()), parent, SLOT(smallSizedIcons()));
174 menu->addAction(smallIcons);
176 QAction * normalIcons = new QAction(iconSizeGroup);
177 normalIcons->setText(qt_("Normal-sized icons"));
178 normalIcons->setCheckable(true);
179 QObject::connect(normalIcons, SIGNAL(triggered()), parent, SLOT(normalSizedIcons()));
180 menu->addAction(normalIcons);
182 QAction * bigIcons = new QAction(iconSizeGroup);
183 bigIcons->setText(qt_("Big-sized icons"));
184 bigIcons->setCheckable(true);
185 QObject::connect(bigIcons, SIGNAL(triggered()), parent, SLOT(bigSizedIcons()));
186 menu->addAction(bigIcons);
188 unsigned int cur = parent->iconSize().width();
189 if ( cur == parent->d.smallIconSize)
190 smallIcons->setChecked(true);
191 else if (cur == parent->d.normalIconSize)
192 normalIcons->setChecked(true);
193 else if (cur == parent->d.bigIconSize)
194 bigIcons->setChecked(true);
199 void initBackground()
201 LYXERR(Debug::GUI) << "show banner: " << lyxrc.show_banner << endl;
202 /// The text to be written on top of the pixmap
203 QString const text = lyx_version ? QString(lyx_version) : qt_("unknown version");
204 bg_widget_ = new BackgroundWidget(":/images/banner.png", text);
209 stack_widget_->setCurrentWidget(bg_widget_);
210 bg_widget_->setUpdatesEnabled(true);
213 TabWorkArea * tabWorkArea(int i)
215 return dynamic_cast<TabWorkArea *>(splitter_->widget(i));
218 TabWorkArea * currentTabWorkArea()
220 if (splitter_->count() == 1)
221 // The first TabWorkArea is always the first one, if any.
222 return tabWorkArea(0);
224 TabWorkArea * tab_widget = 0;
225 for (int i = 0; i != splitter_->count(); ++i) {
226 QWidget * w = splitter_->widget(i);
229 tab_widget = dynamic_cast<TabWorkArea *>(w);
239 unsigned int GuiView::GuiViewPrivate::lastIconSize = 0;
242 GuiView::GuiView(int id)
243 : QMainWindow(), LyXView(id), quitting_by_menu_(false),
244 d(*new GuiViewPrivate)
246 // Qt bug? signal lastWindowClosed does not work
247 setAttribute(Qt::WA_QuitOnClose, false);
248 setAttribute(Qt::WA_DeleteOnClose, true);
250 // hardcode here the platform specific icon size
251 d.smallIconSize = 14; // scaling problems
252 d.normalIconSize = 20; // ok, default
253 d.bigIconSize = 26; // better for some math icons
256 // assign an icon to main form. We do not do it under Qt/Mac,
257 // since the icon is provided in the application bundle.
258 setWindowIcon(QPixmap(":/images/lyx.png"));
262 d.splitter_ = new QSplitter;
265 LYXERR(Debug::GUI) << "stack widget!" << endl;
266 d.stack_widget_ = new QStackedWidget;
267 d.stack_widget_->addWidget(d.bg_widget_);
268 d.stack_widget_->addWidget(d.splitter_);
269 setCentralWidget(d.stack_widget_);
272 setAcceptDrops(true);
282 void GuiView::close()
284 quitting_by_menu_ = true;
285 d.current_work_area_ = 0;
286 for (int i = 0; i != d.splitter_->count(); ++i) {
287 TabWorkArea * twa = d.tabWorkArea(i);
291 QMainWindow::close();
292 quitting_by_menu_ = false;
296 void GuiView::setFocus()
298 if (d.current_work_area_)
299 d.current_work_area_->setFocus();
305 QMenu* GuiView::createPopupMenu()
307 return d.toolBarPopup(this);
313 // GuiToolbars *must* be initialised before GuiMenubar.
314 d.toolbars_ = new GuiToolbars(*this);
315 // FIXME: GuiToolbars::init() cannot be integrated in the ctor
316 // because LyXFunc::getStatus() needs a properly initialized
317 // GuiToolbars object (for LFUN_TOOLBAR_TOGGLE).
319 d.menubar_ = new GuiMenubar(this, menubackend);
321 statusBar()->setSizeGripEnabled(true);
323 QObject::connect(&statusbar_timer_, SIGNAL(timeout()),
324 this, SLOT(update_view_state_qt()));
330 void GuiView::closeEvent(QCloseEvent * close_event)
332 // we may have been called through the close window button
333 // which bypasses the LFUN machinery.
334 if (!quitting_by_menu_ && theApp()->gui().viewIds().size() == 1) {
335 if (!theBufferList().quitWriteAll()) {
336 close_event->ignore();
341 // Make sure that no LFUN use this close to be closed View.
342 theLyXFunc().setLyXView(0);
343 // Make sure the timer time out will not trigger a statusbar update.
344 statusbar_timer_.stop();
346 theApp()->gui().unregisterView(id());
347 if (!theApp()->gui().viewIds().empty()) {
348 // Just close the window and do nothing else if this is not the
350 close_event->accept();
356 // this is the place where we leave the frontend.
357 // it is the only point at which we start quitting.
359 close_event->accept();
360 // quit the event loop
365 void GuiView::dragEnterEvent(QDragEnterEvent * event)
367 if (event->mimeData()->hasUrls())
369 /// \todo Ask lyx-devel is this is enough:
370 /// if (event->mimeData()->hasFormat("text/plain"))
371 /// event->acceptProposedAction();
375 void GuiView::dropEvent(QDropEvent* event)
377 QList<QUrl> files = event->mimeData()->urls();
381 LYXERR(Debug::GUI) << BOOST_CURRENT_FUNCTION
382 << " got URLs!" << endl;
383 for (int i = 0; i != files.size(); ++i) {
384 string const file = support::os::internal_path(fromqstr(
385 files.at(i).toLocalFile()));
387 dispatch(FuncRequest(LFUN_FILE_OPEN, file));
392 void GuiView::saveGeometry()
394 static bool done = false;
401 // change the ifdef to 'geometry = normalGeometry();' only
402 // when Trolltech has fixed the broken normalGeometry on X11:
403 // http://www.trolltech.com/developer/task-tracker/index_html?id=119684+&method=entry
404 // Then also the moveEvent, resizeEvent, and the
405 // code for floatingGeometry_ can be removed;
406 // adjust GuiView::setGeometry()
408 QRect normal_geometry;
411 normal_geometry = normalGeometry();
413 maximized = CompletelyMaximized;
415 maximized = NotMaximized;
418 normal_geometry = updateFloatingGeometry();
420 QDesktopWidget& dw = *qApp->desktop();
421 QRect desk = dw.availableGeometry(dw.primaryScreen());
422 // Qt bug on Linux: load completely maximized, vert max. save-> frameGeometry().height() is wrong
423 if (isMaximized() && desk.width() <= frameGeometry().width() && desk.height() <= frameGeometry().height()) {
424 maximized = CompletelyMaximized;
425 // maximizing does not work when the window is allready hor. or vert. maximized
426 // Tested only on KDE
427 int dh = frameGeometry().height() - height();
428 if (desk.height() <= normal_geometry.height() + dh)
429 normal_geometry.setHeight(normal_geometry.height() - 1);
430 int dw = frameGeometry().width() - width();
431 if (desk.width() <= normal_geometry.width() + dw)
432 normal_geometry.setWidth(normal_geometry.width() - 1);
433 } else if (desk.height() <= frameGeometry().height()) {
434 maximized = VerticallyMaximized;
435 } else if (desk.width() <= frameGeometry().width()) {
436 maximized = HorizontallyMaximized;
438 maximized = NotMaximized;
443 // save windows size and position
444 Session & session = LyX::ref().session();
445 session.sessionInfo().save("WindowWidth", convert<string>(normal_geometry.width()));
446 session.sessionInfo().save("WindowHeight", convert<string>(normal_geometry.height()));
447 session.sessionInfo().save("WindowMaximized", convert<string>(maximized));
448 session.sessionInfo().save("IconSizeXY", convert<string>(iconSize().width()));
449 if (lyxrc.geometry_xysaved) {
450 session.sessionInfo().save("WindowPosX", convert<string>(normal_geometry.x() + d.posx_offset));
451 session.sessionInfo().save("WindowPosY", convert<string>(normal_geometry.y() + d.posy_offset));
453 d.toolbars_->saveToolbarInfo();
457 void GuiView::setGeometry(unsigned int width,
461 unsigned int iconSizeXY,
462 const string & geometryArg)
464 // use last value (not at startup)
465 if (d.lastIconSize != 0)
466 setIconSize(d.lastIconSize);
467 else if (iconSizeXY != 0)
468 setIconSize(iconSizeXY);
470 setIconSize(d.normalIconSize);
472 // only true when the -geometry option was NOT used
473 if (width != 0 && height != 0) {
474 if (posx != -1 && posy != -1) {
475 // if there are startup positioning problems:
476 // http://doc.trolltech.com/4.2/qdesktopwidget.html
477 QDesktopWidget& dw = *qApp->desktop();
478 if (dw.isVirtualDesktop()) {
479 if(!dw.geometry().contains(posx, posy)) {
484 // Which system doesn't use a virtual desktop?
485 // TODO save also last screen number and check if it is still availabe.
488 // FIXME: use setGeometry only when Trolltech has fixed the qt4/X11 bug
489 QWidget::setGeometry(posx, posy, width, height);
491 resize(width, height);
495 resize(width, height);
498 // remember original size
499 floatingGeometry_ = QRect(posx, posy, width, height);
501 if (maximized != NotMaximized) {
502 if (maximized == CompletelyMaximized) {
503 setWindowState(Qt::WindowMaximized);
506 // TODO How to set by the window manager?
507 // setWindowState(Qt::WindowVerticallyMaximized);
509 QDesktopWidget& dw = *qApp->desktop();
510 QRect desk = dw.availableGeometry(dw.primaryScreen());
511 if (maximized == VerticallyMaximized)
512 resize(width, desk.height());
513 if (maximized == HorizontallyMaximized)
514 resize(desk.width(), height);
521 // FIXME: move this code into parse_geometry() (LyX.cpp)
525 QRegExp re( "[=]*(?:([0-9]+)[xX]([0-9]+)){0,1}[ ]*(?:([+-][0-9]*)([+-][0-9]*)){0,1}" );
526 re.indexIn(toqstr(geometryArg.c_str()));
527 w = re.cap(1).toInt();
528 h = re.cap(2).toInt();
529 x = re.cap(3).toInt();
530 y = re.cap(4).toInt();
531 QWidget::setGeometry( x, y, w, h );
542 // after show geometry() has changed (Qt bug?)
543 // we compensate the drift when storing the position
546 if (width != 0 && height != 0)
547 if (posx != -1 && posy != -1) {
549 d.posx_offset = posx - normalGeometry().x();
550 d.posy_offset = posy - normalGeometry().y();
553 if (maximized == NotMaximized) {
554 d.posx_offset = posx - geometry().x();
555 d.posy_offset = posy - geometry().y();
563 void GuiView::message(docstring const & str)
565 statusBar()->showMessage(toqstr(str));
566 statusbar_timer_.stop();
567 statusbar_timer_.start(statusbar_timer_value);
571 void GuiView::clearMessage()
573 update_view_state_qt();
577 void GuiView::setIconSize(unsigned int size)
579 d.lastIconSize = size;
580 QMainWindow::setIconSize(QSize(size, size));
584 void GuiView::smallSizedIcons()
586 setIconSize(d.smallIconSize);
590 void GuiView::normalSizedIcons()
592 setIconSize(d.normalIconSize);
596 void GuiView::bigSizedIcons()
598 setIconSize(d.bigIconSize);
602 void GuiView::update_view_state_qt()
606 theLyXFunc().setLyXView(this);
607 statusBar()->showMessage(toqstr(theLyXFunc().viewStatusMessage()));
608 statusbar_timer_.stop();
612 void GuiView::updateWindowTitle(GuiWorkArea * wa)
614 if (wa != d.current_work_area_)
616 setWindowTitle(qt_("LyX: ") + wa->windowTitle());
617 setWindowIconText(wa->windowIconText());
621 void GuiView::on_currentWorkAreaChanged(GuiWorkArea * wa)
624 disconnectBufferView();
625 connectBufferView(wa->bufferView());
626 connectBuffer(wa->bufferView().buffer());
627 d.current_work_area_ = wa;
628 QObject::connect(wa, SIGNAL(titleChanged(GuiWorkArea *)),
629 this, SLOT(updateWindowTitle(GuiWorkArea *)));
630 updateWindowTitle(wa);
633 // Buffer-dependent dialogs should be updated or
634 // hidden. This should go here because some dialogs (eg ToC)
635 // require bv_->text.
636 getDialogs().updateBufferDependent(true);
638 updateLayoutChoice(false);
643 void GuiView::updateStatusBar()
645 // let the user see the explicit message
646 if (statusbar_timer_.isActive())
649 statusBar()->showMessage(toqstr(theLyXFunc().viewStatusMessage()));
653 void GuiView::activated(FuncRequest const & func)
659 bool GuiView::hasFocus() const
661 return qApp->activeWindow() == this;
665 QRect GuiView::updateFloatingGeometry()
667 QDesktopWidget& dw = *qApp->desktop();
668 QRect desk = dw.availableGeometry(dw.primaryScreen());
669 // remember only non-maximized sizes
670 if (!isMaximized() && desk.width() > frameGeometry().width() && desk.height() > frameGeometry().height()) {
671 floatingGeometry_ = QRect(x(), y(), width(), height());
673 return floatingGeometry_;
677 void GuiView::resizeEvent(QResizeEvent *)
679 updateFloatingGeometry();
683 void GuiView::moveEvent(QMoveEvent *)
685 updateFloatingGeometry();
689 bool GuiView::event(QEvent * e)
693 // Useful debug code:
694 //case QEvent::ActivationChange:
695 //case QEvent::WindowDeactivate:
696 //case QEvent::Paint:
697 //case QEvent::Enter:
698 //case QEvent::Leave:
699 //case QEvent::HoverEnter:
700 //case QEvent::HoverLeave:
701 //case QEvent::HoverMove:
702 //case QEvent::StatusTip:
703 //case QEvent::DragEnter:
704 //case QEvent::DragLeave:
708 case QEvent::WindowActivate: {
709 theApp()->setCurrentView(*this);
710 if (d.current_work_area_) {
711 BufferView & bv = d.current_work_area_->bufferView();
712 connectBufferView(bv);
713 connectBuffer(bv.buffer());
714 // The document structure, name and dialogs might have
715 // changed in another view.
716 getDialogs().updateBufferDependent(true);
718 setWindowTitle(qt_("LyX"));
719 setWindowIconText(qt_("LyX"));
721 return QMainWindow::event(e);
723 case QEvent::ShortcutOverride: {
724 QKeyEvent * ke = static_cast<QKeyEvent*>(e);
725 if (!d.current_work_area_) {
726 theLyXFunc().setLyXView(this);
728 setKeySymbol(&sym, ke);
729 theLyXFunc().processKeySym(sym, q_key_state(ke->modifiers()));
733 if (ke->key() == Qt::Key_Tab || ke->key() == Qt::Key_Backtab) {
735 setKeySymbol(&sym, ke);
736 d.current_work_area_->processKeySym(sym, NoModifier);
742 return QMainWindow::event(e);
747 bool GuiView::focusNextPrevChild(bool /*next*/)
754 void GuiView::showView()
756 setWindowTitle(qt_("LyX"));
758 updateFloatingGeometry();
762 void GuiView::setBusy(bool yes)
764 if (d.current_work_area_) {
765 d.current_work_area_->setUpdatesEnabled(!yes);
767 d.current_work_area_->stopBlinkingCursor();
769 d.current_work_area_->startBlinkingCursor();
773 QApplication::setOverrideCursor(Qt::WaitCursor);
775 QApplication::restoreOverrideCursor();
779 GuiToolbar * GuiView::makeToolbar(ToolbarInfo const & tbinfo, bool newline)
781 GuiToolbar * toolBar = new GuiToolbar(tbinfo, *this);
783 if (tbinfo.flags & ToolbarInfo::TOP) {
785 addToolBarBreak(Qt::TopToolBarArea);
786 addToolBar(Qt::TopToolBarArea, toolBar);
789 if (tbinfo.flags & ToolbarInfo::BOTTOM) {
790 // Qt < 4.2.2 cannot handle ToolBarBreak on non-TOP dock.
791 #if (QT_VERSION >= 0x040202)
793 addToolBarBreak(Qt::BottomToolBarArea);
795 addToolBar(Qt::BottomToolBarArea, toolBar);
798 if (tbinfo.flags & ToolbarInfo::LEFT) {
799 // Qt < 4.2.2 cannot handle ToolBarBreak on non-TOP dock.
800 #if (QT_VERSION >= 0x040202)
802 addToolBarBreak(Qt::LeftToolBarArea);
804 addToolBar(Qt::LeftToolBarArea, toolBar);
807 if (tbinfo.flags & ToolbarInfo::RIGHT) {
808 // Qt < 4.2.2 cannot handle ToolBarBreak on non-TOP dock.
809 #if (QT_VERSION >= 0x040202)
811 addToolBarBreak(Qt::RightToolBarArea);
813 addToolBar(Qt::RightToolBarArea, toolBar);
816 // The following does not work so I cannot restore to exact toolbar location
818 ToolbarSection::ToolbarInfo & tbinfo = LyX::ref().session().toolbars().load(tbinfo.name);
819 toolBar->move(tbinfo.posx, tbinfo.posy);
826 WorkArea * GuiView::workArea(Buffer & buffer)
828 for (int i = 0; i != d.splitter_->count(); ++i) {
829 GuiWorkArea * wa = d.tabWorkArea(i)->workArea(buffer);
837 WorkArea * GuiView::addWorkArea(Buffer & buffer)
839 GuiWorkArea * wa = new GuiWorkArea(buffer, *this);
840 wa->setUpdatesEnabled(false);
842 // Automatically create a TabWorkArea if there are none yet.
843 if (!d.splitter_->count())
846 TabWorkArea * tab_widget = d.currentTabWorkArea();
847 tab_widget->addTab(wa, wa->windowTitle());
848 QObject::connect(wa, SIGNAL(titleChanged(GuiWorkArea *)),
849 tab_widget, SLOT(updateTabText(GuiWorkArea *)));
851 wa->bufferView().updateMetrics();
853 // Hide tabbar if there's only one tab.
854 tab_widget->showBar(tab_widget->count() > 1);
859 void GuiView::addTabWorkArea()
861 TabWorkArea * twa = new TabWorkArea;
862 QObject::connect(twa, SIGNAL(currentWorkAreaChanged(GuiWorkArea *)),
863 this, SLOT(on_currentWorkAreaChanged(GuiWorkArea *)));
864 d.splitter_->addWidget(twa);
865 d.stack_widget_->setCurrentWidget(d.splitter_);
869 WorkArea * GuiView::currentWorkArea()
871 return d.current_work_area_;
875 WorkArea const * GuiView::currentWorkArea() const
877 return d.current_work_area_;
881 void GuiView::setCurrentWorkArea(WorkArea * work_area)
883 BOOST_ASSERT(work_area);
885 // Changing work area can result from opening a file so
886 // update the toc in any case.
889 GuiWorkArea * wa = static_cast<GuiWorkArea *>(work_area);
890 d.current_work_area_ = wa;
891 for (int i = 0; i != d.splitter_->count(); ++i) {
892 if (d.tabWorkArea(i)->setCurrentWorkArea(wa))
898 void GuiView::removeWorkArea(WorkArea * work_area)
900 BOOST_ASSERT(work_area);
901 GuiWorkArea * gwa = static_cast<GuiWorkArea *>(work_area);
902 if (gwa == d.current_work_area_) {
904 disconnectBufferView();
905 getDialogs().hideBufferDependent();
906 d.current_work_area_ = 0;
909 // removing a work area often results from closing a file so
910 // update the toc in any case.
913 for (int i = 0; i != d.splitter_->count(); ++i) {
914 TabWorkArea * twa = d.tabWorkArea(i);
915 if (!twa->removeWorkArea(gwa))
916 // Not found in this tab group.
919 // We found and removed the WorkArea.
921 // No more WorkAreas in this tab group, so delete it.
926 if (d.current_work_area_)
927 // This means that we are not closing the current WorkArea;
930 // Switch to the next WorkArea in the found TabWorkArea.
931 d.current_work_area_ = twa->currentWorkArea();
935 if (d.splitter_->count() == 0)
936 // No more work area, switch to the background widget.
941 void GuiView::showMiniBuffer(bool visible)
943 d.toolbars_->showCommandBuffer(visible);
947 void GuiView::openMenu(docstring const & name)
949 d.menubar_->openByName(toqstr(name));
953 void GuiView::openLayoutList()
955 d.toolbars_->openLayoutList();
959 void GuiView::updateLayoutChoice(bool force)
961 // Don't show any layouts without a buffer
963 d.toolbars_->clearLayoutList();
967 // Update the layout display
968 if (d.toolbars_->updateLayoutList(buffer()->params().getTextClassPtr(), force)) {
969 d.current_layout = buffer()->params().getTextClass().defaultLayoutName();
972 docstring const & layout = d.current_work_area_->bufferView().cursor().
973 innerParagraph().layout()->name();
975 if (layout != d.current_layout) {
976 d.toolbars_->setLayout(layout);
977 d.current_layout = layout;
982 bool GuiView::isToolbarVisible(std::string const & id)
984 return d.toolbars_->visible(id);
987 void GuiView::updateToolbars()
989 if (d.current_work_area_) {
991 d.current_work_area_->bufferView().cursor().inMathed();
993 lyx::getStatus(FuncRequest(LFUN_LAYOUT_TABULAR)).enabled();
995 lyx::getStatus(FuncRequest(LFUN_CHANGES_TRACK)).enabled() &&
996 lyx::getStatus(FuncRequest(LFUN_CHANGES_TRACK)).onoff(true);
998 d.toolbars_->update(math, table, review);
1000 d.toolbars_->update(false, false, false);
1002 // update read-only status of open dialogs.
1003 getDialogs().checkStatus();
1007 ToolbarInfo * GuiView::getToolbarInfo(string const & name)
1009 return d.toolbars_->getToolbarInfo(name);
1013 void GuiView::toggleToolbarState(string const & name, bool allowauto)
1015 // it is possible to get current toolbar status like this,...
1016 // but I decide to obey the order of ToolbarBackend::flags
1017 // and disregard real toolbar status.
1018 // toolbars_->saveToolbarInfo();
1020 // toggle state on/off/auto
1021 d.toolbars_->toggleToolbarState(name, allowauto);
1027 } // namespace frontend
1030 #include "GuiView_moc.cpp"