]> git.lyx.org Git - features.git/commitdiff
consolidate showDialog() incarnations
authorAndré Pönitz <poenitz@gmx.net>
Sun, 18 Nov 2007 00:39:15 +0000 (00:39 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Sun, 18 Nov 2007 00:39:15 +0000 (00:39 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21662 a592a061-630c-0410-9148-cb99ea01b6c8

13 files changed:
src/BufferView.cpp
src/BufferView.h
src/LyXFunc.cpp
src/Text3.cpp
src/frontends/Delegates.h
src/frontends/KeyModifier.h
src/frontends/LyXView.h
src/frontends/qt4/GuiView.cpp
src/frontends/qt4/GuiView.h
src/insets/MailInset.cpp
src/mathed/InsetMathHull.cpp
src/mathed/InsetMathNest.cpp
src/mathed/InsetMathRef.cpp

index 83ce588a8b6dc314a59d04d1c0065334fe0220e5..1c911517aba6c9df19944cb8f36412e276bfd6b1 100644 (file)
@@ -1970,23 +1970,15 @@ void BufferView::message(docstring const & msg)
 void BufferView::showDialog(std::string const & name)
 {
        if (d->gui_)
-               d->gui_->showDialog(name);
+               d->gui_->showDialog(name, string());
 }
 
 
-void BufferView::showDialogWithData(std::string const & name,
-       std::string const & data)
-{
-       if (d->gui_)
-               d->gui_->showDialogWithData(name, data);
-}
-
-
-void BufferView::showInsetDialog(std::string const & name,
+void BufferView::showDialog(std::string const & name,
        std::string const & data, Inset * inset)
 {
        if (d->gui_)
-               d->gui_->showInsetDialog(name, data, inset);
+               d->gui_->showDialog(name, data, inset);
 }
 
 
index 426e8cf8a0407d32e055d19e507787dfea238d39..92fd31072796e555014eb17516865223c8b1c38a 100644 (file)
@@ -231,11 +231,8 @@ public:
 
        /// This signal is emitted when some dialog needs to be shown with
        /// some data.
-       void showDialogWithData(std::string const & name, std::string const & data);
-
-       /// This signal is emitted when some inset dialogs needs to be shown.
-       void showInsetDialog(std::string const & name, std::string const & data,
-               Inset * inset);
+       void showDialog(std::string const & name, std::string const & data,
+               Inset * inset = 0);
 
        /// This signal is emitted when some dialogs needs to be updated.
        void updateDialog(std::string const & name, std::string const & data);
index a743fd261a3ed33fd599e246ca17c5590b1a3cc8..5b96f93a464302e1a92b8c66495e1ea7cc16c0a7 100644 (file)
@@ -1080,7 +1080,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");
+                               lyx_view_->showDialog("sendto", string());
                        else
                                lyx_view_->buffer()->doExport(argument, false);
                        break;
@@ -1423,7 +1423,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        if (name == "character") {
                                data = freefont2string();
                                if (!data.empty())
-                                       lyx_view_->showDialogWithData("character", data);
+                                       lyx_view_->showDialog("character", data);
                        } else if (name == "latexlog") {
                                Buffer::LogType type; 
                                string const logfile = lyx_view_->buffer()->logName(&type);
@@ -1436,13 +1436,13 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                                        break;
                                }
                                data += Lexer::quoteString(logfile);
-                               lyx_view_->showDialogWithData("log", data);
+                               lyx_view_->showDialog("log", data);
                        } else if (name == "vclog") {
                                string const data = "vc " +
                                        Lexer::quoteString(lyx_view_->buffer()->lyxvc().getLogFile());
-                               lyx_view_->showDialogWithData("log", data);
+                               lyx_view_->showDialog("log", data);
                        } else
-                               lyx_view_->showDialogWithData(name, data);
+                               lyx_view_->showDialog(name, data);
                        break;
                }
 
index 18a5d42a66407342bd668793349ba34f89a4d3da..f400794e985a21345107f10e813f1d89638bb896 100644 (file)
@@ -1233,7 +1233,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                        content : cmd.argument();
                string const data = InsetCommandMailer::params2string("href", p);
                if (p["target"].empty()) {
-                       bv->showInsetDialog("href", data, 0);
+                       bv->showDialog("href", data);
                } else {
                        FuncRequest fr(LFUN_INSET_INSERT, data);
                        dispatch(cur, fr);
@@ -1250,7 +1250,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                string const data = InsetCommandMailer::params2string("label", p);
 
                if (cmd.argument().empty()) {
-                       bv->showInsetDialog("label", data, 0);
+                       bv->showDialog("label", data);
                } else {
                        FuncRequest fr(LFUN_INSET_INSERT, data);
                        dispatch(cur, fr);
@@ -1574,7 +1574,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                string data;
                params2string(cur.paragraph(), data);
                data = "show\n" + data;
-               bv->showDialogWithData("paragraph", data);
+               bv->showDialog("paragraph", data);
                break;
        }
 
@@ -1659,7 +1659,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                                arg = cur.selectionAsString(false);
                        }
                }
-               bv->showDialogWithData("thesaurus", to_utf8(arg));
+               bv->showDialog("thesaurus", to_utf8(arg));
                break;
        }
 
index 330b9aa4ff15955869ebccc99022fe0ddd07fae3..fc96786a3972e15fabb31a7d6f1c559fabd8f5b3 100644 (file)
@@ -29,17 +29,9 @@ public:
        /// This function is called when some message shows up.
        virtual void message(docstring const & msg) = 0;
 
