Added lyxrc-flag to be able to select if I want use pspell or ispell if

pspell support is compiled in. Set shortcut of About-Dialog to ESC-key.
Small fix in InsetText.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2244 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Vigna 2001-07-16 10:03:38 +00:00
parent 85570cb7d6
commit c4f841c1b2
11 changed files with 126 additions and 114 deletions

View File

@ -10,14 +10,13 @@ src/CutAndPaste.C
src/debug.C
src/exporter.C
src/ext_l10n.h
src/figureForm.C
src/figure_form.C
src/figureForm.C
src/FontLoader.C
src/frontends/controllers/ButtonController.h
src/frontends/controllers/character.C
src/frontends/controllers/ControlAboutlyx.C
src/frontends/controllers/ControlCharacter.C
src/frontends/controllers/ControlCopyright.C
src/frontends/controllers/ControlCredits.C
src/frontends/controllers/ControlExternal.C
src/frontends/controllers/ControlGraphics.C
src/frontends/controllers/ControlInclude.C
@ -90,69 +89,67 @@ src/frontends/qt2/paragraphdlgimpl.C
src/frontends/qt2/tabularcreatedlgimpl.C
src/frontends/xforms/combox.C
src/frontends/xforms/FileDialog.C
src/frontends/xforms/FormBibitem.C
src/frontends/xforms/form_aboutlyx.C
src/frontends/xforms/FormAboutlyx.C
src/frontends/xforms/form_bibitem.C
src/frontends/xforms/FormBibtex.C
src/frontends/xforms/FormBibitem.C
src/frontends/xforms/form_bibtex.C
src/frontends/xforms/FormBibtex.C
src/frontends/xforms/form_browser.C
src/frontends/xforms/FormCharacter.C
src/frontends/xforms/form_character.C
src/frontends/xforms/FormCitation.C
src/frontends/xforms/FormCharacter.C
src/frontends/xforms/form_citation.C
src/frontends/xforms/FormCopyright.C
src/frontends/xforms/form_copyright.C
src/frontends/xforms/FormCredits.C
src/frontends/xforms/form_credits.C
src/frontends/xforms/FormDocument.C
src/frontends/xforms/FormCitation.C
src/frontends/xforms/form_document.C
src/frontends/xforms/FormError.C
src/frontends/xforms/FormDocument.C
src/frontends/xforms/form_error.C
src/frontends/xforms/FormExternal.C
src/frontends/xforms/FormError.C
src/frontends/xforms/form_external.C
src/frontends/xforms/FormFiledialog.C
src/frontends/xforms/FormExternal.C
src/frontends/xforms/form_filedialog.C
src/frontends/xforms/FormGraphics.C
src/frontends/xforms/FormFiledialog.C
src/frontends/xforms/form_graphics.C
src/frontends/xforms/FormInclude.C
src/frontends/xforms/FormGraphics.C
src/frontends/xforms/form_include.C
src/frontends/xforms/FormIndex.C
src/frontends/xforms/FormInclude.C
src/frontends/xforms/form_index.C
src/frontends/xforms/FormIndex.C
src/frontends/xforms/FormLog.C
src/frontends/xforms/FormMathsBitmap.C
src/frontends/xforms/FormMathsDeco.C
src/frontends/xforms/form_maths_deco.C
src/frontends/xforms/FormMathsDelim.C
src/frontends/xforms/FormMathsDeco.C
src/frontends/xforms/form_maths_delim.C
src/frontends/xforms/FormMathsMatrix.C
src/frontends/xforms/FormMathsDelim.C
src/frontends/xforms/form_maths_matrix.C
src/frontends/xforms/FormMathsPanel.C
src/frontends/xforms/FormMathsMatrix.C
src/frontends/xforms/form_maths_panel.C
src/frontends/xforms/FormMathsSpace.C
src/frontends/xforms/FormMathsPanel.C
src/frontends/xforms/form_maths_space.C
src/frontends/xforms/FormMinipage.C
src/frontends/xforms/FormMathsSpace.C
src/frontends/xforms/form_minipage.C
src/frontends/xforms/FormParagraph.C
src/frontends/xforms/FormMinipage.C
src/frontends/xforms/form_paragraph.C
src/frontends/xforms/FormPreamble.C
src/frontends/xforms/FormParagraph.C
src/frontends/xforms/form_preamble.C
src/frontends/xforms/FormPreferences.C
src/frontends/xforms/FormPreamble.C
src/frontends/xforms/form_preferences.C
src/frontends/xforms/FormPrint.C
src/frontends/xforms/FormPreferences.C
src/frontends/xforms/form_print.C
src/frontends/xforms/FormRef.C
src/frontends/xforms/FormPrint.C
src/frontends/xforms/form_ref.C
src/frontends/xforms/FormSearch.C
src/frontends/xforms/FormRef.C
src/frontends/xforms/form_search.C
src/frontends/xforms/FormSpellchecker.C
src/frontends/xforms/FormSearch.C
src/frontends/xforms/form_spellchecker.C
src/frontends/xforms/FormTabular.C
src/frontends/xforms/FormSpellchecker.C
src/frontends/xforms/form_tabular.C
src/frontends/xforms/FormTabularCreate.C
src/frontends/xforms/FormTabular.C
src/frontends/xforms/form_tabular_create.C
src/frontends/xforms/FormToc.C
src/frontends/xforms/FormTabularCreate.C
src/frontends/xforms/form_toc.C
src/frontends/xforms/FormUrl.C
src/frontends/xforms/FormToc.C
src/frontends/xforms/form_url.C
src/frontends/xforms/FormUrl.C
src/frontends/xforms/FormVCLog.C
src/frontends/xforms/input_validators.C
src/frontends/xforms/Menubar_pimpl.C

