]> git.lyx.org Git - features.git/commitdiff
Move the Texinfo dialog to the new Dialog scheme.
authorAngus Leeming <leeming@lyx.org>
Thu, 19 Jun 2003 17:16:12 +0000 (17:16 +0000)
committerAngus Leeming <leeming@lyx.org>
Thu, 19 Jun 2003 17:16:12 +0000 (17:16 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7193 a592a061-630c-0410-9148-cb99ea01b6c8

18 files changed:
src/frontends/ChangeLog
src/frontends/Dialogs.h
src/frontends/controllers/ChangeLog
src/frontends/controllers/ControlTexinfo.C
src/frontends/controllers/ControlTexinfo.h
src/frontends/guiapi.C
src/frontends/guiapi.h
src/frontends/qt2/ChangeLog
src/frontends/qt2/Dialogs.C
src/frontends/qt2/Dialogs2.C
src/frontends/qt2/QTexinfo.C
src/frontends/qt2/QTexinfo.h
src/frontends/xforms/ChangeLog
src/frontends/xforms/Dialogs.C
src/frontends/xforms/Dialogs2.C
src/frontends/xforms/FormTexinfo.C
src/frontends/xforms/FormTexinfo.h
src/frontends/xforms/forms/form_texinfo.fd

index fd02f185ac31603c7152f828cc8e76112b56a2a2..745330c6a02fff647211017ee28830cf39525ee4 100644 (file)
@@ -1,3 +1,8 @@
+2003-06-19  Angus Leeming  <leeming@lyx.org>
+
+       * Dialogs.h: (showTexinfo):
+       * guiapi.[Ch] (gui_ShowTexinfo):  removed.
+
 2003-06-17  Angus Leeming  <leeming@lyx.org>
 
        * Dialogs.h: (showMathPanel):
index af8f12a09088aaf9d203e6b7ca59070beac4cc77..9ae7f37b13be16bc7c759d1b9c241f698ca0ea02 100644 (file)
@@ -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
index c482cf716769993c72cd83666e4d7d1b83edf6fb..89e95a567d037a13a8e85aefa8eeffb1482917ab 100644 (file)
@@ -1,3 +1,7 @@
+2003-06-19  Angus Leeming  <leeming@lyx.org>
+
+       * ControlTexinfo.[Ch]: rewritten to use the Dialog-based scheme.
+
 2003-06-17  Angus Leeming  <leeming@lyx.org>
 
        * ControlMath.[Ch]:
index 5ef281138512df1430396a254807d1b99391de3c..d0ecf3d84562334885cb06ed64892864d17928b2 100644 (file)
 
 #include <config.h>
 
-
 #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));
 }
 
 
index 34e54a2496f7ce4922e5be5e3d31bff7ae1f3145..2edf4ff08a9abfd2e454308c7632d090e8a0ee05 100644 (file)
 #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
index 1265a84b2f8ff02f2de74eb9bb5032afea933831..bb3ed23d240d4bc70ed69dbf98ab9334584d2b7f 100644 (file)
@@ -69,10 +69,4 @@ void gui_ShowSpellchecker(Dialogs & d)
 }
 
 
-void gui_ShowTexinfo(Dialogs & d)
-{
-       d.showTexinfo();
-}
-
-
 } // extern "C"
index b34910b47230d2ac51a65b019b8964b69026e9a5..a99dbdc67dc16aa63a67fda5d79b9715c542379b 100644 (file)
@@ -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"
 
index b88a07fc82eacb6b36e136ef3105e113437f80d7..0efc0c12f9ded199cc0c903d6210c52e6a99379a 100644 (file)
@@ -1,3 +1,9 @@
+2003-06-19  Angus Leeming  <leeming@lyx.org>
+
+       * Dialogs.C:
+       * Dialogs2.C:
+       * QTexinfo.[Ch]: changes to use the new Dialog-based scheme.
+
 2003-06-19  Angus Leeming  <leeming@lyx.org>
 
        * lyx_gui.C (getStatus): changes due to replacement of lots of lfuns
index e8d5d767f727abf63a11d4ea000069643334fc03..cec245da3be44907e5854775fe9bfe1d75cb292f 100644 (file)
@@ -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"
 
 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));
index 4edb6a1bf3d28d2e66b6f4a01d4804584bd4f155..42921a58f2b5bbb30f90c00dd8706515804d934b 100644 (file)
@@ -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<ControlSpellchecker, QSpellchecker, NoRepeatedApplyReadOnlyPolicy, Qt2BC>
 SpellcheckerDialog;
 
