]> git.lyx.org Git - features.git/commitdiff
38...
authorAndré Pönitz <poenitz@gmx.net>
Fri, 5 Oct 2007 20:43:26 +0000 (20:43 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Fri, 5 Oct 2007 20:43:26 +0000 (20:43 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20760 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/controllers/ControlNote.cpp [deleted file]
src/frontends/controllers/ControlNote.h [deleted file]
src/frontends/controllers/Makefile.am
src/frontends/qt4/Dialogs.cpp
src/frontends/qt4/GuiNote.cpp
src/frontends/qt4/GuiNote.h

diff --git a/src/frontends/controllers/ControlNote.cpp b/src/frontends/controllers/ControlNote.cpp
deleted file mode 100644 (file)
index 30619f1..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * \file ControlNote.cpp
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author Angus Leeming
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#include <config.h>
-
-#include "ControlNote.h"
-#include "FuncRequest.h"
-#include "insets/InsetNote.h"
-#include "gettext.h"
-
-
-using std::string;
-
-namespace lyx {
-namespace frontend {
-
-ControlNote::ControlNote(Dialog & parent)
-       : Controller(parent)
-{}
-
-
-bool ControlNote::initialiseParams(string const & data)
-{
-       InsetNoteMailer::string2params(data, params_);
-       return true;
-}
-
-
-void ControlNote::clearParams()
-{
-       params_ = InsetNoteParams();
-}
-
-
-void ControlNote::dispatchParams()
-{
-       string const lfun = InsetNoteMailer::params2string(params());
-       dispatch(FuncRequest(getLfun(), lfun));
-}
-
-} // namespace frontend
-} // namespace lyx
diff --git a/src/frontends/controllers/ControlNote.h b/src/frontends/controllers/ControlNote.h
deleted file mode 100644 (file)
index 6775ffd..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-// -*- C++ -*-
-/**
- * \file ControlNote.h
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author Angus Leeming
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#ifndef CONTROLNOTE_H
-#define CONTROLNOTE_H
-
-#include "Dialog.h"
-#include "insets/InsetNote.h"
-#include <vector>
-
-namespace lyx {
-namespace frontend {
-
-class ControlNote : public Controller
-{
-public:
-       ///
-       ControlNote(Dialog &);
-       ///
-       virtual bool initialiseParams(std::string const & data);
-       ///
-       virtual void clearParams();
-       ///
-       virtual void dispatchParams();
-       ///
-       virtual bool isBufferDependent() const { return true; }
-       ///
-       InsetNoteParams & params() { return params_; }
-       ///
-       InsetNoteParams const & params() const { return params_; }
-       ///
-private:
-       ///
-       InsetNoteParams params_;
-};
-
-} // namespace frontend
-} // namespace lyx
-
-#endif // CONTROLNOTE_H
index a25275394ad7cc84cc6c041fb98836041c3aaf17..ad03b9aaad2799d11c002cffaad9f13e61e8e3e7 100644 (file)
@@ -29,7 +29,6 @@ SOURCEFILES = \
        ControlLog.cpp \
        ControlViewSource.cpp \
        ControlMath.cpp \
-       ControlNote.cpp \
        ControlParagraph.cpp \
        ControlPrefs.cpp \
        ControlPrint.cpp \
@@ -67,7 +66,6 @@ HEADERFILES = \
        ControlLog.h \
        ControlViewSource.h \
        ControlMath.h \
-       ControlNote.h \
        ControlParagraph.h \
        ControlPrefs.h \
        ControlPrint.h \
index fb59c1f8de7c6276564aa527ad02105bdc8a8006..96c0172854a5220ed507f21ba43a82d8f0e1da82 100644 (file)
@@ -38,7 +38,6 @@
 #include "GuiNomencl.h"
 #include "GuiListings.h"
 #include "GuiLog.h"
-#include "GuiNote.h"
 #include "GuiParagraph.h"
 #include "GuiPrefs.h"
 #include "GuiPrint.h"
@@ -55,7 +54,6 @@
 #include "TocWidget.h"
 #include "GuiURL.h"
 #include "GuiVSpace.h"
-#include "GuiWrap.h"
 
 #ifdef HAVE_LIBAIKSAURUS
 #include "ControlThesaurus.h"
@@ -109,8 +107,43 @@ private:
 
 } // namespace anon
 
-
+// will be replaced by a proper factory...
+Dialog * createGuiAboutDialog(LyXView & lv);
+Dialog * createGuiBibitemDialog(LyXView & lv);
+Dialog * createGuiBibtexDialog(LyXView & lv);
+Dialog * createGuiBoxDialog(LyXView & lv);
+Dialog * createGuiBranchDialog(LyXView & lv);
+Dialog * createGuiChangesDialog(LyXView & lv);
+Dialog * createGuiCharacterDialog(LyXView & lv);
+Dialog * createGuiCitationDialog(LyXView & lv);
+Dialog * createGuiDelimiterDialog(LyXView & lv);
+Dialog * createGuiDocumentDialog(LyXView & lv);
+Dialog * createGuiErrorListDialog(LyXView & lv);
+Dialog * createGuiERTDialog(LyXView & lv);
+Dialog * createGuiExternalDialog(LyXView & lv);
+Dialog * createGuiFloatDialog(LyXView & lv);
+Dialog * createGuiGraphicsDialog(LyXView & lv);
+Dialog * createGuiIncludeDialog(LyXView & lv);
+Dialog * createGuiIndexDialog(LyXView & lv);
+Dialog * createGuiLabelDialog(LyXView & lv);
+Dialog * createGuiListingsDialog(LyXView & lv);
+Dialog * createGuiLogDialog(LyXView & lv);
+Dialog * createGuiMathMatrixDialog(LyXView & lv);
+Dialog * createGuiNomenclDialog(LyXView & lv);
+Dialog * createGuiNote(LyXView & lv);
+Dialog * createGuiPrefsDialog(LyXView & lv);
+Dialog * createGuiPrintDialog(LyXView & lv);
 Dialog * createGuiRef(LyXView & lv);
+Dialog * createGuiSearchDialog(LyXView & lv);
+Dialog * createGuiSendtoDialog(LyXView & lv);
+Dialog * createGuiShowFileDialog(LyXView & lv);
+Dialog * createGuiSpellcheckerDialog(LyXView & lv);
+Dialog * createGuiTabularCreateDialog(LyXView & lv);
+Dialog * createGuiTabularDialog(LyXView & lv);
+Dialog * createGuiTexinfoDialog(LyXView & lv);
+Dialog * createGuiThesaurusDialog(LyXView & lv);
+Dialog * createGuiURLDialog(LyXView & lv);
+Dialog * createGuiVSpaceDialog(LyXView & lv);
 Dialog * createGuiWrap(LyXView & lv);
 
 
@@ -181,7 +214,7 @@ Dialog * Dialogs::build(string const & name)
        } else if (name == "mathmatrix") {
                dialog = new GuiMathMatrixDialog(lyxview_);
        } else if (name == "note") {
-               dialog = new GuiNoteDialog(lyxview_);
+               dialog = createGuiNote(lyxview_);
        } else if (name == "paragraph") {
 #ifdef USE_DOCK_WIDGET
                DockView<ControlParagraph, GuiParagraph> * dv =
index 350fc925c548845d84abfe37eff85f9915ebc9f2..93b1e7dfdef82af8d8096868ef97316ae46bc005 100644 (file)
@@ -3,6 +3,7 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
+ * \author Angus Leeming
  * \author Jürgen Spitzmüller
  *
  * Full author contact details are available in file CREDITS.
 #include <config.h>
 
 #include "GuiNote.h"
+#include "FuncRequest.h"
+#include "gettext.h"
 
-#include "ControlNote.h"
 #include "insets/InsetNote.h"
 
 #include <QCloseEvent>
 
+using std::string;
+
+
 namespace lyx {
 namespace frontend {
 
-GuiNoteDialog::GuiNoteDialog(LyXView & lv)
-       : GuiDialog(lv, "note")
+GuiNote::GuiNote(LyXView & lv)
+       : GuiDialog(lv, "note"), Controller(this)
 {
        setupUi(this);
-       setController(new ControlNote(*this));
+       setController(this, false);
        setViewTitle(_("Note Settings"));
 
        connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
@@ -42,69 +47,78 @@ GuiNoteDialog::GuiNoteDialog(LyXView & lv)
 }
 
 
-ControlNote & GuiNoteDialog::controller()
-{
-       return static_cast<ControlNote &>(GuiDialog::controller());
-}
-
-
-void GuiNoteDialog::closeEvent(QCloseEvent * e)
+void GuiNote::closeEvent(QCloseEvent * e)
 {
        slotClose();
        e->accept();
 }
 
 
-void GuiNoteDialog::change_adaptor()
+void GuiNote::change_adaptor()
 {
        changed();
 }
 
 
-void GuiNoteDialog::updateContents()
+void GuiNote::updateContents()
 {
-       QRadioButton * rb = 0;
-
-       switch (controller().params().type) {
+       switch (params_.type) {
        case InsetNoteParams::Note:
-               rb = noteRB;
+               noteRB->setChecked(true);
                break;
        case InsetNoteParams::Comment:
-               rb = commentRB;
+               commentRB->setChecked(true);
                break;
        case InsetNoteParams::Greyedout:
-               rb = greyedoutRB;
+               greyedoutRB->setChecked(true);
                break;
        case InsetNoteParams::Framed:
-               rb = framedRB;
+               framedRB->setChecked(true);
                break;
        case InsetNoteParams::Shaded:
-               rb = shadedRB;
+               shadedRB->setChecked(true);
                break;
        }
-
-       rb->setChecked(true);
 }
 
 
-void GuiNoteDialog::applyView()
+void GuiNote::applyView()
 {
-       InsetNoteParams::Type type;
-
        if (greyedoutRB->isChecked())
-               type = InsetNoteParams::Greyedout;
+               params_.type = InsetNoteParams::Greyedout;
        else if (commentRB->isChecked())
-               type = InsetNoteParams::Comment;
+               params_.type = InsetNoteParams::Comment;
        else if (framedRB->isChecked())
-               type = InsetNoteParams::Framed;
+               params_.type = InsetNoteParams::Framed;
        else if (shadedRB->isChecked())
-               type = InsetNoteParams::Shaded;
+               params_.type = InsetNoteParams::Shaded;
        else
-               type = InsetNoteParams::Note;
+               params_.type = InsetNoteParams::Note;
+}
+
 
-       controller().params().type = type;
+bool GuiNote::initialiseParams(string const & data)
+{
+       InsetNoteMailer::string2params(data, params_);
+       return true;
 }
 
+
+void GuiNote::clearParams()
+{
+       params_ = InsetNoteParams();
+}
+
+
+void GuiNote::dispatchParams()
+{
+       dispatch(FuncRequest(getLfun(), InsetNoteMailer::params2string(params_)));
+}
+
+
+Dialog * createGuiNote(LyXView & lv) { return new GuiNote(lv); }
+
+
 } // namespace frontend
 } // namespace lyx
 
index 50a2d3318bc6bf8651a2dd5782a6f1145090f710..31b26d93ad57103f6268e15e9b83962706cc2853 100644 (file)
 #define GUINOTE_H
 
 #include "GuiDialog.h"
-#include "ControlNote.h"
+#include "insets/InsetNote.h"
 #include "ui_NoteUi.h"
 
 namespace lyx {
 namespace frontend {
 
-class GuiNoteDialog : public GuiDialog, public Ui::NoteUi
+class GuiNote : public GuiDialog, public Ui::NoteUi, public Controller
 {
        Q_OBJECT
 public:
-       GuiNoteDialog(LyXView & lv);
+       GuiNote(LyXView & lv);
 private Q_SLOTS:
        void change_adaptor();
 private:
        void closeEvent(QCloseEvent * e);
        /// parent controller
-       ControlNote & controller();
+       Controller & controller() { return *this; }
        /// Apply changes
        void applyView();
        /// Update dialog before showing it
        void updateContents();
+       ///
+       bool initialiseParams(std::string const & data);
+       ///
+       void clearParams();
+       ///
+       void dispatchParams();
+       ///
+       bool isBufferDependent() const { return true; }
+private:
+       ///
+       InsetNoteParams params_;
 };
 
 } // namespace frontend