From: Angus Leeming Date: Thu, 19 Jun 2003 17:16:12 +0000 (+0000) Subject: Move the Texinfo dialog to the new Dialog scheme. X-Git-Tag: 1.6.10~16609 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=87f831b8ba37f57418132ec162e22847bdc2e7dc;p=features.git Move the Texinfo dialog to the new Dialog scheme. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7193 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/ChangeLog b/src/frontends/ChangeLog index fd02f185ac..745330c6a0 100644 --- a/src/frontends/ChangeLog +++ b/src/frontends/ChangeLog @@ -1,3 +1,8 @@ +2003-06-19 Angus Leeming + + * Dialogs.h: (showTexinfo): + * guiapi.[Ch] (gui_ShowTexinfo): removed. + 2003-06-17 Angus Leeming * Dialogs.h: (showMathPanel): diff --git a/src/frontends/Dialogs.h b/src/frontends/Dialogs.h index af8f12a090..9ae7f37b13 100644 --- a/src/frontends/Dialogs.h +++ b/src/frontends/Dialogs.h @@ -86,8 +86,6 @@ public: void showSendto(); /// bring up the spellchecker void showSpellchecker(); - /// show the TexInfo - void showTexinfo(); //@} /** \param name == "about" etc; an identifier used to diff --git a/src/frontends/controllers/ChangeLog b/src/frontends/controllers/ChangeLog index c482cf7167..89e95a567d 100644 --- a/src/frontends/controllers/ChangeLog +++ b/src/frontends/controllers/ChangeLog @@ -1,3 +1,7 @@ +2003-06-19 Angus Leeming + + * ControlTexinfo.[Ch]: rewritten to use the Dialog-based scheme. + 2003-06-17 Angus Leeming * ControlMath.[Ch]: diff --git a/src/frontends/controllers/ControlTexinfo.C b/src/frontends/controllers/ControlTexinfo.C index 5ef2811385..d0ecf3d845 100644 --- a/src/frontends/controllers/ControlTexinfo.C +++ b/src/frontends/controllers/ControlTexinfo.C @@ -10,20 +10,10 @@ #include - #include "ControlTexinfo.h" - -#include "helper_funcs.h" #include "tex_helpers.h" +#include "funcrequest.h" -#include "frontends/Dialogs.h" -#include "frontends/LyXView.h" - -#include "support/filetools.h" // FileSearch -#include "support/path.h" -#include "support/lstrings.h" - -extern string user_lyxdir; // home of *Files.lst namespace { @@ -46,8 +36,8 @@ string getFileList(ControlTexinfo::texFileSuffix type, bool withFullPath) } // namespace anon -ControlTexinfo::ControlTexinfo(LyXView & lv, Dialogs & d) - : ControlDialogBI(lv, d) +ControlTexinfo::ControlTexinfo(Dialog & parent) + : Dialog::Controller(parent) {} @@ -81,7 +71,8 @@ ControlTexinfo::getContents(texFileSuffix type, bool withFullPath) const void ControlTexinfo::viewFile(string const filename) const { - lv_.getDialogs().show("file", filename); + string const arg = "file " + filename; + kernel().dispatch(FuncRequest(LFUN_DIALOG_SHOW, arg)); } diff --git a/src/frontends/controllers/ControlTexinfo.h b/src/frontends/controllers/ControlTexinfo.h index 34e54a2496..2edf4ff08a 100644 --- a/src/frontends/controllers/ControlTexinfo.h +++ b/src/frontends/controllers/ControlTexinfo.h @@ -13,17 +13,26 @@ #define CONTROLTEXINFO_H -#include "ControlDialog_impl.h" -#include "LString.h" +#include "Dialog.h" /** A controller for Texinfo dialogs. */ -class ControlTexinfo : public ControlDialogBI { +class ControlTexinfo : public Dialog::Controller { public: + /// + ControlTexinfo(Dialog &); + /// + virtual bool initialiseParams(string const &) { return true; } + /// + virtual void clearParams() {} + /// + virtual void dispatchParams() {} + /// + virtual bool isBufferDependent() const { return false; } + + /// the file extensions enum texFileSuffix {cls, sty, bst}; - /// - ControlTexinfo(LyXView &, Dialogs &); /// show contents af a file void viewFile(string const filename) const; /// show all classoptions diff --git a/src/frontends/guiapi.C b/src/frontends/guiapi.C index 1265a84b2f..bb3ed23d24 100644 --- a/src/frontends/guiapi.C +++ b/src/frontends/guiapi.C @@ -69,10 +69,4 @@ void gui_ShowSpellchecker(Dialogs & d) } -void gui_ShowTexinfo(Dialogs & d) -{ - d.showTexinfo(); -} - - } // extern "C" diff --git a/src/frontends/guiapi.h b/src/frontends/guiapi.h index b34910b472..a99dbdc67d 100644 --- a/src/frontends/guiapi.h +++ b/src/frontends/guiapi.h @@ -29,7 +29,6 @@ void gui_ShowPrint(Dialogs &); void gui_ShowSearch(Dialogs &); void gui_ShowSendto(Dialogs &); void gui_ShowSpellchecker(Dialogs &); -void gui_ShowTexinfo(Dialogs &); } // extern "C" diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index b88a07fc82..0efc0c12f9 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,9 @@ +2003-06-19 Angus Leeming + + * Dialogs.C: + * Dialogs2.C: + * QTexinfo.[Ch]: changes to use the new Dialog-based scheme. + 2003-06-19 Angus Leeming * lyx_gui.C (getStatus): changes due to replacement of lots of lfuns diff --git a/src/frontends/qt2/Dialogs.C b/src/frontends/qt2/Dialogs.C index e8d5d767f7..cec245da3b 100644 --- a/src/frontends/qt2/Dialogs.C +++ b/src/frontends/qt2/Dialogs.C @@ -33,6 +33,7 @@ #include "ControlShowFile.h" #include "ControlTabular.h" #include "ControlTabularCreate.h" +#include "ControlTexinfo.h" #include "ControlToc.h" #include "ControlVCLog.h" #include "ControlWrap.h" @@ -63,6 +64,7 @@ #include "QShowFile.h" #include "QTabular.h" #include "QTabularCreate.h" +#include "QTexinfo.h" #include "QToc.h" #include "QURL.h" #include "QVCLog.h" @@ -80,11 +82,11 @@ namespace { -char const * const dialognames[] = { "about", "bibitem", "bibtex", "changes", +char const * const dialognames[] = { "aboutlyx", "bibitem", "bibtex", "changes", "character", "citation", "error", "errorlist", "ert", "external", "file", -"float", "graphics", "include", "index", "label", "log", +"float", "graphics", "include", "index", "label", "latexlog", "mathpanel", "mathdelimiter", "mathmatrix", -"minipage", "paragraph", "ref", "tabular", "tabularcreate", +"minipage", "paragraph", "ref", "tabular", "tabularcreate", "texinfo", #ifdef HAVE_LIBAIKSAURUS "thesaurus", @@ -123,7 +125,7 @@ Dialog * Dialogs::build(string const & name) Dialog * dialog = new Dialog(lyxview_, name); dialog->bc().view(new Qt2BC(dialog->bc())); - if (name == "about") { + if (name == "aboutlyx") { dialog->setController(new ControlAboutlyx(*dialog)); dialog->setView(new QAbout(*dialog)); dialog->bc().bp(new OkCancelPolicy); @@ -191,7 +193,7 @@ Dialog * Dialogs::build(string const & name) _("LyX: Label"), qt_("&Label"))); dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy); - } else if (name == "log") { + } else if (name == "latexlog") { dialog->setController(new ControlLog(*dialog)); dialog->setView(new QLog(*dialog)); dialog->bc().bp(new OkCancelPolicy); @@ -227,6 +229,10 @@ Dialog * Dialogs::build(string const & name) dialog->setController(new ControlTabularCreate(*dialog)); dialog->setView(new QTabularCreate(*dialog)); dialog->bc().bp(new IgnorantPolicy); + } else if (name == "texinfo") { + dialog->setController(new ControlTexinfo(*dialog)); + dialog->setView(new QTexinfo(*dialog)); + dialog->bc().bp(new OkCancelPolicy); #ifdef HAVE_LIBAIKSAURUS } else if (name == "thesaurus") { dialog->setController(new ControlThesaurus(*dialog)); diff --git a/src/frontends/qt2/Dialogs2.C b/src/frontends/qt2/Dialogs2.C index 4edb6a1bf3..42921a58f2 100644 --- a/src/frontends/qt2/Dialogs2.C +++ b/src/frontends/qt2/Dialogs2.C @@ -23,7 +23,6 @@ #include "ControlSearch.h" #include "ControlSendto.h" #include "ControlSpellchecker.h" -#include "ControlTexinfo.h" #include "QCharacter.h" #include "QCharacterDialog.h" @@ -44,8 +43,6 @@ #include "QSendtoDialog.h" #include "QSpellchecker.h" #include "QSpellcheckerDialog.h" -#include "QTexinfo.h" -#include "QTexinfoDialog.h" #include "Qt2BC.h" @@ -69,9 +66,6 @@ SendtoDialog; typedef GUI SpellcheckerDialog; -typedef GUI -TexinfoDialog; - struct Dialogs::Impl { Impl(LyXView & lv, Dialogs & d); @@ -81,7 +75,6 @@ struct Dialogs::Impl { SearchDialog search; SendtoDialog sendto; SpellcheckerDialog spellchecker; - TexinfoDialog texinfo; }; @@ -91,8 +84,7 @@ Dialogs::Impl::Impl(LyXView & lv, Dialogs & d) print(lv, d), search(lv, d), sendto(lv, d), - spellchecker(lv, d), - texinfo(lv, d) + spellchecker(lv, d) {} @@ -154,9 +146,3 @@ void Dialogs::showSpellchecker() { pimpl_->spellchecker.controller().show(); } - - -void Dialogs::showTexinfo() -{ - pimpl_->texinfo.controller().show(); -} diff --git a/src/frontends/qt2/QTexinfo.C b/src/frontends/qt2/QTexinfo.C index f256e32893..b57dde9a68 100644 --- a/src/frontends/qt2/QTexinfo.C +++ b/src/frontends/qt2/QTexinfo.C @@ -26,11 +26,11 @@ using std::vector; -typedef Qt2CB > base_class; +typedef QController > base_class; -QTexinfo::QTexinfo() - : base_class(_("LyX: LaTeX Information")), +QTexinfo::QTexinfo(Dialog & parent) + : base_class(parent, _("LyX: LaTeX Information")), warningPosted(false), activeStyle(ControlTexinfo::cls) { } diff --git a/src/frontends/qt2/QTexinfo.h b/src/frontends/qt2/QTexinfo.h index 0964a874d5..e0102bd699 100644 --- a/src/frontends/qt2/QTexinfo.h +++ b/src/frontends/qt2/QTexinfo.h @@ -13,8 +13,7 @@ #define QTEXINFO_H -#include "Qt2Base.h" - +#include "QDialogView.h" #include "ControlTexinfo.h" #include @@ -23,13 +22,12 @@ class QTexinfoDialog; /// class QTexinfo - : public Qt2CB > -{ + : public QController > { public: /// friend class QTexinfoDialog; /// - QTexinfo(); + QTexinfo(Dialog &); private: /// Apply changes virtual void apply() {} diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index beef238d54..01d1e4cbb0 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,10 @@ +2003-06-19 Angus Leeming + + * Dialogs.C: + * Dialogs2.C: + * FormTexinfo.[Ch]: + * forms/form_texinfo.fd: changes to use the new Dialog-based scheme. + 2003-06-19 Juergen Spitzmueller * forms/form_preferences.fd Revert Rob Lahaye's patch. diff --git a/src/frontends/xforms/Dialogs.C b/src/frontends/xforms/Dialogs.C index 6eed624908..19da7e5bcc 100644 --- a/src/frontends/xforms/Dialogs.C +++ b/src/frontends/xforms/Dialogs.C @@ -36,6 +36,7 @@ #include "ControlShowFile.h" #include "ControlTabular.h" #include "ControlTabularCreate.h" +#include "ControlTexinfo.h" #include "ControlToc.h" #include "ControlVCLog.h" #include "ControlWrap.h" @@ -64,6 +65,7 @@ #include "FormParagraph.h" #include "FormRef.h" #include "FormTabular.h" +#include "FormTexinfo.h" #include "FormShowFile.h" #include "FormTabularCreate.h" #include "FormText.h" @@ -108,14 +110,14 @@ FormMathsBitmap * createFormBitmap(Dialog & parent, string const & title, } -char const * const dialognames[] = { "about", "bibitem", "bibtex", "changes", +char const * const dialognames[] = { "aboutlyx", "bibitem", "bibtex", "changes", "character", "citation", "error", "errorlist" , "ert", "external", "file", -"float", "graphics", "include", "index", "label", "log", "mathpanel", +"float", "graphics", "include", "index", "label", "latexlog", "mathpanel", "mathaccents", "matharrows", "mathoperators", "mathrelations", "mathgreek", "mathmisc", "mathdots", "mathbigoperators", "mathamsmisc", "mathamsarrows", "mathamsrelations", "mathamsnegatedrelations", "mathamsoperators", "mathdelimiter", "mathmatrix", "mathspace", "mathstyle", -"minipage", "paragraph", "ref", "tabular", "tabularcreate", +"minipage", "paragraph", "ref", "tabular", "tabularcreate", "texinfo", #ifdef HAVE_LIBAIKSAURUS "thesaurus", @@ -153,7 +155,7 @@ Dialog * Dialogs::build(string const & name) Dialog * dialog = new Dialog(lyxview_, name); dialog->bc().view(new xformsBC(dialog->bc())); - if (name == "about") { + if (name == "aboutlyx") { dialog->setController(new ControlAboutlyx(*dialog)); dialog->setView(new FormAboutlyx(*dialog)); dialog->bc().bp(new OkCancelPolicy); @@ -219,7 +221,7 @@ Dialog * Dialogs::build(string const & name) dialog->setView(new FormText(*dialog, _("Label"), _("Label:|#L"))); dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy); - } else if (name == "log") { + } else if (name == "latexlog") { dialog->setController(new ControlLog(*dialog)); dialog->setView(new FormLog(*dialog)); dialog->bc().bp(new OkCancelPolicy); @@ -425,6 +427,10 @@ Dialog * Dialogs::build(string const & name) dialog->setController(new ControlTabularCreate(*dialog)); dialog->setView(new FormTabularCreate(*dialog)); dialog->bc().bp(new IgnorantPolicy); + } else if (name == "texinfo") { + dialog->setController(new ControlTexinfo(*dialog)); + dialog->setView(new FormTexinfo(*dialog)); + dialog->bc().bp(new OkCancelPolicy); #ifdef HAVE_LIBAIKSAURUS } else if (name == "thesaurus") { dialog->setController(new ControlThesaurus(*dialog)); diff --git a/src/frontends/xforms/Dialogs2.C b/src/frontends/xforms/Dialogs2.C index 0aeab5f771..fbfbe01dc3 100644 --- a/src/frontends/xforms/Dialogs2.C +++ b/src/frontends/xforms/Dialogs2.C @@ -51,10 +51,6 @@ #include "FormSpellchecker.h" #include "forms/form_spellchecker.h" -#include "ControlTexinfo.h" -#include "FormTexinfo.h" -#include "forms/form_texinfo.h" - typedef GUI DocumentDialog; @@ -79,8 +75,6 @@ SendtoDialog; typedef GUI SpellcheckerDialog; -typedef GUI -TexinfoDialog; struct Dialogs::Impl { Impl(LyXView & lv, Dialogs & d); @@ -93,7 +87,6 @@ struct Dialogs::Impl { SearchDialog search; SendtoDialog sendto; SpellcheckerDialog spellchecker; - TexinfoDialog texinfo; }; @@ -105,8 +98,7 @@ Dialogs::Impl::Impl(LyXView & lv, Dialogs & d) print(lv, d), search(lv, d), sendto(lv, d), - spellchecker(lv, d), - texinfo(lv, d) + spellchecker(lv, d) {} @@ -168,9 +160,3 @@ void Dialogs::showSpellchecker() { pimpl_->spellchecker.controller().show(); } - - -void Dialogs::showTexinfo() -{ - pimpl_->texinfo.controller().show(); -} diff --git a/src/frontends/xforms/FormTexinfo.C b/src/frontends/xforms/FormTexinfo.C index 08d664f466..e6d703ad66 100644 --- a/src/frontends/xforms/FormTexinfo.C +++ b/src/frontends/xforms/FormTexinfo.C @@ -26,9 +26,10 @@ using std::vector; -typedef FormCB > base_class; -FormTexinfo::FormTexinfo() - : base_class(_("LaTeX Information")), +typedef FormController > base_class; + +FormTexinfo::FormTexinfo(Dialog & parent) + : base_class(parent, _("LaTeX Information")), activeStyle(ControlTexinfo::cls) {} @@ -37,7 +38,8 @@ void FormTexinfo::build() { dialog_.reset(build_texinfo(this)); // callback for double click in browser to view the selected file - fl_set_browser_dblclick_callback(dialog_->browser, C_FormBaseInputCB, 2); + fl_set_browser_dblclick_callback(dialog_->browser, + C_FormDialogView_InputCB, 2); string const classes_List = _("LaTeX classes|LaTeX styles|BibTeX styles"); fl_addto_choice(dialog_->choice_classes, classes_List.c_str()); diff --git a/src/frontends/xforms/FormTexinfo.h b/src/frontends/xforms/FormTexinfo.h index 017555acd9..e2f2b1c5d5 100644 --- a/src/frontends/xforms/FormTexinfo.h +++ b/src/frontends/xforms/FormTexinfo.h @@ -13,15 +13,16 @@ #define FORMTEXINFO_H -#include "FormBase.h" +#include "FormDialogView.h" #include "ControlTexinfo.h" struct FD_texinfo; -class FormTexinfo : public FormCB > { +class FormTexinfo + : public FormController > { public: /// - FormTexinfo(); + FormTexinfo(Dialog &); private: /// not needed virtual void apply() {} diff --git a/src/frontends/xforms/forms/form_texinfo.fd b/src/frontends/xforms/forms/form_texinfo.fd index d682d83dee..653918776b 100644 --- a/src/frontends/xforms/forms/form_texinfo.fd +++ b/src/frontends/xforms/forms/form_texinfo.fd @@ -46,7 +46,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NorthWest FL_SouthEast name: browser -callback: C_FormBaseInputCB +callback: C_FormDialogView_InputCB argument: 0 -------------------- @@ -64,7 +64,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_SouthWest FL_South name: button_rescan -callback: C_FormBaseInputCB +callback: C_FormDialogView_InputCB argument: 2 -------------------- @@ -82,7 +82,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_North FL_North name: check_fullpath -callback: C_FormBaseInputCB +callback: C_FormDialogView_InputCB argument: 2 -------------------- @@ -100,7 +100,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_SouthEast FL_SouthEast name: button_close -callback: C_FormBaseCancelCB +callback: C_FormDialogView_CancelCB argument: 0 -------------------- @@ -118,7 +118,7 @@ shortcut: resize: FL_RESIZE_X gravity: FL_NorthWest FL_North name: choice_classes -callback: C_FormBaseInputCB +callback: C_FormDialogView_InputCB argument: 0 -------------------- @@ -136,7 +136,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_SouthWest FL_South name: button_texhash -callback: C_FormBaseInputCB +callback: C_FormDialogView_InputCB argument: 2 ==============================