mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 13:31:49 +00:00
Simplify dialogs updating.
* GuiView::updateDialogs(): merge with GuiView::checkStatus() * LyXFunc::processKeySym(): remove call to GuiView::restartCursor(), this has already been called in the call to dispatch() at the end of the methof. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24588 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
3f2d9a381d
commit
32fac28acf
@ -377,9 +377,6 @@ void LyXFunc::processKeySym(KeySymbol const & keysym, KeyModifier state)
|
|||||||
if (!lyx_view_)
|
if (!lyx_view_)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lyx_view_)
|
|
||||||
lyx_view_->restartCursor();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -433,7 +433,7 @@ void GuiView::closeEvent(QCloseEvent * close_event)
|
|||||||
// Save toolbars configuration
|
// Save toolbars configuration
|
||||||
if (isFullScreen()) {
|
if (isFullScreen()) {
|
||||||
d.toolbars_->toggleFullScreen(!isFullScreen());
|
d.toolbars_->toggleFullScreen(!isFullScreen());
|
||||||
updateToolbars();
|
updateDialogs();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure the timer time out will not trigger a statusbar update.
|
// Make sure the timer time out will not trigger a statusbar update.
|
||||||
@ -849,9 +849,6 @@ void GuiView::updateToolbars()
|
|||||||
d.toolbars_->update(math, table, review, mathmacrotemplate);
|
d.toolbars_->update(math, table, review, mathmacrotemplate);
|
||||||
} else
|
} else
|
||||||
d.toolbars_->update(false, false, false, false);
|
d.toolbars_->update(false, false, false, false);
|
||||||
|
|
||||||
// update read-only status of open dialogs.
|
|
||||||
checkStatus();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1993,9 +1990,7 @@ void GuiView::restartCursor()
|
|||||||
d.current_work_area_->startBlinkingCursor();
|
d.current_work_area_->startBlinkingCursor();
|
||||||
|
|
||||||
// Take this occasion to update the other GUI elements.
|
// Take this occasion to update the other GUI elements.
|
||||||
updateLayoutList();
|
updateDialogs();
|
||||||
updateToolbars();
|
|
||||||
updateStatusBar();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2160,19 +2155,8 @@ void GuiView::updateDialogs()
|
|||||||
|
|
||||||
for(; it != end; ++it) {
|
for(; it != end; ++it) {
|
||||||
Dialog * dialog = it->second.get();
|
Dialog * dialog = it->second.get();
|
||||||
if (!dialog->isVisibleView())
|
if (dialog && dialog->isVisibleView())
|
||||||
continue;
|
dialog->checkStatus();
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
updateToolbars();
|
updateToolbars();
|
||||||
updateLayoutList();
|
updateLayoutList();
|
||||||
@ -2180,20 +2164,6 @@ void GuiView::updateDialogs()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
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...
|
// will be replaced by a proper factory...
|
||||||
Dialog * createGuiAbout(GuiView & lv);
|
Dialog * createGuiAbout(GuiView & lv);
|
||||||
Dialog * createGuiBibitem(GuiView & lv);
|
Dialog * createGuiBibitem(GuiView & lv);
|
||||||
|
@ -198,19 +198,18 @@ public:
|
|||||||
///
|
///
|
||||||
void resetDialogs();
|
void resetDialogs();
|
||||||
|
|
||||||
/** Check the status of all visible dialogs and disable or reenable
|
/// Hide all visible dialogs
|
||||||
|
void hideAll() const;
|
||||||
|
|
||||||
|
/// Update all visible dialogs.
|
||||||
|
/**
|
||||||
|
* Check the status of all visible dialogs and disable or reenable
|
||||||
* them as appropriate.
|
* them as appropriate.
|
||||||
*
|
*
|
||||||
* Disabling is needed for example when a dialog is open and the
|
* Disabling is needed for example when a dialog is open and the
|
||||||
* cursor moves to a position where the corresponding inset is not
|
* cursor moves to a position where the corresponding inset is not
|
||||||
* allowed.
|
* allowed.
|
||||||
*/
|
*/
|
||||||
void checkStatus();
|
|
||||||
|
|
||||||
/// Hide all visible dialogs
|
|
||||||
void hideAll() const;
|
|
||||||
|
|
||||||
// Update all visible dialogs.
|
|
||||||
void updateDialogs();
|
void updateDialogs();
|
||||||
|
|
||||||
/** \param name == "bibtex", "citation" etc; an identifier used to
|
/** \param name == "bibtex", "citation" etc; an identifier used to
|
||||||
|
@ -452,8 +452,7 @@ void GuiWorkArea::dispatch(FuncRequest const & cmd0, KeyModifier mod)
|
|||||||
// Skip these when selecting
|
// Skip these when selecting
|
||||||
if (cmd.action != LFUN_MOUSE_MOTION) {
|
if (cmd.action != LFUN_MOUSE_MOTION) {
|
||||||
completer_->updateVisibility(false, false);
|
completer_->updateVisibility(false, false);
|
||||||
lyx_view_->updateLayoutList();
|
lyx_view_->updateDialogs();
|
||||||
lyx_view_->updateToolbars();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GUI tweaks except with mouse motion with no button pressed.
|
// GUI tweaks except with mouse motion with no button pressed.
|
||||||
|
Loading…
Reference in New Issue
Block a user