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"
27 #include "qt_helpers.h"
29 #include "frontends/Application.h"
30 #include "frontends/Dialogs.h"
31 #include "frontends/Gui.h"
33 #include "support/filetools.h"
34 #include "support/convert.h"
35 #include "support/lstrings.h"
36 #include "support/os.h"
38 #include "buffer_funcs.h"
40 #include "BufferList.h"
41 #include "BufferParams.h"
42 #include "BufferView.h"
45 #include "ErrorList.h"
46 #include "FuncRequest.h"
53 #include "MenuBackend.h"
54 #include "Paragraph.h"
55 #include "TextClass.h"
57 #include "ToolbarBackend.h"
60 #include "support/lstrings.h"
61 #include "support/filetools.h" // OnlyFilename()
62 #include "support/Timeout.h"
65 #include <QApplication>
66 #include <QCloseEvent>
67 #include <QDesktopWidget>
68 #include <QDragEnterEvent>
74 #include <QPushButton>
78 #include <QStackedWidget>
83 #include <boost/bind.hpp>
84 #include <boost/current_function.hpp>
86 #ifdef HAVE_SYS_TIME_H
87 # include <sys/time.h>
103 using support::bformat;
104 using support::FileName;
105 using support::makeDisplayPath;
106 using support::onlyFilename;
110 int const statusbar_timer_value = 3000;
112 class BackgroundWidget : public QWidget
115 BackgroundWidget(QString const & file, QString const & text)
117 splash_ = new QPixmap(file);
119 lyxerr << "could not load splash screen: '" << fromqstr(file) << "'" << endl;
123 QPainter pain(splash_);
124 pain.setPen(QColor(255, 255, 0));
126 // The font used to display the version info
127 font.setStyleHint(QFont::SansSerif);
128 font.setWeight(QFont::Bold);
129 font.setPointSize(convert<int>(lyxrc.font_sizes[FONT_SIZE_LARGE]));
131 pain.drawText(260, 270, text);
134 void paintEvent(QPaintEvent *)
139 int x = (width() - splash_->width()) / 2;
140 int y = (height() - splash_->height()) / 2;
142 pain.drawPixmap(x, y, *splash_);
152 struct GuiView::GuiViewPrivate
155 : current_work_area_(0), posx_offset(0), posy_offset(0)
162 delete stack_widget_;
167 unsigned int smallIconSize;
168 unsigned int normalIconSize;
169 unsigned int bigIconSize;
170 // static needed by "New Window"
171 static unsigned int lastIconSize;
173 QMenu * toolBarPopup(GuiView * parent)
175 // FIXME: translation
176 QMenu * menu = new QMenu(parent);
177 QActionGroup * iconSizeGroup = new QActionGroup(parent);
179 QAction * smallIcons = new QAction(iconSizeGroup);
180 smallIcons->setText(qt_("Small-sized icons"));
181 smallIcons->setCheckable(true);
182 QObject::connect(smallIcons, SIGNAL(triggered()),
183 parent, SLOT(smallSizedIcons()));
184 menu->addAction(smallIcons);
186 QAction * normalIcons = new QAction(iconSizeGroup);
187 normalIcons->setText(qt_("Normal-sized icons"));
188 normalIcons->setCheckable(true);
189 QObject::connect(normalIcons, SIGNAL(triggered()),
190 parent, SLOT(normalSizedIcons()));
191 menu->addAction(normalIcons);
193 QAction * bigIcons = new QAction(iconSizeGroup);
194 bigIcons->setText(qt_("Big-sized icons"));
195 bigIcons->setCheckable(true);
196 QObject::connect(bigIcons, SIGNAL(triggered()),
197 parent, SLOT(bigSizedIcons()));
198 menu->addAction(bigIcons);
200 unsigned int cur = parent->iconSize().width();
201 if ( cur == parent->d.smallIconSize)
202 smallIcons->setChecked(true);
203 else if (cur == parent->d.normalIconSize)
204 normalIcons->setChecked(true);
205 else if (cur == parent->d.bigIconSize)
206 bigIcons->setChecked(true);
211 void initBackground()
213 LYXERR(Debug::GUI, "show banner: " << lyxrc.show_banner);
214 /// The text to be written on top of the pixmap
215 QString const text = lyx_version ? QString(lyx_version) : qt_("unknown version");
216 bg_widget_ = new BackgroundWidget(":/images/banner.png", text);
221 stack_widget_->setCurrentWidget(bg_widget_);
222 bg_widget_->setUpdatesEnabled(true);
225 TabWorkArea * tabWorkArea(int i)
227 return dynamic_cast<TabWorkArea *>(splitter_->widget(i));
230 TabWorkArea * currentTabWorkArea()
232 if (splitter_->count() == 1)
233 // The first TabWorkArea is always the first one, if any.
234 return tabWorkArea(0);
236 TabWorkArea * tab_widget = 0;
237 for (int i = 0; i != splitter_->count(); ++i) {
238 QWidget * w = splitter_->widget(i);
241 tab_widget = dynamic_cast<TabWorkArea *>(w);
253 GuiWorkArea * current_work_area_;
257 QSplitter * splitter_;
258 QStackedWidget * stack_widget_;
259 BackgroundWidget * bg_widget_;
261 GuiMenubar * menubar_;
263 GuiToolbars * toolbars_;
265 docstring current_layout;
269 unsigned int GuiView::GuiViewPrivate::lastIconSize = 0;
272 GuiView::GuiView(int id)
273 : QMainWindow(), LyXView(id),
274 d(*new GuiViewPrivate),
275 quitting_by_menu_(false),
276 autosave_timeout_(new Timeout(5000)),
277 dialogs_(new Dialogs(*this))
279 // Start autosave timer
280 if (lyxrc.autosave) {
281 autosave_timeout_->timeout.connect(boost::bind(&GuiView::autoSave, this));
282 autosave_timeout_->setTimeout(lyxrc.autosave * 1000);
283 autosave_timeout_->start();
286 // Qt bug? signal lastWindowClosed does not work
287 setAttribute(Qt::WA_QuitOnClose, false);
288 setAttribute(Qt::WA_DeleteOnClose, true);
290 // hardcode here the platform specific icon size
291 d.smallIconSize = 14; // scaling problems
292 d.normalIconSize = 20; // ok, default
293 d.bigIconSize = 26; // better for some math icons
296 // assign an icon to main form. We do not do it under Qt/Mac,
297 // since the icon is provided in the application bundle.
298 setWindowIcon(QPixmap(":/images/lyx.png"));
302 d.splitter_ = new QSplitter;
305 LYXERR(Debug::GUI, "stack widget!");
306 d.stack_widget_ = new QStackedWidget;
307 d.stack_widget_->addWidget(d.bg_widget_);
308 d.stack_widget_->addWidget(d.splitter_);
309 setCentralWidget(d.stack_widget_);
312 setAcceptDrops(true);
319 delete autosave_timeout_;
324 void GuiView::close()
326 quitting_by_menu_ = true;
327 d.current_work_area_ = 0;
328 for (int i = 0; i != d.splitter_->count(); ++i) {
329 TabWorkArea * twa = d.tabWorkArea(i);
333 QMainWindow::close();
334 quitting_by_menu_ = false;
338 void GuiView::setFocus()
340 if (d.current_work_area_)
341 d.current_work_area_->setFocus();
347 QMenu* GuiView::createPopupMenu()
349 return d.toolBarPopup(this);
355 // GuiToolbars *must* be initialised before GuiMenubar.
356 d.toolbars_ = new GuiToolbars(*this);
357 // FIXME: GuiToolbars::init() cannot be integrated in the ctor
358 // because LyXFunc::getStatus() needs a properly initialized
359 // GuiToolbars object (for LFUN_TOOLBAR_TOGGLE).
361 d.menubar_ = new GuiMenubar(this, menubackend);
363 statusBar()->setSizeGripEnabled(true);
365 QObject::connect(&statusbar_timer_, SIGNAL(timeout()),
366 this, SLOT(clearMessage()));
372 void GuiView::showEvent(QShowEvent * e)
374 if (lyxrc.allow_geometry_session) {
376 QString const key = "view-" + QString::number(id());
377 if (!restoreGeometry(settings.value(key + "/geometry").toByteArray()))
378 setGeometry(50, 50, 690, 510);
379 setIconSize(settings.value(key + "/icon_size").toSize());
381 setGeometry(50, 50, 690, 510);
383 if (d.splitter_->count() == 0)
384 // No work area, switch to the background widget.
387 QMainWindow::showEvent(e);
391 void GuiView::closeEvent(QCloseEvent * close_event)
393 // we may have been called through the close window button
394 // which bypasses the LFUN machinery.
395 if (!quitting_by_menu_ && theApp()->gui().viewIds().size() == 1) {
396 if (!theBufferList().quitWriteAll()) {
397 close_event->ignore();
402 // Make sure that no LFUN use this close to be closed View.
403 theLyXFunc().setLyXView(0);
404 // Make sure the timer time out will not trigger a statusbar update.
405 statusbar_timer_.stop();
407 if (lyxrc.allow_geometry_session) {
409 QString const key = "view-" + QString::number(id());
410 settings.setValue(key + "/geometry", saveGeometry());
411 settings.setValue(key + "/icon_size", iconSize());
412 d.toolbars_->saveToolbarInfo();
415 theApp()->gui().unregisterView(id());
416 if (!theApp()->gui().viewIds().empty()) {
417 // Just close the window and do nothing else if this is not the
419 close_event->accept();
425 // this is the place where we leave the frontend.
426 // it is the only point at which we start quitting.
427 close_event->accept();
428 // quit the event loop
433 void GuiView::dragEnterEvent(QDragEnterEvent * event)
435 if (event->mimeData()->hasUrls())
437 /// \todo Ask lyx-devel is this is enough:
438 /// if (event->mimeData()->hasFormat("text/plain"))
439 /// event->acceptProposedAction();
443 void GuiView::dropEvent(QDropEvent* event)
445 QList<QUrl> files = event->mimeData()->urls();
449 LYXERR(Debug::GUI, BOOST_CURRENT_FUNCTION << " got URLs!");
450 for (int i = 0; i != files.size(); ++i) {
451 string const file = support::os::internal_path(fromqstr(
452 files.at(i).toLocalFile()));
454 dispatch(FuncRequest(LFUN_FILE_OPEN, file));
459 void GuiView::message(docstring const & str)
461 statusBar()->showMessage(toqstr(str));
462 statusbar_timer_.stop();
463 statusbar_timer_.start(statusbar_timer_value);
467 void GuiView::smallSizedIcons()
469 setIconSize(QSize(d.smallIconSize, d.smallIconSize));
473 void GuiView::normalSizedIcons()
475 setIconSize(QSize(d.normalIconSize, d.normalIconSize));
479 void GuiView::bigSizedIcons()
481 setIconSize(QSize(d.bigIconSize, d.bigIconSize));
485 void GuiView::clearMessage()
489 theLyXFunc().setLyXView(this);
490 statusBar()->showMessage(toqstr(theLyXFunc().viewStatusMessage()));
491 statusbar_timer_.stop();
495 void GuiView::updateWindowTitle(GuiWorkArea * wa)
497 if (wa != d.current_work_area_)
499 setWindowTitle(qt_("LyX: ") + wa->windowTitle());
500 setWindowIconText(wa->windowIconText());
504 void GuiView::on_currentWorkAreaChanged(GuiWorkArea * wa)
507 disconnectBufferView();
508 connectBufferView(wa->bufferView());
509 connectBuffer(wa->bufferView().buffer());
510 d.current_work_area_ = wa;
511 QObject::connect(wa, SIGNAL(titleChanged(GuiWorkArea *)),
512 this, SLOT(updateWindowTitle(GuiWorkArea *)));
513 updateWindowTitle(wa);
516 // Buffer-dependent dialogs should be updated or
517 // hidden. This should go here because some dialogs (eg ToC)
518 // require bv_->text.
519 dialogs_->updateBufferDependent(true);
521 updateLayoutChoice(false);
526 void GuiView::updateStatusBar()
528 // let the user see the explicit message
529 if (statusbar_timer_.isActive())
532 statusBar()->showMessage(toqstr(theLyXFunc().viewStatusMessage()));
536 bool GuiView::hasFocus() const
538 return qApp->activeWindow() == this;
542 bool GuiView::event(QEvent * e)
546 // Useful debug code:
547 //case QEvent::ActivationChange:
548 //case QEvent::WindowDeactivate:
549 //case QEvent::Paint:
550 //case QEvent::Enter:
551 //case QEvent::Leave:
552 //case QEvent::HoverEnter:
553 //case QEvent::HoverLeave:
554 //case QEvent::HoverMove:
555 //case QEvent::StatusTip:
556 //case QEvent::DragEnter:
557 //case QEvent::DragLeave:
561 case QEvent::WindowActivate: {
562 theApp()->setCurrentView(*this);
563 if (d.current_work_area_) {
564 BufferView & bv = d.current_work_area_->bufferView();
565 connectBufferView(bv);
566 connectBuffer(bv.buffer());
567 // The document structure, name and dialogs might have
568 // changed in another view.
569 dialogs_->updateBufferDependent(true);
571 setWindowTitle(qt_("LyX"));
572 setWindowIconText(qt_("LyX"));
574 return QMainWindow::event(e);
576 case QEvent::ShortcutOverride: {
577 QKeyEvent * ke = static_cast<QKeyEvent*>(e);
578 if (!d.current_work_area_) {
579 theLyXFunc().setLyXView(this);
581 setKeySymbol(&sym, ke);
582 theLyXFunc().processKeySym(sym, q_key_state(ke->modifiers()));
586 if (ke->key() == Qt::Key_Tab || ke->key() == Qt::Key_Backtab) {
588 setKeySymbol(&sym, ke);
589 d.current_work_area_->processKeySym(sym, NoModifier);
595 return QMainWindow::event(e);
600 bool GuiView::focusNextPrevChild(bool /*next*/)
607 void GuiView::setBusy(bool yes)
609 if (d.current_work_area_) {
610 d.current_work_area_->setUpdatesEnabled(!yes);
612 d.current_work_area_->stopBlinkingCursor();
614 d.current_work_area_->startBlinkingCursor();
618 QApplication::setOverrideCursor(Qt::WaitCursor);
620 QApplication::restoreOverrideCursor();
624 GuiToolbar * GuiView::makeToolbar(ToolbarInfo const & tbinfo, bool newline)
626 GuiToolbar * toolBar = new GuiToolbar(tbinfo, *this);
628 if (tbinfo.flags & ToolbarInfo::TOP) {
630 addToolBarBreak(Qt::TopToolBarArea);
631 addToolBar(Qt::TopToolBarArea, toolBar);
634 if (tbinfo.flags & ToolbarInfo::BOTTOM) {
635 // Qt < 4.2.2 cannot handle ToolBarBreak on non-TOP dock.
636 #if (QT_VERSION >= 0x040202)
638 addToolBarBreak(Qt::BottomToolBarArea);
640 addToolBar(Qt::BottomToolBarArea, toolBar);
643 if (tbinfo.flags & ToolbarInfo::LEFT) {
644 // Qt < 4.2.2 cannot handle ToolBarBreak on non-TOP dock.
645 #if (QT_VERSION >= 0x040202)
647 addToolBarBreak(Qt::LeftToolBarArea);
649 addToolBar(Qt::LeftToolBarArea, toolBar);
652 if (tbinfo.flags & ToolbarInfo::RIGHT) {
653 // Qt < 4.2.2 cannot handle ToolBarBreak on non-TOP dock.
654 #if (QT_VERSION >= 0x040202)
656 addToolBarBreak(Qt::RightToolBarArea);
658 addToolBar(Qt::RightToolBarArea, toolBar);
661 // The following does not work so I cannot restore to exact toolbar location
663 ToolbarSection::ToolbarInfo & tbinfo = LyX::ref().session().toolbars().load(tbinfo.name);
664 toolBar->move(tbinfo.posx, tbinfo.posy);
671 GuiWorkArea * GuiView::workArea(Buffer & buffer)
673 for (int i = 0; i != d.splitter_->count(); ++i) {
674 GuiWorkArea * wa = d.tabWorkArea(i)->workArea(buffer);
682 GuiWorkArea * GuiView::addWorkArea(Buffer & buffer)
684 GuiWorkArea * wa = new GuiWorkArea(buffer, *this);
685 wa->setUpdatesEnabled(false);
687 // Automatically create a TabWorkArea if there are none yet.
688 if (!d.splitter_->count())
691 TabWorkArea * tab_widget = d.currentTabWorkArea();
692 tab_widget->addTab(wa, wa->windowTitle());
693 QObject::connect(wa, SIGNAL(titleChanged(GuiWorkArea *)),
694 tab_widget, SLOT(updateTabText(GuiWorkArea *)));
696 wa->bufferView().updateMetrics();
698 // Hide tabbar if there's only one tab.
699 tab_widget->showBar(tab_widget->count() > 1);
704 void GuiView::addTabWorkArea()
706 TabWorkArea * twa = new TabWorkArea;
707 QObject::connect(twa, SIGNAL(currentWorkAreaChanged(GuiWorkArea *)),
708 this, SLOT(on_currentWorkAreaChanged(GuiWorkArea *)));
709 d.splitter_->addWidget(twa);
710 d.stack_widget_->setCurrentWidget(d.splitter_);
714 GuiWorkArea const * GuiView::currentWorkArea() const
716 return d.current_work_area_;
720 void GuiView::setCurrentWorkArea(GuiWorkArea * work_area)
722 BOOST_ASSERT(work_area);
724 // Changing work area can result from opening a file so
725 // update the toc in any case.
728 GuiWorkArea * wa = static_cast<GuiWorkArea *>(work_area);
729 d.current_work_area_ = wa;
730 for (int i = 0; i != d.splitter_->count(); ++i) {
731 if (d.tabWorkArea(i)->setCurrentWorkArea(wa))
737 void GuiView::removeWorkArea(GuiWorkArea * work_area)
739 BOOST_ASSERT(work_area);
740 GuiWorkArea * gwa = static_cast<GuiWorkArea *>(work_area);
741 if (gwa == d.current_work_area_) {
743 disconnectBufferView();
744 dialogs_->hideBufferDependent();
745 d.current_work_area_ = 0;
748 // removing a work area often results from closing a file so
749 // update the toc in any case.
752 for (int i = 0; i != d.splitter_->count(); ++i) {
753 TabWorkArea * twa = d.tabWorkArea(i);
754 if (!twa->removeWorkArea(gwa))
755 // Not found in this tab group.
758 // We found and removed the GuiWorkArea.
760 // No more WorkAreas in this tab group, so delete it.
765 if (d.current_work_area_)
766 // This means that we are not closing the current GuiWorkArea;
769 // Switch to the next GuiWorkArea in the found TabWorkArea.
770 d.current_work_area_ = twa->currentWorkArea();
774 if (d.splitter_->count() == 0)
775 // No more work area, switch to the background widget.
780 void GuiView::updateLayoutChoice(bool force)
782 // Don't show any layouts without a buffer
784 d.toolbars_->clearLayoutList();
788 // Update the layout display
789 if (d.toolbars_->updateLayoutList(buffer()->params().getTextClassPtr(), force)) {
790 d.current_layout = buffer()->params().getTextClass().defaultLayoutName();
793 docstring const & layout = d.current_work_area_->bufferView().cursor().
794 innerParagraph().layout()->name();
796 if (layout != d.current_layout) {
797 d.toolbars_->setLayout(layout);
798 d.current_layout = layout;
803 bool GuiView::isToolbarVisible(std::string const & id)
805 return d.toolbars_->visible(id);
808 void GuiView::updateToolbars()
810 if (d.current_work_area_) {
812 d.current_work_area_->bufferView().cursor().inMathed();
814 lyx::getStatus(FuncRequest(LFUN_LAYOUT_TABULAR)).enabled();
816 lyx::getStatus(FuncRequest(LFUN_CHANGES_TRACK)).enabled() &&
817 lyx::getStatus(FuncRequest(LFUN_CHANGES_TRACK)).onoff(true);
819 d.toolbars_->update(math, table, review);
821 d.toolbars_->update(false, false, false);
823 // update read-only status of open dialogs.
824 dialogs_->checkStatus();
828 Buffer * GuiView::buffer()
830 if (d.current_work_area_)
831 return &d.current_work_area_->bufferView().buffer();
836 Buffer const * GuiView::buffer() const
838 if (d.current_work_area_)
839 return &d.current_work_area_->bufferView().buffer();
844 void GuiView::setBuffer(Buffer * newBuffer)
846 BOOST_ASSERT(newBuffer);
849 GuiWorkArea * wa = workArea(*newBuffer);
851 updateLabels(*newBuffer->masterBuffer());
852 wa = addWorkArea(*newBuffer);
854 //Disconnect the old buffer...there's no new one.
857 connectBuffer(*newBuffer);
858 connectBufferView(wa->bufferView());
859 setCurrentWorkArea(wa);
865 Buffer * GuiView::loadLyXFile(FileName const & filename, bool tolastfiles)
869 Buffer * newBuffer = checkAndLoadLyXFile(filename);
872 message(_("Document not loaded."));
878 GuiWorkArea * wa = workArea(*newBuffer);
880 wa = addWorkArea(*newBuffer);
882 // scroll to the position when the file was last closed
883 if (lyxrc.use_lastfilepos) {
884 LastFilePosSection::FilePos filepos =
885 LyX::ref().session().lastFilePos().load(filename);
886 // if successfully move to pit (returned par_id is not zero),
887 // update metrics and reset font
888 wa->bufferView().moveToPosition(filepos.pit, filepos.pos, 0, 0);
892 LyX::ref().session().lastFiles().add(filename);
899 void GuiView::connectBuffer(Buffer & buf)
901 buf.setGuiDelegate(this);
905 void GuiView::disconnectBuffer()
907 if (d.current_work_area_)
908 d.current_work_area_->bufferView().setGuiDelegate(0);
912 void GuiView::connectBufferView(BufferView & bv)
914 bv.setGuiDelegate(this);
918 void GuiView::disconnectBufferView()
920 if (d.current_work_area_)
921 d.current_work_area_->bufferView().setGuiDelegate(0);
925 void GuiView::errors(string const & error_type)
927 ErrorList & el = buffer()->errorList(error_type);
929 dialogs_->show("errorlist", error_type);
933 void GuiView::showDialog(string const & name)
935 dialogs_->show(name);
939 void GuiView::showDialogWithData(string const & name, string const & data)
941 dialogs_->show(name, data);
945 void GuiView::showInsetDialog(string const & name, string const & data,
948 dialogs_->show(name, data, inset);
952 void GuiView::updateDialog(string const & name, string const & data)
954 if (dialogs_->visible(name))
955 dialogs_->update(name, data);
959 BufferView * GuiView::view()
961 return d.current_work_area_ ? &d.current_work_area_->bufferView() : 0;
965 void GuiView::updateToc()
967 updateDialog("toc", "");
971 void GuiView::updateEmbeddedFiles()
973 updateDialog("embedding", "");
977 void GuiView::autoSave()
979 LYXERR(Debug::INFO, "Running autoSave()");
982 view()->buffer().autoSave();
986 void GuiView::resetAutosaveTimers()
989 autosave_timeout_->restart();
993 void GuiView::dispatch(FuncRequest const & cmd)
996 case LFUN_BUFFER_SWITCH:
997 setBuffer(theBufferList().getBuffer(to_utf8(cmd.argument())));
1000 case LFUN_COMMAND_EXECUTE: {
1001 bool const show_it = cmd.argument() != "off";
1002 d.toolbars_->showCommandBuffer(show_it);
1005 case LFUN_DROP_LAYOUTS_CHOICE:
1006 d.toolbars_->openLayoutList();
1009 case LFUN_MENU_OPEN:
1010 d.menubar_->openByName(toqstr(cmd.argument()));
1013 case LFUN_TOOLBAR_TOGGLE: {
1014 string const name = cmd.getArg(0);
1015 bool const allowauto = cmd.getArg(1) == "allowauto";
1016 // it is possible to get current toolbar status like this,...
1017 // but I decide to obey the order of ToolbarBackend::flags
1018 // and disregard real toolbar status.
1019 // toolbars_->saveToolbarInfo();
1021 // toggle state on/off/auto
1022 d.toolbars_->toggleToolbarState(name, allowauto);
1026 ToolbarInfo * tbi = d.toolbars_->getToolbarInfo(name);
1028 message(bformat(_("Unknown toolbar \"%1$s\""), from_utf8(name)));
1032 if (tbi->flags & ToolbarInfo::ON)
1034 else if (tbi->flags & ToolbarInfo::OFF)
1036 else if (tbi->flags & ToolbarInfo::AUTO)
1039 message(bformat(_("Toolbar \"%1$s\" state set to %2$s"),
1040 _(tbi->gui_name), state));
1045 theLyXFunc().setLyXView(this);
1051 Buffer const * GuiView::updateInset(Inset const * inset)
1053 if (!d.current_work_area_)
1057 d.current_work_area_->scheduleRedraw();
1059 return &d.current_work_area_->bufferView().buffer();
1063 void GuiView::restartCursor()
1065 /* When we move around, or type, it's nice to be able to see
1066 * the cursor immediately after the keypress.
1068 if (d.current_work_area_)
1069 d.current_work_area_->startBlinkingCursor();
1072 } // namespace frontend
1075 #include "GuiView_moc.cpp"