-typedef GUI<ControlTexinfo, QTexinfo, OkCancelPolicy, Qt2BC>
-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();
-}
index f256e328934a6a0bd63ab8969c41759939065502..b57dde9a689101bfd14808a25fa10f54087ba973 100644 (file)
 
 using std::vector;
 
-typedef Qt2CB<ControlTexinfo, Qt2DB<QTexinfoDialog> > base_class;
+typedef QController<ControlTexinfo, QView<QTexinfoDialog> > base_class;
 
 
-QTexinfo::QTexinfo()
-       : base_class(_("LyX: LaTeX Information")),
+QTexinfo::QTexinfo(Dialog & parent)
+       : base_class(parent, _("LyX: LaTeX Information")),
          warningPosted(false), activeStyle(ControlTexinfo::cls)
 {
 }
index 0964a874d5c339957e19c7c6df53c2a3fced6643..e0102bd6993257c8a5471d5ffabb785b4f2b2521 100644 (file)
@@ -13,8 +13,7 @@
 #define QTEXINFO_H
 
 
-#include "Qt2Base.h"
-
+#include "QDialogView.h"
 #include "ControlTexinfo.h"
 
 #include <vector>
@@ -23,13 +22,12 @@ class QTexinfoDialog;
 
 ///
 class QTexinfo
-       : public Qt2CB<ControlTexinfo, Qt2DB<QTexinfoDialog> >
-{
+        : public QController<ControlTexinfo, QView<QTexinfoDialog> > {
 public:
        ///
        friend class QTexinfoDialog;
        ///
-       QTexinfo();
+       QTexinfo(Dialog &);
 private:
        /// Apply changes
        virtual void apply() {}
index beef238d5450b98b9be6192a5b0fd5c6e8e964d4..01d1e4cbb016bb3c3a5daa3bb8a307e5b5bb0e5e 100644 (file)
@@ -1,3 +1,10 @@
+2003-06-19  Angus Leeming  <leeming@lyx.org>
+
+       * Dialogs.C:
+       * Dialogs2.C:
+       * FormTexinfo.[Ch]:
+       * forms/form_texinfo.fd: changes to use the new Dialog-based scheme.
+
 2003-06-19  Juergen Spitzmueller <juergen.sp@t-online.de>
 
        * forms/form_preferences.fd Revert Rob Lahaye's patch. 
index 6eed624908014cf96ec23e128a34966239f8470a..19da7e5bcc26dd12aeed31bc391042f548b3f445 100644 (file)
@@ -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));
index 0aeab5f7713703e559b40062b5235650255e7531..fbfbe01dc36648fcd9dd1fd0e1972ef80658c3ad 100644 (file)
 #include "FormSpellchecker.h"
 #include "forms/form_spellchecker.h"
 
-#include "ControlTexinfo.h"
-#include "FormTexinfo.h"
-#include "forms/form_texinfo.h"
-
 typedef GUI<ControlDocument, FormDocument, NoRepeatedApplyReadOnlyPolicy, xformsBC>
 DocumentDialog;
 
@@ -79,8 +75,6 @@ SendtoDialog;
 typedef GUI<ControlSpellchecker, FormSpellchecker, NoRepeatedApplyReadOnlyPolicy, xformsBC>
 SpellcheckerDialog;
 
-typedef GUI<ControlTexinfo, FormTexinfo, OkCancelPolicy, xformsBC>
-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();
-}
index 08d664f46668e4955cded1975b33096a1c5df957..e6d703ad6601d0f3cba9fc22ff0f985a6487ef8d 100644 (file)
 
 using std::vector;
 
-typedef FormCB<ControlTexinfo, FormDB<FD_texinfo> > base_class;
-FormTexinfo::FormTexinfo()
-       : base_class(_("LaTeX Information")),
+typedef FormController<ControlTexinfo, FormView<FD_texinfo> > 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());
index 017555acd9a069ad899e5f4a8fd09a69484e06c8..e2f2b1c5d513eb59594f996a6305330b0e91dd9f 100644 (file)
 #define FORMTEXINFO_H
 
 
-#include "FormBase.h"
+#include "FormDialogView.h"
 #include "ControlTexinfo.h"
 
 struct FD_texinfo;
 
-class FormTexinfo : public FormCB<ControlTexinfo, FormDB<FD_texinfo> > {
+class FormTexinfo
+       : public FormController<ControlTexinfo, FormView<FD_texinfo> > {
 public:
        ///
-       FormTexinfo();
+       FormTexinfo(Dialog &);
 private:
        /// not needed
        virtual void apply() {}
index d682d83dee3f18780c5cfcec6b9e1399012ec954..653918776b2990dfebfc3821fd52898fd518697f 100644 (file)
@@ -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
 
 ==============================