+++ /dev/null
-/**
- * \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
+++ /dev/null
-// -*- 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
ControlLog.cpp \
ControlViewSource.cpp \
ControlMath.cpp \
- ControlNote.cpp \
ControlParagraph.cpp \
ControlPrefs.cpp \
ControlPrint.cpp \
ControlLog.h \
ControlViewSource.h \
ControlMath.h \
- ControlNote.h \
ControlParagraph.h \
ControlPrefs.h \
ControlPrint.h \
#include "GuiNomencl.h"
#include "GuiListings.h"
#include "GuiLog.h"
-#include "GuiNote.h"
#include "GuiParagraph.h"
#include "GuiPrefs.h"
#include "GuiPrint.h"
#include "TocWidget.h"
#include "GuiURL.h"
#include "GuiVSpace.h"
-#include "GuiWrap.h"
#ifdef HAVE_LIBAIKSAURUS
#include "ControlThesaurus.h"
} // 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);
} 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 =
* 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()));
}
-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
#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