Juergen class-change patch

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2779 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2001-09-21 10:41:09 +00:00
parent f05b2c68e5
commit 846ea78a7b
15 changed files with 308 additions and 115 deletions

View File

@ -1,3 +1,8 @@
2001-09-18 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* ui/default.ui: remove layout-save-default from "Layout"
for it's in Layout -> Document now.
2001-09-20 Michael Schmitt <Michael.Schmitt@teststep.org>
* layouts/g-brief-en.layout:

View File

@ -263,8 +263,6 @@ Menuset
Item "Change Environment Depth|v" "depth-increment"
Item "LaTeX Preamble...|L" "layout-preamble"
Item "Start Appendix here|A" "appendix"
Separator
Item "Save Layout as Default|S" "layout-save-default"
End

View File

@ -1,21 +1,25 @@
src/buffer.C
src/bufferlist.C
src/BufferView2.C
src/bufferview_funcs.C
src/BufferView_pimpl.C
src/Chktex.C
src/ColorHandler.C
src/converter.C
src/CutAndPaste.C
src/FontLoader.C
src/LColor.C
src/LaTeX.C
src/LyXAction.C
src/LyXSendto.C
src/LyXView.C
src/MenuBackend.C
src/buffer.C
src/bufferlist.C
src/bufferview_funcs.C
src/converter.C
src/debug.C
src/exporter.C
src/ext_l10n.h
src/figure_form.C
src/figureForm.C
src/FontLoader.C
src/frontends/controllers/biblio.C
src/figure_form.C
src/frontends/controllers/ButtonController.h
src/frontends/controllers/character.C
src/frontends/controllers/ControlAboutlyx.C
src/frontends/controllers/ControlBibtex.C
src/frontends/controllers/ControlCharacter.C
@ -27,6 +31,8 @@ src/frontends/controllers/ControlPrint.C
src/frontends/controllers/ControlSearch.C
src/frontends/controllers/ControlSpellchecker.C
src/frontends/controllers/ControlThesaurus.C
src/frontends/controllers/biblio.C
src/frontends/controllers/character.C
src/frontends/controllers/helper_funcs.C
src/frontends/gnome/FormCitation.C
src/frontends/gnome/FormIndex.C
@ -35,7 +41,6 @@ src/frontends/gnome/FormRef.C
src/frontends/gnome/FormToc.C
src/frontends/gnome/Menubar_pimpl.C
src/frontends/qt2/FileDialog.C
src/frontends/qt2/lengthcombo.C
src/frontends/qt2/QAbout.C
src/frontends/qt2/QBibitem.C
src/frontends/qt2/QBibtex.C
@ -44,8 +49,8 @@ src/frontends/qt2/QCharacter.C
src/frontends/qt2/QCitation.C
src/frontends/qt2/QCitationDialog.C
src/frontends/qt2/QDocument.C
src/frontends/qt2/QError.C
src/frontends/qt2/QERT.C
src/frontends/qt2/QError.C
src/frontends/qt2/QExternal.C
src/frontends/qt2/QExternalDialog.C
src/frontends/qt2/QGraphics.C
@ -67,84 +72,85 @@ src/frontends/qt2/QThesaurus.C
src/frontends/qt2/QToc.C
src/frontends/qt2/QURL.C
src/frontends/qt2/QVCLog.C
src/frontends/xforms/combox.C
src/frontends/qt2/lengthcombo.C
src/frontends/xforms/FileDialog.C
src/frontends/xforms/form_aboutlyx.C
src/frontends/xforms/FormAboutlyx.C
src/frontends/xforms/form_bibitem.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/form_character.C
src/frontends/xforms/FormCharacter.C
src/frontends/xforms/form_citation.C
src/frontends/xforms/FormCitation.C
src/frontends/xforms/form_document.C
src/frontends/xforms/FormDocument.C
src/frontends/xforms/form_error.C
src/frontends/xforms/FormError.C
src/frontends/xforms/form_ert.C
src/frontends/xforms/FormERT.C
src/frontends/xforms/form_external.C
src/frontends/xforms/FormError.C
src/frontends/xforms/FormExternal.C
src/frontends/xforms/form_filedialog.C
src/frontends/xforms/FormFiledialog.C
src/frontends/xforms/form_float.C
src/frontends/xforms/FormFloat.C
src/frontends/xforms/form_graphics.C
src/frontends/xforms/FormGraphics.C
src/frontends/xforms/form_include.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/form_maths_deco.C
src/frontends/xforms/FormMathsDeco.C
src/frontends/xforms/form_maths_delim.C
src/frontends/xforms/FormMathsDelim.C
src/frontends/xforms/form_maths_matrix.C
src/frontends/xforms/FormMathsMatrix.C
src/frontends/xforms/form_maths_panel.C
src/frontends/xforms/FormMathsPanel.C
src/frontends/xforms/form_maths_space.C
src/frontends/xforms/FormMathsSpace.C
src/frontends/xforms/form_minipage.C
src/frontends/xforms/FormMinipage.C
src/frontends/xforms/form_paragraph.C
src/frontends/xforms/FormParagraph.C
src/frontends/xforms/form_preamble.C
src/frontends/xforms/FormPreamble.C
src/frontends/xforms/form_preferences.C
src/frontends/xforms/FormPreferences.C
src/frontends/xforms/form_print.C
src/frontends/xforms/FormPrint.C
src/frontends/xforms/form_ref.C
src/frontends/xforms/FormRef.C
src/frontends/xforms/form_search.C
src/frontends/xforms/FormSearch.C
src/frontends/xforms/form_spellchecker.C
src/frontends/xforms/FormSpellchecker.C
src/frontends/xforms/form_tabular.C
src/frontends/xforms/FormTabular.C
src/frontends/xforms/form_tabular_create.C
src/frontends/xforms/FormTabularCreate.C
src/frontends/xforms/form_thesaurus.C
src/frontends/xforms/FormThesaurus.C
src/frontends/xforms/form_toc.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
src/frontends/xforms/combox.C
src/frontends/xforms/form_aboutlyx.C
src/frontends/xforms/form_bibitem.C
src/frontends/xforms/form_bibtex.C
src/frontends/xforms/form_browser.C
src/frontends/xforms/form_character.C
src/frontends/xforms/form_citation.C
src/frontends/xforms/form_document.C
src/frontends/xforms/form_error.C
src/frontends/xforms/form_ert.C
src/frontends/xforms/form_external.C
src/frontends/xforms/form_filedialog.C
src/frontends/xforms/form_float.C
src/frontends/xforms/form_graphics.C
src/frontends/xforms/form_include.C
src/frontends/xforms/form_index.C
src/frontends/xforms/form_maths_deco.C
src/frontends/xforms/form_maths_delim.C
src/frontends/xforms/form_maths_matrix.C
src/frontends/xforms/form_maths_panel.C
src/frontends/xforms/form_maths_space.C
src/frontends/xforms/form_minipage.C
src/frontends/xforms/form_paragraph.C
src/frontends/xforms/form_preamble.C
src/frontends/xforms/form_preferences.C
src/frontends/xforms/form_print.C
src/frontends/xforms/form_ref.C
src/frontends/xforms/form_search.C
src/frontends/xforms/form_spellchecker.C
src/frontends/xforms/form_tabular.C
src/frontends/xforms/form_tabular_create.C
src/frontends/xforms/form_thesaurus.C
src/frontends/xforms/form_toc.C
src/frontends/xforms/form_url.C
src/frontends/xforms/input_validators.C
src/frontends/xforms/xforms_helpers.C
src/gettext.h
src/importer.C
src/insets/figinset.C
src/insets/insetbib.C
src/insets/inset.C
src/insets/insetbib.C
src/insets/insetcaption.C
src/insets/inseterror.C
src/insets/insetert.C
@ -169,25 +175,19 @@ src/insets/insettoc.C
src/insets/inseturl.C
src/kbsequence.C
src/language.C
src/LaTeX.C
src/layout.C
src/LColor.C
src/LyXAction.C
src/lyx_cb.C
src/lyx_gui_misc.C
src/lyx_main.C
src/lyxfind.C
src/lyxfont.C
src/lyxfunc.C
src/lyx_gui_misc.C
src/lyx_main.C
src/lyxrc.C
src/LyXSendto.C
src/lyxvc.C
src/LyXView.C
src/mathed/formulabase.C
src/mathed/formula.C
src/mathed/formulabase.C
src/mathed/formulamacro.C
src/mathed/math_cursor.C
src/MenuBackend.C
src/minibuffer.C
src/paragraph.C
src/print_form.C
@ -196,6 +196,6 @@ src/support/getUserName.C
src/support/path.C
src/support/path.h
src/tabular.C
src/text2.C
src/text.C
src/text2.C
src/ext_l10n.h

