diff --git a/src/ChangeLog b/src/ChangeLog index 4044b64c0b..caedbc8f93 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2003-03-09 Angus Leeming + + * lyxfunc.C (dispatch): call Dialogs::show("about") rather + than Dialogs::showAboutlyx(). + 2003-03-09 Angus Leeming * factory.C (createInset): call Dialogs::show("tabularcreate") rather diff --git a/src/factory.C b/src/factory.C index fed4967c1c..90ef810555 100644 --- a/src/factory.C +++ b/src/factory.C @@ -125,7 +125,7 @@ Inset * createInset(FuncRequest const & cmd) ::sscanf(cmd.argument.c_str(),"%d%d", &r, &c); return new InsetTabular(*bv->buffer(), r, c); } - bv->owner()->getDialogs().show("tabularcreate", string(), 0); + bv->owner()->getDialogs().show("tabularcreate"); return 0; case LFUN_INSET_CAPTION: diff --git a/src/frontends/ChangeLog b/src/frontends/ChangeLog index dd97fa7deb..73efec778f 100644 --- a/src/frontends/ChangeLog +++ b/src/frontends/ChangeLog @@ -1,7 +1,14 @@ +2003-03-09 Angus Leeming + + * Dialogs.h: remove showAboutlyx. + * guiapi.[Ch]: remove gui_showAboutlyx. + + * Dialogs.[Ch] (show): new method for non-inset dialogs. + 2003-03-09 Angus Leeming * Dialogs.h: remove showTabularCreate. - * guiapi.[Ch]: remove gui_updateTabularCreate. + * guiapi.[Ch]: remove gui_showTabularCreate. 2003-03-09 Angus Leeming diff --git a/src/frontends/Dialogs.C b/src/frontends/Dialogs.C index 9d12d28e1c..dbc2aa8746 100644 --- a/src/frontends/Dialogs.C +++ b/src/frontends/Dialogs.C @@ -75,6 +75,16 @@ Dialog * Dialogs::find(string const & name) } +void Dialogs::show(string const & name) +{ + Dialog * dialog = find(name); + if (!dialog) + return; + + dialog->show(); +} + + void Dialogs::show(string const & name, string const & data, InsetBase * inset) { Dialog * dialog = find(name); diff --git a/src/frontends/Dialogs.h b/src/frontends/Dialogs.h index 286b69d441..1dfdb019a8 100644 --- a/src/frontends/Dialogs.h +++ b/src/frontends/Dialogs.h @@ -72,8 +72,6 @@ public: Put into some sort of alphabetical order */ //@{ /// - void showAboutlyx(); - /// void showCharacter(); /// connected to the character dialog also void setUserFreeFont(); @@ -113,6 +111,8 @@ public: void showVCLogFile(); //@} + ///name == "about" etc + void show(string const & name); /** name == "bibtex", "citation" etc data is generated by the Inset::write method, to be read by the Inset::read method in the frontends. diff --git a/src/frontends/controllers/ChangeLog b/src/frontends/controllers/ChangeLog index 0be6b203eb..a0b903cd58 100644 --- a/src/frontends/controllers/ChangeLog +++ b/src/frontends/controllers/ChangeLog @@ -1,3 +1,7 @@ +2003-03-09 Angus Leeming + + * ControlAboutlyx.[Ch]: rewrite to use the Dialog-based scheme. + 2003-03-09 Angus Leeming * ControlTabularCreate.[Ch]: rewrite to use the Dialog-based scheme. diff --git a/src/frontends/controllers/ControlAboutlyx.C b/src/frontends/controllers/ControlAboutlyx.C index e3ce154d08..1887f0f63a 100644 --- a/src/frontends/controllers/ControlAboutlyx.C +++ b/src/frontends/controllers/ControlAboutlyx.C @@ -29,8 +29,8 @@ extern string system_lyxdir; extern string user_lyxdir; -ControlAboutlyx::ControlAboutlyx(LyXView & lv, Dialogs & d) - : ControlDialogBI(lv, d) +ControlAboutlyx::ControlAboutlyx(Dialog & parent) + : Dialog::Controller(parent) {} diff --git a/src/frontends/controllers/ControlAboutlyx.h b/src/frontends/controllers/ControlAboutlyx.h index 428cd8fd2d..ef6a998cee 100644 --- a/src/frontends/controllers/ControlAboutlyx.h +++ b/src/frontends/controllers/ControlAboutlyx.h @@ -13,36 +13,34 @@ #ifndef CONTROLABOUTLYX_H #define CONTROLABOUTLYX_H - -#include "ControlDialog_impl.h" -#include "LString.h" - +#include "Dialog.h" #include /** A controller for the About LyX dialogs. */ -class ControlAboutlyx : public ControlDialogBI { +class ControlAboutlyx : public Dialog::Controller { public: /// - ControlAboutlyx(LyXView &, Dialogs &); + ControlAboutlyx(Dialog &); + /// + virtual void initialiseParams(string const &) {} + /// + virtual void clearParams() {} + /// + virtual void dispatchParams() {} + /// + virtual bool isBufferDependent() const { return false; } /// void getCredits(std::ostream &) const; - /// string const getCopyright() const; - /// string const getLicense() const; - /// string const getDisclaimer() const; - /// string const getVersion() const; -private: - /// not needed. - virtual void apply() {} }; #endif // CONTROLABOUTLYX_H diff --git a/src/frontends/guiapi.C b/src/frontends/guiapi.C index 6460cbf942..c2d90b71ef 100644 --- a/src/frontends/guiapi.C +++ b/src/frontends/guiapi.C @@ -21,12 +21,6 @@ void gui_show_dialog(Dialogs * d, char const * name, char const * data) d->show(name, data, 0); } -void gui_ShowAboutlyx(Dialogs & d) -{ - d.showAboutlyx(); -} - - void gui_ShowCharacter(Dialogs & d) { d.showCharacter(); diff --git a/src/frontends/guiapi.h b/src/frontends/guiapi.h index 825077b57e..597b13dea2 100644 --- a/src/frontends/guiapi.h +++ b/src/frontends/guiapi.h @@ -21,7 +21,6 @@ extern "C" { void gui_show_dialog(Dialogs *, char const * name, char const * data); -void gui_ShowAboutlyx(Dialogs &); void gui_ShowCharacter(Dialogs &); void gui_SetUserFreeFont(Dialogs &); void gui_ShowDocument(Dialogs &); diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index 01e011c3df..cd445fee34 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,13 @@ +2003-03-09 Angus Leeming + + * Dialogs.C: + * Dialogs2.C: + * Dialogs_impl.h: remove aboutlyx dialog. + + * Dialogs3.C: add aboutlyx dialog. + + * QAbout.[Ch]: changes to use the new Dialog-based scheme. + 2003-03-09 Angus Leeming * Dialogs.C: diff --git a/src/frontends/qt2/Dialogs.C b/src/frontends/qt2/Dialogs.C index 6415c9c6e5..dc64fb4a27 100644 --- a/src/frontends/qt2/Dialogs.C +++ b/src/frontends/qt2/Dialogs.C @@ -26,8 +26,7 @@ Dialogs::~Dialogs() Dialogs::Impl::Impl(LyXView & lv, Dialogs & d) - : aboutlyx(lv, d), - changes(lv, d), + : changes(lv, d), character(lv, d), document(lv, d), file(lv, d), diff --git a/src/frontends/qt2/Dialogs2.C b/src/frontends/qt2/Dialogs2.C index e75d2801a3..f2c6b10ffd 100644 --- a/src/frontends/qt2/Dialogs2.C +++ b/src/frontends/qt2/Dialogs2.C @@ -15,12 +15,6 @@ #include "Dialogs_impl.h" -void Dialogs::showAboutlyx() -{ - pimpl_->aboutlyx.controller().show(); -} - - void Dialogs::showMergeChanges() { pimpl_->changes.controller().show(); diff --git a/src/frontends/qt2/Dialogs3.C b/src/frontends/qt2/Dialogs3.C index 20d291d579..bac3b686f2 100644 --- a/src/frontends/qt2/Dialogs3.C +++ b/src/frontends/qt2/Dialogs3.C @@ -13,6 +13,7 @@ #include "Dialogs.h" #include "Dialog.h" +#include "ControlAboutlyx.h" #include "ControlBibtex.h" #include "ControlCitation.h" #include "ControlError.h" @@ -28,6 +29,8 @@ #include "ControlToc.h" #include "ControlWrap.h" +#include "QAbout.h" +#include "QAboutDialog.h" #include "QBibitem.h" #include "QBibitemDialog.h" #include "QBibtex.h" @@ -86,7 +89,7 @@ typedef ButtonController namespace { -char const * const dialognames[] = { "bibitem", "bibtex", "citation", +char const * const dialognames[] = { "about", "bibitem", "bibtex", "citation", "error", "ert", "external", "float", "graphics", "include", "index", "label", "minipage", "ref", "tabular", @@ -122,7 +125,11 @@ Dialog * Dialogs::build(string const & name) Dialog * dialog = new Dialog(lyxview_, name); - if (name == "bibitem") { + if (name == "about") { + dialog->setController(new ControlAboutlyx(*dialog)); + dialog->setView(new QAbout(*dialog)); + dialog->setButtonController(new OkCancelBC); + } else if (name == "bibitem") { dialog->setController(new ControlCommand(*dialog, name)); dialog->setView(new QBibitem(*dialog)); dialog->setButtonController(new OkCancelReadOnlyBC); diff --git a/src/frontends/qt2/Dialogs_impl.h b/src/frontends/qt2/Dialogs_impl.h index 81b04d50b5..1f06f29798 100644 --- a/src/frontends/qt2/Dialogs_impl.h +++ b/src/frontends/qt2/Dialogs_impl.h @@ -14,7 +14,6 @@ #include "Dialogs.h" #include "controllers/GUI.h" -#include "ControlAboutlyx.h" #include "ControlChanges.h" #include "ControlCharacter.h" #include "ControlDocument.h" @@ -30,8 +29,6 @@ #include "ControlTexinfo.h" #include "ControlVCLog.h" -#include "QAbout.h" -#include "QAboutDialog.h" #include "QChanges.h" #include "QChangesDialog.h" #include "QCharacter.h" @@ -75,9 +72,6 @@ -typedef GUI -AboutlyxDialog; - typedef GUI ChangesDialog; @@ -126,7 +120,6 @@ VCLogFileDialog; struct Dialogs::Impl { Impl(LyXView & lv, Dialogs & d); - AboutlyxDialog aboutlyx; ChangesDialog changes; CharacterDialog character; DocumentDialog document; diff --git a/src/frontends/qt2/QAbout.C b/src/frontends/qt2/QAbout.C index 54cbbc20d9..b464e4054f 100644 --- a/src/frontends/qt2/QAbout.C +++ b/src/frontends/qt2/QAbout.C @@ -29,11 +29,11 @@ using std::getline; -typedef Qt2CB > base_class; +typedef QController > base_class; -QAbout::QAbout() - : base_class(qt_("About LyX")) +QAbout::QAbout(Dialog & parent) + : base_class(parent, qt_("About LyX")) { } diff --git a/src/frontends/qt2/QAbout.h b/src/frontends/qt2/QAbout.h index 5b884035ae..473fb278c4 100644 --- a/src/frontends/qt2/QAbout.h +++ b/src/frontends/qt2/QAbout.h @@ -13,16 +13,17 @@ #define FORMABOUT_H -#include "Qt2Base.h" +#include "QDialogView.h" + class QAboutDialog; class ControlAboutlyx; class QAbout - : public Qt2CB > + : public QController > { public: - QAbout(); + QAbout(Dialog &); private: /// not needed virtual void apply() {} diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index cac71dffe6..5ca3a7c812 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,14 @@ +2003-03-09 Angus Leeming + + * Dialogs.C: + * Dialogs2.C: + * Dialogs_impl.h: remove aboutlyx dialog. + + * Dialogs3.C: add aboutlyx dialog. + + * FormAboutlyx.[Ch]: + * forms/form_aboutlyx.fd: changes to use the new Dialog-based scheme. + 2003-03-09 Angus Leeming * Dialogs.C: diff --git a/src/frontends/xforms/Dialogs.C b/src/frontends/xforms/Dialogs.C index e261b0b61e..f2fb43a93d 100644 --- a/src/frontends/xforms/Dialogs.C +++ b/src/frontends/xforms/Dialogs.C @@ -26,8 +26,7 @@ Dialogs::~Dialogs() Dialogs::Impl::Impl(LyXView & lv, Dialogs & d) - : aboutlyx(lv, d), - changes(lv, d), + : changes(lv, d), character(lv, d), document(lv, d), file(lv, d), diff --git a/src/frontends/xforms/Dialogs2.C b/src/frontends/xforms/Dialogs2.C index 5669d2b26d..c272f3713b 100644 --- a/src/frontends/xforms/Dialogs2.C +++ b/src/frontends/xforms/Dialogs2.C @@ -15,12 +15,6 @@ #include "Dialogs_impl.h" -void Dialogs::showAboutlyx() -{ - pimpl_->aboutlyx.controller().show(); -} - - void Dialogs::showMergeChanges() { pimpl_->changes.controller().show(); diff --git a/src/frontends/xforms/Dialogs3.C b/src/frontends/xforms/Dialogs3.C index 1e88ca944f..4d5460b949 100644 --- a/src/frontends/xforms/Dialogs3.C +++ b/src/frontends/xforms/Dialogs3.C @@ -15,6 +15,7 @@ #include "Tooltips.h" +#include "ControlAboutlyx.h" #include "ControlBibtex.h" #include "ControlCitation.h" #include "ControlCommand.h" @@ -31,6 +32,8 @@ #include "ControlToc.h" #include "ControlWrap.h" +#include "FormAboutlyx.h" +#include "forms/form_aboutlyx.h" #include "FormBibitem.h" #include "forms/form_bibitem.h" #include "FormBibtex.h" @@ -85,7 +88,7 @@ typedef ButtonController namespace { -char const * const dialognames[] = { "bibitem", "bibtex", "citation", +char const * const dialognames[] = { "about", "bibitem", "bibtex", "citation", "error", "ert", "external", "float", "graphics", "include", "index", "label", "minipage", "ref", "tabular", @@ -122,7 +125,11 @@ Dialog * Dialogs::build(string const & name) Dialog * dialog = new Dialog(lyxview_, name); - if (name == "bibitem") { + if (name == "about") { + dialog->setController(new ControlAboutlyx(*dialog)); + dialog->setView(new FormAboutlyx(*dialog)); + dialog->setButtonController(new OkCancelBC); + } else if (name == "bibitem") { dialog->setController(new ControlCommand(*dialog, name)); dialog->setView(new FormBibitem(*dialog)); dialog->setButtonController(new OkCancelReadOnlyBC); diff --git a/src/frontends/xforms/Dialogs_impl.h b/src/frontends/xforms/Dialogs_impl.h index daacd56ed4..3386904f6b 100644 --- a/src/frontends/xforms/Dialogs_impl.h +++ b/src/frontends/xforms/Dialogs_impl.h @@ -18,10 +18,6 @@ #include "xformsBC.h" #include "combox.h" -#include "ControlAboutlyx.h" -#include "FormAboutlyx.h" -#include "forms/form_aboutlyx.h" - #include "FormBrowser.h" #include "forms/form_browser.h" @@ -92,9 +88,6 @@ #include "ControlVCLog.h" #include "FormVCLog.h" -typedef GUI -AboutlyxDialog; - typedef GUI ChangesDialog; @@ -151,7 +144,6 @@ VCLogFileDialog; struct Dialogs::Impl { Impl(LyXView & lv, Dialogs & d); - AboutlyxDialog aboutlyx; ChangesDialog changes; CharacterDialog character; DocumentDialog document; diff --git a/src/frontends/xforms/FormAboutlyx.C b/src/frontends/xforms/FormAboutlyx.C index b4cd7946fe..947de9bd41 100644 --- a/src/frontends/xforms/FormAboutlyx.C +++ b/src/frontends/xforms/FormAboutlyx.C @@ -24,10 +24,10 @@ #include FORMS_H_LOCATION -typedef FormCB > base_class; +typedef FormController > base_class; -FormAboutlyx::FormAboutlyx() - : base_class(_("About LyX"), false) +FormAboutlyx::FormAboutlyx(Dialog & parent) + : base_class(parent, _("About LyX"), false) {} diff --git a/src/frontends/xforms/FormAboutlyx.h b/src/frontends/xforms/FormAboutlyx.h index c73216a91d..4eb32c6277 100644 --- a/src/frontends/xforms/FormAboutlyx.h +++ b/src/frontends/xforms/FormAboutlyx.h @@ -14,7 +14,7 @@ #define FORMABOUTLYX_H -#include "FormBase.h" +#include "FormDialogView.h" #include @@ -26,10 +26,11 @@ struct FD_aboutlyx_license; /** This class provides an XForms implementation of the FormAboutlyx Dialog. */ -class FormAboutlyx : public FormCB > { +class FormAboutlyx + : public FormController > { public: /// - FormAboutlyx(); + FormAboutlyx(Dialog &); private: /// not needed. diff --git a/src/frontends/xforms/forms/form_aboutlyx.fd b/src/frontends/xforms/forms/form_aboutlyx.fd index 3c01dc1074..16072a3c02 100644 --- a/src/frontends/xforms/forms/form_aboutlyx.fd +++ b/src/frontends/xforms/forms/form_aboutlyx.fd @@ -46,7 +46,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_SouthEast FL_SouthEast name: button_close -callback: C_FormBaseCancelCB +callback: C_FormDialogView_CancelCB argument: 0 -------------------- @@ -106,8 +106,8 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NorthWest FL_SouthEast name: browser_version -callback: C_FormBaseInputCB -argument: 0 +callback: +argument: =============== FORM =============== Name: form_aboutlyx_credits @@ -148,8 +148,8 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NorthWest FL_SouthEast name: browser_credits -callback: C_FormBaseInputCB -argument: 0 +callback: +argument: =============== FORM =============== Name: form_aboutlyx_license @@ -190,8 +190,8 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NorthWest FL_SouthEast name: browser_license -callback: C_FormBaseInputCB -argument: 0 +callback: +argument: ============================== create_the_forms diff --git a/src/lyxfunc.C b/src/lyxfunc.C index 0092cc5296..f762f743ce 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -1126,7 +1126,7 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose) #endif #endif case LFUN_HELP_ABOUTLYX: - owner->getDialogs().showAboutlyx(); + owner->getDialogs().show("about"); break; case LFUN_HELP_TEXINFO: