The dialog changes for the xforms frontend. I also have the Qt versions, but I'm not posting those yet.
Index: src/frontends/xforms/Dialogs.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/Dialogs.C,v retrieving revision 1.83 diff -u -r1.83 Dialogs.C --- src/frontends/xforms/Dialogs.C 1 Dec 2002 22:59:19 -0000 1.83 +++ src/frontends/xforms/Dialogs.C 7 Feb 2003 11:32:12 -0000 @@ -48,6 +48,7 @@ : aboutlyx(lv, d), bibitem(lv, d), bibtex(lv, d), + changes(lv, d), character(lv, d), citation(lv, d), document(lv, d), Index: src/frontends/xforms/Dialogs2.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/Dialogs2.C,v retrieving revision 1.11 diff -u -r1.11 Dialogs2.C --- src/frontends/xforms/Dialogs2.C 31 Jan 2003 13:50:21 -0000 1.11 +++ src/frontends/xforms/Dialogs2.C 7 Feb 2003 11:32:12 -0000 @@ -37,6 +37,12 @@ } +void Dialogs::showMergeChanges() +{ + pimpl_->changes.controller().show(); +} + + void Dialogs::showCharacter() { pimpl_->character.controller().show(); Index: src/frontends/xforms/Dialogs_impl.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/Dialogs_impl.h,v retrieving revision 1.13 diff -u -r1.13 Dialogs_impl.h --- src/frontends/xforms/Dialogs_impl.h 1 Dec 2002 22:59:19 -0000 1.13 +++ src/frontends/xforms/Dialogs_impl.h 7 Feb 2003 11:32:12 -0000 @@ -37,6 +37,10 @@ #include "FormBrowser.h" #include "forms/form_browser.h" +#include "ControlChanges.h" +#include "FormChanges.h" +#include "forms/form_changes.h" + #include "ControlCharacter.h" #include "FormCharacter.h" #include "forms/form_character.h" @@ -170,6 +174,9 @@ typedef GUI<ControlBibtex, FormBibtex, NoRepeatedApplyReadOnlyPolicy, xformsBC> BibtexDialog; +typedef GUI<ControlChanges, FormChanges, NoRepeatedApplyReadOnlyPolicy, xformsBC> +ChangesDialog; + typedef GUI<ControlCharacter, FormCharacter, OkApplyCancelReadOnlyPolicy, xformsBC> CharacterDialog; @@ -270,8 +277,9 @@ AboutlyxDialog aboutlyx; BibitemDialog bibitem; - BibtexDialog bibtex; - CharacterDialog character; + BibtexDialog bibtex; + ChangesDialog changes; + CharacterDialog character; CitationDialog citation; DocumentDialog document; ErrorDialog error; Index: src/frontends/xforms/FormChanges.C =================================================================== RCS file: src/frontends/xforms/FormChanges.C diff -N src/frontends/xforms/FormChanges.C --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/frontends/xforms/FormChanges.C 7 Feb 2003 11:32:12 -0000 @@ -0,0 +1,81 @@ +/** + * \file FormChanges.C + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. + * + * \author John Levon + * + * Full author contact details are available in file CREDITS + */ + +#include <config.h> + +#ifdef __GNUG__ +#pragma implementation +#endif + +#include "xformsBC.h" +#include "ControlChanges.h" +#include "FormChanges.h" +#include "forms/form_changes.h" + +#include FORMS_H_LOCATION + +typedef FormCB<ControlChanges, FormDB<FD_changes> > base_class; + +FormChanges::FormChanges() + : base_class(_("LyX: Merge changes")) +{} + + +void FormChanges::build() +{ + dialog_.reset(build_changes(this)); + + bc().setCancel(dialog_->button_close); + bc().addReadOnly(dialog_->button_accept); + bc().addReadOnly(dialog_->button_reject); +} + + +void FormChanges::update() +{ + fl_set_object_label(dialog_->author, ""); + fl_set_object_label(dialog_->date, ""); + // FIXME: enable/disable accept/reject +} + + +ButtonPolicy::SMInput FormChanges::input(FL_OBJECT * obj, long) +{ + if (obj == dialog_->button_accept) { + controller().accept(); + return ButtonPolicy::SMI_VALID; + } + + if (obj == dialog_->button_reject) { + controller().reject(); + return ButtonPolicy::SMI_VALID; + } + + if (obj != dialog_->button_next) + return ButtonPolicy::SMI_VALID; + + controller().find(); + + string author(controller().getChangeAuthor()); + string date(controller().getChangeDate()); + if (!date.empty()) { + date = _("Changed at : ") + date; + } + if (!author.empty()) { + author = _("Change made by : ") + author; + } + fl_set_object_label(dialog_->author, author.c_str()); + fl_set_object_label(dialog_->date, date.c_str()); + + // Yes, this is needed. + fl_redraw_form(form()); + + return ButtonPolicy::SMI_VALID; +} Index: src/frontends/xforms/FormChanges.h =================================================================== RCS file: src/frontends/xforms/FormChanges.h diff -N src/frontends/xforms/FormChanges.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/frontends/xforms/FormChanges.h 7 Feb 2003 11:32:12 -0000 @@ -0,0 +1,43 @@ +// -*- C++ -*- +/** + * \file FormChanges.h + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. + * + * \author John Levon + * + * Full author contact details are available in file CREDITS + */ + +#ifndef FORMCHANGES_H +#define FORMCHANGES_H + +#ifdef __GNUG__ +#pragma interface +#endif + +#include "FormBase.h" + +class ControlChanges; +struct FD_changes; + +/** + * This class provides an XForms implementation of the Merge Changes Dialog. + */ +class FormChanges : public FormCB<ControlChanges, FormDB<FD_changes> > { +public: + FormChanges(); + +private: + /// not needed. + virtual void apply() {} + /// Build the dialog + virtual void build(); + /// update the dialog + virtual void update(); + + /// Filter the inputs + virtual ButtonPolicy::SMInput input(FL_OBJECT *, long); +}; + +#endif // FORMCHANGES_H Index: src/frontends/xforms/FormPreferences.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormPreferences.C,v retrieving revision 1.147 diff -u -r1.147 FormPreferences.C --- src/frontends/xforms/FormPreferences.C 14 Jan 2003 21:51:34 -0000 1.147 +++ src/frontends/xforms/FormPreferences.C 7 Feb 2003 11:32:16 -0000 @@ -36,6 +36,7 @@ #include "LColor.h" #include "Lsstream.h" #include "funcrequest.h" +#include "author.h" #include "support/lyxfunctional.h" #include "support/lyxmanip.h" @@ -97,8 +98,9 @@ : base_class(_("Preferences"), false), colors_(*this), converters_(*this), inputs_misc_(*this), formats_(*this), interface_(*this), language_(*this), - lnf_misc_(*this), outputs_misc_(*this), paths_(*this), - printer_(*this), screen_fonts_(*this), spelloptions_(*this) + lnf_misc_(*this), identity_(*this), outputs_misc_(*this), + paths_(*this), printer_(*this), screen_fonts_(*this), + spelloptions_(*this) { } @@ -175,6 +177,7 @@ interface_.build(); language_.build(); lnf_misc_.build(); + identity_.build(); outputs_misc_.build(); paths_.build(); printer_.build(); @@ -212,6 +215,9 @@ fl_addto_tabfolder(look_n_feel_tab_->tabfolder_inner, _("Misc"), lnf_misc_.dialog()->form); + fl_addto_tabfolder(look_n_feel_tab_->tabfolder_inner, + _("Identity"), + identity_.dialog()->form); // then build converters fl_addto_tabfolder(converters_tab_->tabfolder_inner, @@ -277,6 +283,7 @@ interface_.apply(rc); language_.apply(rc); lnf_misc_.apply(rc); + identity_.apply(rc); outputs_misc_.apply(rc); paths_.apply(rc); printer_.apply(rc); @@ -371,6 +378,7 @@ interface_.update(rc); language_.update(rc); lnf_misc_.update(rc); + identity_.update(rc); outputs_misc_.update(rc); paths_.update(rc); printer_.update(rc); @@ -1421,6 +1429,40 @@ fl_unfreeze_form(dialog_->form); return false; +} + + +FormPreferences::Identity::Identity(FormPreferences & p) + : parent_(p) +{} + + +FD_preferences_identity const * FormPreferences::Identity::dialog() +{ + return dialog_.get(); +} + + +void FormPreferences::Identity::apply(LyXRC & rc) const +{ + rc.user_name = fl_get_input(dialog_->input_user_name); + rc.user_email = fl_get_input(dialog_->input_user_email); + authorlist.record(0, Author(rc.user_name, rc.user_email)); +} + + +void FormPreferences::Identity::build() +{ + dialog_.reset(build_preferences_identity(&parent_)); + fl_set_input_return(dialog_->input_user_name, FL_RETURN_CHANGED); + fl_set_input_return(dialog_->input_user_email, FL_RETURN_CHANGED); +} + + +void FormPreferences::Identity::update(LyXRC const & rc) +{ + fl_set_input(dialog_->input_user_name, rc.user_name.c_str()); + fl_set_input(dialog_->input_user_email, rc.user_email.c_str()); } Index: src/frontends/xforms/FormPreferences.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormPreferences.h,v retrieving revision 1.65 diff -u -r1.65 FormPreferences.h --- src/frontends/xforms/FormPreferences.h 1 Dec 2002 22:59:21 -0000 1.65 +++ src/frontends/xforms/FormPreferences.h 7 Feb 2003 11:32:17 -0000 @@ -41,6 +41,7 @@ struct FD_preferences_interface; struct FD_preferences_language; struct FD_preferences_lnf_misc; +struct FD_preferences_identity; struct FD_preferences_inner_tab; struct FD_preferences_outputs_misc; struct FD_preferences_paths; @@ -336,6 +337,29 @@ /// friend class LnFmisc; + class Identity { + public: + /// + Identity(FormPreferences & p); + /// + FD_preferences_identity const * dialog(); + /// + void apply(LyXRC & rc) const; + /// + void build(); + /// + string const feedback(FL_OBJECT const * const) const; + /// + void update(LyXRC const & rc); + + private: + /// + FormPreferences & parent_; + /// + boost::scoped_ptr<FD_preferences_identity> dialog_; + }; + friend class Identity; + /// class OutputsMisc { public: @@ -484,6 +508,8 @@ Language language_; /// LnFmisc lnf_misc_; + /// + Identity identity_; /// OutputsMisc outputs_misc_; /// Index: src/frontends/xforms/Makefile.am =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/Makefile.am,v retrieving revision 1.89 diff -u -r1.89 Makefile.am --- src/frontends/xforms/Makefile.am 16 Dec 2002 11:38:20 -0000 1.89 +++ src/frontends/xforms/Makefile.am 7 Feb 2003 11:32:17 -0000 @@ -66,6 +66,8 @@ FormBibtex.h \ FormBrowser.C \ FormBrowser.h \ + FormChanges.C \ + FormChanges.h \ FormCharacter.C \ FormCharacter.h \ FormCitation.C \ Index: src/frontends/xforms/forms/Makefile.am =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/forms/Makefile.am,v retrieving revision 1.14 diff -u -r1.14 Makefile.am --- src/frontends/xforms/forms/Makefile.am 12 Jan 2003 22:20:22 -0000 1.14 +++ src/frontends/xforms/forms/Makefile.am 7 Feb 2003 11:32:17 -0000 @@ -11,6 +11,7 @@ form_bibitem.fd \ form_bibtex.fd \ form_browser.fd \ + form_changes.fd \ form_character.fd \ form_citation.fd \ form_document.fd \ Index: src/frontends/xforms/forms/form_changes.fd =================================================================== RCS file: src/frontends/xforms/forms/form_changes.fd diff -N src/frontends/xforms/forms/form_changes.fd --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/frontends/xforms/forms/form_changes.fd 7 Feb 2003 11:32:17 -0000 @@ -0,0 +1,160 @@ +Magic: 13000 + +Internal Form Definition File + (do not change) + +Number of forms: 1 +Unit of measure: FL_COORD_PIXEL + +=============== FORM =============== +Name: form_changes +Width: 400 +Height: 190 +Number of Objects: 8 + +-------------------- +class: FL_BOX +type: UP_BOX +box: 0 0 400 190 +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: +shortcut: +resize: FL_RESIZE_ALL +gravity: FL_NoGravity FL_NoGravity +name: +callback: +argument: + +-------------------- +class: FL_BUTTON +type: NORMAL_BUTTON +box: 270 110 120 30 +boxtype: FL_UP_BOX +colors: FL_COL1 FL_COL1 +alignment: FL_ALIGN_CENTER +style: FL_NORMAL_STYLE +size: FL_NORMAL_SIZE +lcol: FL_BLACK +label: Reject change|#R +shortcut: +resize: FL_RESIZE_NONE +gravity: FL_SouthEast FL_SouthEast +name: button_reject +callback: C_FormBaseInputCB +argument: 0 + +-------------------- +class: FL_BUTTON +type: NORMAL_BUTTON +box: 10 110 100 30 +boxtype: FL_UP_BOX +colors: FL_COL1 FL_COL1 +alignment: FL_ALIGN_CENTER +style: FL_NORMAL_STYLE +size: FL_NORMAL_SIZE +lcol: FL_BLACK +label: Next change|#N +shortcut: +resize: FL_RESIZE_NONE +gravity: FL_SouthEast FL_SouthEast +name: button_next +callback: C_FormBaseInputCB +argument: 0 + +-------------------- +class: FL_BUTTON +type: NORMAL_BUTTON +box: 130 110 120 30 +boxtype: FL_UP_BOX +colors: FL_COL1 FL_COL1 +alignment: FL_ALIGN_CENTER +style: FL_NORMAL_STYLE +size: FL_NORMAL_SIZE +lcol: FL_BLACK +label: Accept change|#A +shortcut: +resize: FL_RESIZE_NONE +gravity: FL_SouthEast FL_SouthEast +name: button_accept +callback: C_FormBaseInputCB +argument: 0 + +-------------------- +class: FL_BUTTON +type: NORMAL_BUTTON +box: 310 150 80 30 +boxtype: FL_UP_BOX +colors: FL_COL1 FL_COL1 +alignment: FL_ALIGN_CENTER +style: FL_NORMAL_STYLE +size: FL_NORMAL_SIZE +lcol: FL_BLACK +label: Close|^[ +shortcut: +resize: FL_RESIZE_NONE +gravity: FL_SouthEast FL_SouthEast +name: button_close +callback: C_FormBaseCancelCB +argument: 0 + +-------------------- +class: FL_TEXT +type: NORMAL_TEXT +box: 10 10 150 20 +boxtype: FL_FLAT_BOX +colors: FL_COL1 FL_MCOL +alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE +style: FL_NORMAL_STYLE +size: FL_NORMAL_SIZE +lcol: FL_BLACK +label: Accept change ? +shortcut: +resize: FL_RESIZE_ALL +gravity: FL_NoGravity FL_NoGravity +name: +callback: +argument: + +-------------------- +class: FL_TEXT +type: NORMAL_TEXT +box: 10 40 380 30 +boxtype: FL_NO_BOX +colors: FL_COL1 FL_MCOL +alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE +style: FL_NORMAL_STYLE +size: FL_NORMAL_SIZE +lcol: FL_BLACK +label: text +shortcut: +resize: FL_RESIZE_ALL +gravity: FL_NoGravity FL_NoGravity +name: author +callback: +argument: + +-------------------- +class: FL_TEXT +type: NORMAL_TEXT +box: 10 70 380 30 +boxtype: FL_NO_BOX +colors: FL_COL1 FL_MCOL +alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE +style: FL_NORMAL_STYLE +size: FL_NORMAL_SIZE +lcol: FL_BLACK +label: text +shortcut: +resize: FL_RESIZE_ALL +gravity: FL_NoGravity FL_NoGravity +name: date +callback: +argument: + +============================== +-------------------- Index: src/frontends/xforms/forms/form_preferences.fd =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/forms/form_preferences.fd,v retrieving revision 1.56 diff -u -r1.56 form_preferences.fd --- src/frontends/xforms/forms/form_preferences.fd 23 Jan 2003 16:23:41 -0000 1.56 +++ src/frontends/xforms/forms/form_preferences.fd 7 Feb 2003 11:32:21 -0000 @@ -3,7 +3,7 @@ Internal Form Definition File (do not change) -Number of forms: 14 +Number of forms: 15 Unit of measure: FL_COORD_PIXEL SnapGrid: 5 @@ -1222,6 +1222,66 @@ callback: C_FormBaseInputCB argument: 0 +=============== FORM =============== +Name: form_preferences_identity +Width: 450 +Height: 350 +Number of Objects: 3 + +-------------------- +class: FL_BOX +type: FLAT_BOX +box: 0 0 450 350 +boxtype: FL_FLAT_BOX +colors: FL_COL1 FL_COL1 +alignment: FL_ALIGN_CENTER +style: FL_NORMAL_STYLE +size: FL_DEFAULT_SIZE +lcol: FL_BLACK +label: +shortcut: +resize: FL_RESIZE_ALL +gravity: FL_NoGravity FL_NoGravity +name: +callback: +argument: + +-------------------- +class: FL_INPUT +type: NORMAL_INPUT +box: 125 25 220 35 +boxtype: FL_DOWN_BOX +colors: FL_COL1 FL_MCOL +alignment: FL_ALIGN_LEFT +style: FL_NORMAL_STYLE +size: FL_DEFAULT_SIZE +lcol: FL_BLACK +label: Real name : |#R +shortcut: +resize: FL_RESIZE_ALL +gravity: FL_NoGravity FL_NoGravity +name: input_user_name +callback: C_FormBaseInputCB +argument: 0 + +-------------------- +class: FL_INPUT +type: NORMAL_INPUT +box: 125 80 220 35 +boxtype: FL_DOWN_BOX +colors: FL_COL1 FL_MCOL +alignment: FL_ALIGN_LEFT +style: FL_NORMAL_STYLE +size: FL_DEFAULT_SIZE +lcol: FL_BLACK +label: Email address : |#E +shortcut: +resize: FL_RESIZE_ALL +gravity: FL_NoGravity FL_NoGravity +name: input_user_email +callback: C_FormBaseInputCB +argument: 0 + =============== FORM =============== Name: form_preferences_spelloptions Width: 450