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"
52 #include <boost/current_function.hpp>
55 #include <QApplication>
56 #include <QCloseEvent>
57 #include <QDesktopWidget>
58 #include <QDragEnterEvent>
64 #include <QPushButton>
65 #include <QStackedWidget>
76 using support::FileName;
77 using support::libFileSearch;
78 using support::makeDisplayPath;
86 int const statusbar_timer_value = 3000;
88 class BackgroundWidget : public QWidget
91 BackgroundWidget(QString const & file, QString const & text)
93 splash_ = new QPixmap(file);
95 lyxerr << "could not load splash screen: '" << fromqstr(file) << "'" << endl;
99 QPainter pain(splash_);
100 pain.setPen(QColor(255, 255, 0));
102 // The font used to display the version info
103 font.setStyleHint(QFont::SansSerif);
104 font.setWeight(QFont::Bold);
105 font.setPointSize(convert<int>(lyxrc.font_sizes[Font::SIZE_LARGE]));
107 pain.drawText(260, 270, text);
110 void paintEvent(QPaintEvent *)
115 int x = (width() - splash_->width()) / 2;
116 int y = (height() - splash_->height()) / 2;
118 pain.drawPixmap(x, y, *splash_);
128 struct GuiViewBase::GuiViewPrivate
135 TabWorkArea * tab_widget_;
136 QStackedWidget * stack_widget_;
137 BackgroundWidget * bg_widget_;
139 GuiMenubar * menubar_;
141 GuiToolbars * toolbars_;
143 docstring current_layout;
145 GuiViewPrivate() : posx_offset(0), posy_offset(0) {}
147 unsigned int smallIconSize;
148 unsigned int normalIconSize;
149 unsigned int bigIconSize;
150 // static needed by "New Window"
151 static unsigned int lastIconSize;
153 QMenu * toolBarPopup(GuiViewBase * parent)
155 // FIXME: translation
156 QMenu * menu = new QMenu(parent);
157 QActionGroup * iconSizeGroup = new QActionGroup(parent);
159 QAction * smallIcons = new QAction(iconSizeGroup);
160 smallIcons->setText(qt_("Small-sized icons"));
161 smallIcons->setCheckable(true);
162 QObject::connect(smallIcons, SIGNAL(triggered()), parent, SLOT(smallSizedIcons()));
163 menu->addAction(smallIcons);
165 QAction * normalIcons = new QAction(iconSizeGroup);
166 normalIcons->setText(qt_("Normal-sized icons"));
167 normalIcons->setCheckable(true);
168 QObject::connect(normalIcons, SIGNAL(triggered()), parent, SLOT(normalSizedIcons()));
169 menu->addAction(normalIcons);
171 QAction * bigIcons = new QAction(iconSizeGroup);
172 bigIcons->setText(qt_("Big-sized icons"));
173 bigIcons->setCheckable(true);
174 QObject::connect(bigIcons, SIGNAL(triggered()), parent, SLOT(bigSizedIcons()));
175 menu->addAction(bigIcons);
177 unsigned int cur = parent->iconSize().width();
178 if ( cur == parent->d.smallIconSize)
179 smallIcons->setChecked(true);
180 else if (cur == parent->d.normalIconSize)
181 normalIcons->setChecked(true);
182 else if (cur == parent->d.bigIconSize)
183 bigIcons->setChecked(true);
188 void initBackground()
191 LYXERR(Debug::GUI) << "show banner: " << lyxrc.show_banner << endl;
192 /// The text to be written on top of the pixmap
193 QString const text = lyx_version ? QString(lyx_version) : qt_("unknown version");
194 FileName const file = support::libFileSearch("images", "banner", "png");
198 bg_widget_ = new BackgroundWidget(toqstr(file.absFilename()), text);
206 stack_widget_->setCurrentWidget(bg_widget_);
207 bg_widget_->setUpdatesEnabled(true);
212 unsigned int GuiViewBase::GuiViewPrivate::lastIconSize = 0;
215 GuiViewBase::GuiViewBase(int id)
216 : QMainWindow(), LyXView(id), quitting_by_menu_(false),
217 d(*new GuiViewPrivate)
219 // Qt bug? signal lastWindowClosed does not work
220 setAttribute(Qt::WA_QuitOnClose, false);
221 setAttribute(Qt::WA_DeleteOnClose, true);
223 // hardcode here the platform specific icon size
224 d.smallIconSize = 14; // scaling problems
225 d.normalIconSize = 20; // ok, default
226 d.bigIconSize = 26; // better for some math icons
229 // assign an icon to main form. We do not do it under Qt/Mac,
230 // since the icon is provided in the application bundle.
231 FileName const iconname = libFileSearch("images", "lyx", "png");
232 if (!iconname.empty())
233 setWindowIcon(QPixmap(toqstr(iconname.absFilename())));
236 d.tab_widget_ = new TabWorkArea;
237 QObject::connect(d.tab_widget_, SIGNAL(currentWorkAreaChanged(GuiWorkArea *)),
238 this, SLOT(on_currentWorkAreaChanged(GuiWorkArea *)));
242 LYXERR(Debug::GUI) << "stack widget!" << endl;
243 d.stack_widget_ = new QStackedWidget;
244 d.stack_widget_->addWidget(d.bg_widget_);
245 d.stack_widget_->addWidget(d.tab_widget_);
246 setCentralWidget(d.stack_widget_);
249 setCentralWidget(d.tab_widget_);
253 setAcceptDrops(true);
257 GuiViewBase::~GuiViewBase()
265 void GuiViewBase::close()
267 quitting_by_menu_ = true;
268 d.tab_widget_->closeAll();
269 QMainWindow::close();
270 quitting_by_menu_ = false;
274 void GuiViewBase::setFocus()
276 if (d.tab_widget_->count())
277 d.tab_widget_->currentWidget()->setFocus();
281 QMenu* GuiViewBase::createPopupMenu()
283 return d.toolBarPopup(this);
287 void GuiViewBase::init()
289 // GuiToolbars *must* be initialised before GuiMenubar.
290 d.toolbars_ = new GuiToolbars(*this);
291 // FIXME: GuiToolbars::init() cannot be integrated in the ctor
292 // because LyXFunc::getStatus() needs a properly initialized
293 // GuiToolbars object (for LFUN_TOOLBAR_TOGGLE).
295 d.menubar_ = new GuiMenubar(this, menubackend);
297 statusBar()->setSizeGripEnabled(true);
299 QObject::connect(&statusbar_timer_, SIGNAL(timeout()),
300 this, SLOT(update_view_state_qt()));
303 d.stack_widget_->setCurrentWidget(d.bg_widget_);
307 void GuiViewBase::closeEvent(QCloseEvent * close_event)
309 // we may have been called through the close window button
310 // which bypasses the LFUN machinery.
311 if (!quitting_by_menu_ && theApp()->gui().viewIds().size() == 1) {
312 if (!theBufferList().quitWriteAll()) {
313 close_event->ignore();
318 // Make sure that no LFUN use this close to be closed View.
319 theLyXFunc().setLyXView(0);
320 // Make sure the timer time out will not trigger a statusbar update.
321 statusbar_timer_.stop();
323 theApp()->gui().unregisterView(id());
324 if (!theApp()->gui().viewIds().empty()) {
325 // Just close the window and do nothing else if this is not the
327 close_event->accept();
333 // this is the place where we leave the frontend.
334 // it is the only point at which we start quitting.
336 close_event->accept();
337 // quit the event loop
342 void GuiViewBase::dragEnterEvent(QDragEnterEvent * event)
344 if (event->mimeData()->hasUrls())
346 /// \todo Ask lyx-devel is this is enough:
347 /// if (event->mimeData()->hasFormat("text/plain"))
348 /// event->acceptProposedAction();
352 void GuiViewBase::dropEvent(QDropEvent* event)
354 QList<QUrl> files = event->mimeData()->urls();
358 LYXERR(Debug::GUI) << BOOST_CURRENT_FUNCTION
359 << " got URLs!" << endl;
360 for (int i = 0; i != files.size(); ++i) {
361 string const file = support::os::internal_path(fromqstr(
362 files.at(i).toLocalFile()));
364 dispatch(FuncRequest(LFUN_FILE_OPEN, file));
369 void GuiViewBase::saveGeometry()
371 static bool done = false;
378 // change the ifdef to 'geometry = normalGeometry();' only
379 // when Trolltech has fixed the broken normalGeometry on X11:
380 // http://www.trolltech.com/developer/task-tracker/index_html?id=119684+&method=entry
381 // Then also the moveEvent, resizeEvent, and the
382 // code for floatingGeometry_ can be removed;
383 // adjust GuiViewBase::setGeometry()
385 QRect normal_geometry;
388 normal_geometry = normalGeometry();
390 maximized = CompletelyMaximized;
392 maximized = NotMaximized;
395 normal_geometry = updateFloatingGeometry();
397 QDesktopWidget& dw = *qApp->desktop();
398 QRect desk = dw.availableGeometry(dw.primaryScreen());
399 // Qt bug on Linux: load completely maximized, vert max. save-> frameGeometry().height() is wrong
400 if (isMaximized() && desk.width() <= frameGeometry().width() && desk.height() <= frameGeometry().height()) {
401 maximized = CompletelyMaximized;
402 // maximizing does not work when the window is allready hor. or vert. maximized
403 // Tested only on KDE
404 int dh = frameGeometry().height() - height();
405 if (desk.height() <= normal_geometry.height() + dh)
406 normal_geometry.setHeight(normal_geometry.height() - 1);
407 int dw = frameGeometry().width() - width();
408 if (desk.width() <= normal_geometry.width() + dw)
409 normal_geometry.setWidth(normal_geometry.width() - 1);
410 } else if (desk.height() <= frameGeometry().height()) {
411 maximized = VerticallyMaximized;
412 } else if (desk.width() <= frameGeometry().width()) {
413 maximized = HorizontallyMaximized;
415 maximized = NotMaximized;
420 // save windows size and position
421 Session & session = LyX::ref().session();
422 session.sessionInfo().save("WindowWidth", convert<string>(normal_geometry.width()));
423 session.sessionInfo().save("WindowHeight", convert<string>(normal_geometry.height()));
424 session.sessionInfo().save("WindowMaximized", convert<string>(maximized));
425 session.sessionInfo().save("IconSizeXY", convert<string>(iconSize().width()));
426 if (lyxrc.geometry_xysaved) {
427 session.sessionInfo().save("WindowPosX", convert<string>(normal_geometry.x() + d.posx_offset));
428 session.sessionInfo().save("WindowPosY", convert<string>(normal_geometry.y() + d.posy_offset));
430 d.toolbars_->saveToolbarInfo();
434 void GuiViewBase::setGeometry(unsigned int width,
438 unsigned int iconSizeXY,
439 const string & geometryArg)
441 // use last value (not at startup)
442 if (d.lastIconSize != 0)
443 setIconSize(d.lastIconSize);
444 else if (iconSizeXY != 0)
445 setIconSize(iconSizeXY);
447 setIconSize(d.normalIconSize);
449 // only true when the -geometry option was NOT used
450 if (width != 0 && height != 0) {
451 if (posx != -1 && posy != -1) {
452 // if there are startup positioning problems:
453 // http://doc.trolltech.com/4.2/qdesktopwidget.html
454 QDesktopWidget& dw = *qApp->desktop();
455 if (dw.isVirtualDesktop()) {
456 if(!dw.geometry().contains(posx, posy)) {
461 // Which system doesn't use a virtual desktop?
462 // TODO save also last screen number and check if it is still availabe.
465 // FIXME: use setGeometry only when Trolltech has fixed the qt4/X11 bug
466 QWidget::setGeometry(posx, posy, width, height);
468 resize(width, height);
472 resize(width, height);
475 // remember original size
476 floatingGeometry_ = QRect(posx, posy, width, height);
478 if (maximized != NotMaximized) {
479 if (maximized == CompletelyMaximized) {
480 setWindowState(Qt::WindowMaximized);
483 // TODO How to set by the window manager?
484 // setWindowState(Qt::WindowVerticallyMaximized);
486 QDesktopWidget& dw = *qApp->desktop();
487 QRect desk = dw.availableGeometry(dw.primaryScreen());
488 if (maximized == VerticallyMaximized)
489 resize(width, desk.height());
490 if (maximized == HorizontallyMaximized)
491 resize(desk.width(), height);
498 // FIXME: move this code into parse_geometry() (LyX.cpp)
502 QRegExp re( "[=]*(?:([0-9]+)[xX]([0-9]+)){0,1}[ ]*(?:([+-][0-9]*)([+-][0-9]*)){0,1}" );
503 re.indexIn(toqstr(geometryArg.c_str()));
504 w = re.cap(1).toInt();
505 h = re.cap(2).toInt();
506 x = re.cap(3).toInt();
507 y = re.cap(4).toInt();
508 QWidget::setGeometry( x, y, w, h );
519 // For an unknown reason, the Window title update is not effective for
520 // the second windows up until it is shown on screen (Qt bug?).
523 // after show geometry() has changed (Qt bug?)
524 // we compensate the drift when storing the position
527 if (width != 0 && height != 0)
528 if (posx != -1 && posy != -1) {
530 d.posx_offset = posx - normalGeometry().x();
531 d.posy_offset = posy - normalGeometry().y();
534 if (maximized == NotMaximized) {
535 d.posx_offset = posx - geometry().x();
536 d.posy_offset = posy - geometry().y();
544 void GuiViewBase::setWindowTitle(docstring const & t, docstring const & it)
546 QString title = windowTitle();
547 QString new_title = toqstr(t);
548 if (title != new_title) {
549 QMainWindow::setWindowTitle(new_title);
550 QMainWindow::setWindowIconText(toqstr(it));
552 if (Buffer const * buf = buffer())
553 d.tab_widget_->setTabText(d.tab_widget_->currentIndex(),
554 toqstr(makeDisplayPath(buf->fileName(), 30)));
558 void GuiViewBase::message(docstring const & str)
560 statusBar()->showMessage(toqstr(str));
561 statusbar_timer_.stop();
562 statusbar_timer_.start(statusbar_timer_value);
566 void GuiViewBase::clearMessage()
568 update_view_state_qt();
572 void GuiViewBase::setIconSize(unsigned int size)
574 d.lastIconSize = size;
575 QMainWindow::setIconSize(QSize(size, size));
579 void GuiViewBase::smallSizedIcons()
581 setIconSize(d.smallIconSize);
585 void GuiViewBase::normalSizedIcons()
587 setIconSize(d.normalIconSize);
591 void GuiViewBase::bigSizedIcons()
593 setIconSize(d.bigIconSize);
597 void GuiViewBase::update_view_state_qt()
601 theLyXFunc().setLyXView(this);
602 statusBar()->showMessage(toqstr(theLyXFunc().viewStatusMessage()));
603 statusbar_timer_.stop();
607 void GuiViewBase::on_currentWorkAreaChanged(GuiWorkArea * wa)
610 disconnectBufferView();
611 connectBufferView(wa->bufferView());
612 connectBuffer(wa->bufferView().buffer());
615 // Buffer-dependent dialogs should be updated or
616 // hidden. This should go here because some dialogs (eg ToC)
617 // require bv_->text.
618 getDialogs().updateBufferDependent(true);
620 updateLayoutChoice();
626 void GuiViewBase::updateStatusBar()
628 // let the user see the explicit message
629 if (statusbar_timer_.isActive())
632 statusBar()->showMessage(toqstr(theLyXFunc().viewStatusMessage()));
636 void GuiViewBase::activated(FuncRequest const & func)
642 bool GuiViewBase::hasFocus() const
644 return qApp->activeWindow() == this;
648 QRect GuiViewBase::updateFloatingGeometry()
650 QDesktopWidget& dw = *qApp->desktop();
651 QRect desk = dw.availableGeometry(dw.primaryScreen());
652 // remember only non-maximized sizes
653 if (!isMaximized() && desk.width() > frameGeometry().width() && desk.height() > frameGeometry().height()) {
654 floatingGeometry_ = QRect(x(), y(), width(), height());
656 return floatingGeometry_;
660 void GuiViewBase::resizeEvent(QResizeEvent *)
662 updateFloatingGeometry();
666 void GuiViewBase::moveEvent(QMoveEvent *)
668 updateFloatingGeometry();
672 bool GuiViewBase::event(QEvent * e)
676 // Useful debug code:
677 //case QEvent::ActivationChange:
678 //case QEvent::WindowDeactivate:
679 //case QEvent::Paint:
680 //case QEvent::Enter:
681 //case QEvent::Leave:
682 //case QEvent::HoverEnter:
683 //case QEvent::HoverLeave:
684 //case QEvent::HoverMove:
685 //case QEvent::StatusTip:
686 //case QEvent::DragEnter:
687 //case QEvent::DragLeave:
691 case QEvent::WindowActivate:
692 theApp()->setCurrentView(*this);
693 if (d.tab_widget_->count()) {
694 GuiWorkArea * wa = dynamic_cast<GuiWorkArea *>(
695 d.tab_widget_->currentWidget());
697 BufferView & bv = wa->bufferView();
698 connectBufferView(bv);
699 connectBuffer(bv.buffer());
700 // The document structure, name and dialogs might have
701 // changed in another view.
703 getDialogs().updateBufferDependent(true);
705 return QMainWindow::event(e);
707 case QEvent::ShortcutOverride: {
708 QKeyEvent * ke = static_cast<QKeyEvent*>(e);
709 if (d.tab_widget_->count() == 0) {
710 theLyXFunc().setLyXView(this);
712 setKeySymbol(&sym, ke);
713 theLyXFunc().processKeySym(sym, q_key_state(ke->modifiers()));
717 if (ke->key() == Qt::Key_Tab || ke->key() == Qt::Key_Backtab) {
719 setKeySymbol(&sym, ke);
720 currentWorkArea()->processKeySym(sym, NoModifier);
726 return QMainWindow::event(e);
731 bool GuiViewBase::focusNextPrevChild(bool /*next*/)
738 void GuiViewBase::showView()
740 QMainWindow::setWindowTitle(qt_("LyX"));
742 updateFloatingGeometry();
746 void GuiViewBase::busy(bool yes)
748 if (d.tab_widget_->count()) {
749 GuiWorkArea * wa = dynamic_cast<GuiWorkArea *>(d.tab_widget_->currentWidget());
751 wa->setUpdatesEnabled(!yes);
753 wa->stopBlinkingCursor();
755 wa->startBlinkingCursor();
759 QApplication::setOverrideCursor(Qt::WaitCursor);
761 QApplication::restoreOverrideCursor();
765 GuiToolbar * GuiViewBase::makeToolbar(ToolbarInfo const & tbinfo, bool newline)
767 GuiToolbar * toolBar = new GuiToolbar(tbinfo, *this);
769 if (tbinfo.flags & ToolbarInfo::TOP) {
771 addToolBarBreak(Qt::TopToolBarArea);
772 addToolBar(Qt::TopToolBarArea, toolBar);
775 if (tbinfo.flags & ToolbarInfo::BOTTOM) {
776 // Qt < 4.2.2 cannot handle ToolBarBreak on non-TOP dock.
777 #if (QT_VERSION >= 0x040202)
779 addToolBarBreak(Qt::BottomToolBarArea);
781 addToolBar(Qt::BottomToolBarArea, toolBar);
784 if (tbinfo.flags & ToolbarInfo::LEFT) {
785 // Qt < 4.2.2 cannot handle ToolBarBreak on non-TOP dock.
786 #if (QT_VERSION >= 0x040202)
788 addToolBarBreak(Qt::LeftToolBarArea);
790 addToolBar(Qt::LeftToolBarArea, toolBar);
793 if (tbinfo.flags & ToolbarInfo::RIGHT) {
794 // Qt < 4.2.2 cannot handle ToolBarBreak on non-TOP dock.
795 #if (QT_VERSION >= 0x040202)
797 addToolBarBreak(Qt::RightToolBarArea);
799 addToolBar(Qt::RightToolBarArea, toolBar);
802 // The following does not work so I cannot restore to exact toolbar location
804 ToolbarSection::ToolbarInfo & tbinfo = LyX::ref().session().toolbars().load(tbinfo.name);
805 toolBar->move(tbinfo.posx, tbinfo.posy);
812 WorkArea * GuiViewBase::workArea(Buffer & buffer)
814 for (int i = 0; i != d.tab_widget_->count(); ++i) {
815 GuiWorkArea * wa = dynamic_cast<GuiWorkArea *>(d.tab_widget_->widget(i));
817 if (&wa->bufferView().buffer() == &buffer)
824 WorkArea * GuiViewBase::addWorkArea(Buffer & buffer)
826 GuiWorkArea * wa = new GuiWorkArea(buffer, *this);
827 wa->setUpdatesEnabled(false);
828 d.tab_widget_->addTab(wa, toqstr(makeDisplayPath(buffer.fileName(), 30)));
829 wa->bufferView().updateMetrics(false);
831 d.stack_widget_->setCurrentWidget(d.tab_widget_);
832 // Hide tabbar if there's only one tab.
833 d.tab_widget_->showBar(d.tab_widget_->count() > 1);
838 WorkArea * GuiViewBase::currentWorkArea()
840 if (d.tab_widget_->count() == 0)
842 BOOST_ASSERT(dynamic_cast<GuiWorkArea *>(d.tab_widget_->currentWidget()));
843 return dynamic_cast<GuiWorkArea *>(d.tab_widget_->currentWidget());
847 WorkArea const * GuiViewBase::currentWorkArea() const
849 if (d.tab_widget_->count() == 0)
851 BOOST_ASSERT(dynamic_cast<GuiWorkArea const *>(d.tab_widget_->currentWidget()));
852 return dynamic_cast<GuiWorkArea const *>(d.tab_widget_->currentWidget());
856 void GuiViewBase::setCurrentWorkArea(WorkArea * work_area)
858 BOOST_ASSERT(work_area);
860 // Changing work area can result from opening a file so
861 // update the toc in any case.
864 GuiWorkArea * wa = dynamic_cast<GuiWorkArea *>(work_area);
866 d.tab_widget_->setCurrentWorkArea(wa);
870 void GuiViewBase::removeWorkArea(WorkArea * work_area)
872 BOOST_ASSERT(work_area);
873 if (work_area == currentWorkArea()) {
875 disconnectBufferView();
878 // removing a work area often results from closing a file so
879 // update the toc in any case.
882 GuiWorkArea * gwa = dynamic_cast<GuiWorkArea *>(work_area);
884 d.tab_widget_->removeWorkArea(gwa);
886 getDialogs().hideBufferDependent();
888 if (d.tab_widget_->count() == 0 && d.stack_widget_)
889 // No more work area, switch to the background widget.
894 void GuiViewBase::showMiniBuffer(bool visible)
896 d.toolbars_->showCommandBuffer(visible);
900 void GuiViewBase::openMenu(docstring const & name)
902 d.menubar_->openByName(toqstr(name));
906 void GuiViewBase::openLayoutList()
908 d.toolbars_->openLayoutList();
912 void GuiViewBase::updateLayoutChoice()
914 // Don't show any layouts without a buffer
916 d.toolbars_->clearLayoutList();
920 // Update the layout display
921 if (d.toolbars_->updateLayoutList(buffer()->params().getTextClassPtr())) {
922 d.current_layout = buffer()->params().getTextClass().defaultLayoutName();
925 docstring const & layout = currentWorkArea()->bufferView().cursor().
926 innerParagraph().layout()->name();
928 if (layout != d.current_layout) {
929 d.toolbars_->setLayout(layout);
930 d.current_layout = layout;
935 bool GuiViewBase::isToolbarVisible(std::string const & id)
937 return d.toolbars_->visible(id);
940 void GuiViewBase::updateToolbars()
942 WorkArea * wa = currentWorkArea();
945 wa->bufferView().cursor().inMathed();
947 lyx::getStatus(FuncRequest(LFUN_LAYOUT_TABULAR)).enabled();
949 lyx::getStatus(FuncRequest(LFUN_CHANGES_TRACK)).enabled() &&
950 lyx::getStatus(FuncRequest(LFUN_CHANGES_TRACK)).onoff(true);
952 d.toolbars_->update(math, table, review);
954 d.toolbars_->update(false, false, false);
956 // update read-only status of open dialogs.
957 getDialogs().checkStatus();
961 ToolbarInfo * GuiViewBase::getToolbarInfo(string const & name)
963 return d.toolbars_->getToolbarInfo(name);
967 void GuiViewBase::toggleToolbarState(string const & name, bool allowauto)
969 // it is possible to get current toolbar status like this,...
970 // but I decide to obey the order of ToolbarBackend::flags
971 // and disregard real toolbar status.
972 // toolbars_->saveToolbarInfo();
974 // toggle state on/off/auto
975 d.toolbars_->toggleToolbarState(name, allowauto);
981 } // namespace frontend
984 #include "GuiView_moc.cpp"