]> git.lyx.org Git - features.git/commitdiff
Port the About LyX dialog to the Dialog scheme.
authorAngus Leeming <leeming@lyx.org>
Sun, 9 Mar 2003 20:29:58 +0000 (20:29 +0000)
committerAngus Leeming <leeming@lyx.org>
Sun, 9 Mar 2003 20:29:58 +0000 (20:29 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6403 a592a061-630c-0410-9148-cb99ea01b6c8

26 files changed:
src/ChangeLog
src/factory.C
src/frontends/ChangeLog
src/frontends/Dialogs.C
src/frontends/Dialogs.h
src/frontends/controllers/ChangeLog
src/frontends/controllers/ControlAboutlyx.C
src/frontends/controllers/ControlAboutlyx.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/Dialogs3.C
src/frontends/qt2/Dialogs_impl.h
src/frontends/qt2/QAbout.C
src/frontends/qt2/QAbout.h
src/frontends/xforms/ChangeLog
src/frontends/xforms/Dialogs.C
src/frontends/xforms/Dialogs2.C
src/frontends/xforms/Dialogs3.C
src/frontends/xforms/Dialogs_impl.h
src/frontends/xforms/FormAboutlyx.C
src/frontends/xforms/FormAboutlyx.h
src/frontends/xforms/forms/form_aboutlyx.fd
src/lyxfunc.C

index 4044b64c0b2d9aedc8ac176f1f0d60d8c2617db4..caedbc8f9387f6ab3ad7c12a7dd337cda1137665 100644 (file)
@@ -1,3 +1,8 @@
+2003-03-09  Angus Leeming  <leeming@lyx.org>
+
+       * lyxfunc.C (dispatch): call Dialogs::show("about") rather
+       than Dialogs::showAboutlyx().
+
 2003-03-09  Angus Leeming  <leeming@lyx.org>
 
        * factory.C (createInset): call Dialogs::show("tabularcreate") rather
index fed4967c1c91a1334ff96abdaa5bb8cc618d8ab0..90ef810555e9c397f0b4849250d405c8e6d583c9 100644 (file)
@@ -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:
index dd97fa7debea4c6872fb6c1c7a68cd06c8070bce..73efec778f1d1f11f38593bd9968821d9a4bc91e 100644 (file)
@@ -1,7 +1,14 @@
+2003-03-09  Angus Leeming  <leeming@lyx.org>
+
+       * Dialogs.h: remove showAboutlyx.
+       * guiapi.[Ch]: remove gui_showAboutlyx.
+
+       * Dialogs.[Ch] (show): new method for non-inset dialogs.
+
 2003-03-09  Angus Leeming  <leeming@lyx.org>
 
        * Dialogs.h: remove showTabularCreate.
-       * guiapi.[Ch]: remove gui_updateTabularCreate.
+       * guiapi.[Ch]: remove gui_showTabularCreate.
 
 2003-03-09  Angus Leeming  <leeming@lyx.org>
 
index 9d12d28e1c1ac8ac1122ec408506955e3262c290..dbc2aa8746b583c4e944a5be1ff29abbb0dddfe1 100644 (file)
@@ -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);
index 286b69d44199bad3f18b15c2054573651fbabbbd..1dfdb019a892c4887a410201abd9bf579e91c759 100644 (file)
@@ -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.
index 0be6b203eb660a573eb9a593a6c03dd6b7fe62f2..a0b903cd58593b22d69ccd1b6e3549812ae87da1 100644 (file)
@@ -1,3 +1,7 @@
+2003-03-09  Angus Leeming  <leeming@lyx.org>
+
+       * ControlAboutlyx.[Ch]: rewrite to use the Dialog-based scheme.
+
 2003-03-09  Angus Leeming  <leeming@lyx.org>
 
        * ControlTabularCreate.[Ch]: rewrite to use the Dialog-based scheme.