-       /// This function is called when some dialog needs to be shown.
-       virtual void showDialog(std::string const & name) = 0;
-
-       /// This function is called when some dialog needs to be shown with
-       /// some data.
-       virtual void showDialogWithData(std::string const & name,
-               std::string const & data) = 0;
-
        /// This function is called when some inset dialogs needs to be shown.
-       virtual void showInsetDialog(std::string const & name,
-               std::string const & data, Inset * inset) = 0;
+       virtual void showDialog(std::string const & name,
+               std::string const & data, Inset * inset = 0) = 0;
 
        /// This function is called when some dialogs needs to be updated.
        virtual void updateDialog(std::string const & name,
index 7c8035f91ff784e85141573d2f32d785c9d08d43..0e04eb79d69d7d5f2bc1025d12a6fc34a29a59dd 100644 (file)
@@ -22,7 +22,7 @@ enum KeyModifier {
        NoModifier       = 0, //< no modifiers held
        ControlModifier  = 1, //< control button held
        AltModifier      = 2, //< alt/meta key held
-       ShiftModifier    =  4  //< shift key held
+       ShiftModifier    = 4  //< shift key held
 };
 
 
index d73677db1ab438c1007c5e1820a144df58fb68c1..8219f708942d9aad149499f565b535aec856d9d6 100644 (file)
@@ -16,8 +16,6 @@
 #include "frontends/Delegates.h"
 #include "support/strfwd.h"
 
-#include <string>
-
 namespace lyx {
 
 namespace support { class FileName; }
@@ -158,7 +156,7 @@ public:
            the current cursor position or modify an existing, 'open' inset?
        */
        virtual void showDialog(std::string const & name,
-               std::string const & data = std::string(), Inset * inset = 0) = 0;
+               std::string const & data, Inset * inset = 0) = 0;
 
        /** \param name == "citation", "bibtex" etc; an identifier used
            to update the contents of a particular dialog with \param data.
index 288c7b10b57adfc732270a9dbf608c3752864167..8eb4a016ebacd9b7bb6f84c2c240ad1d80e805b2 100644 (file)
@@ -960,24 +960,6 @@ void GuiView::errors(string const & error_type)
 }
 
 
-void GuiView::showDialog(std::string const & name)
-{
-       showDialog(name, string());
-}
-
-void GuiView::showDialogWithData(string const & name, string const & data)
-{
-       showDialog(name, data);
-}
-
-
-void GuiView::showInsetDialog(string const & name, string const & data,
-               Inset * inset)
-{
-       showDialog(name, data, inset);
-}
-
-
 void GuiView::updateDialog(string const & name, string const & data)
 {
        if (!isDialogVisible(name))
index 860cfae8df2a4ba55fad8c818cdb99f962b11d6b..774a5543cdc9ae4d914ed95ff91d390ea07caecb 100644 (file)
@@ -93,12 +93,6 @@ public:
        void structureChanged() { updateToc(); }
        ///@}
 
-       ////
-       void showDialog(std::string const & name);
-       void showDialogWithData(std::string const & name,
-               std::string const & data);
-       void showInsetDialog(std::string const & name,
-               std::string const & data, Inset * inset);
        
        /// called on timeout
        void autoSave();
@@ -244,7 +238,7 @@ public:
            the current cursor position or modify an existing, 'open' inset?
        */
        void showDialog(std::string const & name,
-               std::string const & data = std::string(), Inset * inset = 0);
+               std::string const & data, Inset * inset = 0);
 
        /** \param name == "citation", "bibtex" etc; an identifier used
            to update the contents of a particular dialog with \param data.
index 57658ab391782e7b4a3701fdbd514288a3683bdd..b8b24e4cb2f109cafbd06cf0e124d43d7bb44d6d 100644 (file)
@@ -28,7 +28,7 @@ using std::string;
 void MailInset::showDialog(BufferView * bv) const
 {
        BOOST_ASSERT(bv);
-       bv->showInsetDialog(name(), inset2string(bv->buffer()), &inset());
+       bv->showDialog(name(), inset2string(bv->buffer()), &inset());
 }
 
 
index 2b1c8883169917c7c1b9a4a3d18cdbc4fe85749d..967843c48c8b07c75ab99f7eea277406c1bc360c 100644 (file)
@@ -1097,7 +1097,7 @@ void InsetMathHull::doDispatch(Cursor & cur, FuncRequest & cmd)
                std::string const data = InsetCommandMailer::params2string("label", p);
 
                if (cmd.argument().empty())
-                       cur.bv().showInsetDialog("label", data, 0);
+                       cur.bv().showDialog("label", data);
                else {
                        FuncRequest fr(LFUN_INSET_INSERT, data);
                        dispatch(cur, fr);
index 69f75fde5322182c8cfd486411e1e3a52d8c7d96..00d38403d9f304d80810b12c0d10529e311cf303 100644 (file)
@@ -1028,7 +1028,7 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
                        InsetMathRef tmp(name);
                        data = tmp.createDialogStr(to_utf8(name));
                }
-               cur.bv().showInsetDialog(to_utf8(name), data, 0);
+               cur.bv().showDialog(to_utf8(name), data);
                break;
        }
 
index 48b74a8aa8ee0a5a82707c58bf5cdfe82db96c13..7aef781c47b88363f6d59a6e25058d8d831e8531 100644 (file)
@@ -86,7 +86,7 @@ void InsetMathRef::doDispatch(Cursor & cur, FuncRequest & cmd)
                if (cmd.button() == mouse_button::button1) {
                        // Eventually trigger dialog with button 3, not 1
                        string const data = createDialogStr("ref");
-                       cur.bv().showInsetDialog("ref", data, this);
+                       cur.bv().showDialog("ref", data, this);
                        break;
                }
                cur.undispatched();