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 d.tab_widget_->closeAll();
268 QMainWindow::close();
269 quitting_by_menu_ = false;
273 void GuiViewBase::setFocus()
275 if (d.tab_widget_->count())
276 d.tab_widget_->currentWidget()->setFocus();
280 QMenu* GuiViewBase::createPopupMenu()
282 return d.toolBarPopup(this);
286 void GuiViewBase::init()
288 // GuiToolbars *must* be initialised before GuiMenubar.
289 d.toolbars_ = new GuiToolbars(*this);
290 // FIXME: GuiToolbars::init() cannot be integrated in the ctor
291 // because LyXFunc::getStatus() needs a properly initialized
292 // GuiToolbars object (for LFUN_TOOLBAR_TOGGLE).
294 d.menubar_ = new GuiMenubar(this, menubackend);
296 statusBar()->setSizeGripEnabled(true);
298 QObject::connect(&statusbar_timer_, SIGNAL(timeout()),
299 this, SLOT(update_view_state_qt()));
302 d.stack_widget_->setCurrentWidget(d.bg_widget_);
306 void GuiViewBase::closeEvent(QCloseEvent * close_event)
308 // we may have been called through the close window button
309 // which bypasses the LFUN machinery.
310 if (!quitting_by_menu_ && theApp()->gui().viewIds().size() == 1) {
311 if (!theBufferList().quitWriteAll()) {
312 close_event->ignore();
317 // Make sure that no LFUN use this close to be closed View.
318 theLyXFunc().setLyXView(0);
319 // Make sure the timer time out will not trigger a statusbar update.
320 statusbar_timer_.stop();
322 theApp()->gui().unregisterView(id());
323 if (!theApp()->gui().viewIds().empty()) {
324 // Just close the window and do nothing else if this is not the
326 close_event->accept();
332 // this is the place where we leave the frontend.
333 // it is the only point at which we start quitting.
335 close_event->accept();
336 // quit the event loop
341 void GuiViewBase::dragEnterEvent(QDragEnterEvent * event)
343 if (event->mimeData()->hasUrls())
345 /// \todo Ask lyx-devel is this is enough:
346 /// if (event->mimeData()->hasFormat("text/plain"))
347 /// event->acceptProposedAction();
351 void GuiViewBase::dropEvent(QDropEvent* event)
353 QList<QUrl> files = event->mimeData()->urls();
357 LYXERR(Debug::GUI) << BOOST_CURRENT_FUNCTION
358 << " got URLs!" << endl;
359 for (int i = 0; i != files.size(); ++i) {
360 string const file = support::os::internal_path(fromqstr(
361 files.at(i).toLocalFile()));
363 dispatch(FuncRequest(LFUN_FILE_OPEN, file));
368 void GuiViewBase::saveGeometry()
370 static bool done = false;
377 // change the ifdef to 'geometry = normalGeometry();' only
378 // when Trolltech has fixed the broken normalGeometry on X11:
379 // http://www.trolltech.com/developer/task-tracker/index_html?id=119684+&method=entry
380 // Then also the moveEvent, resizeEvent, and the
381 // code for floatingGeometry_ can be removed;
382 // adjust GuiViewBase::setGeometry()
384 QRect normal_geometry;
387 normal_geometry = normalGeometry();
389 maximized = CompletelyMaximized;
391 maximized = NotMaximized;
394 normal_geometry = updateFloatingGeometry();
396 QDesktopWidget& dw = *qApp->desktop();
397 QRect desk = dw.availableGeometry(dw.primaryScreen());
398 // Qt bug on Linux: load completely maximized, vert max. save-> frameGeometry().height() is wrong
399 if (isMaximized() && desk.width() <= frameGeometry().width() && desk.height() <= frameGeometry().height()) {
400 maximized = CompletelyMaximized;
401 // maximizing does not work when the window is allready hor. or vert. maximized
402 // Tested only on KDE
403 int dh = frameGeometry().height() - height();
404 if (desk.height() <= normal_geometry.height() + dh)
405 normal_geometry.setHeight(normal_geometry.height() - 1);
406 int dw = frameGeometry().width() - width();
407 if (desk.width() <= normal_geometry.width() + dw)
408 normal_geometry.setWidth(normal_geometry.width() - 1);
409 } else if (desk.height() <= frameGeometry().height()) {
410 maximized = VerticallyMaximized;
411 } else if (desk.width() <= frameGeometry().width()) {
412 maximized = HorizontallyMaximized;
414 maximized = NotMaximized;
419 // save windows size and position
420 Session & session = LyX::ref().session();
421 session.sessionInfo().save("WindowWidth", convert<string>(normal_geometry.width()));
422 session.sessionInfo().save("WindowHeight", convert<string>(normal_geometry.height()));
423 session.sessionInfo().save("WindowMaximized", convert<string>(maximized));
424 session.sessionInfo().save("IconSizeXY", convert<string>(iconSize().width()));
425 if (lyxrc.geometry_xysaved) {
426 session.sessionInfo().save("WindowPosX", convert<string>(normal_geometry.x() + d.posx_offset));
427 session.sessionInfo().save("WindowPosY", convert<string>(normal_geometry.y() + d.posy_offset));
429 d.toolbars_->saveToolbarInfo();
433 void GuiViewBase::setGeometry(unsigned int width,
437 unsigned int iconSizeXY,
438 const string & geometryArg)
440 // use last value (not at startup)
441 if (d.lastIconSize != 0)
442 setIconSize(d.lastIconSize);
443 else if (iconSizeXY != 0)
444 setIconSize(iconSizeXY);
446 setIconSize(d.normalIconSize);
448 // only true when the -geometry option was NOT used
449 if (width != 0 && height != 0) {
450 if (posx != -1 && posy != -1) {
451 // if there are startup positioning problems:
452 // http://doc.trolltech.com/4.2/qdesktopwidget.html
453 QDesktopWidget& dw = *qApp->desktop();
454 if (dw.isVirtualDesktop()) {
455 if(!dw.geometry().contains(posx, posy)) {
460 // Which system doesn't use a virtual desktop?
461 // TODO save also last screen number and check if it is still availabe.
464 // FIXME: use setGeometry only when Trolltech has fixed the qt4/X11 bug
465 QWidget::setGeometry(posx, posy, width, height);
467 resize(width, height);
471 resize(width, height);
474 // remember original size
475 floatingGeometry_ = QRect(posx, posy, width, height);
477 if (maximized != NotMaximized) {
478 if (maximized == CompletelyMaximized) {
479 setWindowState(Qt::WindowMaximized);
482 // TODO How to set by the window manager?
483 // setWindowState(Qt::WindowVerticallyMaximized);
485 QDesktopWidget& dw = *qApp->desktop();
486 QRect desk = dw.availableGeometry(dw.primaryScreen());
487 if (maximized == VerticallyMaximized)
488 resize(width, desk.height());
489 if (maximized == HorizontallyMaximized)
490 resize(desk.width(), height);
497 // FIXME: move this code into parse_geometry() (LyX.cpp)
501 QRegExp re( "[=]*(?:([0-9]+)[xX]([0-9]+)){0,1}[ ]*(?:([+-][0-9]*)([+-][0-9]*)){0,1}" );
502 re.indexIn(toqstr(geometryArg.c_str()));
503 w = re.cap(1).toInt();
504 h = re.cap(2).toInt();
505 x = re.cap(3).toInt();
506 y = re.cap(4).toInt();
507 QWidget::setGeometry( x, y, w, h );
518 // For an unknown reason, the Window title update is not effective for
519 // the second windows up until it is shown on screen (Qt bug?).
522 // after show geometry() has changed (Qt bug?)
523 // we compensate the drift when storing the position
526 if (width != 0 && height != 0)
527 if (posx != -1 && posy != -1) {
529 d.posx_offset = posx - normalGeometry().x();
530 d.posy_offset = posy - normalGeometry().y();
533 if (maximized == NotMaximized) {
534 d.posx_offset = posx - geometry().x();
535 d.posy_offset = posy - geometry().y();
543 void GuiViewBase::setWindowTitle(docstring const & t, docstring const & it)
545 QString title = windowTitle();
546 QString new_title = toqstr(t);
547 if (title != new_title) {
548 QMainWindow::setWindowTitle(new_title);
549 QMainWindow::setWindowIconText(toqstr(it));
551 if (Buffer const * buf = buffer())
552 d.tab_widget_->setTabText(d.tab_widget_->currentIndex(),
553 toqstr(makeDisplayPath(buf->fileName(), 30)));
557 void GuiViewBase::message(docstring const & str)
559 statusBar()->showMessage(toqstr(str));
560 statusbar_timer_.stop();
561 statusbar_timer_.start(statusbar_timer_value);
565 void GuiViewBase::clearMessage()
567 update_view_state_qt();
571 void GuiViewBase::setIconSize(unsigned int size)
573 d.lastIconSize = size;
574 QMainWindow::setIconSize(QSize(size, size));
578 void GuiViewBase::smallSizedIcons()
580 setIconSize(d.smallIconSize);
584 void GuiViewBase::normalSizedIcons()
586 setIconSize(d.normalIconSize);
590 void GuiViewBase::bigSizedIcons()
592 setIconSize(d.bigIconSize);
596 void GuiViewBase::update_view_state_qt()
600 theLyXFunc().setLyXView(this);
601 statusBar()->showMessage(toqstr(theLyXFunc().viewStatusMessage()));
602 statusbar_timer_.stop();
606 void GuiViewBase::on_currentWorkAreaChanged(GuiWorkArea * wa)
609 disconnectBufferView();
610 connectBufferView(wa->bufferView());
611 connectBuffer(wa->bufferView().buffer());
614 // Buffer-dependent dialogs should be updated or
615 // hidden. This should go here because some dialogs (eg ToC)
616 // require bv_->text.
617 getDialogs().updateBufferDependent(true);
619 updateLayoutChoice();
625 void GuiViewBase::updateStatusBar()
627 // let the user see the explicit message
628 if (statusbar_timer_.isActive())
631 statusBar()->showMessage(toqstr(theLyXFunc().viewStatusMessage()));
635 void GuiViewBase::activated(FuncRequest const & func)
641 bool GuiViewBase::hasFocus() const
643 return qApp->activeWindow() == this;
647 QRect GuiViewBase::updateFloatingGeometry()
649 QDesktopWidget& dw = *qApp->desktop();
650 QRect desk = dw.availableGeometry(dw.primaryScreen());
651 // remember only non-maximized sizes
652 if (!isMaximized() && desk.width() > frameGeometry().width() && desk.height() > frameGeometry().height()) {
653 floatingGeometry_ = QRect(x(), y(), width(), height());
655 return floatingGeometry_;
659 void GuiViewBase::resizeEvent(QResizeEvent *)
661 updateFloatingGeometry();
665 void GuiViewBase::moveEvent(QMoveEvent *)
667 updateFloatingGeometry();
671 bool GuiViewBase::event(QEvent * e)
675 // Useful debug code:
676 //case QEvent::ActivationChange:
677 //case QEvent::WindowDeactivate:
678 //case QEvent::Paint:
679 //case QEvent::Enter:
680 //case QEvent::Leave:
681 //case QEvent::HoverEnter:
682 //case QEvent::HoverLeave:
683 //case QEvent::HoverMove:
684 //case QEvent::StatusTip:
685 //case QEvent::DragEnter:
686 //case QEvent::DragLeave:
690 case QEvent::WindowActivate:
691 theApp()->setCurrentView(*this);
692 if (d.tab_widget_->count()) {
693 GuiWorkArea * wa = dynamic_cast<GuiWorkArea *>(
694 d.tab_widget_->currentWidget());
696 BufferView & bv = wa->bufferView();
697 connectBufferView(bv);
698 connectBuffer(bv.buffer());
699 // The document structure, name and dialogs might have
700 // 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"