continue;
}
- std::vector<int> const & ids = guiApp->viewIds();
- for (size_type i = 0; i != ids.size(); ++i) {
+ QVector<int> const ids = guiApp->viewIds();
+ for (int i = 0; i != ids.size(); ++i) {
if (id_ == ids[i])
continue;
if (guiApp->view(ids[i]).workArea(*b)) {
// Save toolbars configuration
if (isFullScreen()) {
d.toolbars_->toggleFullScreen(!isFullScreen());
- updateToolbars();
+ updateDialogs();
}
// Make sure the timer time out will not trigger a statusbar update.
this, SLOT(updateWindowTitle(GuiWorkArea *)));
updateWindowTitle(wa);
- // Navigator needs more than a simple update in this case. It needs to be
- // rebuilt.
structureChanged();
+ // The document settings needs to be reinitialised.
+ updateDialog("document", "");
+
// Buffer-dependent dialogs must be updated. This is done here because
// some dialogs require buffer()->text.
updateDialogs();
}
#else
structureChanged();
+ // The document settings needs to be reinitialised.
+ updateDialog("document", "");
updateDialogs();
#endif
}
// The document structure, name and dialogs might have
// changed in another view.
structureChanged();
+ // The document settings needs to be reinitialised.
+ updateDialog("document", "");
updateDialogs();
} else {
setWindowTitle(qt_("LyX"));
}
case QEvent::ShortcutOverride: {
+
+ if (isFullScreen() && menuBar()->isHidden()) {
+ QKeyEvent * ke = static_cast<QKeyEvent*>(e);
+ // FIXME: we should also try to detect special LyX shortcut such as
+ // Alt-P and Alt-M. Right now there is a hack in
+ // GuiWorkArea::processKeySym() that hides again the menubar for
+ // those cases.
+ if (ke->modifiers() & Qt::AltModifier && ke->key() != Qt::Key_Alt)
+ menuBar()->show();
+ return QMainWindow::event(e);
+ }
+
if (d.current_work_area_)
// Nothing special to do.
return QMainWindow::event(e);
QKeyEvent * ke = static_cast<QKeyEvent*>(e);
-
// Let Qt handle menu access and the Tab keys to navigate keys to navigate
// between controls.
if (ke->modifiers() & Qt::AltModifier || ke->key() == Qt::Key_Tab
d.toolbars_->update(math, table, review, mathmacrotemplate);
} else
d.toolbars_->update(false, false, false, false);
-
- // update read-only status of open dialogs.
- checkStatus();
}
void GuiView::structureChanged()
{
d.toc_models_.reset(view());
+ // Navigator needs more than a simple update in this case. It needs to be
+ // rebuilt.
updateDialog("toc", "");
}
Dialog * const dialog = it->second.get();
if (dialog->isVisibleView())
- dialog->updateData(data);
+ dialog->initialiseParams(data);
}
}
-FuncStatus GuiView::getStatus(FuncRequest const & cmd)
+bool GuiView::getStatus(FuncRequest const & cmd, FuncStatus & flag)
{
- FuncStatus flag;
bool enable = true;
Buffer * buf = buffer();
}
case LFUN_INSET_APPLY: {
- if (!buf) {
- enable = false;
- break;
- }
string const name = cmd.getArg(0);
Inset * inset = getOpenInset(name);
if (inset) {
flag |= fs;
} else {
FuncRequest fr(LFUN_INSET_INSERT, cmd.argument());
- flag |= getStatus(fr);
+ flag |= lyx::getStatus(fr);
}
enable = flag.enabled();
break;
break;
default:
- if (!view()) {
- enable = false;
- break;
- }
+ return false;
}
if (!enable)
flag.enabled(false);
- return flag;
+ return true;
}
bool GuiView::dispatch(FuncRequest const & cmd)
{
- BufferView * bv = view();
+ BufferView * bv = view();
// By default we won't need any update.
if (bv)
bv->cursor().updateFlags(Update::None);
+ bool dispatched = true;
switch(cmd.action) {
case LFUN_BUFFER_IMPORT:
}
case LFUN_INSET_APPLY: {
+ view()->cursor().recordUndoFullDocument();
string const name = cmd.getArg(0);
Inset * inset = getOpenInset(name);
if (inset) {
break;
default:
- return false;
+ dispatched = false;
+ break;
}
- return true;
+ if (isFullScreen()) {
+ if (menuBar()->isVisible())
+ menuBar()->hide();
+ if (statusBar()->isVisible())
+ statusBar()->hide();
+ }
+
+ return dispatched;
}
d.current_work_area_->startBlinkingCursor();
// Take this occasion to update the other GUI elements.
- updateLayoutList();
- updateToolbars();
- updateStatusBar();
+ updateDialogs();
}
for(; it != end; ++it) {
Dialog * dialog = it->second.get();
- if (!dialog->isVisibleView())
- continue;
- if (dialog->isBufferDependent()) {
- if (buffer())
- dialog->updateView();
- else
- dialog->enableView(false);
- } else {
- // A bit clunky, but the dialog will request
- // that the kernel provides it with the necessary
- // data.
- dialog->updateDialog();
- }
+ if (dialog && dialog->isVisibleView())
+ dialog->checkStatus();
}
updateToolbars();
updateLayoutList();
}
-void GuiView::checkStatus()
-{
- map<string, DialogPtr>::const_iterator it = d.dialogs_.begin();
- map<string, DialogPtr>::const_iterator end = d.dialogs_.end();
-
- for(; it != end; ++it) {
- Dialog * const dialog = it->second.get();
- if (dialog && dialog->isVisibleView())
- dialog->checkStatus();
- }
-}
-
-
-
// will be replaced by a proper factory...
Dialog * createGuiAbout(GuiView & lv);
Dialog * createGuiBibitem(GuiView & lv);