diff --git a/src/LyXFunc.cpp b/src/LyXFunc.cpp index ee89ed58a6..704c970ed2 100644 --- a/src/LyXFunc.cpp +++ b/src/LyXFunc.cpp @@ -539,6 +539,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const case LFUN_DIALOG_SHOW: case LFUN_DIALOG_UPDATE: case LFUN_TOOLBAR_TOGGLE: + case LFUN_INSET_APPLY: if (lyx_view_) return lyx_view_->getStatus(cmd); enable = false; @@ -586,29 +587,6 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const && (!buf->isClean() || buf->isExternallyModified(Buffer::timestamp_method)); break; - case LFUN_INSET_APPLY: { - if (!view()) { - enable = false; - break; - } - string const name = cmd.getArg(0); - Inset * inset = lyx_view_->getOpenInset(name); - if (inset) { - FuncRequest fr(LFUN_INSET_MODIFY, cmd.argument()); - FuncStatus fs; - if (!inset->getStatus(view()->cursor(), fr, fs)) { - // Every inset is supposed to handle this - BOOST_ASSERT(false); - } - flag |= fs; - } else { - FuncRequest fr(LFUN_INSET_INSERT, cmd.argument()); - flag |= getStatus(fr); - } - enable = flag.enabled(); - break; - } - case LFUN_CITATION_INSERT: { FuncRequest fr(LFUN_INSET_INSERT, "citation"); enable = getStatus(fr).enabled(); @@ -876,8 +854,11 @@ void LyXFunc::dispatch(FuncRequest const & cmd) case LFUN_DIALOG_DISCONNECT_INSET: case LFUN_DIALOG_HIDE: case LFUN_DIALOG_SHOW: + case LFUN_INSET_APPLY: BOOST_ASSERT(lyx_view_); lyx_view_->dispatch(cmd); + if (lyx_view_->view()) + updateFlags = lyx_view_->view()->cursor().result().update(); break; case LFUN_WORD_FIND_FORWARD: @@ -1672,23 +1653,6 @@ void LyXFunc::dispatch(FuncRequest const & cmd) break; } - case LFUN_INSET_APPLY: { - BOOST_ASSERT(lyx_view_); - string const name = cmd.getArg(0); - Inset * inset = lyx_view_->getOpenInset(name); - if (inset) { - FuncRequest fr(LFUN_INSET_MODIFY, argument); - inset->dispatch(view()->cursor(), fr); - } else { - FuncRequest fr(LFUN_INSET_INSERT, argument); - dispatch(fr); - } - // ideally, the update flag should be set by the insets, - // but this is not possible currently - updateFlags = Update::Force | Update::FitCursor; - break; - } - case LFUN_ALL_INSETS_TOGGLE: { BOOST_ASSERT(lyx_view_); string action; diff --git a/src/frontends/LyXView.h b/src/frontends/LyXView.h index 9f4a5da46c..59d0cf9aa9 100644 --- a/src/frontends/LyXView.h +++ b/src/frontends/LyXView.h @@ -74,7 +74,7 @@ public: /// virtual FuncStatus getStatus(FuncRequest const & cmd) = 0; - /// dispatch to current BufferView + /// dispatch command. virtual void dispatch(FuncRequest const & cmd) = 0; /// @@ -85,15 +85,6 @@ public: // virtual void errors(std::string const &) = 0; - // - // This View's Dialogs - // - - /// - virtual void disconnectDialog(std::string const & name) = 0; - /// - virtual Inset * getOpenInset(std::string const & name) const = 0; - private: /// noncopyable LyXView(LyXView const &); diff --git a/src/frontends/qt4/Dialog.cpp b/src/frontends/qt4/Dialog.cpp index edfe72e44e..7eaf6a03ae 100644 --- a/src/frontends/qt4/Dialog.cpp +++ b/src/frontends/qt4/Dialog.cpp @@ -12,13 +12,13 @@ #include "Dialog.h" +#include "GuiView.h" + #include "Buffer.h" #include "FuncRequest.h" #include "FuncStatus.h" #include "LyXFunc.h" -#include "LyXView.h" - namespace lyx { namespace frontend { diff --git a/src/frontends/qt4/Dialog.h b/src/frontends/qt4/Dialog.h index 485df55ee8..94454c74d8 100644 --- a/src/frontends/qt4/Dialog.h +++ b/src/frontends/qt4/Dialog.h @@ -24,7 +24,7 @@ class FuncRequest; namespace frontend { -class LyXView; +class GuiView; /** \enum KernelDocType used to flag the different kinds of buffer * without making the kernel header files available to the @@ -47,7 +47,7 @@ public: /// \param lv is the access point for the dialog to the LyX kernel. /// \param name is the identifier given to the dialog by its parent /// container. - Dialog(LyXView & lv) : lyxview_(&lv) {} + Dialog(GuiView & lv) : lyxview_(&lv) {} virtual ~Dialog(); /** \name Container Access @@ -215,8 +215,8 @@ public: * We should aim to reduce/remove these from the interface. */ //@{ - LyXView & lyxview() { return *lyxview_; } - LyXView const & lyxview() const { return *lyxview_; } + GuiView & lyxview() { return *lyxview_; } + GuiView const & lyxview() const { return *lyxview_; } Buffer & buffer(); Buffer const & buffer() const; @@ -229,7 +229,7 @@ protected: virtual void apply() {} private: - LyXView * lyxview_; + GuiView * lyxview_; private: /// intentionally unimplemented, therefore uncopiable diff --git a/src/frontends/qt4/GuiAbout.cpp b/src/frontends/qt4/GuiAbout.cpp index 9fd2e49bdc..7d6fa2d15d 100644 --- a/src/frontends/qt4/GuiAbout.cpp +++ b/src/frontends/qt4/GuiAbout.cpp @@ -95,7 +95,7 @@ static QString version() } -GuiAbout::GuiAbout(LyXView & lv) +GuiAbout::GuiAbout(GuiView & lv) : GuiDialog(lv, "aboutlyx") { setupUi(this); @@ -114,7 +114,7 @@ GuiAbout::GuiAbout(LyXView & lv) } -Dialog * createGuiAbout(LyXView & lv) { return new GuiAbout(lv); } +Dialog * createGuiAbout(GuiView & lv) { return new GuiAbout(lv); } } // namespace frontend diff --git a/src/frontends/qt4/GuiAbout.h b/src/frontends/qt4/GuiAbout.h index 8391002309..9b88d765af 100644 --- a/src/frontends/qt4/GuiAbout.h +++ b/src/frontends/qt4/GuiAbout.h @@ -24,7 +24,7 @@ class GuiAbout : public GuiDialog, public Ui::AboutUi public: // Constructor - GuiAbout(LyXView & lv); + GuiAbout(GuiView & lv); // Controller stuff bool initialiseParams(std::string const &) { return true; } diff --git a/src/frontends/qt4/GuiBibitem.cpp b/src/frontends/qt4/GuiBibitem.cpp index 6ae2b30c07..4c651cec46 100644 --- a/src/frontends/qt4/GuiBibitem.cpp +++ b/src/frontends/qt4/GuiBibitem.cpp @@ -23,7 +23,7 @@ namespace lyx { namespace frontend { -GuiBibitem::GuiBibitem(LyXView & lv) +GuiBibitem::GuiBibitem(GuiView & lv) : GuiCommand(lv, "bibitem") { setupUi(this); @@ -78,7 +78,7 @@ bool GuiBibitem::isValid() } -Dialog * createGuiBibitem(LyXView & lv) { return new GuiBibitem(lv); } +Dialog * createGuiBibitem(GuiView & lv) { return new GuiBibitem(lv); } } // namespace frontend diff --git a/src/frontends/qt4/GuiBibitem.h b/src/frontends/qt4/GuiBibitem.h index 489f86af28..dfc18a1d1b 100644 --- a/src/frontends/qt4/GuiBibitem.h +++ b/src/frontends/qt4/GuiBibitem.h @@ -26,7 +26,7 @@ class GuiBibitem : public GuiCommand, public Ui::BibitemUi Q_OBJECT public: - GuiBibitem(LyXView & lv); + GuiBibitem(GuiView & lv); private Q_SLOTS: void change_adaptor(); diff --git a/src/frontends/qt4/GuiBibtex.cpp b/src/frontends/qt4/GuiBibtex.cpp index 32bcc23aa7..da9bb06732 100644 --- a/src/frontends/qt4/GuiBibtex.cpp +++ b/src/frontends/qt4/GuiBibtex.cpp @@ -53,7 +53,7 @@ using support::split; using support::trim; -GuiBibtex::GuiBibtex(LyXView & lv) +GuiBibtex::GuiBibtex(GuiView & lv) : GuiCommand(lv, "bibtex") { setupUi(this); @@ -495,7 +495,7 @@ string const GuiBibtex::getStylefile() const } -Dialog * createGuiBibtex(LyXView & lv) { return new GuiBibtex(lv); } +Dialog * createGuiBibtex(GuiView & lv) { return new GuiBibtex(lv); } } // namespace frontend diff --git a/src/frontends/qt4/GuiBibtex.h b/src/frontends/qt4/GuiBibtex.h index 52aebfc0b0..b015cb91b7 100644 --- a/src/frontends/qt4/GuiBibtex.h +++ b/src/frontends/qt4/GuiBibtex.h @@ -44,7 +44,7 @@ class GuiBibtex : public GuiCommand, public Ui::BibtexUi Q_OBJECT public: - GuiBibtex(LyXView & lv); + GuiBibtex(GuiView & lv); private Q_SLOTS: void change_adaptor(); diff --git a/src/frontends/qt4/GuiBox.cpp b/src/frontends/qt4/GuiBox.cpp index 2ec93db89c..7da5e6dd12 100644 --- a/src/frontends/qt4/GuiBox.cpp +++ b/src/frontends/qt4/GuiBox.cpp @@ -73,7 +73,7 @@ void box_gui_tokens_special_length(vector & ids, } -GuiBox::GuiBox(LyXView & lv) +GuiBox::GuiBox(GuiView & lv) : GuiDialog(lv, "box"), params_("") { setupUi(this); @@ -436,7 +436,7 @@ void GuiBox::dispatchParams() } -Dialog * createGuiBox(LyXView & lv) { return new GuiBox(lv); } +Dialog * createGuiBox(GuiView & lv) { return new GuiBox(lv); } } // namespace frontend diff --git a/src/frontends/qt4/GuiBox.h b/src/frontends/qt4/GuiBox.h index be9874df47..0c293da123 100644 --- a/src/frontends/qt4/GuiBox.h +++ b/src/frontends/qt4/GuiBox.h @@ -28,7 +28,7 @@ class GuiBox : public GuiDialog, public Ui::BoxUi Q_OBJECT public: - GuiBox(LyXView & lv); + GuiBox(GuiView & lv); private Q_SLOTS: void change_adaptor(); diff --git a/src/frontends/qt4/GuiBranch.cpp b/src/frontends/qt4/GuiBranch.cpp index 515bdf9c12..b7aa73a7cb 100644 --- a/src/frontends/qt4/GuiBranch.cpp +++ b/src/frontends/qt4/GuiBranch.cpp @@ -33,7 +33,7 @@ using std::vector; namespace lyx { namespace frontend { -GuiBranch::GuiBranch(LyXView & lv) +GuiBranch::GuiBranch(GuiView & lv) : GuiDialog(lv, "branch") { setupUi(this); @@ -111,7 +111,7 @@ void GuiBranch::dispatchParams() } -Dialog * createGuiBranch(LyXView & lv) { return new GuiBranch(lv); } +Dialog * createGuiBranch(GuiView & lv) { return new GuiBranch(lv); } } // namespace frontend diff --git a/src/frontends/qt4/GuiBranch.h b/src/frontends/qt4/GuiBranch.h index 52f195613e..e33e151a73 100644 --- a/src/frontends/qt4/GuiBranch.h +++ b/src/frontends/qt4/GuiBranch.h @@ -27,7 +27,7 @@ class GuiBranch : public GuiDialog, public Ui::BranchUi Q_OBJECT public: - GuiBranch(LyXView & lv); + GuiBranch(GuiView & lv); private Q_SLOTS: void change_adaptor(); diff --git a/src/frontends/qt4/GuiChanges.cpp b/src/frontends/qt4/GuiChanges.cpp index e5587819b2..b99865736c 100644 --- a/src/frontends/qt4/GuiChanges.cpp +++ b/src/frontends/qt4/GuiChanges.cpp @@ -36,7 +36,7 @@ namespace frontend { using support::bformat; -GuiChanges::GuiChanges(LyXView & lv) +GuiChanges::GuiChanges(GuiView & lv) : GuiDialog(lv, "changes") { setupUi(this); @@ -124,7 +124,7 @@ void GuiChanges::rejectChange() } -Dialog * createGuiChanges(LyXView & lv) { return new GuiChanges(lv); } +Dialog * createGuiChanges(GuiView & lv) { return new GuiChanges(lv); } } // namespace frontend diff --git a/src/frontends/qt4/GuiChanges.h b/src/frontends/qt4/GuiChanges.h index 816dd03ddb..a1579a5ee8 100644 --- a/src/frontends/qt4/GuiChanges.h +++ b/src/frontends/qt4/GuiChanges.h @@ -26,7 +26,7 @@ class GuiChanges : public GuiDialog, public Ui::ChangesUi Q_OBJECT public: - GuiChanges(LyXView & lv); + GuiChanges(GuiView & lv); protected Q_SLOTS: /// accept the current change diff --git a/src/frontends/qt4/GuiCharacter.cpp b/src/frontends/qt4/GuiCharacter.cpp index de3be8fd5a..b8d5044fde 100644 --- a/src/frontends/qt4/GuiCharacter.cpp +++ b/src/frontends/qt4/GuiCharacter.cpp @@ -270,7 +270,7 @@ static vector const getFamilyData() } -GuiCharacter::GuiCharacter(LyXView & lv) +GuiCharacter::GuiCharacter(GuiView & lv) : GuiDialog(lv, "character"), font_(ignore_font), toggleall_(false), reset_lang_(false) { @@ -594,7 +594,7 @@ void GuiCharacter::setLanguage(string const & val) } -Dialog * createGuiCharacter(LyXView & lv) { return new GuiCharacter(lv); } +Dialog * createGuiCharacter(GuiView & lv) { return new GuiCharacter(lv); } } // namespace frontend diff --git a/src/frontends/qt4/GuiCharacter.h b/src/frontends/qt4/GuiCharacter.h index b2035cba51..faf9716f4c 100644 --- a/src/frontends/qt4/GuiCharacter.h +++ b/src/frontends/qt4/GuiCharacter.h @@ -51,7 +51,7 @@ class GuiCharacter : public GuiDialog, public Ui::CharacterUi Q_OBJECT public: - GuiCharacter(LyXView & lv); + GuiCharacter(GuiView & lv); protected Q_SLOTS: void change_adaptor(); diff --git a/src/frontends/qt4/GuiCitation.cpp b/src/frontends/qt4/GuiCitation.cpp index 975b470d62..4610839a5d 100644 --- a/src/frontends/qt4/GuiCitation.cpp +++ b/src/frontends/qt4/GuiCitation.cpp @@ -75,7 +75,7 @@ static vector to_docstring_vector(QStringList const & qlist) } -GuiCitation::GuiCitation(LyXView & lv) +GuiCitation::GuiCitation(GuiView & lv) : GuiCommand(lv, "citation") { setupUi(this); @@ -741,7 +741,7 @@ vector GuiCitation::searchKeys( } -Dialog * createGuiCitation(LyXView & lv) { return new GuiCitation(lv); } +Dialog * createGuiCitation(GuiView & lv) { return new GuiCitation(lv); } } // namespace frontend diff --git a/src/frontends/qt4/GuiCitation.h b/src/frontends/qt4/GuiCitation.h index dc3b18ae98..de2655a453 100644 --- a/src/frontends/qt4/GuiCitation.h +++ b/src/frontends/qt4/GuiCitation.h @@ -34,7 +34,7 @@ class GuiCitation : public GuiCommand, public Ui::CitationUi public: /// - GuiCitation(LyXView & lv); + GuiCitation(GuiView & lv); /// void applyView(); diff --git a/src/frontends/qt4/GuiDelimiter.cpp b/src/frontends/qt4/GuiDelimiter.cpp index c5d3089223..7182870f2f 100644 --- a/src/frontends/qt4/GuiDelimiter.cpp +++ b/src/frontends/qt4/GuiDelimiter.cpp @@ -69,7 +69,7 @@ namespace lyx { namespace frontend { -GuiDelimiter::GuiDelimiter(LyXView & lv) +GuiDelimiter::GuiDelimiter(GuiView & lv) : GuiMath(lv, "mathdelimiter") { setupUi(this); @@ -243,7 +243,7 @@ void GuiDelimiter::on_matchCB_stateChanged(int state) } -Dialog * createGuiDelimiter(LyXView & lv) { return new GuiDelimiter(lv); } +Dialog * createGuiDelimiter(GuiView & lv) { return new GuiDelimiter(lv); } } // namespace frontend diff --git a/src/frontends/qt4/GuiDelimiter.h b/src/frontends/qt4/GuiDelimiter.h index 9521ffaa3f..62843742b7 100644 --- a/src/frontends/qt4/GuiDelimiter.h +++ b/src/frontends/qt4/GuiDelimiter.h @@ -25,7 +25,7 @@ class GuiDelimiter : public GuiMath, public Ui::DelimiterUi Q_OBJECT public: - GuiDelimiter(LyXView & lv); + GuiDelimiter(GuiView & lv); public Q_SLOTS: void on_leftLW_itemActivated(QListWidgetItem *); diff --git a/src/frontends/qt4/GuiDialog.cpp b/src/frontends/qt4/GuiDialog.cpp index ec4bd1188d..42d2109d7a 100644 --- a/src/frontends/qt4/GuiDialog.cpp +++ b/src/frontends/qt4/GuiDialog.cpp @@ -13,7 +13,6 @@ #include "GuiDialog.h" #include "debug.h" #include "qt_helpers.h" -#include "frontends/LyXView.h" #include #include @@ -24,7 +23,7 @@ using std::string; namespace lyx { namespace frontend { -GuiDialog::GuiDialog(LyXView & lv, std::string const & name) +GuiDialog::GuiDialog(GuiView & lv, std::string const & name) : Dialog(lv), is_closing_(false), name_(name) {} @@ -265,7 +264,7 @@ using std::string; namespace lyx { namespace frontend { -GuiCommand::GuiCommand(LyXView & lv, string const & name) +GuiCommand::GuiCommand(GuiView & lv, string const & name) : GuiDialog(lv, name), params_(insetCode(name)), lfun_name_(name) { } diff --git a/src/frontends/qt4/GuiDialog.h b/src/frontends/qt4/GuiDialog.h index 29f450e3a2..ee53bf22ae 100644 --- a/src/frontends/qt4/GuiDialog.h +++ b/src/frontends/qt4/GuiDialog.h @@ -37,7 +37,7 @@ public: /// \param lv is the access point for the dialog to the LyX kernel. /// \param name is the identifier given to the dialog by its parent /// container. - explicit GuiDialog(LyXView & lv, std::string const & name); + explicit GuiDialog(GuiView & lv, std::string const & name); ~GuiDialog(); public Q_SLOTS: @@ -141,7 +141,7 @@ class GuiCommand : public GuiDialog public: /// We need to know with what sort of inset we're associated. // FIXME This should probably be an InsetCode - GuiCommand(LyXView &, std::string const & name); + GuiCommand(GuiView &, std::string const & name); /// bool initialiseParams(std::string const & data); /// clean-up on hide. diff --git a/src/frontends/qt4/GuiDocument.cpp b/src/frontends/qt4/GuiDocument.cpp index a1617053b2..f3a6888f80 100644 --- a/src/frontends/qt4/GuiDocument.cpp +++ b/src/frontends/qt4/GuiDocument.cpp @@ -212,7 +212,7 @@ void PreambleModule::closeEvent(QCloseEvent * e) -GuiDocument::GuiDocument(LyXView & lv) +GuiDocument::GuiDocument(GuiView & lv) : GuiDialog(lv, "document") { setupUi(this); @@ -1841,7 +1841,7 @@ void GuiDocument::loadModuleNames () } -Dialog * createGuiDocument(LyXView & lv) { return new GuiDocument(lv); } +Dialog * createGuiDocument(GuiView & lv) { return new GuiDocument(lv); } } // namespace frontend diff --git a/src/frontends/qt4/GuiDocument.h b/src/frontends/qt4/GuiDocument.h index fcab1802f1..27261011e6 100644 --- a/src/frontends/qt4/GuiDocument.h +++ b/src/frontends/qt4/GuiDocument.h @@ -75,7 +75,7 @@ class GuiDocument : public GuiDialog, public Ui::DocumentUi { Q_OBJECT public: - GuiDocument(LyXView & lv); + GuiDocument(GuiView & lv); void updateParams(BufferParams const & params); void apply(BufferParams & params); diff --git a/src/frontends/qt4/GuiERT.cpp b/src/frontends/qt4/GuiERT.cpp index 70beaaf90a..f3ee865e3e 100644 --- a/src/frontends/qt4/GuiERT.cpp +++ b/src/frontends/qt4/GuiERT.cpp @@ -24,7 +24,7 @@ namespace lyx { namespace frontend { -GuiERT::GuiERT(LyXView & lv) +GuiERT::GuiERT(GuiView & lv) : GuiDialog(lv, "ert"), status_(InsetERT::Collapsed) { setupUi(this); @@ -91,7 +91,7 @@ void GuiERT::dispatchParams() } -Dialog * createGuiERT(LyXView & lv) { return new GuiERT(lv); } +Dialog * createGuiERT(GuiView & lv) { return new GuiERT(lv); } } // namespace frontend diff --git a/src/frontends/qt4/GuiERT.h b/src/frontends/qt4/GuiERT.h index 040a89dc4a..aad5f12464 100644 --- a/src/frontends/qt4/GuiERT.h +++ b/src/frontends/qt4/GuiERT.h @@ -24,7 +24,7 @@ class GuiERT : public GuiDialog, public Ui::ERTUi Q_OBJECT public: - GuiERT(LyXView & lv); + GuiERT(GuiView & lv); private Q_SLOTS: void change_adaptor(); diff --git a/src/frontends/qt4/GuiErrorList.cpp b/src/frontends/qt4/GuiErrorList.cpp index 54a035f006..968e11e4e4 100644 --- a/src/frontends/qt4/GuiErrorList.cpp +++ b/src/frontends/qt4/GuiErrorList.cpp @@ -37,7 +37,7 @@ namespace frontend { using support::bformat; -GuiErrorList::GuiErrorList(LyXView & lv) +GuiErrorList::GuiErrorList(GuiView & lv) : GuiDialog(lv, "errorlist") { setupUi(this); @@ -133,7 +133,7 @@ void GuiErrorList::goTo(int item) } -Dialog * createGuiErrorList(LyXView & lv) { return new GuiErrorList(lv); } +Dialog * createGuiErrorList(GuiView & lv) { return new GuiErrorList(lv); } } // namespace frontend } // namespace lyx diff --git a/src/frontends/qt4/GuiErrorList.h b/src/frontends/qt4/GuiErrorList.h index 26ec430fbe..cddea246aa 100644 --- a/src/frontends/qt4/GuiErrorList.h +++ b/src/frontends/qt4/GuiErrorList.h @@ -26,7 +26,7 @@ class GuiErrorList : public GuiDialog, public Ui::ErrorListUi Q_OBJECT public: - GuiErrorList(LyXView & lv); + GuiErrorList(GuiView & lv); public Q_SLOTS: /// select an entry diff --git a/src/frontends/qt4/GuiExternal.cpp b/src/frontends/qt4/GuiExternal.cpp index 9b2ab0bd06..10d4f35670 100644 --- a/src/frontends/qt4/GuiExternal.cpp +++ b/src/frontends/qt4/GuiExternal.cpp @@ -100,7 +100,7 @@ char const * const origin_gui_strs[] = { } // namespace anon -GuiExternal::GuiExternal(LyXView & lv) +GuiExternal::GuiExternal(GuiView & lv) : GuiDialog(lv, "external"), bbChanged_(false) { setupUi(this); @@ -831,7 +831,7 @@ string const GuiExternal::readBB(string const & file) } -Dialog * createGuiExternal(LyXView & lv) { return new GuiExternal(lv); } +Dialog * createGuiExternal(GuiView & lv) { return new GuiExternal(lv); } } // namespace frontend diff --git a/src/frontends/qt4/GuiExternal.h b/src/frontends/qt4/GuiExternal.h index b5ae2becee..36eec3ae58 100644 --- a/src/frontends/qt4/GuiExternal.h +++ b/src/frontends/qt4/GuiExternal.h @@ -41,7 +41,7 @@ class GuiExternal : public GuiDialog, public Ui::ExternalUi Q_OBJECT public: - GuiExternal(LyXView & lv); + GuiExternal(GuiView & lv); private Q_SLOTS: void bbChanged(); diff --git a/src/frontends/qt4/GuiFloat.cpp b/src/frontends/qt4/GuiFloat.cpp index 660d047414..6ac3cf7d54 100644 --- a/src/frontends/qt4/GuiFloat.cpp +++ b/src/frontends/qt4/GuiFloat.cpp @@ -26,7 +26,7 @@ using std::string; namespace lyx { namespace frontend { -GuiFloat::GuiFloat(LyXView & lv) +GuiFloat::GuiFloat(GuiView & lv) : GuiDialog(lv, "float") { setupUi(this); @@ -99,7 +99,7 @@ void GuiFloat::dispatchParams() } -Dialog * createGuiFloat(LyXView & lv) { return new GuiFloat(lv); } +Dialog * createGuiFloat(GuiView & lv) { return new GuiFloat(lv); } } // namespace frontend diff --git a/src/frontends/qt4/GuiFloat.h b/src/frontends/qt4/GuiFloat.h index 3bb23aab0d..fe820f2d86 100644 --- a/src/frontends/qt4/GuiFloat.h +++ b/src/frontends/qt4/GuiFloat.h @@ -25,7 +25,7 @@ class GuiFloat : public GuiDialog, public Ui::FloatUi Q_OBJECT public: - GuiFloat(LyXView & lv); + GuiFloat(GuiView & lv); private Q_SLOTS: void change_adaptor(); diff --git a/src/frontends/qt4/GuiGraphics.cpp b/src/frontends/qt4/GuiGraphics.cpp index 5eb0fba11f..2170c7f35f 100644 --- a/src/frontends/qt4/GuiGraphics.cpp +++ b/src/frontends/qt4/GuiGraphics.cpp @@ -132,7 +132,7 @@ typedef std::pair RotationOriginPair; std::vector getRotationOriginData(); -GuiGraphics::GuiGraphics(LyXView & lv) +GuiGraphics::GuiGraphics(GuiView & lv) : GuiDialog(lv, "graphics") { setupUi(this); @@ -870,7 +870,7 @@ vector getRotationOriginData() } -Dialog * createGuiGraphics(LyXView & lv) { return new GuiGraphics(lv); } +Dialog * createGuiGraphics(GuiView & lv) { return new GuiGraphics(lv); } } // namespace frontend diff --git a/src/frontends/qt4/GuiGraphics.h b/src/frontends/qt4/GuiGraphics.h index f88df2629e..a80074e70b 100644 --- a/src/frontends/qt4/GuiGraphics.h +++ b/src/frontends/qt4/GuiGraphics.h @@ -32,14 +32,12 @@ class InsetGraphicsParams; namespace frontend { -class LyXView; - class GuiGraphics : public GuiDialog, public Ui::GraphicsUi { Q_OBJECT public: - GuiGraphics(LyXView & lv); + GuiGraphics(GuiView & lv); void setAutoText(); private Q_SLOTS: diff --git a/src/frontends/qt4/GuiHyperlink.cpp b/src/frontends/qt4/GuiHyperlink.cpp index b94e08138d..b7e7382b5e 100644 --- a/src/frontends/qt4/GuiHyperlink.cpp +++ b/src/frontends/qt4/GuiHyperlink.cpp @@ -26,7 +26,7 @@ namespace lyx { namespace frontend { -GuiHyperlink::GuiHyperlink(LyXView & lv) +GuiHyperlink::GuiHyperlink(GuiView & lv) : GuiCommand(lv, "href") { setupUi(this); @@ -107,7 +107,7 @@ bool GuiHyperlink::isValid() } -Dialog * createGuiHyperlink(LyXView & lv) { return new GuiHyperlink(lv); } +Dialog * createGuiHyperlink(GuiView & lv) { return new GuiHyperlink(lv); } } // namespace frontend diff --git a/src/frontends/qt4/GuiHyperlink.h b/src/frontends/qt4/GuiHyperlink.h index ac018ae318..24d709fb4b 100644 --- a/src/frontends/qt4/GuiHyperlink.h +++ b/src/frontends/qt4/GuiHyperlink.h @@ -25,7 +25,7 @@ class GuiHyperlink : public GuiCommand, public Ui::HyperlinkUi Q_OBJECT public: - GuiHyperlink(LyXView & lv); + GuiHyperlink(GuiView & lv); public Q_SLOTS: void changed_adaptor(); diff --git a/src/frontends/qt4/GuiInclude.cpp b/src/frontends/qt4/GuiInclude.cpp index 02d6aae374..976755e62d 100644 --- a/src/frontends/qt4/GuiInclude.cpp +++ b/src/frontends/qt4/GuiInclude.cpp @@ -57,7 +57,7 @@ using support::getStringFromVector; using support::getVectorFromString; -GuiInclude::GuiInclude(LyXView & lv) +GuiInclude::GuiInclude(GuiView & lv) : GuiCommand(lv, "include") { setupUi(this); @@ -358,7 +358,7 @@ void GuiInclude::edit(string const & file) } -Dialog * createGuiInclude(LyXView & lv) { return new GuiInclude(lv); } +Dialog * createGuiInclude(GuiView & lv) { return new GuiInclude(lv); } } // namespace frontend diff --git a/src/frontends/qt4/GuiInclude.h b/src/frontends/qt4/GuiInclude.h index 5007be8ba7..91383900ed 100644 --- a/src/frontends/qt4/GuiInclude.h +++ b/src/frontends/qt4/GuiInclude.h @@ -30,7 +30,7 @@ class GuiInclude : public GuiCommand, public Ui::IncludeUi Q_OBJECT public: - GuiInclude(LyXView & lv); + GuiInclude(GuiView & lv); private Q_SLOTS: void change_adaptor(); diff --git a/src/frontends/qt4/GuiIndex.cpp b/src/frontends/qt4/GuiIndex.cpp index 4dbba0e45b..477ed544cb 100644 --- a/src/frontends/qt4/GuiIndex.cpp +++ b/src/frontends/qt4/GuiIndex.cpp @@ -32,7 +32,7 @@ namespace frontend { // ///////////////////////////////////////////////////////////////// -GuiIndexDialogBase::GuiIndexDialogBase(LyXView & lv, +GuiIndexDialogBase::GuiIndexDialogBase(GuiView & lv, docstring const & title, QString const & label, std::string const & name) : GuiCommand(lv, name) { @@ -118,7 +118,7 @@ bool GuiIndexDialogBase::isValid() ///////////////////////////////////////////////////////////////// -GuiIndex::GuiIndex(LyXView & lv) +GuiIndex::GuiIndex(GuiView & lv) : GuiIndexDialogBase(lv, _("Index Entry"), qt_("&Keyword:"), "index") { keywordED->setWhatsThis( qt_( @@ -139,7 +139,7 @@ GuiIndex::GuiIndex(LyXView & lv) } -Dialog * createGuiIndex(LyXView & lv) { return new GuiIndex(lv); } +Dialog * createGuiIndex(GuiView & lv) { return new GuiIndex(lv); } ///////////////////////////////////////////////////////////////// @@ -148,12 +148,12 @@ Dialog * createGuiIndex(LyXView & lv) { return new GuiIndex(lv); } // ///////////////////////////////////////////////////////////////// -GuiLabel::GuiLabel(LyXView & lv) +GuiLabel::GuiLabel(GuiView & lv) : GuiIndexDialogBase(lv, _("Label"), qt_("&Label:"), "label") {} -Dialog * createGuiLabel(LyXView & lv) { return new GuiLabel(lv); } +Dialog * createGuiLabel(GuiView & lv) { return new GuiLabel(lv); } } // namespace frontend diff --git a/src/frontends/qt4/GuiIndex.h b/src/frontends/qt4/GuiIndex.h index f354ac2c85..6d2b5e9a27 100644 --- a/src/frontends/qt4/GuiIndex.h +++ b/src/frontends/qt4/GuiIndex.h @@ -24,7 +24,7 @@ class GuiIndexDialogBase : public GuiCommand, public Ui::IndexUi Q_OBJECT public: - GuiIndexDialogBase(LyXView & lv, docstring const & title, + GuiIndexDialogBase(GuiView & lv, docstring const & title, QString const & label, std::string const & name); private Q_SLOTS: @@ -49,14 +49,14 @@ private: class GuiIndex : public GuiIndexDialogBase { public: - GuiIndex(LyXView & lv); + GuiIndex(GuiView & lv); }; class GuiLabel : public GuiIndexDialogBase { public: - GuiLabel(LyXView & lv); + GuiLabel(GuiView & lv); }; diff --git a/src/frontends/qt4/GuiListings.cpp b/src/frontends/qt4/GuiListings.cpp index 831efbc2ea..fbd6ac373a 100644 --- a/src/frontends/qt4/GuiListings.cpp +++ b/src/frontends/qt4/GuiListings.cpp @@ -165,7 +165,7 @@ char const * font_styles_gui[] = -GuiListings::GuiListings(LyXView & lv) +GuiListings::GuiListings(GuiView & lv) : GuiDialog(lv, "listings") { setupUi(this); @@ -642,7 +642,7 @@ void GuiListings::setParams(InsetListingsParams const & params) } -Dialog * createGuiListings(LyXView & lv) { return new GuiListings(lv); } +Dialog * createGuiListings(GuiView & lv) { return new GuiListings(lv); } } // namespace frontend diff --git a/src/frontends/qt4/GuiListings.h b/src/frontends/qt4/GuiListings.h index 400b867e38..653fbcd760 100644 --- a/src/frontends/qt4/GuiListings.h +++ b/src/frontends/qt4/GuiListings.h @@ -23,7 +23,7 @@ class GuiListings : public GuiDialog, public Ui::ListingsUi { Q_OBJECT public: - GuiListings(LyXView & lv); + GuiListings(GuiView & lv); /// get values from all the widgets and form a string std::string construct_params(); /// validate listings parameters and return an error message, if any diff --git a/src/frontends/qt4/GuiLog.cpp b/src/frontends/qt4/GuiLog.cpp index 438ecb6099..12067c0df9 100644 --- a/src/frontends/qt4/GuiLog.cpp +++ b/src/frontends/qt4/GuiLog.cpp @@ -102,7 +102,7 @@ void LogHighlighter::highlightBlock(QString const & text) // ///////////////////////////////////////////////////////////////////// -GuiLog::GuiLog(LyXView & lv) +GuiLog::GuiLog(GuiView & lv) : GuiDialog(lv, "log"), type_(LatexLog) { setupUi(this); @@ -237,7 +237,7 @@ void GuiLog::on_copyPB_clicked() } -Dialog * createGuiLog(LyXView & lv) { return new GuiLog(lv); } +Dialog * createGuiLog(GuiView & lv) { return new GuiLog(lv); } } // namespace frontend diff --git a/src/frontends/qt4/GuiLog.h b/src/frontends/qt4/GuiLog.h index bce4b9b6b6..3e4de5abbb 100644 --- a/src/frontends/qt4/GuiLog.h +++ b/src/frontends/qt4/GuiLog.h @@ -29,7 +29,7 @@ class GuiLog : public GuiDialog, public Ui::LogUi Q_OBJECT public: - GuiLog(LyXView & lv); + GuiLog(GuiView & lv); private Q_SLOTS: void updateContents(); diff --git a/src/frontends/qt4/GuiMath.cpp b/src/frontends/qt4/GuiMath.cpp index e64243d7f9..5929a5923e 100644 --- a/src/frontends/qt4/GuiMath.cpp +++ b/src/frontends/qt4/GuiMath.cpp @@ -20,7 +20,7 @@ using std::map; namespace lyx { namespace frontend { -GuiMath::GuiMath(LyXView & lv, std::string const & name) +GuiMath::GuiMath(GuiView & lv, std::string const & name) : GuiDialog(lv, name) { // FIXME: Ideally, those unicode codepoints would be defined diff --git a/src/frontends/qt4/GuiMath.h b/src/frontends/qt4/GuiMath.h index 9aae1c265a..0f516b75d8 100644 --- a/src/frontends/qt4/GuiMath.h +++ b/src/frontends/qt4/GuiMath.h @@ -36,7 +36,7 @@ struct MathSymbol { class GuiMath : public GuiDialog { public: - GuiMath(LyXView & lv, std::string const & name); + GuiMath(GuiView & lv, std::string const & name); /// Nothing to initialise in this case. bool initialiseParams(std::string const &) { return true; } diff --git a/src/frontends/qt4/GuiMathMatrix.cpp b/src/frontends/qt4/GuiMathMatrix.cpp index 6137e4e1f3..dc6331c1f5 100644 --- a/src/frontends/qt4/GuiMathMatrix.cpp +++ b/src/frontends/qt4/GuiMathMatrix.cpp @@ -28,7 +28,7 @@ using std::string; namespace lyx { namespace frontend { -GuiMathMatrix::GuiMathMatrix(LyXView & lv) +GuiMathMatrix::GuiMathMatrix(GuiView & lv) : GuiMath(lv, "mathmatrix") { setupUi(this); @@ -109,7 +109,7 @@ void GuiMathMatrix::slotClose() } -Dialog * createGuiMathMatrix(LyXView & lv) { return new GuiMathMatrix(lv); } +Dialog * createGuiMathMatrix(GuiView & lv) { return new GuiMathMatrix(lv); } } // namespace frontend diff --git a/src/frontends/qt4/GuiMathMatrix.h b/src/frontends/qt4/GuiMathMatrix.h index 197581b1a9..cbe11c17d2 100644 --- a/src/frontends/qt4/GuiMathMatrix.h +++ b/src/frontends/qt4/GuiMathMatrix.h @@ -27,7 +27,7 @@ class GuiMathMatrix : public GuiMath, public Ui::MathMatrixUi Q_OBJECT public: - GuiMathMatrix(LyXView & lv); + GuiMathMatrix(GuiView & lv); public Q_SLOTS: void slotOK(); diff --git a/src/frontends/qt4/GuiMenubar.cpp b/src/frontends/qt4/GuiMenubar.cpp index a06be19ae9..2574c9ed33 100644 --- a/src/frontends/qt4/GuiMenubar.cpp +++ b/src/frontends/qt4/GuiMenubar.cpp @@ -37,8 +37,8 @@ namespace frontend { // MacOSX specific stuff is at the end. -GuiMenubar::GuiMenubar(LyXView * view, MenuBackend & mbe) - : owner_(static_cast(view)), menubackend_(mbe) +GuiMenubar::GuiMenubar(GuiView * view, MenuBackend & mbe) + : owner_(view), menubackend_(mbe) { init(); } diff --git a/src/frontends/qt4/GuiMenubar.h b/src/frontends/qt4/GuiMenubar.h index fd48ea3ccf..e4e11312a2 100644 --- a/src/frontends/qt4/GuiMenubar.h +++ b/src/frontends/qt4/GuiMenubar.h @@ -26,13 +26,13 @@ namespace frontend { class GuiView; class GuiPopupMenu; -class LyXView; +class GuiView; class GuiMenubar : public QObject { Q_OBJECT public: - GuiMenubar(LyXView *, MenuBackend &); + GuiMenubar(GuiView *, MenuBackend &); ~GuiMenubar(); diff --git a/src/frontends/qt4/GuiNomencl.cpp b/src/frontends/qt4/GuiNomencl.cpp index 02b06ec0be..77d1118fb9 100644 --- a/src/frontends/qt4/GuiNomencl.cpp +++ b/src/frontends/qt4/GuiNomencl.cpp @@ -28,7 +28,7 @@ using std::string; namespace lyx { namespace frontend { -GuiNomenclature::GuiNomenclature(LyXView & lv) +GuiNomenclature::GuiNomenclature(GuiView & lv) : GuiCommand(lv, "nomenclature") { setupUi(this); @@ -99,7 +99,7 @@ bool GuiNomenclature::isValid() } -Dialog * createGuiNomenclature(LyXView & lv) +Dialog * createGuiNomenclature(GuiView & lv) { return new GuiNomenclature(lv); } diff --git a/src/frontends/qt4/GuiNomencl.h b/src/frontends/qt4/GuiNomencl.h index c8735f5775..c9fa2cb825 100644 --- a/src/frontends/qt4/GuiNomencl.h +++ b/src/frontends/qt4/GuiNomencl.h @@ -25,7 +25,7 @@ class GuiNomenclature : public GuiCommand, public Ui::NomenclUi Q_OBJECT public: - GuiNomenclature(LyXView & lv); + GuiNomenclature(GuiView & lv); private Q_SLOTS: void change_adaptor(); diff --git a/src/frontends/qt4/GuiNote.cpp b/src/frontends/qt4/GuiNote.cpp index 6f56ac1828..64fc29bd69 100644 --- a/src/frontends/qt4/GuiNote.cpp +++ b/src/frontends/qt4/GuiNote.cpp @@ -25,7 +25,7 @@ using std::string; namespace lyx { namespace frontend { -GuiNote::GuiNote(LyXView & lv) +GuiNote::GuiNote(GuiView & lv) : GuiDialog(lv, "note") { setupUi(this); @@ -115,7 +115,7 @@ void GuiNote::dispatchParams() } -Dialog * createGuiNote(LyXView & lv) { return new GuiNote(lv); } +Dialog * createGuiNote(GuiView & lv) { return new GuiNote(lv); } } // namespace frontend diff --git a/src/frontends/qt4/GuiNote.h b/src/frontends/qt4/GuiNote.h index d4cb92942c..25525e3a6c 100644 --- a/src/frontends/qt4/GuiNote.h +++ b/src/frontends/qt4/GuiNote.h @@ -23,7 +23,7 @@ class GuiNote : public GuiDialog, public Ui::NoteUi { Q_OBJECT public: - GuiNote(LyXView & lv); + GuiNote(GuiView & lv); private Q_SLOTS: void change_adaptor(); private: diff --git a/src/frontends/qt4/GuiParagraph.cpp b/src/frontends/qt4/GuiParagraph.cpp index 9e26f5cc2a..713f5e084b 100644 --- a/src/frontends/qt4/GuiParagraph.cpp +++ b/src/frontends/qt4/GuiParagraph.cpp @@ -48,7 +48,7 @@ using std::endl; namespace lyx { namespace frontend { -GuiParagraph::GuiParagraph(LyXView & lv) +GuiParagraph::GuiParagraph(GuiView & lv) : Dialog(lv) { setupUi(this); @@ -328,7 +328,7 @@ LyXAlignment GuiParagraph::alignDefault() const } -Dialog * createGuiParagraph(LyXView & lv) +Dialog * createGuiParagraph(GuiView & lv) { #if 0 GuiView & guiview = static_cast(lv); diff --git a/src/frontends/qt4/GuiParagraph.h b/src/frontends/qt4/GuiParagraph.h index 4ea59f1c6c..a8ff105014 100644 --- a/src/frontends/qt4/GuiParagraph.h +++ b/src/frontends/qt4/GuiParagraph.h @@ -42,7 +42,7 @@ class GuiParagraph { Q_OBJECT public: - GuiParagraph(LyXView & lv); + GuiParagraph(GuiView & lv); /// update void updateView(); diff --git a/src/frontends/qt4/GuiPrefs.cpp b/src/frontends/qt4/GuiPrefs.cpp index 6c6fb64b24..30ada5a3e2 100644 --- a/src/frontends/qt4/GuiPrefs.cpp +++ b/src/frontends/qt4/GuiPrefs.cpp @@ -2117,7 +2117,7 @@ void PrefIdentity::update(LyXRC const & rc) // ///////////////////////////////////////////////////////////////////// -GuiPreferences::GuiPreferences(LyXView & lv) +GuiPreferences::GuiPreferences(GuiView & lv) : GuiDialog(lv, "prefs"), update_screen_font_(false) { setupUi(this); @@ -2386,7 +2386,7 @@ int GuiPreferences::fromPaperSize(PAPER_SIZE papersize) const } -Dialog * createGuiPreferences(LyXView & lv) { return new GuiPreferences(lv); } +Dialog * createGuiPreferences(GuiView & lv) { return new GuiPreferences(lv); } } // namespace frontend diff --git a/src/frontends/qt4/GuiPrefs.h b/src/frontends/qt4/GuiPrefs.h index ff51d7a306..dcba32be36 100644 --- a/src/frontends/qt4/GuiPrefs.h +++ b/src/frontends/qt4/GuiPrefs.h @@ -426,7 +426,7 @@ class GuiPreferences : public GuiDialog, public Ui::PrefsUi { Q_OBJECT public: - GuiPreferences(LyXView & lv); + GuiPreferences(GuiView & lv); void apply(LyXRC & rc) const; void updateRc(LyXRC const & rc); diff --git a/src/frontends/qt4/GuiPrint.cpp b/src/frontends/qt4/GuiPrint.cpp index c57c977efc..5ff6f0ee05 100644 --- a/src/frontends/qt4/GuiPrint.cpp +++ b/src/frontends/qt4/GuiPrint.cpp @@ -42,7 +42,7 @@ namespace frontend { using support::FileFilterList; -GuiPrint::GuiPrint(LyXView & lv) +GuiPrint::GuiPrint(GuiView & lv) : GuiDialog(lv, "print") { setupUi(this); @@ -257,7 +257,7 @@ void GuiPrint::dispatchParams() } -Dialog * createGuiPrint(LyXView & lv) { return new GuiPrint(lv); } +Dialog * createGuiPrint(GuiView & lv) { return new GuiPrint(lv); } } // namespace frontend diff --git a/src/frontends/qt4/GuiPrint.h b/src/frontends/qt4/GuiPrint.h index 169752896a..3d793500fc 100644 --- a/src/frontends/qt4/GuiPrint.h +++ b/src/frontends/qt4/GuiPrint.h @@ -30,7 +30,7 @@ class GuiPrint : public GuiDialog, public Ui::PrintUi Q_OBJECT public: - GuiPrint(LyXView & lv); + GuiPrint(GuiView & lv); private Q_SLOTS: void change_adaptor(); diff --git a/src/frontends/qt4/GuiRef.cpp b/src/frontends/qt4/GuiRef.cpp index 364e7be739..b0ae6958cc 100644 --- a/src/frontends/qt4/GuiRef.cpp +++ b/src/frontends/qt4/GuiRef.cpp @@ -42,7 +42,7 @@ namespace frontend { using support::makeAbsPath; using support::makeDisplayPath; -GuiRef::GuiRef(LyXView & lv) +GuiRef::GuiRef(GuiView & lv) : GuiCommand(lv, "ref") { setupUi(this); @@ -372,7 +372,7 @@ void GuiRef::gotoBookmark() } -Dialog * createGuiRef(LyXView & lv) { return new GuiRef(lv); } +Dialog * createGuiRef(GuiView & lv) { return new GuiRef(lv); } } // namespace frontend diff --git a/src/frontends/qt4/GuiRef.h b/src/frontends/qt4/GuiRef.h index b5b8e03b56..f1bb9f9e3c 100644 --- a/src/frontends/qt4/GuiRef.h +++ b/src/frontends/qt4/GuiRef.h @@ -29,7 +29,7 @@ class GuiRef : public GuiCommand, public Ui::RefUi Q_OBJECT public: - GuiRef(LyXView & lv); + GuiRef(GuiView & lv); private Q_SLOTS: void changed_adaptor(); diff --git a/src/frontends/qt4/GuiSearch.cpp b/src/frontends/qt4/GuiSearch.cpp index d2ed6de03b..ee6bdfda72 100644 --- a/src/frontends/qt4/GuiSearch.cpp +++ b/src/frontends/qt4/GuiSearch.cpp @@ -38,7 +38,7 @@ static void uniqueInsert(QComboBox * box, QString const & text) } -GuiSearch::GuiSearch(LyXView & lv) +GuiSearch::GuiSearch(GuiView & lv) : GuiDialog(lv, "findreplace") { setupUi(this); @@ -142,7 +142,7 @@ void GuiSearch::replace(docstring const & search, docstring const & replace, dispatch(FuncRequest(LFUN_WORD_REPLACE, data)); } -Dialog * createGuiSearch(LyXView & lv) { return new GuiSearch(lv); } +Dialog * createGuiSearch(GuiView & lv) { return new GuiSearch(lv); } } // namespace frontend diff --git a/src/frontends/qt4/GuiSearch.h b/src/frontends/qt4/GuiSearch.h index 73c5d40644..9f6f0d969a 100644 --- a/src/frontends/qt4/GuiSearch.h +++ b/src/frontends/qt4/GuiSearch.h @@ -24,7 +24,7 @@ class GuiSearch : public GuiDialog, public Ui::SearchUi Q_OBJECT public: - GuiSearch(LyXView & lv); + GuiSearch(GuiView & lv); private Q_SLOTS: void findChanged(); diff --git a/src/frontends/qt4/GuiSendto.cpp b/src/frontends/qt4/GuiSendto.cpp index 6e6452350c..c6cc0d62b2 100644 --- a/src/frontends/qt4/GuiSendto.cpp +++ b/src/frontends/qt4/GuiSendto.cpp @@ -36,7 +36,7 @@ namespace frontend { using support::trim; -GuiSendTo::GuiSendTo(LyXView & lv) +GuiSendTo::GuiSendTo(GuiView & lv) : GuiDialog(lv, "sendto") { setupUi(this); @@ -190,7 +190,7 @@ vector GuiSendTo::allFormats() const } -Dialog * createGuiSendTo(LyXView & lv) { return new GuiSendTo(lv); } +Dialog * createGuiSendTo(GuiView & lv) { return new GuiSendTo(lv); } } // namespace frontend diff --git a/src/frontends/qt4/GuiSendto.h b/src/frontends/qt4/GuiSendto.h index 644971fdc6..595f5b815a 100644 --- a/src/frontends/qt4/GuiSendto.h +++ b/src/frontends/qt4/GuiSendto.h @@ -31,7 +31,7 @@ class GuiSendTo : public GuiDialog, public Ui::SendtoUi Q_OBJECT public: - GuiSendTo(LyXView & lv); + GuiSendTo(GuiView & lv); private Q_SLOTS: void changed_adaptor(); diff --git a/src/frontends/qt4/GuiShowFile.cpp b/src/frontends/qt4/GuiShowFile.cpp index 9bdec5dba0..ed0b6b2b27 100644 --- a/src/frontends/qt4/GuiShowFile.cpp +++ b/src/frontends/qt4/GuiShowFile.cpp @@ -27,7 +27,7 @@ namespace frontend { using support::FileName; using support::onlyFilename; -GuiShowFile::GuiShowFile(LyXView & lv) +GuiShowFile::GuiShowFile(GuiView & lv) : GuiDialog(lv, "file") { setupUi(this); @@ -72,7 +72,7 @@ void GuiShowFile::clearParams() } -Dialog * createGuiShowFile(LyXView & lv) { return new GuiShowFile(lv); } +Dialog * createGuiShowFile(GuiView & lv) { return new GuiShowFile(lv); } } // namespace frontend diff --git a/src/frontends/qt4/GuiShowFile.h b/src/frontends/qt4/GuiShowFile.h index 1287597884..b8dad883b1 100644 --- a/src/frontends/qt4/GuiShowFile.h +++ b/src/frontends/qt4/GuiShowFile.h @@ -26,7 +26,7 @@ class GuiShowFile : public GuiDialog, public Ui::ShowFileUi Q_OBJECT public: - GuiShowFile(LyXView & lv); + GuiShowFile(GuiView & lv); private: /// diff --git a/src/frontends/qt4/GuiSpellchecker.cpp b/src/frontends/qt4/GuiSpellchecker.cpp index c223bf095e..daff427e85 100644 --- a/src/frontends/qt4/GuiSpellchecker.cpp +++ b/src/frontends/qt4/GuiSpellchecker.cpp @@ -66,7 +66,7 @@ namespace frontend { using support::bformat; using support::contains; -GuiSpellchecker::GuiSpellchecker(LyXView & lv) +GuiSpellchecker::GuiSpellchecker(GuiView & lv) : GuiDialog(lv, "spellchecker"), exitEarly_(false), oldval_(0), newvalue_(0), count_(0), speller_(0) { @@ -491,7 +491,7 @@ void GuiSpellchecker::ignoreAll() } -Dialog * createGuiSpellchecker(LyXView & lv) { return new GuiSpellchecker(lv); } +Dialog * createGuiSpellchecker(GuiView & lv) { return new GuiSpellchecker(lv); } } // namespace frontend } // namespace lyx diff --git a/src/frontends/qt4/GuiSpellchecker.h b/src/frontends/qt4/GuiSpellchecker.h index fc58b0f741..b0e6862f19 100644 --- a/src/frontends/qt4/GuiSpellchecker.h +++ b/src/frontends/qt4/GuiSpellchecker.h @@ -32,7 +32,7 @@ class GuiSpellchecker : public GuiDialog, public Ui::SpellcheckerUi Q_OBJECT public: - GuiSpellchecker(LyXView & lv); + GuiSpellchecker(GuiView & lv); ~GuiSpellchecker(); public Q_SLOTS: diff --git a/src/frontends/qt4/GuiTabular.cpp b/src/frontends/qt4/GuiTabular.cpp index e3a3186734..7d8e1b1ba8 100644 --- a/src/frontends/qt4/GuiTabular.cpp +++ b/src/frontends/qt4/GuiTabular.cpp @@ -37,7 +37,7 @@ using std::string; namespace lyx { namespace frontend { -GuiTabular::GuiTabular(LyXView & lv) +GuiTabular::GuiTabular(GuiView & lv) : GuiDialog(lv, "tabular") { active_cell_ = Tabular::npos; @@ -1155,7 +1155,7 @@ void GuiTabular::longTabular(bool yes) } -Dialog * createGuiTabular(LyXView & lv) { return new GuiTabular(lv); } +Dialog * createGuiTabular(GuiView & lv) { return new GuiTabular(lv); } } // namespace frontend diff --git a/src/frontends/qt4/GuiTabular.h b/src/frontends/qt4/GuiTabular.h index 23a976a3c7..e7ab37149b 100644 --- a/src/frontends/qt4/GuiTabular.h +++ b/src/frontends/qt4/GuiTabular.h @@ -27,7 +27,7 @@ class GuiTabular : public GuiDialog, public Ui::TabularUi Q_OBJECT public: - GuiTabular(LyXView & lv); + GuiTabular(GuiView & lv); ~GuiTabular(); private Q_SLOTS: diff --git a/src/frontends/qt4/GuiTabularCreate.cpp b/src/frontends/qt4/GuiTabularCreate.cpp index 76f4362e3d..2a8b5f6436 100644 --- a/src/frontends/qt4/GuiTabularCreate.cpp +++ b/src/frontends/qt4/GuiTabularCreate.cpp @@ -27,7 +27,7 @@ using std::string; namespace lyx { namespace frontend { -GuiTabularCreate::GuiTabularCreate(LyXView & lv) +GuiTabularCreate::GuiTabularCreate(GuiView & lv) : GuiDialog(lv, "tabularcreate") { setupUi(this); @@ -91,7 +91,7 @@ void GuiTabularCreate::dispatchParams() } -Dialog * createGuiTabularCreate(LyXView & lv) +Dialog * createGuiTabularCreate(GuiView & lv) { return new GuiTabularCreate(lv); } diff --git a/src/frontends/qt4/GuiTabularCreate.h b/src/frontends/qt4/GuiTabularCreate.h index a56001a66c..63c04ea010 100644 --- a/src/frontends/qt4/GuiTabularCreate.h +++ b/src/frontends/qt4/GuiTabularCreate.h @@ -26,7 +26,7 @@ class GuiTabularCreate : public GuiDialog, public Ui::TabularCreateUi Q_OBJECT public: - GuiTabularCreate(LyXView & lv); + GuiTabularCreate(GuiView & lv); private Q_SLOTS: void columnsChanged(int); diff --git a/src/frontends/qt4/GuiTexinfo.cpp b/src/frontends/qt4/GuiTexinfo.cpp index 9c9b6f49a5..252a97f411 100644 --- a/src/frontends/qt4/GuiTexinfo.cpp +++ b/src/frontends/qt4/GuiTexinfo.cpp @@ -85,7 +85,7 @@ static string texFileFromList(string const & file, string const & type) } -GuiTexInfo::GuiTexInfo(LyXView & lv) +GuiTexInfo::GuiTexInfo(GuiView & lv) : GuiDialog(lv, "texinfo") { setupUi(this); @@ -240,7 +240,7 @@ string GuiTexInfo::fileType(TexFileType type) const } -Dialog * createGuiTexInfo(LyXView & lv) { return new GuiTexInfo(lv); } +Dialog * createGuiTexInfo(GuiView & lv) { return new GuiTexInfo(lv); } } // namespace frontend diff --git a/src/frontends/qt4/GuiTexinfo.h b/src/frontends/qt4/GuiTexinfo.h index 59d2143369..8231f1c210 100644 --- a/src/frontends/qt4/GuiTexinfo.h +++ b/src/frontends/qt4/GuiTexinfo.h @@ -30,7 +30,7 @@ class GuiTexInfo : public GuiDialog, public Ui::TexinfoUi public: /// - GuiTexInfo(LyXView & lv); + GuiTexInfo(GuiView & lv); /// the file extensions. order matters in GuiTexInfo::fileType() enum TexFileType { ClsType, StyType, BstType }; diff --git a/src/frontends/qt4/GuiThesaurus.cpp b/src/frontends/qt4/GuiThesaurus.cpp index 3cc0de64cc..7267b070d1 100644 --- a/src/frontends/qt4/GuiThesaurus.cpp +++ b/src/frontends/qt4/GuiThesaurus.cpp @@ -31,7 +31,7 @@ using std::string; namespace lyx { namespace frontend { -GuiThesaurus::GuiThesaurus(LyXView & lv) +GuiThesaurus::GuiThesaurus(GuiView & lv) : GuiDialog(lv, "thesaurus") { setupUi(this); @@ -185,7 +185,7 @@ Thesaurus::Meanings const & GuiThesaurus::getMeanings(docstring const & str) } -Dialog * createGuiThesaurus(LyXView & lv) { return new GuiThesaurus(lv); } +Dialog * createGuiThesaurus(GuiView & lv) { return new GuiThesaurus(lv); } } // namespace frontend diff --git a/src/frontends/qt4/GuiThesaurus.h b/src/frontends/qt4/GuiThesaurus.h index 4a3d5f9210..e5671fba36 100644 --- a/src/frontends/qt4/GuiThesaurus.h +++ b/src/frontends/qt4/GuiThesaurus.h @@ -26,7 +26,7 @@ class GuiThesaurus : public GuiDialog, public Ui::ThesaurusUi Q_OBJECT public: - GuiThesaurus(LyXView & lv); + GuiThesaurus(GuiView & lv); private Q_SLOTS: void change_adaptor(); diff --git a/src/frontends/qt4/GuiToc.cpp b/src/frontends/qt4/GuiToc.cpp index 27ac5d0601..7e3ca23da1 100644 --- a/src/frontends/qt4/GuiToc.cpp +++ b/src/frontends/qt4/GuiToc.cpp @@ -229,7 +229,7 @@ void GuiToc::dispatchParams() } -Dialog * createGuiToc(LyXView & lv) +Dialog * createGuiToc(GuiView & lv) { GuiView & guiview = static_cast(lv); #ifdef Q_WS_MACX diff --git a/src/frontends/qt4/GuiVSpace.cpp b/src/frontends/qt4/GuiVSpace.cpp index f691ff0080..3dcb45dab1 100644 --- a/src/frontends/qt4/GuiVSpace.cpp +++ b/src/frontends/qt4/GuiVSpace.cpp @@ -40,7 +40,7 @@ using std::string; namespace lyx { namespace frontend { -GuiVSpace::GuiVSpace(LyXView & lv) +GuiVSpace::GuiVSpace(GuiView & lv) : GuiDialog(lv, "vspace") { setupUi(this); @@ -196,7 +196,7 @@ void GuiVSpace::dispatchParams() } -Dialog * createGuiVSpace(LyXView & lv) { return new GuiVSpace(lv); } +Dialog * createGuiVSpace(GuiView & lv) { return new GuiVSpace(lv); } } // namespace frontend diff --git a/src/frontends/qt4/GuiVSpace.h b/src/frontends/qt4/GuiVSpace.h index a583f6213b..b46eecd01d 100644 --- a/src/frontends/qt4/GuiVSpace.h +++ b/src/frontends/qt4/GuiVSpace.h @@ -27,7 +27,7 @@ class GuiVSpace : public GuiDialog, public Ui::VSpaceUi Q_OBJECT public: - GuiVSpace(LyXView & lv); + GuiVSpace(GuiView & lv); private Q_SLOTS: /// diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 1be09b5392..950631194f 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -981,6 +981,29 @@ FuncStatus GuiView::getStatus(FuncRequest const & cmd) break; } + case LFUN_INSET_APPLY: { + if (!buf) { + enable = false; + break; + } + string const name = cmd.getArg(0); + Inset * inset = getOpenInset(name); + if (inset) { + FuncRequest fr(LFUN_INSET_MODIFY, cmd.argument()); + FuncStatus fs; + if (!inset->getStatus(view()->cursor(), fr, fs)) { + // Every inset is supposed to handle this + BOOST_ASSERT(false); + } + flag |= fs; + } else { + FuncRequest fr(LFUN_INSET_INSERT, cmd.argument()); + flag |= getStatus(fr); + } + enable = flag.enabled(); + break; + } + default: if (!view()) { enable = false; @@ -997,7 +1020,9 @@ FuncStatus GuiView::getStatus(FuncRequest const & cmd) void GuiView::dispatch(FuncRequest const & cmd) { - Buffer * buf = buffer(); + // By default we won't need any new update. + Update::flags update_flags = Update::None; + switch(cmd.action) { case LFUN_BUFFER_SWITCH: setBuffer(theBufferList().getBuffer(to_utf8(cmd.argument()))); @@ -1092,7 +1117,7 @@ void GuiView::dispatch(FuncRequest const & cmd) showDialog("character", data); } else if (name == "latexlog") { Buffer::LogType type; - string const logfile = buf->logName(&type); + string const logfile = buffer()->logName(&type); switch (type) { case Buffer::latexlog: data = "latex "; @@ -1105,17 +1130,36 @@ void GuiView::dispatch(FuncRequest const & cmd) showDialog("log", data); } else if (name == "vclog") { string const data = "vc " + - Lexer::quoteString(buf->lyxvc().getLogFile()); + Lexer::quoteString(buffer()->lyxvc().getLogFile()); showDialog("log", data); } else showDialog(name, data); break; } + case LFUN_INSET_APPLY: { + string const name = cmd.getArg(0); + Inset * inset = getOpenInset(name); + if (inset) { + FuncRequest fr(LFUN_INSET_MODIFY, cmd.argument()); + inset->dispatch(view()->cursor(), fr); + // ideally, the update flag should be set by the insets, + // but this is not possible currently + update_flags = Update::Force | Update::FitCursor; + } else { + FuncRequest fr(LFUN_INSET_INSERT, cmd.argument()); + lyx::dispatch(fr); + } + break; + } + default: theLyXFunc().setLyXView(this); lyx::dispatch(cmd); } + + if (view()) + view()->cursor().updateFlags(update_flags); } @@ -1344,46 +1388,46 @@ void GuiView::checkStatus() // will be replaced by a proper factory... -Dialog * createGuiAbout(LyXView & lv); -Dialog * createGuiBibitem(LyXView & lv); -Dialog * createGuiBibtex(LyXView & lv); -Dialog * createGuiBox(LyXView & lv); -Dialog * createGuiBranch(LyXView & lv); -Dialog * createGuiChanges(LyXView & lv); -Dialog * createGuiCharacter(LyXView & lv); -Dialog * createGuiCitation(LyXView & lv); -Dialog * createGuiDelimiter(LyXView & lv); -Dialog * createGuiDocument(LyXView & lv); -Dialog * createGuiErrorList(LyXView & lv); -Dialog * createGuiERT(LyXView & lv); -Dialog * createGuiExternal(LyXView & lv); -Dialog * createGuiFloat(LyXView & lv); -Dialog * createGuiGraphics(LyXView & lv); -Dialog * createGuiInclude(LyXView & lv); -Dialog * createGuiIndex(LyXView & lv); -Dialog * createGuiLabel(LyXView & lv); -Dialog * createGuiListings(LyXView & lv); -Dialog * createGuiLog(LyXView & lv); -Dialog * createGuiMathMatrix(LyXView & lv); -Dialog * createGuiNomenclature(LyXView & lv); -Dialog * createGuiNote(LyXView & lv); -Dialog * createGuiParagraph(LyXView & lv); -Dialog * createGuiPreferences(LyXView & lv); -Dialog * createGuiPrint(LyXView & lv); -Dialog * createGuiRef(LyXView & lv); -Dialog * createGuiSearch(LyXView & lv); -Dialog * createGuiSendTo(LyXView & lv); -Dialog * createGuiShowFile(LyXView & lv); -Dialog * createGuiSpellchecker(LyXView & lv); -Dialog * createGuiTabularCreate(LyXView & lv); -Dialog * createGuiTabular(LyXView & lv); -Dialog * createGuiTexInfo(LyXView & lv); -Dialog * createGuiToc(LyXView & lv); -Dialog * createGuiThesaurus(LyXView & lv); -Dialog * createGuiHyperlink(LyXView & lv); -Dialog * createGuiVSpace(LyXView & lv); -Dialog * createGuiViewSource(LyXView & lv); -Dialog * createGuiWrap(LyXView & lv); +Dialog * createGuiAbout(GuiView & lv); +Dialog * createGuiBibitem(GuiView & lv); +Dialog * createGuiBibtex(GuiView & lv); +Dialog * createGuiBox(GuiView & lv); +Dialog * createGuiBranch(GuiView & lv); +Dialog * createGuiChanges(GuiView & lv); +Dialog * createGuiCharacter(GuiView & lv); +Dialog * createGuiCitation(GuiView & lv); +Dialog * createGuiDelimiter(GuiView & lv); +Dialog * createGuiDocument(GuiView & lv); +Dialog * createGuiErrorList(GuiView & lv); +Dialog * createGuiERT(GuiView & lv); +Dialog * createGuiExternal(GuiView & lv); +Dialog * createGuiFloat(GuiView & lv); +Dialog * createGuiGraphics(GuiView & lv); +Dialog * createGuiInclude(GuiView & lv); +Dialog * createGuiIndex(GuiView & lv); +Dialog * createGuiLabel(GuiView & lv); +Dialog * createGuiListings(GuiView & lv); +Dialog * createGuiLog(GuiView & lv); +Dialog * createGuiMathMatrix(GuiView & lv); +Dialog * createGuiNomenclature(GuiView & lv); +Dialog * createGuiNote(GuiView & lv); +Dialog * createGuiParagraph(GuiView & lv); +Dialog * createGuiPreferences(GuiView & lv); +Dialog * createGuiPrint(GuiView & lv); +Dialog * createGuiRef(GuiView & lv); +Dialog * createGuiSearch(GuiView & lv); +Dialog * createGuiSendTo(GuiView & lv); +Dialog * createGuiShowFile(GuiView & lv); +Dialog * createGuiSpellchecker(GuiView & lv); +Dialog * createGuiTabularCreate(GuiView & lv); +Dialog * createGuiTabular(GuiView & lv); +Dialog * createGuiTexInfo(GuiView & lv); +Dialog * createGuiToc(GuiView & lv); +Dialog * createGuiThesaurus(GuiView & lv); +Dialog * createGuiHyperlink(GuiView & lv); +Dialog * createGuiVSpace(GuiView & lv); +Dialog * createGuiViewSource(GuiView & lv); +Dialog * createGuiWrap(GuiView & lv); Dialog * GuiView::build(string const & name) diff --git a/src/frontends/qt4/GuiView.h b/src/frontends/qt4/GuiView.h index 54d3462ce6..107e07a9e8 100644 --- a/src/frontends/qt4/GuiView.h +++ b/src/frontends/qt4/GuiView.h @@ -230,10 +230,11 @@ public: void hideDialog(std::string const & name, Inset * inset); /// void disconnectDialog(std::string const & name); + +private: /// Inset * getOpenInset(std::string const & name) const; -private: /// Is the dialog currently visible? bool isDialogVisible(std::string const & name) const; /// diff --git a/src/frontends/qt4/GuiViewSource.cpp b/src/frontends/qt4/GuiViewSource.cpp index a5d776d376..443844c1fd 100644 --- a/src/frontends/qt4/GuiViewSource.cpp +++ b/src/frontends/qt4/GuiViewSource.cpp @@ -170,7 +170,7 @@ QString GuiViewSource::title() const } -Dialog * createGuiViewSource(LyXView & lv) +Dialog * createGuiViewSource(GuiView & lv) { return new GuiViewSource(static_cast(lv)); } diff --git a/src/frontends/qt4/GuiWrap.cpp b/src/frontends/qt4/GuiWrap.cpp index 615dbc9ac7..40a30caae0 100644 --- a/src/frontends/qt4/GuiWrap.cpp +++ b/src/frontends/qt4/GuiWrap.cpp @@ -31,7 +31,7 @@ using std::string; namespace lyx { namespace frontend { -GuiWrap::GuiWrap(LyXView & lv) +GuiWrap::GuiWrap(GuiView & lv) : GuiDialog(lv, "wrap") { setupUi(this); @@ -196,7 +196,7 @@ void GuiWrap::dispatchParams() } -Dialog * createGuiWrap(LyXView & lv) { return new GuiWrap(lv); } +Dialog * createGuiWrap(GuiView & lv) { return new GuiWrap(lv); } } // namespace frontend diff --git a/src/frontends/qt4/GuiWrap.h b/src/frontends/qt4/GuiWrap.h index 151d2e1be1..e483400eab 100644 --- a/src/frontends/qt4/GuiWrap.h +++ b/src/frontends/qt4/GuiWrap.h @@ -24,7 +24,7 @@ class GuiWrap : public GuiDialog, public Ui::WrapUi Q_OBJECT public: - GuiWrap(LyXView & lv); + GuiWrap(GuiView & lv); private Q_SLOTS: void change_adaptor(); diff --git a/src/frontends/qt4/InsertTableWidget.cpp b/src/frontends/qt4/InsertTableWidget.cpp index 5b62b0266d..c385d02a8d 100644 --- a/src/frontends/qt4/InsertTableWidget.cpp +++ b/src/frontends/qt4/InsertTableWidget.cpp @@ -11,24 +11,25 @@ #include -#include "LyXFunc.h" -#include "FuncStatus.h" -#include "FuncRequest.h" -#include "LyXView.h" +#include "InsertTableWidget.h" +#include "GuiView.h" #include "qt_helpers.h" -#include "InsertTableWidget.h" +#include "FuncStatus.h" +#include "FuncRequest.h" +#include "LyXFunc.h" + #include +#include #include #include -#include namespace lyx { namespace frontend { -InsertTableWidget::InsertTableWidget(LyXView & lyxView, QWidget * parent) +InsertTableWidget::InsertTableWidget(GuiView & lyxView, QWidget * parent) : QWidget(parent, Qt::Popup), colwidth_(20), rowheight_(12), lyxView_(lyxView) { init(); diff --git a/src/frontends/qt4/InsertTableWidget.h b/src/frontends/qt4/InsertTableWidget.h index a36b2fc72c..36e6dfa9e1 100644 --- a/src/frontends/qt4/InsertTableWidget.h +++ b/src/frontends/qt4/InsertTableWidget.h @@ -18,13 +18,13 @@ namespace lyx { namespace frontend { -class LyXView; +class GuiView; class InsertTableWidget : public QWidget { Q_OBJECT public: - InsertTableWidget(LyXView &, QWidget *); + InsertTableWidget(GuiView &, QWidget *); Q_SIGNALS: //! widget is visible @@ -63,7 +63,7 @@ private: //! column of pointer int right_; //! the lyxview we need to dispatch the funcrequest - LyXView & lyxView_; + GuiView & lyxView_; //! widget under mouse bool underMouse_; };