View File

@ -1,3 +1,11 @@
2001-07-16 Juergen Vigna <jug@sad.it>
* lyxrc.C: added use_pspell entry and it's handling.
2001-07-13 Juergen Vigna <jug@sad.it>
* sp_spell.C: removed double includes.
2001-07-13 Angus Leeming <a.leeming@ic.ac.uk>
Consistent use of Lsstream.h:

View File

@ -44,10 +44,9 @@
#include "Dialogs.h"
#include "Liason.h"
# include "sp_ispell.h"
#ifdef USE_PSPELL
# include "sp_pspell.h"
#else
# include "sp_ispell.h"
#endif
#include "debug.h"
@ -85,16 +84,21 @@ void ControlSpellchecker::show()
if (!speller_) {
// create spell object
string tmp;
#ifdef USE_PSPELL
string tmp = (lyxrc.isp_use_alt_lang) ?
if (lyxrc.use_pspell) {
tmp = (lyxrc.isp_use_alt_lang) ?
lyxrc.isp_alt_lang : lv_.buffer()->params.language->code();
speller_ = new PSpell(lv_.view()->buffer()->params, tmp);
#else
string tmp = (lyxrc.isp_use_alt_lang) ?
} else {
#endif
tmp = (lyxrc.isp_use_alt_lang) ?
lyxrc.isp_alt_lang : lv_.buffer()->params.language->lang();
speller_ = new ISpell(lv_.view()->buffer()->params, tmp);
#ifdef USE_PSPELL
}
#endif
if (lyxrc.isp_use_alt_lang) {

View File

@ -1,3 +1,7 @@
2001-07-16 Juergen Vigna <jug@sad.it>
* form_aboutlyx.C: set default for "Close" button to "ESC"-key.
2001-07-13 Angus Leeming <a.leeming@ic.ac.uk>
Consistent use of Lsstream.h:

View File

@ -26,7 +26,7 @@ FD_form_aboutlyx * FormAboutlyx::build_aboutlyx()
fdui->form->u_vdata = this;
obj = fl_add_box(FL_UP_BOX, 0, 0, 450, 370, "");
{
char const * const dummy = N_("Close|#C");
char const * const dummy = N_("Close|^[");
fdui->close = obj = fl_add_button(FL_NORMAL_BUTTON, 320, 330, 120, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}

View File

@ -40,7 +40,7 @@ alignment: FL_ALIGN_CENTER
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
label: Close|#C
label: Close|^[
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity

View File

@ -1,3 +1,7 @@
2001-07-16 Juergen Vigna <jug@sad.it>
* insettext.C (update): fixed small oversight (reset lt to 0).
2001-07-14 Baruch Even <baruch@lyx.org>
* insetgraphics.h:

View File

@ -503,6 +503,8 @@ void InsetText::update(BufferView * bv, LyXFont const & font, bool reinit)
if (oldw != insetWidth) {
resizeLyXText(bv);
need_update |= FULL;
if (clear)
lt = 0;
return;
}
if ((need_update & CURSOR_PAR) && (lt->status() == LyXText::UNCHANGED) &&

View File

@ -133,6 +133,9 @@ keyword_item lyxrcTags[] = {
{ "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
{ "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
{ "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
#ifdef USE_PSPELL
{ "\\use_pspell", LyXRC::RC_USE_PSPELL },
#endif
{ "\\use_tempdir", LyXRC::RC_USETEMPDIR },
{ "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
{ "\\viewer" ,LyXRC::RC_VIEWER},
@ -216,6 +219,9 @@ void LyXRC::setDefaults() {
exit_confirmation = true;
display_shortcuts = true;
// Spellchecker settings:
#ifdef USE_PSPELL
use_pspell = true;
#endif
isp_command = "ispell";
isp_accept_compound = false;
isp_use_input_encoding = false;
@ -751,6 +757,12 @@ int LyXRC::read(string const & filename)
ascii_linelen = lexrc.GetInteger();
break;
// Spellchecker settings:
#ifdef USE_PSPELL
case RC_USE_PSPELL:
if (lexrc.next())
use_pspell = lexrc.GetBool();
break;
#endif
case RC_SPELL_COMMAND:
if (lexrc.next())
isp_command = lexrc.GetString();
@ -1375,7 +1387,12 @@ void LyXRC::output(ostream & os) const
os << "\n#\n"
<< "# SPELLCHECKER SECTION ##############################\n"
<< "#\n\n";
#ifdef USE_PSPELL
case RC_USE_PSPELL:
if (use_pspell != system_lyxrc.use_pspell) {
os << "\\use_pspell \"" << use_pspell << "\"\n";
}
#endif
case RC_SPELL_COMMAND:
if (isp_command != system_lyxrc.isp_command) {
os << "\\spell_command \"" << isp_command << "\"\n";

View File

@ -117,6 +117,9 @@ enum LyXRCTags {
RC_NEW_ASK_FILENAME,
RC_DEFAULT_LANGUAGE,
RC_LABEL_INIT_LENGTH,
#ifdef USE_PSPELL
RC_USE_PSPELL,
#endif
RC_LAST
};
@ -263,6 +266,9 @@ enum LyXRCTags {
///
unsigned int ascii_linelen;
/// Ispell command
#ifdef USE_PSPELL
bool use_pspell;
#endif
string isp_command;
/// Accept compound words in spellchecker?
bool isp_accept_compound;

View File

@ -17,12 +17,21 @@
#pragma implementation
#endif
#ifdef USE_PSPELL
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <ctime>
#else
# if HAVE_SYS_TIME_H
# include <sys/time.h>
# else
# include <ctime>
# endif
#endif
#ifdef HAVE_SYS_SELECT_H
# ifdef HAVE_STRINGS_H
// <strings.h> is needed at least on AIX because FD_ZERO uses bzero().
@ -36,6 +45,26 @@
#include "LString.h"
#include "support/lstrings.h"
#include "lyxrc.h"
#include "debug.h"
#include "encoding.h"
#include "sp_ispell.h"
using std::endl;
namespace {
/// pid for the `ispell' process.
pid_t isp_pid = -1;
}
/// can be found in src/insets/figinset.C
extern void sigchldchecker(pid_t pid, int * status);
///
// ------------------- start special pspell code/class --------------------
///
#ifdef USE_PSPELL
#include "support/LAssert.h"
#define USE_ORIGINAL_MANAGER_FUNCS 1
@ -43,8 +72,6 @@
#include "sp_pspell.h"
extern void sigchldchecker(pid_t pid, int *status);
PSpell::PSpell()
{
@ -154,6 +181,7 @@ char const * PSpell::nextMiss()
{
if (els)
return pspell_string_emulation_next(els);
return "";
}
char const * PSpell::error()
@ -166,65 +194,11 @@ void PSpell::sigchldhandler(pid_t pid, int * status)
sigchldchecker(pid, status);
}
#else
/*
*This file is part of
* ======================================================
*
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
* Copyright 1995-1998 The LyX Team
*
* ======================================================
*/
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <ctime>
#else
# if HAVE_SYS_TIME_H
# include <sys/time.h>
# else
# include <ctime>
# endif
#endif
#ifdef HAVE_SYS_SELECT_H
# ifdef HAVE_STRINGS_H
// <strings.h> is needed at least on AIX because FD_ZERO uses bzero().
// BUT we cannot include both string.h and strings.h on Irix 6.5 :(
# ifdef _AIX
# include <strings.h>
# endif
# endif
#include <sys/select.h>
#endif
#include "LString.h"
#include "support/lstrings.h"
#include "lyxrc.h"
#include "debug.h"
#include "encoding.h"
#include "sp_ispell.h"
using std::endl;
/// can be found in src/insets/figinset.C
extern void sigchldchecker(pid_t pid, int * status);
namespace {
/// pid for the `ispell' process.
pid_t isp_pid = -1;
}
///
// ------------------- start special ispell code/class --------------------
///
ISpell::ISpell()
{
@ -574,7 +548,3 @@ char const * ISpell::error()
{
return error_;
}
#endif