index e3ce154d08e284f066a8e0f7001af7c0768268a0..1887f0f63a851cb9c199a38e7dd178d966ad35dc 100644 (file)
@@ -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)
 {}
 
 
index 428cd8fd2db10010e110f603db6481d52999bdbb..ef6a998cee9371ad334d0035d442080d4c90cd38 100644 (file)
 #ifndef CONTROLABOUTLYX_H
 #define CONTROLABOUTLYX_H
 
-
-#include "ControlDialog_impl.h"
-#include "LString.h"
-
+#include "Dialog.h"
 #include <iosfwd>
 
 /** 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
index 6460cbf942d9db0c18d77eded545f86462d48f66..c2d90b71ef5ad3bfdd0ff813249c1665073edfbe 100644 (file)
@@ -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();
index 825077b57e4d13bab573fc6fafb8ba7cd0a2fa0a..597b13dea21a86249fd3f514f5b076b3cd74f30d 100644 (file)
@@ -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 &);
index 01e011c3df3139114c697659ad6f1a1513dd3a12..cd445fee3413c60d033176a966df6f5c972a5ecc 100644 (file)
@@ -1,3 +1,13 @@
+2003-03-09  Angus Leeming  <leeming@lyx.org>
+
+       * 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  <leeming@lyx.org>
 
        * Dialogs.C:
index 6415c9c6e5e5a12f7558825ca2d7fdd7355d66a1..dc64fb4a2753f903132573645b3d8e4e4167ca30 100644 (file)
@@ -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),
index e75d2801a324e79a591488d03a548b19be7dfb22..f2c6b10ffdba9916a5109af6754d6bf180b87032 100644 (file)
 #include "Dialogs_impl.h"
 
 
-void Dialogs::showAboutlyx()
-{
-       pimpl_->aboutlyx.controller().show();
-}
-
-
 void Dialogs::showMergeChanges()
 {
        pimpl_->changes.controller().show();
index 20d291d57914b508ce5d16d6d4350abd8c584f12..bac3b686f206f29d2dbc9008625b87fe03129e3b 100644 (file)
@@ -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<NoRepeatedApplyReadOnlyPolicy, Qt2BC>
 
 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);
index 81b04d50b5efce445600fbedcf5a24636d3953e9..1f06f2979884c570d48a60a644dfa9e563381aac 100644 (file)
@@ -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<ControlAboutlyx, QAbout, OkCancelPolicy, Qt2BC>
-AboutlyxDialog;
-
 typedef GUI<ControlChanges, QChanges, NoRepeatedApplyReadOnlyPolicy, Qt2BC>
 ChangesDialog;
 
@@ -126,7 +120,6 @@ VCLogFileDialog;
 struct Dialogs::Impl {
        Impl(LyXView & lv, Dialogs & d);
 
-       AboutlyxDialog      aboutlyx;
        ChangesDialog       changes;
        CharacterDialog     character;
        DocumentDialog      document;
index 54cbbc20d9d65a5669fb431bc2477b49a41d9f11..b464e4054f9181cb9a4d8db8e34958df69579108 100644 (file)
 
 using std::getline;
 
-typedef Qt2CB<ControlAboutlyx, Qt2DB<QAboutDialog> > base_class;
+typedef QController<ControlAboutlyx, QView<QAboutDialog> > base_class;
 
 
-QAbout::QAbout()
-       : base_class(qt_("About LyX"))
+QAbout::QAbout(Dialog & parent)
+       : base_class(parent, qt_("About LyX"))
 {
 }
 
index 5b884035ae799def577077485568ca88d3d7b004..473fb278c40718e228879f3a2e5b9f76a06080a4 100644 (file)
 #define FORMABOUT_H
 
 
-#include "Qt2Base.h"
+#include "QDialogView.h"
+
 
 class QAboutDialog;
 class ControlAboutlyx;
 
 class QAbout
-       : public Qt2CB<ControlAboutlyx, Qt2DB<QAboutDialog> >
+       : public QController<ControlAboutlyx, QView<QAboutDialog> >
 {
 public:
-       QAbout();
+       QAbout(Dialog &);
 private:
        /// not needed
        virtual void apply() {}
index cac71dffe66dab9336d355b6ee875c5bf100f2d6..5ca3a7c8123ad426276bb6ae20495605823a8e16 100644 (file)
@@ -1,3 +1,14 @@
+2003-03-09  Angus Leeming  <leeming@lyx.org>
+
+       * 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  <leeming@lyx.org>
 
        * Dialogs.C:
index e261b0b61ec65b7b455c54cf55439409d4c98019..f2fb43a93dae3b8e5193f732666b7b69695c42a8 100644 (file)
@@ -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),
index 5669d2b26dd6bbd56c4780062ba56e330137acc8..c272f3713bd68568e972d5e1f1a85d8064b95f24 100644 (file)
 #include "Dialogs_impl.h"
 
 
-void Dialogs::showAboutlyx()
-{
-       pimpl_->aboutlyx.controller().show();
-}
-
-
 void Dialogs::showMergeChanges()
 {
        pimpl_->changes.controller().show();
index 1e88ca944fb82e4d1b837be26c0fc925a11d2950..4d5460b9494273bede0ecd32c14520e676341944 100644 (file)
@@ -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<NoRepeatedApplyReadOnlyPolicy, xformsBC>
 
 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);
index daacd56ed415df4d6a3d71e355e3292f66c59b57..3386904f6b59a4c9559a036ff56cd457d8af2b7c 100644 (file)
 #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<ControlAboutlyx, FormAboutlyx, OkCancelPolicy, xformsBC>
-AboutlyxDialog;
-
 typedef GUI<ControlChanges, FormChanges, NoRepeatedApplyReadOnlyPolicy, xformsBC>
 ChangesDialog;
 
@@ -151,7 +144,6 @@ VCLogFileDialog;
 struct Dialogs::Impl {
        Impl(LyXView & lv, Dialogs & d);
 
-       AboutlyxDialog      aboutlyx;
        ChangesDialog       changes;
         CharacterDialog     character;
        DocumentDialog      document;
index b4cd7946fed963e171555c89bfcd7bb53f8c4a42..947de9bd419000b1da0211a495f71569d6773dac 100644 (file)
 #include FORMS_H_LOCATION
 
 
-typedef FormCB<ControlAboutlyx, FormDB<FD_aboutlyx> > base_class;
+typedef FormController<ControlAboutlyx, FormView<FD_aboutlyx> > base_class;
 
-FormAboutlyx::FormAboutlyx()
-       : base_class(_("About LyX"), false)
+FormAboutlyx::FormAboutlyx(Dialog & parent)
+       : base_class(parent, _("About LyX"), false)
 {}
 
 
index c73216a91d6125507789afeda735795b3a1c97b5..4eb32c627753b032431dc9f3b3c97844b1a30330 100644 (file)
@@ -14,7 +14,7 @@
 #define FORMABOUTLYX_H
 
 
-#include "FormBase.h"
+#include "FormDialogView.h"
 
 #include <boost/scoped_ptr.hpp>
 
@@ -26,10 +26,11 @@ struct FD_aboutlyx_license;
 
 /** This class provides an XForms implementation of the FormAboutlyx Dialog.
  */
-class FormAboutlyx : public FormCB<ControlAboutlyx, FormDB<FD_aboutlyx> > {
+class FormAboutlyx
+       : public FormController<ControlAboutlyx, FormView<FD_aboutlyx> > {
 public:
        ///
-       FormAboutlyx();
+       FormAboutlyx(Dialog &);
 
 private:
        /// not needed.
index 3c01dc10748249c3a918df4a331df1879eb4ecbd..16072a3c020951c94d45fa40154f5d920f249eea 100644 (file)
@@ -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
index 0092cc52960cefbd1c274716c2dec8130c377424..f762f743ce08dcae29edc53b7c3137ac33cfe4f2 100644 (file)
@@ -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: