mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 21:21:32 +00:00
* Define a new member variable to ControlButtons, emergency_exit_
* Use it to exit gracefully if the speller cannot be launched when spellchecking. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2801 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
558ce4437f
commit
55a2ce9c09
@ -1,3 +1,14 @@
|
||||
2001-09-25 Angus Leeming <a.leeming@ic.ac.uk>
|
||||
|
||||
* ControlButtons.h: add variable emergency_exit_. If set to true, the
|
||||
view will be shut down.
|
||||
|
||||
* ControlDialogs.h:
|
||||
* ControlInset.h: act on emergency_exit_.
|
||||
|
||||
* ControlSpellchecker.C (clearParams): set emergency_exit_ if the
|
||||
speller fails to launch.
|
||||
|
||||
2001-09-24 Angus Leeming <a.leeming@ic.ac.uk>
|
||||
|
||||
* ControlRef.C (getBufferList): use MakeDisplayPath on the list.
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "lyxrc.h"
|
||||
|
||||
ControlButtons::ControlButtons()
|
||||
: is_closing_(false)
|
||||
: emergency_exit_(false), is_closing_(false)
|
||||
{}
|
||||
|
||||
|
||||
|
@ -82,6 +82,10 @@ protected:
|
||||
of the View. */
|
||||
virtual ViewBase & view() = 0;
|
||||
|
||||
/** This flag can be set by one of the miriad the controller methods
|
||||
to ensure that the dialog is shut down. */
|
||||
bool emergency_exit_;
|
||||
|
||||
private:
|
||||
///
|
||||
bool is_closing_;
|
||||
|
@ -70,6 +70,10 @@ void ControlDialog<Base>::show()
|
||||
connect();
|
||||
|
||||
setParams();
|
||||
if (emergency_exit_) {
|
||||
hide();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!dialog_built_) {
|
||||
view().build();
|
||||
@ -87,6 +91,10 @@ void ControlDialog<Base>::update()
|
||||
return;
|
||||
|
||||
setParams();
|
||||
if (emergency_exit_) {
|
||||
hide();
|
||||
return;
|
||||
}
|
||||
|
||||
bc().readOnly(isReadonly());
|
||||
view().update();
|
||||
@ -95,6 +103,7 @@ void ControlDialog<Base>::update()
|
||||
template <class Base>
|
||||
void ControlDialog<Base>::hide()
|
||||
{
|
||||
emergency_exit_ = false;
|
||||
clearParams();
|
||||
|
||||
disconnect();
|
||||
|
@ -143,6 +143,10 @@ void ControlInset<Inset, Params>::show(Params const & params)
|
||||
params_ = new Params(params);
|
||||
|
||||
setDaughterParams();
|
||||
if (emergency_exit_) {
|
||||
hide();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!dialog_built_) {
|
||||
view().build();
|
||||
@ -157,6 +161,7 @@ void ControlInset<Inset, Params>::show(Params const & params)
|
||||
template <class Inset, class Params>
|
||||
void ControlInset<Inset, Params>::hide()
|
||||
{
|
||||
emergency_exit_ = false;
|
||||
if (params_) {
|
||||
delete params_;
|
||||
params_ = 0;
|
||||
@ -181,6 +186,11 @@ void ControlInset<Inset, Params>::update()
|
||||
else
|
||||
params_ = new Params();
|
||||
|
||||
if (emergency_exit_) {
|
||||
hide();
|
||||
return;
|
||||
}
|
||||
|
||||
bc().readOnly(isReadonly());
|
||||
view().update();
|
||||
}
|
||||
|
@ -239,6 +239,9 @@ void ControlSpellchecker::clearParams()
|
||||
stop_ = false;
|
||||
result_ = SpellBase::ISP_UNKNOWN;
|
||||
speller_ = 0;
|
||||
|
||||
// make sure that the dialog is not launched
|
||||
emergency_exit_ = true;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user