diff --git a/src/ChangeLog b/src/ChangeLog index 1b0e105737..f48b589e2f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,7 @@ 2001-09-21 Jean-Marc Lasgouttes + * lyx_cb.C (MenuLayoutSave): change a bit the question + * sp_base.h: include 2001-09-18 Angus Leeming diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 1f76ad154e..ab7b5e90b9 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,7 @@ +2001-09-20 Jürgen Spitzmüller + + * forms/form_document.fd: small tweaks. + 2001-09-19 Jürgen Spitzmüller * forms/form_document.fd: Added checkbox "auto_reset", button diff --git a/src/frontends/xforms/FormDocument.C b/src/frontends/xforms/FormDocument.C index bfe4f041a8..2157638217 100644 --- a/src/frontends/xforms/FormDocument.C +++ b/src/frontends/xforms/FormDocument.C @@ -91,6 +91,7 @@ void FormDocument::build() bc().setApply(dialog_->button_apply); bc().setCancel(dialog_->button_cancel); bc().setRestore(dialog_->button_restore); + bc().addReadOnly (dialog_->button_save_defaults); // the document paper form paper_.reset(build_doc_paper()); @@ -179,7 +180,6 @@ void FormDocument::build() 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 @@ -309,6 +309,9 @@ void FormDocument::update() checkReadOnly(); + fl_set_object_label(dialog_->button_save_defaults, + _("Save as Defaults")); + BufferParams const & params = lv_->buffer()->params; class_update(params); @@ -363,7 +366,7 @@ bool FormDocument::input( FL_OBJECT * ob, long data ) lyxrc.auto_reset_options = fl_get_button(class_->radio_auto_reset); } - if (ob == class_->button_save_defaults) { + if (ob == dialog_->button_save_defaults) { lv_->getLyXFunc()->dispatch(LFUN_LAYOUT_SAVE_DEFAULT); } @@ -726,7 +729,6 @@ void FormDocument::class_update(BufferParams const & params) 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")); } diff --git a/src/frontends/xforms/form_document.C b/src/frontends/xforms/form_document.C index 5f1e7c4d18..afa0c91ae5 100644 --- a/src/frontends/xforms/form_document.C +++ b/src/frontends/xforms/form_document.C @@ -25,37 +25,43 @@ FD_form_tabbed_document * FormDocument::build_tabbed_document() FL_OBJECT *obj; FD_form_tabbed_document *fdui = new FD_form_tabbed_document; - fdui->form = fl_bgn_form(FL_NO_BOX, 465, 450); + fdui->form = fl_bgn_form(FL_NO_BOX, 465, 475); fdui->form->u_vdata = this; - obj = fl_add_box(FL_UP_BOX, 0, 0, 465, 450, ""); + obj = fl_add_box(FL_UP_BOX, 0, 0, 465, 475, ""); fdui->tabbed_folder = obj = fl_add_tabfolder(FL_TOP_TABFOLDER, 20, 15, 435, 365, _("Tabbed folder")); fl_set_object_resize(obj, FL_RESIZE_ALL); { char const * const dummy = N_("Cancel|^["); - fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 355, 410, 100, 30, idex(_(dummy))); + fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 355, 430, 100, 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_FormBaseDeprecatedCancelCB, INPUT); { char const * const dummy = N_("Apply|#A"); - fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 245, 410, 100, 30, idex(_(dummy))); + fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 245, 430, 100, 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_FormBaseDeprecatedApplyCB, INPUT); - fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 135, 410, 100, 30, _("OK")); + fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 135, 430, 100, 30, _("OK")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_callback(obj, C_FormBaseDeprecatedOKCB, INPUT); - fdui->text_warning = obj = fl_add_text(FL_NORMAL_TEXT, 20, 380, 435, 30, ""); + fdui->text_warning = obj = fl_add_text(FL_NORMAL_TEXT, 10, 390, 435, 30, ""); fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE); { char const * const dummy = N_("Restore|#R"); - fdui->button_restore = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 410, 100, 30, idex(_(dummy))); + fdui->button_restore = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 430, 100, 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_FormBaseDeprecatedRestoreCB, INPUT); + { + char const * const dummy = N_("Save as Defaults|#v"); + fdui->button_save_defaults = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 390, 170, 30, idex(_(dummy))); + fl_set_button_shortcut(obj, scex(_(dummy)), 1); + } + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT); fl_end_form(); fdui->form->fdui = fdui; @@ -354,7 +360,6 @@ 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))); @@ -368,21 +373,15 @@ FD_form_doc_class * FormDocument::build_doc_class() 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))); + fdui->button_reset_defaults = obj = fl_add_button(FL_NORMAL_BUTTON, 190, 300, 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")); + fdui->radio_auto_reset = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 25, 300, 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")); + obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 15, 290, 285, 45, _("Class Defaults")); fl_end_form(); fdui->form->fdui = fdui; diff --git a/src/frontends/xforms/form_document.h b/src/frontends/xforms/form_document.h index 8a6da0c025..55b45ad673 100644 --- a/src/frontends/xforms/form_document.h +++ b/src/frontends/xforms/form_document.h @@ -9,6 +9,7 @@ extern "C" void C_FormBaseDeprecatedCancelCB(FL_OBJECT *, long); extern "C" void C_FormBaseDeprecatedApplyCB(FL_OBJECT *, long); extern "C" void C_FormBaseDeprecatedOKCB(FL_OBJECT *, long); extern "C" void C_FormBaseDeprecatedRestoreCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long); extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long); @@ -32,6 +33,7 @@ struct FD_form_tabbed_document { FL_OBJECT *button_ok; FL_OBJECT *text_warning; FL_OBJECT *button_restore; + FL_OBJECT *button_save_defaults; }; struct FD_form_doc_paper { ~FD_form_doc_paper(); @@ -76,7 +78,6 @@ 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; }; diff --git a/src/frontends/xforms/forms/form_document.fd b/src/frontends/xforms/forms/form_document.fd index cbc88b64d7..49feaf6fa3 100644 --- a/src/frontends/xforms/forms/form_document.fd +++ b/src/frontends/xforms/forms/form_document.fd @@ -10,13 +10,13 @@ SnapGrid: 5 =============== FORM =============== Name: form_tabbed_document Width: 465 -Height: 450 -Number of Objects: 7 +Height: 475 +Number of Objects: 8 -------------------- class: FL_BOX type: UP_BOX -box: 0 0 465 450 +box: 0 0 465 475 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER @@ -52,7 +52,7 @@ argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON -box: 355 410 100 30 +box: 355 430 100 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER @@ -70,7 +70,7 @@ argument: INPUT -------------------- class: FL_BUTTON type: NORMAL_BUTTON -box: 245 410 100 30 +box: 245 430 100 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER @@ -88,7 +88,7 @@ argument: INPUT -------------------- class: FL_BUTTON type: RETURN_BUTTON -box: 135 410 100 30 +box: 135 430 100 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER @@ -106,7 +106,7 @@ argument: INPUT -------------------- class: FL_TEXT type: NORMAL_TEXT -box: 20 380 435 30 +box: 10 390 435 30 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE @@ -124,7 +124,7 @@ argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON -box: 10 410 100 30 +box: 10 430 100 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER @@ -139,6 +139,24 @@ name: button_restore callback: C_FormBaseDeprecatedRestoreCB argument: INPUT +-------------------- +class: FL_BUTTON +type: NORMAL_BUTTON +box: 10 390 170 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 + =============== FORM =============== Name: form_doc_paper Width: 440 @@ -653,7 +671,7 @@ argument: Name: form_doc_class Width: 440 Height: 345 -Number of Objects: 29 +Number of Objects: 28 -------------------- class: FL_BOX @@ -1109,25 +1127,7 @@ 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 +box: 190 300 100 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER @@ -1145,7 +1145,7 @@ argument: INPUT -------------------- class: FL_CHECKBUTTON type: PUSH_BUTTON -box: 20 295 30 30 +box: 25 300 30 30 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_CENTER @@ -1163,7 +1163,7 @@ argument: INPUT -------------------- class: FL_LABELFRAME type: ENGRAVED_FRAME -box: 10 285 410 45 +box: 15 290 285 45 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_TOP_LEFT diff --git a/src/lyx_cb.C b/src/lyx_cb.C index a49b202dc8..75da0511a5 100644 --- a/src/lyx_cb.C +++ b/src/lyx_cb.C @@ -532,7 +532,7 @@ void MenuLayoutSave(BufferView * bv) return; if (AskQuestion(_("Do you want to save the current settings"), - _("for Character, Document, Paper and Quotes"), + _("for document layout"), _("as default for new documents?"))) bv->buffer()->saveParamsAsDefaults(); } diff --git a/src/lyxrc.C b/src/lyxrc.C index 035dadf6a3..e64d1caca3 100644 --- a/src/lyxrc.C +++ b/src/lyxrc.C @@ -214,7 +214,7 @@ void LyXRC::setDefaults() { override_x_deadkeys = true; autosave = 300; auto_region_delete = true; - auto_reset_options = true; + auto_reset_options = false; ascii_linelen = 65; num_lastfiles = 4; check_lastfiles = true;