]> git.lyx.org Git - features.git/commitdiff
Some more cleanup of LyXView:
authorAbdelrazak Younes <younes@lyx.org>
Wed, 21 Nov 2007 22:48:13 +0000 (22:48 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Wed, 21 Nov 2007 22:48:13 +0000 (22:48 +0000)
- transfer GuiBufferDelegate and GuiBufferViewDelegate to GuiView
- delete showDialog() and use LFUN_DIALOG_SHOW in LyXFunc::dispatch().

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21702 a592a061-630c-0410-9148-cb99ea01b6c8

src/LyXFunc.cpp
src/frontends/Delegates.h
src/frontends/LyXView.h
src/frontends/qt4/GuiView.h

index 5fcf92825e624b8ad9d4fe72f127462f6045ad2e..ee89ed58a651fb9c8bb8b831d72849e60e77a660 100644 (file)
@@ -875,6 +875,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                case LFUN_DIALOG_TOGGLE:
                case LFUN_DIALOG_DISCONNECT_INSET:
                case LFUN_DIALOG_HIDE:
+               case LFUN_DIALOG_SHOW:
                        BOOST_ASSERT(lyx_view_);
                        lyx_view_->dispatch(cmd);
                        break;
@@ -1038,7 +1039,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                case LFUN_BUFFER_EXPORT:
                        BOOST_ASSERT(lyx_view_ && lyx_view_->buffer());
                        if (argument == "custom")
-                               lyx_view_->showDialog("sendto", string());
+                               dispatch(FuncRequest(LFUN_DIALOG_SHOW, "sendto"));
                        else
                                lyx_view_->buffer()->doExport(argument, false);
                        break;
@@ -1467,7 +1468,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                                break;
                        } // end switch(code)
                        if (insetCodeOK)
-                               lyx_view_->showDialog(name, data, 0);
+                               dispatch(FuncRequest(LFUN_DIALOG_SHOW, name + " " + data));
                        break;
                }
 
index 1a41771e3dc7b9de264d3a84de4708376bd647ee..96c134bf56b706bf2f9fc152ea3e39f397ae8de8 100644 (file)
@@ -30,6 +30,18 @@ public:
        virtual void message(docstring const & msg) = 0;
 
        /// This function is called when some inset dialogs needs to be shown.
+       /** \param name == "bibtex", "citation" etc; an identifier used to
+           launch a particular dialog.
+           \param data is a string representation of the Inset contents.
+           It is often little more than the output from Inset::write.
+           It is passed to, and parsed by, the frontend dialog.
+           Several of these dialogs do not need any data.
+           \param inset ownership is _not_ passed to the frontend dialog.
+           It is stored internally and used by the kernel to ascertain
+           what to do with the FuncRequest dispatched from the frontend
+           dialog on 'Apply'; should it be used to create a new inset at
+           the current cursor position or modify an existing, 'open' inset?
+       */
        virtual void showDialog(std::string const & name,
                std::string const & data, Inset * inset = 0) = 0;
 
index 91f564971ba4adcd177999c21e839795ec4c608a..9f4a5da46ccd501df6da4158589b131ce0100cd8 100644 (file)
@@ -42,7 +42,6 @@ namespace frontend {
  * in a single LyXView.
  */
 class LyXView
-       : public GuiBufferViewDelegate, public GuiBufferDelegate
 {
 public:
        ///
@@ -90,22 +89,6 @@ public:
        // This View's Dialogs
        //
        
-       /** \param name == "bibtex", "citation" etc; an identifier used to
-           launch a particular dialog.
-           \param data is a string representation of the Inset contents.
-           It is often little more than the output from Inset::write.
-           It is passed to, and parsed by, the frontend dialog.
-           Several of these dialogs do not need any data,
-           so it defaults to string().
-           \param inset ownership is _not_ passed to the frontend dialog.
-           It is stored internally and used by the kernel to ascertain
-           what to do with the FuncRequest dispatched from the frontend
-           dialog on 'Apply'; should it be used to create a new inset at
-           the current cursor position or modify an existing, 'open' inset?
-       */
-       virtual void showDialog(std::string const & name,
-               std::string const & data, Inset * inset = 0) = 0;
-
        ///
        virtual void disconnectDialog(std::string const & name) = 0;
        ///
index b4e548fbbaa5551c09322e3b42a77b55fcac97c6..5196876381ec8e9332ea3e1754a06bea72ffd4f2 100644 (file)
@@ -49,7 +49,8 @@ class GuiWorkArea;
  * is deleted. This might be useful for closing other dialogs
  * depending on a given GuiView.
  */
-class GuiView : public QMainWindow, public LyXView
+class GuiView : public QMainWindow, public LyXView, public GuiBufferViewDelegate,
+       public GuiBufferDelegate
 {
        Q_OBJECT
 public: