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 "ToolbarBackend.h"
53 #include <boost/current_function.hpp>
56 #include <QApplication>
57 #include <QCloseEvent>
58 #include <QDesktopWidget>
59 #include <QDragEnterEvent>
65 #include <QPushButton>
66 #include <QStackedWidget>
77 using support::FileName;
78 using support::libFileSearch;
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 GuiViewBase::GuiViewPrivate
136 TabWorkArea * tab_widget_;
137 QStackedWidget * stack_widget_;
138 BackgroundWidget * bg_widget_;
140 GuiMenubar * menubar_;
142 GuiToolbars * toolbars_;
144 docstring current_layout;
146 GuiViewPrivate() : posx_offset(0), posy_offset(0) {}
148 unsigned int smallIconSize;
149 unsigned int normalIconSize;
150 unsigned int bigIconSize;
151 // static needed by "New Window"
152 static unsigned int lastIconSize;
154 QMenu * toolBarPopup(GuiViewBase * parent)
156 // FIXME: translation
157 QMenu * menu = new QMenu(parent);
158 QActionGroup * iconSizeGroup = new QActionGroup(parent);
160 QAction * smallIcons = new QAction(iconSizeGroup);
161 smallIcons->setText(qt_("Small-sized icons"));
162 smallIcons->setCheckable(true);
163 QObject::connect(smallIcons, SIGNAL(triggered()), parent, SLOT(smallSizedIcons()));
164 menu->addAction(smallIcons);
166 QAction * normalIcons = new QAction(iconSizeGroup);
167 normalIcons->setText(qt_("Normal-sized icons"));
168 normalIcons->setCheckable(true);
169 QObject::connect(normalIcons, SIGNAL(triggered()), parent, SLOT(normalSizedIcons()));
170 menu->addAction(normalIcons);
172 QAction * bigIcons = new QAction(iconSizeGroup);
173 bigIcons->setText(qt_("Big-sized icons"));
174 bigIcons->setCheckable(true);
175 QObject::connect(bigIcons, SIGNAL(triggered()), parent, SLOT(bigSizedIcons()));
176 menu->addAction(bigIcons);
178 unsigned int cur = parent->iconSize().width();
179 if ( cur == parent->d.smallIconSize)
180 smallIcons->setChecked(true);
181 else if (cur == parent->d.normalIconSize)
182 normalIcons->setChecked(true);
183 else if (cur == parent->d.bigIconSize)
184 bigIcons->setChecked(true);
189 void initBackground()
192 LYXERR(Debug::GUI) << "show banner: " << lyxrc.show_banner << endl;
193 /// The text to be written on top of the pixmap
194 QString const text = lyx_version ? QString(lyx_version) : qt_("unknown version");
195 FileName const file = support::libFileSearch("images", "banner", "png");
199 bg_widget_ = new BackgroundWidget(toqstr(file.absFilename()), text);
207 stack_widget_->setCurrentWidget(bg_widget_);
208 bg_widget_->setUpdatesEnabled(true);
213 unsigned int GuiViewBase::GuiViewPrivate::lastIconSize = 0;
216 GuiViewBase::GuiViewBase(int id)
217 : QMainWindow(), LyXView(id), quitting_by_menu_(false),
218 d(*new GuiViewPrivate)
220 // Qt bug? signal lastWindowClosed does not work
221 setAttribute(Qt::WA_QuitOnClose, false);
222 setAttribute(Qt::WA_DeleteOnClose, true);
224 // hardcode here the platform specific icon size
225 d.smallIconSize = 14; // scaling problems
226 d.normalIconSize = 20; // ok, default
227 d.bigIconSize = 26; // better for some math icons
230 // assign an icon to main form. We do not do it under Qt/Mac,
231 // since the icon is provided in the application bundle.
232 FileName const iconname = libFileSearch("images", "lyx", "png");
233 if (!iconname.empty())
234 setWindowIcon(QPixmap(toqstr(iconname.absFilename())));
237 d.tab_widget_ = new TabWorkArea;
238 QObject::connect(d.tab_widget_, SIGNAL(currentWorkAreaChanged(GuiWorkArea *)),
239 this, SLOT(on_currentWorkAreaChanged(GuiWorkArea *)));
243 LYXERR(Debug::GUI) << "stack widget!" << endl;
244 d.stack_widget_ = new QStackedWidget;
245 d.stack_widget_->addWidget(d.bg_widget_);
246 d.stack_widget_->addWidget(d.tab_widget_);
247 setCentralWidget(d.stack_widget_);
250 setCentralWidget(d.tab_widget_);
254 setAcceptDrops(true);
258 GuiViewBase::~GuiViewBase()
266 void GuiViewBase::close()
268 quitting_by_menu_ = true;
269 d.tab_widget_->closeAll();
270 QMainWindow::close();
271 quitting_by_menu_ = false;
275 void GuiViewBase::setFocus()
277 if (d.tab_widget_->count())
278 d.tab_widget_->currentWidget()->setFocus();
282 QMenu* GuiViewBase::createPopupMenu()
284 return d.toolBarPopup(this);
288 void GuiViewBase::init()
290 // GuiToolbars *must* be initialised before GuiMenubar.
291 d.toolbars_ = new GuiToolbars(*this);
292 // FIXME: GuiToolbars::init() cannot be integrated in the ctor
293 // because LyXFunc::getStatus() needs a properly initialized
294 // GuiToolbars object (for LFUN_TOOLBAR_TOGGLE).
296 d.menubar_ = new GuiMenubar(this, menubackend);
298 statusBar()->setSizeGripEnabled(true);
300 QObject::connect(&statusbar_timer_, SIGNAL(timeout()),
301 this, SLOT(update_view_state_qt()));
304 d.stack_widget_->setCurrentWidget(d.bg_widget_);
308 void GuiViewBase::closeEvent(QCloseEvent * close_event)
310 // we may have been called through the close window button
311 // which bypasses the LFUN machinery.
312 if (!quitting_by_menu_ && theApp()->gui().viewIds().size() == 1) {
313 if (!theBufferList().quitWriteAll()) {
314 close_event->ignore();
319 // Make sure that no LFUN use this close to be closed View.
320 theLyXFunc().setLyXView(0);
321 // Make sure the timer time out will not trigger a statusbar update.
322 statusbar_timer_.stop();
324 theApp()->gui().unregisterView(id());
325 if (!theApp()->gui().viewIds().empty()) {
326 // Just close the window and do nothing else if this is not the
328 close_event->accept();
334 // this is the place where we leave the frontend.
335 // it is the only point at which we start quitting.
337 close_event->accept();
338 // quit the event loop
343 void GuiViewBase::dragEnterEvent(QDragEnterEvent * event)
345 if (event->mimeData()->hasUrls())
347 /// \todo Ask lyx-devel is this is enough:
348 /// if (event->mimeData()->hasFormat("text/plain"))
349 /// event->acceptProposedAction();
353 void GuiViewBase::dropEvent(QDropEvent* event)
355 QList<QUrl> files = event->mimeData()->urls();
359 LYXERR(Debug::GUI) << BOOST_CURRENT_FUNCTION
360 << " got URLs!" << endl;
361 for (int i = 0; i != files.size(); ++i) {
362 string const file = support::os::internal_path(fromqstr(
363 files.at(i).toLocalFile()));
365 dispatch(FuncRequest(LFUN_FILE_OPEN, file));
370 void GuiViewBase::saveGeometry()
372 static bool done = false;
379 // change the ifdef to 'geometry = normalGeometry();' only
380 // when Trolltech has fixed the broken normalGeometry on X11:
381 // http://www.trolltech.com/developer/task-tracker/index_html?id=119684+&method=entry
382 // Then also the moveEvent, resizeEvent, and the
383 // code for floatingGeometry_ can be removed;
384 // adjust GuiViewBase::setGeometry()
386 QRect normal_geometry;
389 normal_geometry = normalGeometry();
391 maximized = CompletelyMaximized;
393 maximized = NotMaximized;
396 normal_geometry = updateFloatingGeometry();
398 QDesktopWidget& dw = *qApp->desktop();
399 QRect desk = dw.availableGeometry(dw.primaryScreen());
400 // Qt bug on Linux: load completely maximized, vert max. save-> frameGeometry().height() is wrong
401 if (isMaximized() && desk.width() <= frameGeometry().width() && desk.height() <= frameGeometry().height()) {
402 maximized = CompletelyMaximized;
403 // maximizing does not work when the window is allready hor. or vert. maximized
404 // Tested only on KDE
405 int dh = frameGeometry().height() - height();
406 if (desk.height() <= normal_geometry.height() + dh)
407 normal_geometry.setHeight(normal_geometry.height() - 1);
408 int dw = frameGeometry().width() - width();
409 if (desk.width() <= normal_geometry.width() + dw)
410 normal_geometry.setWidth(normal_geometry.width() - 1);
411 } else if (desk.height() <= frameGeometry().height()) {
412 maximized = VerticallyMaximized;
413 } else if (desk.width() <= frameGeometry().width()) {
414 maximized = HorizontallyMaximized;
416 maximized = NotMaximized;
421 // save windows size and position
422 Session & session = LyX::ref().session();
423 session.sessionInfo().save("WindowWidth", convert<string>(normal_geometry.width()));
424 session.sessionInfo().save("WindowHeight", convert<string>(normal_geometry.height()));
425 session.sessionInfo().save("WindowMaximized", convert<string>(maximized));
426 session.sessionInfo().save("IconSizeXY", convert<string>(iconSize().width()));
427 if (lyxrc.geometry_xysaved) {
428 session.sessionInfo().save("WindowPosX", convert<string>(normal_geometry.x() + d.posx_offset));
429 session.sessionInfo().save("WindowPosY", convert<string>(normal_geometry.y() + d.posy_offset));
431 d.toolbars_->saveToolbarInfo();
435 void GuiViewBase::setGeometry(unsigned int width,
439 unsigned int iconSizeXY,
440 const string & geometryArg)
442 // use last value (not at startup)
443 if (d.lastIconSize != 0)
444 setIconSize(d.lastIconSize);
445 else if (iconSizeXY != 0)
446 setIconSize(iconSizeXY);
448 setIconSize(d.normalIconSize);
450 // only true when the -geometry option was NOT used
451 if (width != 0 && height != 0) {
452 if (posx != -1 && posy != -1) {
453 // if there are startup positioning problems:
454 // http://doc.trolltech.com/4.2/qdesktopwidget.html
455 QDesktopWidget& dw = *qApp->desktop();
456 if (dw.isVirtualDesktop()) {
457 if(!dw.geometry().contains(posx, posy)) {
462 // Which system doesn't use a virtual desktop?
463 // TODO save also last screen number and check if it is still availabe.
466 // FIXME: use setGeometry only when Trolltech has fixed the qt4/X11 bug
467 QWidget::setGeometry(posx, posy, width, height);
469 resize(width, height);
473 resize(width, height);
476 // remember original size
477 floatingGeometry_ = QRect(posx, posy, width, height);
479 if (maximized != NotMaximized) {
480 if (maximized == CompletelyMaximized) {
481 setWindowState(Qt::WindowMaximized);
484 // TODO How to set by the window manager?
485 // setWindowState(Qt::WindowVerticallyMaximized);
487 QDesktopWidget& dw = *qApp->desktop();
488 QRect desk = dw.availableGeometry(dw.primaryScreen());
489 if (maximized == VerticallyMaximized)
490 resize(width, desk.height());
491 if (maximized == HorizontallyMaximized)
492 resize(desk.width(), height);
499 // FIXME: move this code into parse_geometry() (LyX.cpp)
503 QRegExp re( "[=]*(?:([0-9]+)[xX]([0-9]+)){0,1}[ ]*(?:([+-][0-9]*)([+-][0-9]*)){0,1}" );
504 re.indexIn(toqstr(geometryArg.c_str()));
505 w = re.cap(1).toInt();
506 h = re.cap(2).toInt();
507 x = re.cap(3).toInt();
508 y = re.cap(4).toInt();
509 QWidget::setGeometry( x, y, w, h );
520 // For an unknown reason, the Window title update is not effective for
521 // the second windows up until it is shown on screen (Qt bug?).
524 // after show geometry() has changed (Qt bug?)
525 // we compensate the drift when storing the position
528 if (width != 0 && height != 0)
529 if (posx != -1 && posy != -1) {
531 d.posx_offset = posx - normalGeometry().x();
532 d.posy_offset = posy - normalGeometry().y();
535 if (maximized == NotMaximized) {
536 d.posx_offset = posx - geometry().x();
537 d.posy_offset = posy - geometry().y();
545 void GuiViewBase::setWindowTitle(docstring const & t, docstring const & it)
547 QString title = windowTitle();
548 QString new_title = toqstr(t);
549 if (title != new_title) {
550 QMainWindow::setWindowTitle(new_title);
551 QMainWindow::setWindowIconText(toqstr(it));
553 if (Buffer const * buf = buffer())
554 d.tab_widget_->setTabText(d.tab_widget_->currentIndex(),
555 toqstr(makeDisplayPath(buf->fileName(), 30)));
559 void GuiViewBase::message(docstring const & str)
561 statusBar()->showMessage(toqstr(str));
562 statusbar_timer_.stop();
563 statusbar_timer_.start(statusbar_timer_value);
567 void GuiViewBase::clearMessage()
569 update_view_state_qt();
573 void GuiViewBase::setIconSize(unsigned int size)
575 d.lastIconSize = size;
576 QMainWindow::setIconSize(QSize(size, size));
580 void GuiViewBase::smallSizedIcons()
582 setIconSize(d.smallIconSize);
586 void GuiViewBase::normalSizedIcons()
588 setIconSize(d.normalIconSize);
592 void GuiViewBase::bigSizedIcons()
594 setIconSize(d.bigIconSize);
598 void GuiViewBase::update_view_state_qt()
602 theLyXFunc().setLyXView(this);
603 statusBar()->showMessage(toqstr(theLyXFunc().viewStatusMessage()));
604 statusbar_timer_.stop();
608 void GuiViewBase::on_currentWorkAreaChanged(GuiWorkArea * wa)
611 disconnectBufferView();
612 connectBufferView(wa->bufferView());
613 connectBuffer(wa->bufferView().buffer());
616 // Buffer-dependent dialogs should be updated or
617 // hidden. This should go here because some dialogs (eg ToC)
618 // require bv_->text.
619 getDialogs().updateBufferDependent(true);
621 updateLayoutChoice();
627 void GuiViewBase::updateStatusBar()
629 // let the user see the explicit message
630 if (statusbar_timer_.isActive())
633 statusBar()->showMessage(toqstr(theLyXFunc().viewStatusMessage()));
637 void GuiViewBase::activated(FuncRequest const & func)
643 bool GuiViewBase::hasFocus() const
645 return qApp->activeWindow() == this;
649 QRect GuiViewBase::updateFloatingGeometry()
651 QDesktopWidget& dw = *qApp->desktop();
652 QRect desk = dw.availableGeometry(dw.primaryScreen());
653 // remember only non-maximized sizes
654 if (!isMaximized() && desk.width() > frameGeometry().width() && desk.height() > frameGeometry().height()) {
655 floatingGeometry_ = QRect(x(), y(), width(), height());
657 return floatingGeometry_;
661 void GuiViewBase::resizeEvent(QResizeEvent *)
663 updateFloatingGeometry();
667 void GuiViewBase::moveEvent(QMoveEvent *)
669 updateFloatingGeometry();
673 bool GuiViewBase::event(QEvent * e)
677 // Useful debug code:
678 //case QEvent::ActivationChange:
679 //case QEvent::WindowDeactivate:
680 //case QEvent::Paint:
681 //case QEvent::Enter:
682 //case QEvent::Leave:
683 //case QEvent::HoverEnter:
684 //case QEvent::HoverLeave:
685 //case QEvent::HoverMove:
686 //case QEvent::StatusTip:
687 //case QEvent::DragEnter:
688 //case QEvent::DragLeave:
692 case QEvent::WindowActivate:
693 theApp()->setCurrentView(*this);
694 if (d.tab_widget_->count()) {
695 GuiWorkArea * wa = dynamic_cast<GuiWorkArea *>(
696 d.tab_widget_->currentWidget());
698 BufferView & bv = wa->bufferView();
699 connectBufferView(bv);
700 connectBuffer(bv.buffer());
701 // The document structure, name and dialogs might have
702 // changed in another view.
704 getDialogs().updateBufferDependent(true);
706 return QMainWindow::event(e);
708 case QEvent::ShortcutOverride: {
709 QKeyEvent * ke = static_cast<QKeyEvent*>(e);
710 if (d.tab_widget_->count() == 0) {
711 theLyXFunc().setLyXView(this);
713 setKeySymbol(&sym, ke);
714 theLyXFunc().processKeySym(sym, q_key_state(ke->modifiers()));
718 if (ke->key() == Qt::Key_Tab || ke->key() == Qt::Key_Backtab) {
720 setKeySymbol(&sym, ke);
721 currentWorkArea()->processKeySym(sym, NoModifier);
727 return QMainWindow::event(e);
732 bool GuiViewBase::focusNextPrevChild(bool /*next*/)
739 void GuiViewBase::showView()
741 QMainWindow::setWindowTitle(qt_("LyX"));
743 updateFloatingGeometry();
747 void GuiViewBase::busy(bool yes)
749 if (d.tab_widget_->count()) {
750 GuiWorkArea * wa = dynamic_cast<GuiWorkArea *>(d.tab_widget_->currentWidget());
752 wa->setUpdatesEnabled(!yes);
754 wa->stopBlinkingCursor();
756 wa->startBlinkingCursor();
760 QApplication::setOverrideCursor(Qt::WaitCursor);
762 QApplication::restoreOverrideCursor();
766 GuiToolbar * GuiViewBase::makeToolbar(ToolbarInfo const & tbinfo, bool newline)
768 GuiToolbar * toolBar = new GuiToolbar(tbinfo, *this);
770 if (tbinfo.flags & ToolbarInfo::TOP) {
772 addToolBarBreak(Qt::TopToolBarArea);
773 addToolBar(Qt::TopToolBarArea, toolBar);
776 if (tbinfo.flags & ToolbarInfo::BOTTOM) {
777 // Qt < 4.2.2 cannot handle ToolBarBreak on non-TOP dock.
778 #if (QT_VERSION >= 0x040202)
780 addToolBarBreak(Qt::BottomToolBarArea);
782 addToolBar(Qt::BottomToolBarArea, toolBar);
785 if (tbinfo.flags & ToolbarInfo::LEFT) {
786 // Qt < 4.2.2 cannot handle ToolBarBreak on non-TOP dock.
787 #if (QT_VERSION >= 0x040202)
789 addToolBarBreak(Qt::LeftToolBarArea);
791 addToolBar(Qt::LeftToolBarArea, toolBar);
794 if (tbinfo.flags & ToolbarInfo::RIGHT) {
795 // Qt < 4.2.2 cannot handle ToolBarBreak on non-TOP dock.
796 #if (QT_VERSION >= 0x040202)
798 addToolBarBreak(Qt::RightToolBarArea);
800 addToolBar(Qt::RightToolBarArea, toolBar);
803 // The following does not work so I cannot restore to exact toolbar location
805 ToolbarSection::ToolbarInfo & tbinfo = LyX::ref().session().toolbars().load(tbinfo.name);
806 toolBar->move(tbinfo.posx, tbinfo.posy);
813 WorkArea * GuiViewBase::workArea(Buffer & buffer)
815 for (int i = 0; i != d.tab_widget_->count(); ++i) {
816 GuiWorkArea * wa = dynamic_cast<GuiWorkArea *>(d.tab_widget_->widget(i));
818 if (&wa->bufferView().buffer() == &buffer)
825 WorkArea * GuiViewBase::addWorkArea(Buffer & buffer)
827 GuiWorkArea * wa = new GuiWorkArea(buffer, *this);
828 wa->setUpdatesEnabled(false);
829 d.tab_widget_->addTab(wa, toqstr(makeDisplayPath(buffer.fileName(), 30)));
830 wa->bufferView().updateMetrics(false);
832 d.stack_widget_->setCurrentWidget(d.tab_widget_);
833 // Hide tabbar if there's only one tab.
834 d.tab_widget_->showBar(d.tab_widget_->count() > 1);
839 WorkArea * GuiViewBase::currentWorkArea()
841 if (d.tab_widget_->count() == 0)
843 BOOST_ASSERT(dynamic_cast<GuiWorkArea *>(d.tab_widget_->currentWidget()));
844 return dynamic_cast<GuiWorkArea *>(d.tab_widget_->currentWidget());
848 WorkArea const * GuiViewBase::currentWorkArea() const
850 if (d.tab_widget_->count() == 0)
852 BOOST_ASSERT(dynamic_cast<GuiWorkArea const *>(d.tab_widget_->currentWidget()));
853 return dynamic_cast<GuiWorkArea const *>(d.tab_widget_->currentWidget());
857 void GuiViewBase::setCurrentWorkArea(WorkArea * work_area)
859 BOOST_ASSERT(work_area);
861 // Changing work area can result from opening a file so
862 // update the toc in any case.
865 GuiWorkArea * wa = dynamic_cast<GuiWorkArea *>(work_area);
867 d.tab_widget_->setCurrentWorkArea(wa);
871 void GuiViewBase::removeWorkArea(WorkArea * work_area)
873 BOOST_ASSERT(work_area);
874 if (work_area == currentWorkArea()) {
876 disconnectBufferView();
879 // removing a work area often results from closing a file so
880 // update the toc in any case.
883 GuiWorkArea * gwa = dynamic_cast<GuiWorkArea *>(work_area);
885 d.tab_widget_->removeWorkArea(gwa);
887 getDialogs().hideBufferDependent();
889 if (d.tab_widget_->count() == 0 && d.stack_widget_)
890 // No more work area, switch to the background widget.
895 void GuiViewBase::showMiniBuffer(bool visible)
897 d.toolbars_->showCommandBuffer(visible);
901 void GuiViewBase::openMenu(docstring const & name)
903 d.menubar_->openByName(toqstr(name));
907 void GuiViewBase::openLayoutList()
909 d.toolbars_->openLayoutList();
913 void GuiViewBase::updateLayoutChoice()
915 // Don't show any layouts without a buffer
917 d.toolbars_->clearLayoutList();
921 // Update the layout display
922 if (d.toolbars_->updateLayoutList(buffer()->params().getTextClassPtr())) {
923 d.current_layout = buffer()->params().getTextClass().defaultLayoutName();
926 docstring const & layout = currentWorkArea()->bufferView().cursor().
927 innerParagraph().layout()->name();
929 if (layout != d.current_layout) {
930 d.toolbars_->setLayout(layout);
931 d.current_layout = layout;
936 bool GuiViewBase::isToolbarVisible(std::string const & id)
938 return d.toolbars_->visible(id);
941 void GuiViewBase::updateToolbars()
943 WorkArea * wa = currentWorkArea();
946 wa->bufferView().cursor().inMathed();
948 lyx::getStatus(FuncRequest(LFUN_LAYOUT_TABULAR)).enabled();
950 lyx::getStatus(FuncRequest(LFUN_CHANGES_TRACK)).enabled() &&
951 lyx::getStatus(FuncRequest(LFUN_CHANGES_TRACK)).onoff(true);
953 d.toolbars_->update(math, table, review);
955 d.toolbars_->update(false, false, false);
957 // update read-only status of open dialogs.
958 getDialogs().checkStatus();
962 ToolbarInfo * GuiViewBase::getToolbarInfo(string const & name)
964 return d.toolbars_->getToolbarInfo(name);
968 void GuiViewBase::toggleToolbarState(string const & name, bool allowauto)
970 // it is possible to get current toolbar status like this,...
971 // but I decide to obey the order of ToolbarBackend::flags
972 // and disregard real toolbar status.
973 // toolbars_->saveToolbarInfo();
975 // toggle state on/off/auto
976 d.toolbars_->toggleToolbarState(name, allowauto);
982 } // namespace frontend
985 #include "GuiView_moc.cpp"