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:
Abdelrazak Younes 2008-05-02 20:58:25 +00:00
parent 3f2d9a381d
commit 32fac28acf
4 changed files with 11 additions and 46 deletions

View File

@ -377,9 +377,6 @@ void LyXFunc::processKeySym(KeySymbol const & keysym, KeyModifier state)
if (!lyx_view_)
return;
}
if (lyx_view_)
lyx_view_->restartCursor();
}

View File

@ -433,7 +433,7 @@ void GuiView::closeEvent(QCloseEvent * close_event)
// Save toolbars configuration
if (isFullScreen()) {
d.toolbars_->toggleFullScreen(!isFullScreen());
updateToolbars();
updateDialogs();
}
// 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);
} else
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();
// Take this occasion to update the other GUI elements.
updateLayoutList();
updateToolbars();
updateStatusBar();
updateDialogs();
}
@ -2160,19 +2155,8 @@ void GuiView::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();
@ -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...
Dialog * createGuiAbout(GuiView & lv);
Dialog * createGuiBibitem(GuiView & lv);

View File

@ -198,19 +198,18 @@ public:
///
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.
*
* Disabling is needed for example when a dialog is open and the
* cursor moves to a position where the corresponding inset is not
* allowed.
*/
void checkStatus();
/// Hide all visible dialogs
void hideAll() const;
// Update all visible dialogs.
void updateDialogs();
/** \param name == "bibtex", "citation" etc; an identifier used to

View File

@ -452,8 +452,7 @@ void GuiWorkArea::dispatch(FuncRequest const & cmd0, KeyModifier mod)
// Skip these when selecting
if (cmd.action != LFUN_MOUSE_MOTION) {
completer_->updateVisibility(false, false);
lyx_view_->updateLayoutList();
lyx_view_->updateToolbars();
lyx_view_->updateDialogs();
}
// GUI tweaks except with mouse motion with no button pressed.