View File

@ -17,6 +17,10 @@
* FontLoader.C (available): Check if font is available without
loading the font.
2001-09-19 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* lyxrc.[Ch]: added auto_reset_options variable and associated code.
2001-09-13 Angus Leeming <a.leeming@ic.ac.uk>
* lyxrc.[Ch]: added display_graphics variable and associated code.

View File

@ -1,3 +1,16 @@
2001-09-19 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* forms/form_document.fd: Added checkbox "auto_reset", button
"reset_defaults" and button "save_defaults".
* Form_Document.[Ch]: Removed AskQuestion when changing class.
Implement the 2 buttons and the checkbox described above.
* forms/form_preferences.fd: Added checkbox "auto_reset" (to
save the default value of that lyxrc)
* FormPreferences.C: Handle that button
2001-09-18 Angus Leeming <a.leeming@ic.ac.uk>
* form_ref.fd: a little tweaking.

View File

@ -34,6 +34,8 @@
#include "support/lstrings.h"
#include "language.h"
#include "LyXView.h"
#include "lyxfunc.h"
#include "lyxrc.h"
#include "BufferView.h"
#include "buffer.h"
#include "Liason.h"
@ -175,6 +177,10 @@ void FormDocument::build()
bc().addReadOnly (class_->choice_doc_skip);
bc().addReadOnly (class_->choice_doc_spacing);
bc().addReadOnly (class_->input_doc_spacing);
bc().addReadOnly (class_->radio_auto_reset);
bc().addReadOnly (class_->button_reset_defaults);
bc().addReadOnly (class_->button_save_defaults);
// the document language form
language_.reset(build_doc_language());
@ -353,6 +359,26 @@ bool FormDocument::input( FL_OBJECT * ob, long data )
fl_get_button(options_->check_use_natbib));
}
if (ob == class_->radio_auto_reset) {
lyxrc.auto_reset_options = fl_get_button(class_->radio_auto_reset);
}
if (ob == class_->button_save_defaults) {
lv_->getLyXFunc()->dispatch(LFUN_LAYOUT_SAVE_DEFAULT);
}
if (ob == class_->button_reset_defaults) {
BufferParams params = lv_->buffer()->params;
params.textclass = combo_doc_class->get() - 1;
params.useClassDefaults();
UpdateLayoutDocument(params);
}
setEnabled(class_->button_reset_defaults,
lv_->buffer()->params.hasClassDefaults());
switch (data) {
case INPUT:
case CHECKCHOICECLASS:
@ -440,7 +466,7 @@ bool FormDocument::class_apply()
case 2:
params.setDefSkip(VSpace(VSpace::MEDSKIP));
break;
case 3:
case 3:
params.setDefSkip(VSpace(VSpace::BIGSKIP));
break;
case 4:
@ -697,6 +723,11 @@ void FormDocument::class_update(BufferParams const & params)
fl_set_input(class_->input_doc_extra, params.options.c_str());
else
fl_set_input(class_->input_doc_extra, "");
fl_set_button(class_->radio_auto_reset, lyxrc.auto_reset_options);
fl_set_object_label(class_->button_reset_defaults, _("Reset"));
setEnabled(class_->button_reset_defaults, !params.hasClassDefaults());
fl_set_object_label(class_->button_save_defaults, _("Save as Defaults"));
}
@ -1054,12 +1085,10 @@ void FormDocument::CheckChoiceClass(FL_OBJECT * ob, long)
unsigned int tc = combo_doc_class->get() - 1;
if (textclasslist.Load(tc)) {
// we use a copy of the bufferparams because we do not
// want to modify them yet.
// want to modify them yet.
BufferParams params = lv_->buffer()->params;
if (params.textclass != tc
&& AskQuestion(_("Should I set some parameters to"),
_("the defaults of this document class?"))) {
if (lyxrc.auto_reset_options) {
params.textclass = tc;
params.useClassDefaults();
UpdateLayoutDocument(params);

View File

@ -1958,6 +1958,7 @@ void FormPreferences::OutputsMisc::apply() const
lyxrc.ascii_roff_command = fl_get_input(dialog_->input_ascii_roff);
lyxrc.chktex_command = fl_get_input(dialog_->input_checktex);
lyxrc.view_dvi_paper_option = fl_get_input(dialog_->input_paperoption);
lyxrc.auto_reset_options = fl_get_button(dialog_->check_autoreset_classopt);
}
@ -1983,6 +1984,7 @@ void FormPreferences::OutputsMisc::build()
setPreHandler(dialog_->input_ascii_roff);
setPreHandler(dialog_->input_checktex);
setPreHandler(dialog_->input_paperoption);
setPreHandler(dialog_->check_autoreset_classopt);
}
@ -2003,6 +2005,8 @@ FormPreferences::OutputsMisc::feedback(FL_OBJECT const * const ob) const
str = lyxrc.getDescription(LyXRC::RC_DEFAULT_PAPERSIZE);
else if (ob == dialog_->input_paperoption)
str = lyxrc.getDescription(LyXRC::RC_VIEWDVI_PAPEROPTION);
else if (ob == dialog_->check_autoreset_classopt)
str = lyxrc.getDescription(LyXRC::RC_AUTORESET_OPTIONS);
return str;
}
@ -2022,6 +2026,9 @@ void FormPreferences::OutputsMisc::update()
lyxrc.chktex_command.c_str());
fl_set_input(dialog_->input_paperoption,
lyxrc.view_dvi_paper_option.c_str());
fl_set_button(dialog_->check_autoreset_classopt,
lyxrc.auto_reset_options);
}

View File

@ -135,7 +135,7 @@ FD_form_doc_paper * FormDocument::build_doc_paper()
{
char const * const dummy = N_("Papersize:|#P");
fdui->choice_papersize2 = obj = fl_add_choice(FL_NORMAL_CHOICE, 70, 15, 160, 30, idex(_(dummy)));
fdui->choice_papersize2 = obj = fl_add_choice(FL_NORMAL_CHOICE, 85, 15, 135, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_boxtype(obj, FL_FRAME_BOX);
@ -253,7 +253,7 @@ FD_form_doc_class * FormDocument::build_doc_class()
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
{
char const * const dummy = N_("Fonts:|#F");
fdui->choice_doc_fonts = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 100, 160, 30, idex(_(dummy)));
fdui->choice_doc_fonts = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 90, 160, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_boxtype(obj, FL_FRAME_BOX);
@ -261,7 +261,7 @@ FD_form_doc_class * FormDocument::build_doc_class()
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT);
{
char const * const dummy = N_("Font Size:|#O");
fdui->choice_doc_fontsize = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 140, 160, 30, idex(_(dummy)));
fdui->choice_doc_fontsize = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 125, 160, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_boxtype(obj, FL_FRAME_BOX);
@ -277,7 +277,7 @@ FD_form_doc_class * FormDocument::build_doc_class()
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, CHECKCHOICECLASS);
{
char const * const dummy = N_("Pagestyle:|#P");
fdui->choice_doc_pagestyle = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 60, 160, 30, idex(_(dummy)));
fdui->choice_doc_pagestyle = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 55, 160, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_boxtype(obj, FL_FRAME_BOX);
@ -285,7 +285,7 @@ FD_form_doc_class * FormDocument::build_doc_class()
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT);
{
char const * const dummy = N_("Spacing|#g");
fdui->choice_doc_spacing = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 290, 160, 30, idex(_(dummy)));
fdui->choice_doc_spacing = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 240, 90, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_boxtype(obj, FL_FRAME_BOX);
@ -293,17 +293,17 @@ FD_form_doc_class * FormDocument::build_doc_class()
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT);
{
char const * const dummy = N_("Extra Options:|#X");
fdui->input_doc_extra = obj = fl_add_input(FL_NORMAL_INPUT, 120, 185, 160, 30, idex(_(dummy)));
fdui->input_doc_extra = obj = fl_add_input(FL_NORMAL_INPUT, 120, 160, 160, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT);
fdui->input_doc_skip = obj = fl_add_input(FL_NORMAL_INPUT, 220, 225, 60, 30, "");
fdui->input_doc_skip = obj = fl_add_input(FL_NORMAL_INPUT, 220, 200, 60, 30, "");
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT);
{
char const * const dummy = N_("Default Skip:|#u");
fdui->choice_doc_skip = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 225, 90, 30, idex(_(dummy)));
fdui->choice_doc_skip = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 200, 90, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_boxtype(obj, FL_FRAME_BOX);
@ -354,6 +354,7 @@ FD_form_doc_class * FormDocument::build_doc_class()
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT);
fl_set_button(obj, 1);
{
char const * const dummy = N_("Skip|#K");
fdui->radio_doc_skip = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 300, 240, 110, 30, idex(_(dummy)));
@ -364,9 +365,24 @@ FD_form_doc_class * FormDocument::build_doc_class()
fl_set_button(obj, 1);
fl_end_group();
fdui->input_doc_spacing = obj = fl_add_input(FL_NORMAL_INPUT, 300, 290, 120, 30, "");
fdui->input_doc_spacing = obj = fl_add_input(FL_NORMAL_INPUT, 220, 240, 60, 30, "");
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT);
{
char const * const dummy = N_("Save as Defaults|#v");
fdui->button_save_defaults = obj = fl_add_button(FL_NORMAL_BUTTON, 305, 295, 105, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT);
{
char const * const dummy = N_("Reset|#R");
fdui->button_reset_defaults = obj = fl_add_button(FL_NORMAL_BUTTON, 160, 295, 100, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT);
fdui->radio_auto_reset = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 20, 295, 30, 30, _("Auto Reset"));
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT);
obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 10, 285, 410, 45, _("Class Defaults"));
fl_end_form();
fdui->form->fdui = fdui;
@ -457,22 +473,22 @@ FD_form_doc_options * FormDocument::build_doc_options()
obj = fl_add_box(FL_FLAT_BOX, 0, 0, 440, 345, "");
{
char const * const dummy = N_("Float Placement:|#L");
fdui->input_float_placement = obj = fl_add_input(FL_NORMAL_INPUT, 220, 45, 120, 30, idex(_(dummy)));
fdui->input_float_placement = obj = fl_add_input(FL_NORMAL_INPUT, 200, 35, 120, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT);
fdui->slider_secnumdepth = obj = fl_add_counter(FL_SIMPLE_COUNTER, 220, 85, 80, 30, _("Section number depth"));
fdui->slider_secnumdepth = obj = fl_add_counter(FL_SIMPLE_COUNTER, 200, 75, 80, 30, _("Section number depth"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT);
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT);
fdui->slider_tocdepth = obj = fl_add_counter(FL_SIMPLE_COUNTER, 220, 125, 80, 30, _("Table of contents depth"));
fdui->slider_tocdepth = obj = fl_add_counter(FL_SIMPLE_COUNTER, 200, 115, 80, 30, _("Table of contents depth"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT);
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT);
{
char const * const dummy = N_("PS Driver|#S");
fdui->choice_postscript_driver = obj = fl_add_choice(FL_NORMAL_CHOICE, 220, 165, 190, 30, idex(_(dummy)));
fdui->choice_postscript_driver = obj = fl_add_choice(FL_NORMAL_CHOICE, 200, 155, 190, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_boxtype(obj, FL_FRAME_BOX);
@ -480,7 +496,7 @@ FD_form_doc_options * FormDocument::build_doc_options()
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT);
{
char const * const dummy = N_("Use AMS Math|#M");
fdui->check_use_amsmath = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 220, 205, 35, 30, idex(_(dummy)));
fdui->check_use_amsmath = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 200, 200, 35, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
@ -488,7 +504,7 @@ FD_form_doc_options * FormDocument::build_doc_options()
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT);
{
char const * const dummy = N_("Use Natbib|#N");
fdui->check_use_natbib = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 220, 245, 35, 30, idex(_(dummy)));
fdui->check_use_natbib = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 200, 245, 35, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
@ -496,7 +512,7 @@ FD_form_doc_options * FormDocument::build_doc_options()
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT);
{
char const * const dummy = N_("Citation style|#C");
fdui->choice_citation_format = obj = fl_add_choice(FL_NORMAL_CHOICE, 220, 285, 190, 30, idex(_(dummy)));
fdui->choice_citation_format = obj = fl_add_choice(FL_NORMAL_CHOICE, 200, 285, 190, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_boxtype(obj, FL_FRAME_BOX);

View File

@ -76,6 +76,9 @@ struct FD_form_doc_class {
FL_OBJECT *radio_doc_indent;
FL_OBJECT *radio_doc_skip;
FL_OBJECT *input_doc_spacing;
FL_OBJECT *button_save_defaults;
FL_OBJECT *button_reset_defaults;
FL_OBJECT *radio_auto_reset;
};
struct FD_form_doc_language {
~FD_form_doc_language();

View File

@ -1098,33 +1098,39 @@ FD_form_outputs_misc * FormPreferences::build_outputs_misc()
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0);
{
char const * const dummy = N_("Default paper size|#p");
fdui->choice_default_papersize = obj = fl_add_choice(FL_NORMAL_CHOICE, 230, 110, 199, 29, idex(_(dummy)));
fdui->choice_default_papersize = obj = fl_add_choice(FL_NORMAL_CHOICE, 230, 105, 199, 29, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_boxtype(obj, FL_FRAME_BOX);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0);
obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 10, 160, 435, 135, _("Outside code interaction"));
obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 10, 190, 435, 135, _("Outside code interaction"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
{
char const * const dummy = N_("ascii roff|#r");
fdui->input_ascii_roff = obj = fl_add_input(FL_NORMAL_INPUT, 145, 175, 285, 30, idex(_(dummy)));
fdui->input_ascii_roff = obj = fl_add_input(FL_NORMAL_INPUT, 145, 205, 285, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0);
{
char const * const dummy = N_("checktex|#c");
fdui->input_checktex = obj = fl_add_input(FL_NORMAL_INPUT, 145, 215, 285, 30, idex(_(dummy)));
fdui->input_checktex = obj = fl_add_input(FL_NORMAL_INPUT, 145, 245, 285, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0);
fdui->input_paperoption = obj = fl_add_input(FL_NORMAL_INPUT, 145, 255, 285, 30, _("DVI paper option"));
fdui->input_paperoption = obj = fl_add_input(FL_NORMAL_INPUT, 145, 285, 285, 30, _("DVI paper option"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0);
obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 10, 435, 140, "");
obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 10, 435, 165, "");
{
char const * const dummy = N_("Autoreset Class Options on change|#u");
fdui->check_autoreset_classopt = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 20, 140, 30, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0);
fl_end_form();
fdui->form->fdui = fdui;

View File

@ -244,6 +244,7 @@ struct FD_form_outputs_misc {
FL_OBJECT *input_ascii_roff;
FL_OBJECT *input_checktex;
FL_OBJECT *input_paperoption;
FL_OBJECT *check_autoreset_classopt;
};
#endif /* FD_form_preferences_h_ */

View File

@ -418,7 +418,7 @@ argument:
--------------------
class: FL_CHOICE
type: NORMAL_CHOICE
box: 70 15 160 30
box: 85 15 135 30
boxtype: FL_FRAME_BOX
colors: FL_COL1 FL_BLACK
alignment: FL_ALIGN_LEFT
@ -653,7 +653,7 @@ argument:
Name: form_doc_class
Width: 440
Height: 345
Number of Objects: 25
Number of Objects: 29
--------------------
class: FL_BOX
@ -730,7 +730,7 @@ argument:
--------------------
class: FL_CHOICE
type: NORMAL_CHOICE
box: 120 100 160 30
box: 120 90 160 30
boxtype: FL_FRAME_BOX
colors: FL_COL1 FL_BLACK
alignment: FL_ALIGN_LEFT
@ -748,7 +748,7 @@ argument: INPUT
--------------------
class: FL_CHOICE
type: NORMAL_CHOICE
box: 120 140 160 30
box: 120 125 160 30
boxtype: FL_FRAME_BOX
colors: FL_COL1 FL_BLACK
alignment: FL_ALIGN_LEFT
@ -784,7 +784,7 @@ argument: CHECKCHOICECLASS
--------------------
class: FL_CHOICE
type: NORMAL_CHOICE
box: 120 60 160 30
box: 120 55 160 30
boxtype: FL_FRAME_BOX
colors: FL_COL1 FL_BLACK
alignment: FL_ALIGN_LEFT
@ -802,7 +802,7 @@ argument: INPUT
--------------------
class: FL_CHOICE
type: NORMAL_CHOICE
box: 120 290 160 30
box: 120 240 90 30
boxtype: FL_FRAME_BOX
colors: FL_COL1 FL_BLACK
alignment: FL_ALIGN_LEFT
@ -820,7 +820,7 @@ argument: INPUT
--------------------
class: FL_INPUT
type: NORMAL_INPUT
box: 120 185 160 30
box: 120 160 160 30
boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_LEFT
@ -838,7 +838,7 @@ argument: INPUT
--------------------
class: FL_INPUT
type: NORMAL_INPUT
box: 220 225 60 30
box: 220 200 60 30
boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_LEFT
@ -856,7 +856,7 @@ argument: INPUT
--------------------
class: FL_CHOICE
type: NORMAL_CHOICE
box: 120 225 90 30
box: 120 200 90 30
boxtype: FL_FRAME_BOX
colors: FL_COL1 FL_BLACK
alignment: FL_ALIGN_LEFT
@ -1091,7 +1091,7 @@ argument:
--------------------
class: FL_INPUT
type: NORMAL_INPUT
box: 300 290 120 30
box: 220 240 60 30
boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_LEFT
@ -1106,6 +1106,78 @@ name: input_doc_spacing
callback: C_FormBaseDeprecatedInputCB
argument: INPUT
--------------------
class: FL_BUTTON
type: NORMAL_BUTTON
box: 305 295 105 30
boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
style: FL_NORMAL_STYLE
size: FL_DEFAULT_SIZE
lcol: FL_BLACK
label: Save as Defaults|#v
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: button_save_defaults
callback: C_FormBaseDeprecatedInputCB
argument: INPUT
--------------------
class: FL_BUTTON
type: NORMAL_BUTTON
box: 160 295 100 30
boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
style: FL_NORMAL_STYLE
size: FL_DEFAULT_SIZE
lcol: FL_BLACK
label: Reset|#R
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: button_reset_defaults
callback: C_FormBaseDeprecatedInputCB
argument: INPUT
--------------------
class: FL_CHECKBUTTON
type: PUSH_BUTTON
box: 20 295 30 30
boxtype: FL_NO_BOX
colors: FL_COL1 FL_YELLOW
alignment: FL_ALIGN_CENTER
style: FL_NORMAL_STYLE
size: FL_DEFAULT_SIZE
lcol: FL_BLACK
label: Auto Reset
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_auto_reset
callback: C_FormBaseDeprecatedInputCB
argument: INPUT
--------------------
class: FL_LABELFRAME
type: ENGRAVED_FRAME
box: 10 285 410 45
boxtype: FL_NO_BOX
colors: FL_BLACK FL_COL1
alignment: FL_ALIGN_TOP_LEFT
style: FL_NORMAL_STYLE
size: FL_DEFAULT_SIZE
lcol: FL_BLACK
label: Class Defaults
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name:
callback:
argument:
=============== FORM ===============
Name: form_doc_language
Width: 440
@ -1301,7 +1373,7 @@ argument:
--------------------
class: FL_INPUT
type: NORMAL_INPUT
box: 220 45 120 30
box: 200 35 120 30
boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_LEFT
@ -1319,7 +1391,7 @@ argument: INPUT
--------------------
class: FL_COUNTER
type: SIMPLE_COUNTER
box: 220 85 80 30
box: 200 75 80 30
boxtype: FL_UP_BOX
colors: FL_COL1 FL_BLUE
alignment: FL_ALIGN_LEFT
@ -1337,7 +1409,7 @@ argument: INPUT
--------------------
class: FL_COUNTER
type: SIMPLE_COUNTER
box: 220 125 80 30
box: 200 115 80 30
boxtype: FL_UP_BOX
colors: FL_COL1 FL_BLUE
alignment: FL_ALIGN_LEFT
@ -1355,7 +1427,7 @@ argument: INPUT
--------------------
class: FL_CHOICE
type: NORMAL_CHOICE
box: 220 165 190 30
box: 200 155 190 30
boxtype: FL_FRAME_BOX
colors: FL_COL1 FL_BLACK
alignment: FL_ALIGN_LEFT
@ -1373,7 +1445,7 @@ argument: INPUT
--------------------
class: FL_CHECKBUTTON
type: PUSH_BUTTON
box: 220 205 35 30
box: 200 200 35 30
boxtype: FL_NO_BOX
colors: FL_COL1 FL_YELLOW
alignment: FL_ALIGN_LEFT
@ -1391,7 +1463,7 @@ argument: INPUT
--------------------
class: FL_CHECKBUTTON
type: PUSH_BUTTON
box: 220 245 35 30
box: 200 245 35 30
boxtype: FL_NO_BOX
colors: FL_COL1 FL_YELLOW
alignment: FL_ALIGN_LEFT
@ -1409,7 +1481,7 @@ argument: INPUT
--------------------
class: FL_CHOICE
type: NORMAL_CHOICE
box: 220 285 190 30
box: 200 285 190 30
boxtype: FL_FRAME_BOX
colors: FL_COL1 FL_BLACK
alignment: FL_ALIGN_LEFT

View File

@ -3097,7 +3097,7 @@ argument:
Name: form_outputs_misc
Width: 455
Height: 375
Number of Objects: 9
Number of Objects: 10
--------------------
class: FL_BOX
@ -3160,7 +3160,7 @@ argument: 0
--------------------
class: FL_CHOICE
type: NORMAL_CHOICE
box: 230 110 199 29
box: 230 105 199 29
boxtype: FL_FRAME_BOX
colors: FL_COL1 FL_BLACK
alignment: FL_ALIGN_LEFT
@ -3178,7 +3178,7 @@ argument: 0
--------------------
class: FL_LABELFRAME
type: ENGRAVED_FRAME
box: 10 160 435 135
box: 10 190 435 135
boxtype: FL_NO_BOX
colors: FL_BLACK FL_COL1
alignment: FL_ALIGN_TOP_LEFT
@ -3196,7 +3196,7 @@ argument:
--------------------
class: FL_INPUT
type: NORMAL_INPUT
box: 145 175 285 30
box: 145 205 285 30
boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_LEFT
@ -3214,7 +3214,7 @@ argument: 0
--------------------
class: FL_INPUT
type: NORMAL_INPUT
box: 145 215 285 30
box: 145 245 285 30
boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_LEFT
@ -3232,7 +3232,7 @@ argument: 0
--------------------
class: FL_INPUT
type: NORMAL_INPUT
box: 145 255 285 30
box: 145 285 285 30
boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_LEFT
@ -3250,7 +3250,7 @@ argument: 0
--------------------
class: FL_FRAME
type: ENGRAVED_FRAME
box: 10 10 435 140
box: 10 10 435 165
boxtype: FL_NO_BOX
colors: FL_BLACK FL_COL1
alignment: FL_ALIGN_CENTER
@ -3265,5 +3265,23 @@ name:
callback:
argument:
--------------------
class: FL_CHECKBUTTON
type: PUSH_BUTTON
box: 20 140 30 30
boxtype: FL_NO_BOX
colors: FL_COL1 FL_YELLOW
alignment: FL_ALIGN_CENTER
style: FL_NORMAL_STYLE
size: FL_DEFAULT_SIZE
lcol: FL_BLACK
label: Autoreset Class Options on change|#u
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: check_autoreset_classopt
callback: C_FormBaseDeprecatedInputCB
argument: 0
==============================
create_the_forms

View File

@ -52,6 +52,7 @@ keyword_item lyxrcTags[] = {
{ "\\ascii_roff_command", LyXRC::RC_ASCIIROFF_COMMAND },
{ "\\auto_number", LyXRC::RC_AUTO_NUMBER },
{ "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
{ "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
{ "\\autosave", LyXRC::RC_AUTOSAVE },
{ "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
{ "\\bind", LyXRC::RC_BIND },
@ -213,6 +214,7 @@ void LyXRC::setDefaults() {
override_x_deadkeys = true;
autosave = 300;
auto_region_delete = true;
auto_reset_options = true;
ascii_linelen = 65;
num_lastfiles = 4;
check_lastfiles = true;
@ -347,16 +349,21 @@ int LyXRC::read(string const & filename)
exit_confirmation = lexrc.getBool();
break;
case RC_AUTORESET_OPTIONS:
if (lexrc.next())
auto_reset_options = lexrc.getBool();
break;
case RC_DISPLAY_GRAPHICS:
if (lexrc.next())
display_graphics = lexrc.getString();
break;
case RC_DISPLAY_SHORTCUTS:
if (lexrc.next())
display_shortcuts = lexrc.getBool();
break;
case RC_KBMAP:
if (lexrc.next())
use_kbmap = lexrc.getBool();
@ -1022,6 +1029,13 @@ void LyXRC::output(ostream & os) const
<< "\\auto_region_delete " << tostr(auto_region_delete)
<< "\n";
}
case RC_AUTORESET_OPTIONS:
if (auto_reset_options != system_lyxrc.auto_reset_options) {
os << "# Set to false to inhibit automatic reset of\n"
<< "# the class options to defaults on class change.\n"
<< "\\auto_reset_options " << tostr(auto_reset_options)
<< "\n";
}
case RC_AUTOSAVE:
if (autosave != system_lyxrc.autosave) {
os << "# The time interval between auto-saves in seconds.\n"
@ -1792,20 +1806,24 @@ string const LyXRC::getDescription(LyXRCTags tag)
case RC_AUTOREGIONDELETE:
str = N_("De-select if you don't want the current selection to be replaced automatically by what you type.");
break;
case RC_AUTORESET_OPTIONS:
str = N_("De-select if you don't want the class options to be reset to defaults after class change.");
break;
case RC_OVERRIDE_X_DEADKEYS:
str = N_("Select if LyX is to take over the handling of the dead keys (a.k.a. accent keys) that may be defined for your keyboard.");
break;
case RC_SERVERPIPE:
str = N_("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
break;
case RC_BINDFILE:
str = N_("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
break;
case RC_UIFILE:
str = N_("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
break;

View File

@ -66,6 +66,7 @@ enum LyXRCTags {
RC_USETEMPDIR,
RC_LASTFILES,
RC_AUTOREGIONDELETE,
RC_AUTORESET_OPTIONS,
RC_BIND,
RC_OVERRIDE_X_DEADKEYS,
RC_SERVERPIPE,
@ -208,6 +209,8 @@ enum LyXRCTags {
///
bool auto_region_delete;
/// flag telling whether lastfiles should be checked for existance
bool auto_reset_options;
///
bool check_lastfiles;
/// filename for lastfiles file
string lastfiles;