No longer pass Controller & or Dialogs & to the View c-tors.

GUI now contains a controller rather than derives from a controller.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4942 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2002-08-12 14:28:43 +00:00
parent a9e93befaa
commit 1e3d2fce7f
148 changed files with 621 additions and 454 deletions

View File

@ -1,3 +1,9 @@
2002-08-12 Angus Leeming <leeming@lyx.org>
* DialogBase.h: no longer derive from boost::signals::trackable.
* Toolbar.[Ch] (c-tor): no londer passed a Dialogs &.
2002-08-08 John Levon <levon@movementarian.org> 2002-08-08 John Levon <levon@movementarian.org>
* Toolbar.C: * Toolbar.C:

View File

@ -17,7 +17,6 @@
#ifndef DIALOGBASE_H #ifndef DIALOGBASE_H
#define DIALOGBASE_H #define DIALOGBASE_H
#include <boost/signals/trackable.hpp>
#include <boost/utility.hpp> #include <boost/utility.hpp>
/** Abstract base class of all dialogs. /** Abstract base class of all dialogs.
@ -26,7 +25,7 @@
satisfy that request. Thus a dialog will have to "pull" the necessary satisfy that request. Thus a dialog will have to "pull" the necessary
details from the core of the program. details from the core of the program.
*/ */
class DialogBase : public boost::signals::trackable, boost::noncopyable class DialogBase : boost::noncopyable
{ {
public: public:
/**@name Constructors and Deconstructors */ /**@name Constructors and Deconstructors */

View File

@ -20,11 +20,10 @@
using std::endl; using std::endl;
Toolbar::Toolbar(LyXView * o, Dialogs & d, Toolbar::Toolbar(LyXView * o, int x, int y, ToolbarDefaults const &tbd)
int x, int y, ToolbarDefaults const &tbd)
: last_textclass_(-1) : last_textclass_(-1)
{ {
pimpl_ = new Pimpl(o, d, x, y); pimpl_ = new Pimpl(o, x, y);
// extracts the toolbar actions from tbd // extracts the toolbar actions from tbd
for (ToolbarDefaults::const_iterator cit = tbd.begin(); for (ToolbarDefaults::const_iterator cit = tbd.begin();

View File

@ -22,7 +22,7 @@
class LyXView; class LyXView;
class ToolbarDefaults; class ToolbarDefaults;
class Dialogs;
/** The LyX GUI independent toolbar class /** The LyX GUI independent toolbar class
The GUI interface is implemented in the corresponding Toolbar_pimpl class. The GUI interface is implemented in the corresponding Toolbar_pimpl class.
@ -30,8 +30,7 @@ class Dialogs;
class Toolbar { class Toolbar {
public: public:
/// ///
Toolbar(LyXView * o, Dialogs & d, Toolbar(LyXView * o, int x, int y, ToolbarDefaults const &);
int x, int y, ToolbarDefaults const &);
/// ///
~Toolbar(); ~Toolbar();

View File

@ -1,3 +1,21 @@
2002-08-12 Angus Leeming <leeming@lyx.org>
* ControlButtons.[Ch] (bc, view): no longer virtual.
(setView, setButtonController): new methods, invoked by GUI.
* ControlDialog.h (show):
* ControlInset.h (createInset, showInset): make public, so that GUI can
invoke them.
* GUI.h: GUI now contains a controller, rather than deriving from it.
remove all those friend functions since we can now access the show,
createInset, showInset controller methods.
* ViewBase.h: simplifiy, enabling ControlButtons to be forward-declared.
(ViewBC): scrapped.
* character.h: #include a couple of STL files.
2002-08-08 John Levon <levon@movementarian.org> 2002-08-08 John Levon <levon@movementarian.org>
* ControlCommandBuffer.C: LyXAction cleanup * ControlCommandBuffer.C: LyXAction cleanup

View File

@ -21,9 +21,11 @@
#include "ButtonControllerBase.h" #include "ButtonControllerBase.h"
#include "ViewBase.h" #include "ViewBase.h"
#include "lyxrc.h" #include "lyxrc.h"
#include "support/LAssert.h"
ControlButtons::ControlButtons() ControlButtons::ControlButtons()
: emergency_exit_(false), is_closing_(false) : emergency_exit_(false), is_closing_(false), bc_ptr_(0), view_ptr_(0)
{} {}
@ -62,3 +64,30 @@ bool ControlButtons::IconifyWithMain() const
{ {
return lyxrc.dialogs_iconify_with_main; return lyxrc.dialogs_iconify_with_main;
} }
ButtonControllerBase & ControlButtons::bc()
{
lyx::Assert(bc_ptr_);
return *bc_ptr_;
}
ViewBase & ControlButtons::view()
{
lyx::Assert(view_ptr_);
return *view_ptr_;
}
void ControlButtons::setView(ViewBase & v)
{
view_ptr_ = &v;
}
void ControlButtons::setButtonController(ButtonControllerBase & bc)
{
bc_ptr_ = &bc;
}

View File

@ -48,7 +48,9 @@ public:
/// ///
virtual ~ControlButtons() {} virtual ~ControlButtons() {}
/// These functions are called when the controlling buttons are pressed. /** These functions are called by the view when the appropriate buttons
* are pressed.
*/
/// ///
void ApplyButton(); void ApplyButton();
/// ///
@ -57,15 +59,22 @@ public:
void CancelButton(); void CancelButton();
/// ///
void RestoreButton(); void RestoreButton();
///
/// Returns the user-specified iconification policy.
bool IconifyWithMain() const; bool IconifyWithMain() const;
/** Allow the view to access the ButtonController. This method must be ///
instantiated in a daughter class that creates the actual instance ButtonControllerBase & bc();
of the ButtonController. */
virtual ButtonControllerBase & bc() = 0; ///
void setView(ViewBase &);
///
void setButtonController(ButtonControllerBase &);
protected: protected:
///
ViewBase & view();
/** When Applying it's useful to know whether the dialog is about /** When Applying it's useful to know whether the dialog is about
to close or not (no point refreshing the display for example). */ to close or not (no point refreshing the display for example). */
bool isClosing() const { return is_closing_; } bool isClosing() const { return is_closing_; }
@ -77,11 +86,6 @@ protected:
/// Update dialog before showing it. /// Update dialog before showing it.
virtual void update() = 0; virtual void update() = 0;
/** Allow the Controller to access the View. This method must be
instantiated in a daughter class that creates the actual instance
of the View. */
virtual ViewBase & view() = 0;
/** This flag can be set by one of the miriad the controller methods /** This flag can be set by one of the miriad the controller methods
to ensure that the dialog is shut down. */ to ensure that the dialog is shut down. */
bool emergency_exit_; bool emergency_exit_;
@ -89,7 +93,10 @@ protected:
private: private:
/// ///
bool is_closing_; bool is_closing_;
/// We own neither of these pointers.
ButtonControllerBase * bc_ptr_;
///
ViewBase * view_ptr_;
}; };
#endif // CONTROLBUTTONS_H #endif // CONTROLBUTTONS_H

View File

@ -29,9 +29,12 @@ public:
/// ///
ControlDialog(LyXView &, Dialogs &); ControlDialog(LyXView &, Dialogs &);
protected: /** Show the dialog.
/// Show the dialog. * Publicly accessible so that it can be invoked by the Dialogs class.
*/
virtual void show(); virtual void show();
protected:
/// Hide the dialog. /// Hide the dialog.
virtual void hide(); virtual void hide();
/// Update the dialog. /// Update the dialog.

View File

@ -37,12 +37,13 @@ public:
/// ///
Params const & params() const; Params const & params() const;
protected:
/// Slots connected in the daughter classes c-tor. /// Slots connected in the daughter classes c-tor.
/// Slot launching dialog to (possibly) create a new inset. /// Slot launching dialog to (possibly) create a new inset.
void createInset(string const &); void createInset(string const &);
/// Slot launching dialog to an existing inset. /// Slot launching dialog to an existing inset.
void showInset(Inset *); void showInset(Inset *);
protected:
/// Allow the daughter methods to access the inset. /// Allow the daughter methods to access the inset.
Inset * inset() const; Inset * inset() const;

View File

@ -11,65 +11,41 @@
#define GUI_H #define GUI_H
#include "ButtonController.h" #include "ButtonController.h"
#include "ViewBase.h"
/** This class instantiates and makes available the GUI-specific
ButtonController and View. /** This class makes a whole out of the disparate parts of a dialog.
*/ */
template <class Controller, class GUIview, class Policy, class GUIbc> template <typename Controller, typename GUIview,
class GUI : public Controller { typename Policy, typename GUIbc>
class GUI {
public: public:
/// ///
GUI(LyXView & lv, Dialogs & d) : Controller(lv, d), view_(*this, d) {} GUI(LyXView & lv, Dialogs & d);
/// ///
virtual ButtonControllerBase & bc() { return bc_; } Controller & controller() { return controller_; }
/// ///
virtual ViewBase & view() { return view_; } Controller const & controller() const { return controller_; }
friend void gui_ShowAboutlyx(LyXView &, Dialogs &);
friend void gui_ShowBibitem(InsetCommand *, LyXView &, Dialogs &);
friend void gui_ShowBibtex(InsetCommand *, LyXView &, Dialogs &);
friend void gui_ShowCharacter(LyXView &, Dialogs &);
friend void gui_SetUserFreeFont(LyXView &, Dialogs &);
friend void gui_ShowCitation(InsetCommand *, LyXView &, Dialogs &);
friend void gui_CreateCitation(string const &, LyXView &, Dialogs &);
friend void gui_ShowDocument(LyXView &, Dialogs &);
friend void gui_ShowError(InsetError *, LyXView &, Dialogs &);
friend void gui_ShowERT(InsetERT *, LyXView &, Dialogs &);
friend void gui_UpdateERT(InsetERT *, LyXView &, Dialogs &);
friend void gui_ShowExternal(InsetExternal *, LyXView &, Dialogs &);
friend void gui_ShowFloat(InsetFloat *, LyXView &, Dialogs &);
friend void gui_ShowForks(LyXView &, Dialogs &);
friend void gui_ShowGraphics(InsetGraphics *, LyXView &, Dialogs &);
friend void gui_ShowInclude(InsetInclude *, LyXView &, Dialogs &);
friend void gui_ShowIndex(InsetCommand *, LyXView &, Dialogs &);
friend void gui_CreateIndex(LyXView &, Dialogs &);
friend void gui_ShowLogFile(LyXView &, Dialogs &);
friend void gui_ShowMathPanel(LyXView &, Dialogs &);
friend void gui_ShowMinipage(InsetMinipage *, LyXView &, Dialogs &);
friend void gui_UpdateMinipage(InsetMinipage *, LyXView &, Dialogs &);
friend void gui_ShowParagraph(LyXView &, Dialogs &);
friend void gui_ShowPreamble(LyXView &, Dialogs &);
friend void gui_ShowPreferences(LyXView &, Dialogs &);
friend void gui_ShowPrint(LyXView &, Dialogs &);
friend void gui_ShowRef(InsetCommand *, LyXView &, Dialogs &);
friend void gui_CreateRef(string const &, LyXView &, Dialogs &);
friend void gui_ShowSearch(LyXView &, Dialogs &);
friend void gui_ShowSendto(LyXView &, Dialogs &);
friend void gui_ShowSpellchecker(LyXView &, Dialogs &);
friend void gui_ShowTabularCreate(LyXView &, Dialogs &);
friend void gui_ShowTexinfo(LyXView &, Dialogs &);
friend void gui_ShowTOC(InsetCommand *, LyXView &, Dialogs &);
friend void gui_CreateTOC(string const &, LyXView &, Dialogs &);
friend void gui_ShowUrl(InsetCommand *, LyXView &, Dialogs &);
friend void gui_CreateUrl(string const &, LyXView &, Dialogs &);
friend void gui_ShowVCLogFile(LyXView &, Dialogs &);
private: private:
///
Controller controller_;
/// ///
ButtonController<Policy, GUIbc> bc_; ButtonController<Policy, GUIbc> bc_;
/// ///
GUIview view_; GUIview view_;
}; };
template <typename Controller, typename GUIview,
typename Policy, typename GUIbc>
GUI<Controller, GUIview, Policy, GUIbc>::GUI(LyXView & lv, Dialogs & d)
: controller_(lv, d),
view_()
{
controller_.setView(view_);
controller_.setButtonController(bc_);
view_.setController(controller_);
}
#endif // GUI_H #endif // GUI_H

View File

@ -14,18 +14,22 @@
#ifndef VIEWBASE_H #ifndef VIEWBASE_H
#define VIEWBASE_H #define VIEWBASE_H
#include <boost/utility.hpp> #include "support/LAssert.h"
#include "ControlButtons.h"
class ControlButtons;
class ViewBase { class ViewBase {
public: public:
/// ///
ViewBase(ControlButtons & c) : controller_(c) {} ViewBase() : controller_ptr_(0) {}
/// ///
virtual ~ViewBase() {} virtual ~ViewBase() {}
/// Apply changes to LyX data from dialog. /// Apply changes to LyX data from dialog.
virtual void apply() = 0; virtual void apply() = 0;
/// build the dialog
virtual void build() = 0;
/// Hide the dialog. /// Hide the dialog.
virtual void hide() = 0; virtual void hide() = 0;
/// Redraw the dialog (e.g. if the colors have been remapped). /// Redraw the dialog (e.g. if the colors have been remapped).
@ -34,47 +38,35 @@ public:
virtual void show() = 0; virtual void show() = 0;
/// Update dialog before/whilst showing it. /// Update dialog before/whilst showing it.
virtual void update() = 0; virtual void update() = 0;
/// build the dialog
virtual void build() = 0;
/** These shortcuts allow (e.g. xform's) global callback functions /** Defaults to nothing. Can be used by the controller, however, to
access to the buttons without making the whole controller_ public. * indicate to the view that something has changed and that the
* dialog therefore needs updating.
*/ */
///
void ApplyButton() { controller_.ApplyButton(); }
///
void OKButton() { controller_.OKButton(); }
///
void CancelButton() { controller_.CancelButton(); }
///
void RestoreButton() { controller_.RestoreButton(); }
/** Defaults to nothing. Can be used by the Controller, however, to
indicate to the View that something has changed and that the
dialog therefore needs updating. */
virtual void partialUpdate(int) {} virtual void partialUpdate(int) {}
protected: /** This should be set by the GUI class that owns both the controller
/// The view is, after all, controlled! * and the view
ControlButtons & controller_; */
}; void setController(ControlButtons & c) { controller_ptr_ = &c; }
/** A generic class to cast the ButtonController controller_.bc_ to it's
daughter class. */
template <class GUIbc>
class ViewBC : public ViewBase {
public:
/// ///
ViewBC(ControlButtons & c) : ViewBase(c) {} ControlButtons & getController()
protected:
///
GUIbc & bc() const
{ {
return static_cast<GUIbc &>(controller_.bc()); lyx::Assert(controller_ptr_);
// return dynamic_cast<GUIbc &>(controller_.bc()); return *controller_ptr_;
} }
///
ControlButtons const & getController() const
{
lyx::Assert(controller_ptr_);
return *controller_ptr_;
}
protected:
/// We don't own this.
ControlButtons * controller_ptr_;
}; };
#endif // VIEWBASE_H #endif // VIEWBASE_H

View File

@ -22,6 +22,9 @@
#include "lyxfont.h" #include "lyxfont.h"
#include "LColor.h" #include "LColor.h"
#include <utility>
#include <vector>
/** Functions of use to the character GUI controller and view */ /** Functions of use to the character GUI controller and view */
namespace frnt { namespace frnt {
/// ///

View File

@ -1,3 +1,57 @@
2002-08-12 Angus Leeming <leeming@lyx.org>
* Menubar_pimpl.C: no need to #include "Dialogs.h". Remove semi-colon
from namespace closing delimiter.
* Menubar_pimpl.h: remove MenuItemInfo:: prefix from c-tor declaration.
* QAbout.[Ch]:
* QBibitem.[Ch]:
* QBibtex.[Ch]:
* QCharacter.[Ch]:
* QCitation.[Ch]:
* QERT.[Ch]:
* QError.[Ch]:
* QExternal.[Ch]:
* QFloat.[Ch]:
* QGraphics.[Ch]:
* QInclude.[Ch]:
* QIndex.[Ch]:
* QLog.[Ch]:
* QMinipage.[Ch]:
* QParagraph.[Ch]:
* QPreamble.[Ch]:
* QPrint.[Ch]:
* QRef.[Ch]:
* QSearch.[Ch]:
* QShowFile.[Ch]:
* QSpellchecker.[Ch]:
* QTabularCreate.[Ch]:
* QTexinfo.[Ch]:
* QThesaurus.[Ch]:
* QToc.[Ch]:
* QURL.[Ch]:
* QVCLog.[Ch]:
No longer pass Controller or Dialogs to the c-tor.
No longer forward-declare Dialogs.
* Qt2Base.[Ch]: derives from ViewBase directly.
No longer passed ControlButtons & or Dialogs &.
(bc): new method, enabling the daughter classes to access the
ButtonController.
(slotWMHide):
(slotApply):
(slotOK):
(slotClose):
(slotRestore): changes due to a change in the ViewBase class.
* QtView.C (c-tor): no longer pass Dialogs & to the Toolbar.
* Toolbar_pimpl.[Ch] (c-tor): no longer passed a Dialogs &.
* guiapi.C: access the controller methods by explicit invocation of the
controller.
2002-08-09 John Levon <levon@movementarian.org> 2002-08-09 John Levon <levon@movementarian.org>
* Toolbar_pimpl.C: add missing header * Toolbar_pimpl.C: add missing header

View File

@ -19,7 +19,6 @@
#include "LyXAction.h" #include "LyXAction.h"
#include "kbmap.h" #include "kbmap.h"
#include "buffer.h" #include "buffer.h"
#include "Dialogs.h"
#include "lyxfunc.h" #include "lyxfunc.h"
#include "FloatList.h" #include "FloatList.h"
#include "support/lstrings.h" #include "support/lstrings.h"
@ -58,7 +57,7 @@ string const getLabel(MenuItem const & mi)
return label; return label;
} }
}; }
typedef vector<int>::size_type size_type; typedef vector<int>::size_type size_type;

View File

@ -36,10 +36,10 @@ class MenuBackend;
/// stored state for menu items /// stored state for menu items
struct MenuItemInfo { struct MenuItemInfo {
// I REALLY hate this stupid requirement of std::map // I REALLY hate this stupid requirement of std::map
MenuItemInfo::MenuItemInfo() MenuItemInfo()
: parent_(0), id_(0), item_(0) {}; : parent_(0), id_(0), item_(0) {};
MenuItemInfo::MenuItemInfo(QMenuData * p, int id, MenuItem const * item) MenuItemInfo(QMenuData * p, int id, MenuItem const * item)
: parent_(p), id_(id), item_(item) {}; : parent_(p), id_(id), item_(item) {};
/// menu containing item /// menu containing item

View File

@ -28,8 +28,8 @@ using std::getline;
typedef Qt2CB<ControlAboutlyx, Qt2DB<QAboutDialog> > base_class; typedef Qt2CB<ControlAboutlyx, Qt2DB<QAboutDialog> > base_class;
QAbout::QAbout(ControlAboutlyx & c, Dialogs &) QAbout::QAbout()
: base_class(c, _("About LyX")) : base_class(_("About LyX"))
{ {
} }

View File

@ -13,7 +13,6 @@
#include "Qt2Base.h" #include "Qt2Base.h"
#include "boost/utility.hpp" #include "boost/utility.hpp"
class Dialogs;
class LyXView; class LyXView;
class QAboutDialog; class QAboutDialog;
class ControlAboutlyx; class ControlAboutlyx;
@ -22,7 +21,7 @@ class QAbout
: public Qt2CB<ControlAboutlyx, Qt2DB<QAboutDialog> > : public Qt2CB<ControlAboutlyx, Qt2DB<QAboutDialog> >
{ {
public: public:
QAbout(ControlAboutlyx &, Dialogs &); QAbout();
private: private:
/// not needed /// not needed

View File

@ -23,8 +23,8 @@
typedef Qt2CB<ControlBibitem, Qt2DB<QBibitemDialog> > base_class; typedef Qt2CB<ControlBibitem, Qt2DB<QBibitemDialog> > base_class;
QBibitem::QBibitem(ControlBibitem & c, Dialogs &) QBibitem::QBibitem()
: base_class(c, _("Bibliography Item")) : base_class(_("Bibliography Item"))
{ {
} }

View File

@ -21,7 +21,7 @@ class QBibitem :
friend class QBibitemDialog; friend class QBibitemDialog;
public: public:
QBibitem(ControlBibitem &, Dialogs &); QBibitem();
protected: protected:
virtual bool isValid(); virtual bool isValid();

View File

@ -29,8 +29,8 @@ using std::vector;
typedef Qt2CB<ControlBibtex, Qt2DB<QBibtexDialog> > base_class; typedef Qt2CB<ControlBibtex, Qt2DB<QBibtexDialog> > base_class;
QBibtex::QBibtex(ControlBibtex & c, Dialogs &) QBibtex::QBibtex()
: base_class(c, _("BibTeX")) : base_class(_("BibTeX"))
{ {
} }

View File

@ -21,7 +21,7 @@ class QBibtex :
friend class QBibtexDialog; friend class QBibtexDialog;
public: public:
QBibtex(ControlBibtex &, Dialogs &); QBibtex();
protected: protected:
virtual bool isValid(); virtual bool isValid();

View File

@ -27,8 +27,8 @@ using std::vector;
typedef Qt2CB<ControlCharacter, Qt2DB<QCharacterDialog> > base_class; typedef Qt2CB<ControlCharacter, Qt2DB<QCharacterDialog> > base_class;
QCharacter::QCharacter(ControlCharacter & c, Dialogs &) QCharacter::QCharacter()
: base_class(c, _("Character")) : base_class(_("Character"))
{ {
} }

View File

@ -22,7 +22,7 @@
class ControlCharacter; class ControlCharacter;
class QCharacterDialog; class QCharacterDialog;
class Dialogs;
class QCharacter : class QCharacter :
public Qt2CB<ControlCharacter, Qt2DB<QCharacterDialog> > public Qt2CB<ControlCharacter, Qt2DB<QCharacterDialog> >
@ -30,7 +30,7 @@ class QCharacter :
friend class QCharacterDialog; friend class QCharacterDialog;
public: public:
QCharacter(ControlCharacter &, Dialogs &); QCharacter();
private: private:
/// Apply changes /// Apply changes

View File

@ -41,8 +41,8 @@ using std::vector;
typedef Qt2CB<ControlCitation, Qt2DB<QCitationDialog> > base_class; typedef Qt2CB<ControlCitation, Qt2DB<QCitationDialog> > base_class;
QCitation::QCitation(ControlCitation & c, Dialogs &) QCitation::QCitation()
: base_class(c, _("Citation")) : base_class(_("Citation"))
{} {}

View File

@ -21,7 +21,7 @@ class QListBox;
class ControlCitation; class ControlCitation;
class QCitationDialog; class QCitationDialog;
class Dialogs;
class QCitation : public Qt2CB<ControlCitation, Qt2DB<QCitationDialog> > class QCitation : public Qt2CB<ControlCitation, Qt2DB<QCitationDialog> >
{ {
@ -29,7 +29,7 @@ class QCitation : public Qt2CB<ControlCitation, Qt2DB<QCitationDialog> >
public: public:
/// ///
QCitation(ControlCitation &, Dialogs &); QCitation();
private: private:
/// ///

View File

@ -20,8 +20,8 @@
typedef Qt2CB<ControlERT, Qt2DB<QERTDialog> > base_class; typedef Qt2CB<ControlERT, Qt2DB<QERTDialog> > base_class;
QERT::QERT(ControlERT & c, Dialogs &) QERT::QERT()
: base_class(c, _("LaTeX ERT")) : base_class(_("LaTeX ERT"))
{ {
} }

View File

@ -14,7 +14,7 @@
class ControlERT; class ControlERT;
class QERTDialog; class QERTDialog;
class Dialogs;
class QERT : class QERT :
public Qt2CB<ControlERT, Qt2DB<QERTDialog> > public Qt2CB<ControlERT, Qt2DB<QERTDialog> >
@ -22,7 +22,7 @@ class QERT :
friend class QERTDialog; friend class QERTDialog;
public: public:
QERT(ControlERT &, Dialogs &); QERT();
private: private:
/// Apply changes /// Apply changes

View File

@ -20,8 +20,8 @@
typedef Qt2CB<ControlError, Qt2DB<QErrorDialog> > base_class; typedef Qt2CB<ControlError, Qt2DB<QErrorDialog> > base_class;
QError::QError(ControlError & c, Dialogs &) QError::QError()
: base_class(c, _("LaTeX Error")) : base_class(_("LaTeX Error"))
{ {
} }

View File

@ -14,7 +14,7 @@
class ControlError; class ControlError;
class QErrorDialog; class QErrorDialog;
class Dialogs;
class QError : class QError :
public Qt2CB<ControlError, Qt2DB<QErrorDialog> > public Qt2CB<ControlError, Qt2DB<QErrorDialog> >
@ -22,7 +22,7 @@ class QError :
friend class QErrorDialog; friend class QErrorDialog;
public: public:
QError(ControlError &, Dialogs &); QError();
private: private:
/// Apply changes /// Apply changes

View File

@ -23,8 +23,8 @@
typedef Qt2CB<ControlExternal, Qt2DB<QExternalDialog> > base_class; typedef Qt2CB<ControlExternal, Qt2DB<QExternalDialog> > base_class;
QExternal::QExternal(ControlExternal & c, Dialogs &) QExternal::QExternal()
: base_class(c, _("External")) : base_class(_("External"))
{ {
} }

View File

@ -21,7 +21,7 @@ class QExternal :
friend class QExternalDialog; friend class QExternalDialog;
public: public:
QExternal(ControlExternal &, Dialogs &); QExternal();
protected: protected:
virtual bool isValid(); virtual bool isValid();

View File

@ -27,8 +27,8 @@
typedef Qt2CB<ControlFloat, Qt2DB<QFloatDialog> > base_class; typedef Qt2CB<ControlFloat, Qt2DB<QFloatDialog> > base_class;
QFloat::QFloat(ControlFloat & c, Dialogs &) QFloat::QFloat()
: base_class(c, _("LaTeX Information")) : base_class(_("LaTeX Information"))
{ {
} }

View File

@ -27,7 +27,7 @@ public:
/// ///
friend class QFloatDialog; friend class QFloatDialog;
/// ///
QFloat(ControlFloat &, Dialogs &); QFloat();
private: private:
/// Apply changes /// Apply changes
virtual void apply(); virtual void apply();

View File

@ -41,8 +41,8 @@
typedef Qt2CB<ControlGraphics, Qt2DB<QGraphicsDialog> > base_class; typedef Qt2CB<ControlGraphics, Qt2DB<QGraphicsDialog> > base_class;
QGraphics::QGraphics(ControlGraphics & c, Dialogs &) QGraphics::QGraphics()
: base_class(c, _("Graphics")) : base_class(_("Graphics"))
{ {
} }

View File

@ -28,7 +28,7 @@ public:
/// ///
friend class QGraphicsDialog; friend class QGraphicsDialog;
/// ///
QGraphics(ControlGraphics &, Dialogs &); QGraphics();
protected: protected:
virtual bool isValid(); virtual bool isValid();

View File

@ -27,8 +27,8 @@
typedef Qt2CB<ControlInclude, Qt2DB<QIncludeDialog> > base_class; typedef Qt2CB<ControlInclude, Qt2DB<QIncludeDialog> > base_class;
QInclude::QInclude(ControlInclude & c, Dialogs &) QInclude::QInclude()
: base_class(c, _("Include")) : base_class(_("Include"))
{ {
} }

View File

@ -27,7 +27,7 @@ public:
/// ///
friend class QIncludeDialog; friend class QIncludeDialog;
/// ///
QInclude(ControlInclude &, Dialogs &); QInclude();
protected: protected:
virtual bool isValid(); virtual bool isValid();

View File

@ -19,8 +19,8 @@
typedef Qt2CB<ControlIndex, Qt2DB<QIndexDialog> > base_class; typedef Qt2CB<ControlIndex, Qt2DB<QIndexDialog> > base_class;
QIndex::QIndex(ControlIndex & c, Dialogs &) QIndex::QIndex()
: base_class(c, _("Index")) : base_class(_("Index"))
{ {
} }

View File

@ -15,7 +15,7 @@
class ControlIndex; class ControlIndex;
class QIndexDialog; class QIndexDialog;
class Dialogs;
class QIndex : class QIndex :
public Qt2CB<ControlIndex, Qt2DB<QIndexDialog> > public Qt2CB<ControlIndex, Qt2DB<QIndexDialog> >
@ -23,7 +23,7 @@ class QIndex :
friend class QIndexDialog; friend class QIndexDialog;
public: public:
QIndex(ControlIndex &, Dialogs &); QIndex();
protected: protected:
virtual bool isValid(); virtual bool isValid();

View File

@ -29,8 +29,8 @@ using std::getline;
typedef Qt2CB<ControlLog, Qt2DB<QLogDialog> > base_class; typedef Qt2CB<ControlLog, Qt2DB<QLogDialog> > base_class;
QLog::QLog(ControlLog & c, Dialogs &) QLog::QLog()
: base_class(c, _("Log")) : base_class(_("Log"))
{ {
} }

View File

@ -27,7 +27,7 @@ public:
/// ///
friend class QLogDialog; friend class QLogDialog;
/// ///
QLog(ControlLog &, Dialogs &); QLog();
private: private:
/// Apply changes /// Apply changes

View File

@ -29,8 +29,8 @@
typedef Qt2CB<ControlMinipage, Qt2DB<QMinipageDialog> > base_class; typedef Qt2CB<ControlMinipage, Qt2DB<QMinipageDialog> > base_class;
QMinipage::QMinipage(ControlMinipage & c, Dialogs &) QMinipage::QMinipage()
: base_class(c, _("Minipage")) : base_class(_("Minipage"))
{ {
} }

View File

@ -27,7 +27,7 @@ public:
/// ///
friend class QMinipageDialog; friend class QMinipageDialog;
/// ///
QMinipage(ControlMinipage &, Dialogs &); QMinipage();
private: private:
/// Apply changes /// Apply changes

View File

@ -42,8 +42,8 @@ using std::remove_if;
typedef Qt2CB<ControlParagraph, Qt2DB<QParagraphDialog> > base_class; typedef Qt2CB<ControlParagraph, Qt2DB<QParagraphDialog> > base_class;
QParagraph::QParagraph(ControlParagraph & c, Dialogs &) QParagraph::QParagraph()
: base_class(c, _("Paragraph Layout")) : base_class(_("Paragraph Layout"))
{} {}
void QParagraph::build_dialog() void QParagraph::build_dialog()

View File

@ -16,7 +16,7 @@
class ControlParagraph; class ControlParagraph;
class QParagraphDialog; class QParagraphDialog;
class Dialogs;
class QParagraph : class QParagraph :
public Qt2CB<ControlParagraph, Qt2DB<QParagraphDialog> > public Qt2CB<ControlParagraph, Qt2DB<QParagraphDialog> >
@ -24,7 +24,7 @@ class QParagraph :
friend class QParagraphDialog; friend class QParagraphDialog;
public: public:
QParagraph(ControlParagraph &, Dialogs &); QParagraph();
private: private:
/// Apply changes /// Apply changes

View File

@ -26,8 +26,8 @@
typedef Qt2CB<ControlPreamble, Qt2DB<QPreambleDialog> > base_class; typedef Qt2CB<ControlPreamble, Qt2DB<QPreambleDialog> > base_class;
QPreamble::QPreamble(ControlPreamble & c, Dialogs &) QPreamble::QPreamble()
: base_class(c, _("LaTeX Preamble")) : base_class(_("LaTeX Preamble"))
{ {
} }

View File

@ -27,7 +27,7 @@ public:
/// ///
friend class QPreambleDialog; friend class QPreambleDialog;
/// ///
QPreamble(ControlPreamble &, Dialogs &); QPreamble();
private: private:
/// Apply changes /// Apply changes

View File

@ -32,8 +32,8 @@
typedef Qt2CB<ControlPrint, Qt2DB<QPrintDialog> > base_class; typedef Qt2CB<ControlPrint, Qt2DB<QPrintDialog> > base_class;
QPrint::QPrint(ControlPrint & c, Dialogs &) QPrint::QPrint()
: base_class(c, _("Print")) : base_class(_("Print"))
{ {
} }

View File

@ -29,7 +29,7 @@ public:
/// ///
friend class QPrintDialog; friend class QPrintDialog;
/// ///
QPrint(ControlPrint &, Dialogs &); QPrint();
private: private:
/// Apply changes /// Apply changes

View File

@ -33,8 +33,8 @@ using std::endl;
typedef Qt2CB<ControlRef, Qt2DB<QRefDialog> > base_class; typedef Qt2CB<ControlRef, Qt2DB<QRefDialog> > base_class;
QRef::QRef(ControlRef & c, Dialogs &) QRef::QRef()
: base_class(c, _("Cross Reference")), : base_class(_("Cross Reference")),
sort_(false), at_ref_(false) sort_(false), at_ref_(false)
{ {
} }

View File

@ -17,7 +17,7 @@
class ControlRef; class ControlRef;
class QRefDialog; class QRefDialog;
class Dialogs;
class QRef : class QRef :
public Qt2CB<ControlRef, Qt2DB<QRefDialog> > public Qt2CB<ControlRef, Qt2DB<QRefDialog> >
@ -25,7 +25,7 @@ class QRef :
friend class QRefDialog; friend class QRefDialog;
public: public:
QRef(ControlRef & c, Dialogs &); QRef();
private: private:
/// apply changes /// apply changes

View File

@ -27,8 +27,8 @@
typedef Qt2CB<ControlSearch, Qt2DB<QSearchDialog> > base_class; typedef Qt2CB<ControlSearch, Qt2DB<QSearchDialog> > base_class;
QSearch::QSearch(ControlSearch & c, Dialogs &) QSearch::QSearch()
: base_class(c, _("Search")) : base_class(_("Search"))
{ {
} }

View File

@ -18,7 +18,7 @@
class ControlSearch; class ControlSearch;
class QSearchDialog; class QSearchDialog;
class Dialogs;
/// ///
class QSearch class QSearch
@ -28,7 +28,7 @@ public:
/// ///
friend class QSearchDialog; friend class QSearchDialog;
/// ///
QSearch(ControlSearch &, Dialogs &); QSearch();
private: private:
/// Apply changes /// Apply changes

View File

@ -20,8 +20,8 @@
typedef Qt2CB<ControlShowFile, Qt2DB<QShowFileDialog> > base_class; typedef Qt2CB<ControlShowFile, Qt2DB<QShowFileDialog> > base_class;
QShowFile::QShowFile(ControlShowFile & c, Dialogs &) QShowFile::QShowFile()
: base_class(c, _("ShowFile")) : base_class(_("ShowFile"))
{ {
} }

View File

@ -14,7 +14,7 @@
class ControlShowFile; class ControlShowFile;
class QShowFileDialog; class QShowFileDialog;
class Dialogs;
class QShowFile : class QShowFile :
public Qt2CB<ControlShowFile, Qt2DB<QShowFileDialog> > public Qt2CB<ControlShowFile, Qt2DB<QShowFileDialog> >
@ -22,7 +22,7 @@ class QShowFile :
friend class QShowFileDialog; friend class QShowFileDialog;
public: public:
QShowFile(ControlShowFile &, Dialogs &); QShowFile();
private: private:
/// Apply changes /// Apply changes

View File

@ -23,8 +23,8 @@
typedef Qt2CB<ControlSpellchecker, Qt2DB<QSpellcheckerDialog> > base_class; typedef Qt2CB<ControlSpellchecker, Qt2DB<QSpellcheckerDialog> > base_class;
QSpellchecker::QSpellchecker(ControlSpellchecker & c, Dialogs &) QSpellchecker::QSpellchecker()
: base_class(c, _("Spellchecker")) : base_class(_("Spellchecker"))
{ {
} }

View File

@ -16,7 +16,7 @@
class ControlSpellchecker; class ControlSpellchecker;
class QSpellcheckerDialog; class QSpellcheckerDialog;
class Dialogs;
class QSpellchecker : class QSpellchecker :
public Qt2CB<ControlSpellchecker, Qt2DB<QSpellcheckerDialog> > public Qt2CB<ControlSpellchecker, Qt2DB<QSpellcheckerDialog> >
@ -24,7 +24,7 @@ class QSpellchecker :
friend class QSpellcheckerDialog; friend class QSpellcheckerDialog;
public: public:
QSpellchecker(ControlSpellchecker &, Dialogs &); QSpellchecker();
/// update from controller /// update from controller
void partialUpdate(int id); void partialUpdate(int id);

View File

@ -24,8 +24,8 @@
typedef Qt2CB<ControlTabularCreate, Qt2DB<QTabularCreateDialog> > base_class; typedef Qt2CB<ControlTabularCreate, Qt2DB<QTabularCreateDialog> > base_class;
QTabularCreate::QTabularCreate(ControlTabularCreate & c, Dialogs &) QTabularCreate::QTabularCreate()
: base_class(c, _("Insert table")) : base_class(_("Insert table"))
{ {
} }

View File

@ -18,7 +18,7 @@
class ControlTabularCreate; class ControlTabularCreate;
class QTabularCreateDialog; class QTabularCreateDialog;
class Dialogs;
/// ///
class QTabularCreate class QTabularCreate
@ -28,7 +28,7 @@ public:
/// ///
friend class QTabularCreateDialog; friend class QTabularCreateDialog;
/// ///
QTabularCreate(ControlTabularCreate &, Dialogs &); QTabularCreate();
private: private:
/// Apply changes /// Apply changes

View File

@ -31,8 +31,8 @@ using std::vector;
typedef Qt2CB<ControlTexinfo, Qt2DB<QTexinfoDialog> > base_class; typedef Qt2CB<ControlTexinfo, Qt2DB<QTexinfoDialog> > base_class;
QTexinfo::QTexinfo(ControlTexinfo & c, Dialogs &) QTexinfo::QTexinfo()
: base_class(c, _("LaTeX Information")), warningPosted(false), activeStyle(ControlTexinfo::cls) : base_class(_("LaTeX Information")), warningPosted(false), activeStyle(ControlTexinfo::cls)
{ {
} }

View File

@ -28,7 +28,7 @@ public:
/// ///
friend class QTexinfoDialog; friend class QTexinfoDialog;
/// ///
QTexinfo(ControlTexinfo &, Dialogs &); QTexinfo();
private: private:
/// Apply changes /// Apply changes
virtual void apply() { }; virtual void apply() { };

View File

@ -24,8 +24,8 @@
typedef Qt2CB<ControlThesaurus, Qt2DB<QThesaurusDialog> > base_class; typedef Qt2CB<ControlThesaurus, Qt2DB<QThesaurusDialog> > base_class;
QThesaurus::QThesaurus(ControlThesaurus & c, Dialogs &) QThesaurus::QThesaurus()
: base_class(c, _("Thesaurus")) : base_class(_("Thesaurus"))
{ {
} }

View File

@ -27,7 +27,7 @@ public:
/// ///
friend class QThesaurusDialog; friend class QThesaurusDialog;
/// ///
QThesaurus(ControlThesaurus &, Dialogs &); QThesaurus();
private: private:
/// Apply changes /// Apply changes
virtual void apply() { }; virtual void apply() { };

View File

@ -35,8 +35,8 @@ using std::vector;
typedef Qt2CB<ControlToc, Qt2DB<QTocDialog> > base_class; typedef Qt2CB<ControlToc, Qt2DB<QTocDialog> > base_class;
QToc::QToc(ControlToc & c, Dialogs &) QToc::QToc()
: base_class(c, _("Table of contents")), depth_(1) : base_class(_("Table of contents")), depth_(1)
{} {}

View File

@ -27,7 +27,7 @@ class QToc :
public Qt2CB<ControlToc, Qt2DB<QTocDialog> > public Qt2CB<ControlToc, Qt2DB<QTocDialog> >
{ {
public: public:
QToc(ControlToc &, Dialogs &); QToc();
friend class QTocDialog; friend class QTocDialog;

View File

@ -22,8 +22,8 @@
typedef Qt2CB<ControlUrl, Qt2DB<QURLDialog> > base_class; typedef Qt2CB<ControlUrl, Qt2DB<QURLDialog> > base_class;
QURL::QURL(ControlUrl & c, Dialogs &) QURL::QURL()
: base_class(c, _("URL")) : base_class(_("URL"))
{ {
} }

View File

@ -13,14 +13,14 @@
class ControlUrl; class ControlUrl;
class QURLDialog; class QURLDialog;
class Dialogs;
class QURL : class QURL :
public Qt2CB<ControlUrl, Qt2DB<QURLDialog> > public Qt2CB<ControlUrl, Qt2DB<QURLDialog> >
{ {
friend class QURLDialog; friend class QURLDialog;
public: public:
QURL(ControlUrl & c, Dialogs &); QURL();
protected: protected:
virtual bool isValid(); virtual bool isValid();

View File

@ -26,8 +26,8 @@
typedef Qt2CB<ControlVCLog, Qt2DB<QVCLogDialog> > base_class; typedef Qt2CB<ControlVCLog, Qt2DB<QVCLogDialog> > base_class;
QVCLog::QVCLog(ControlVCLog & c, Dialogs &) QVCLog::QVCLog()
: base_class(c, _("VCLog")) : base_class(_("VCLog"))
{ {
} }

View File

@ -27,7 +27,7 @@ public:
/// ///
friend class QVCLogDialog; friend class QVCLogDialog;
/// ///
QVCLog(ControlVCLog &, Dialogs &); QVCLog();
private: private:
/// Apply changes /// Apply changes

View File

@ -24,13 +24,21 @@
#include "Dialogs.h" #include "Dialogs.h"
#include "Qt2Base.h" #include "Qt2Base.h"
#include "Qt2BC.h" #include "Qt2BC.h"
#include "ControlButtons.h"
#include "support/LAssert.h" #include "support/LAssert.h"
Qt2Base::Qt2Base(ControlButtons & c, QString const & t) Qt2Base::Qt2Base(QString const & t)
: ViewBC<Qt2BC>(c), updating_(false), title_(t) : ViewBase(), updating_(false), title_(t)
{} {}
Qt2BC & Qt2Base::bc()
{
return static_cast<Qt2BC &>(getController().bc());
// return dynamic_cast<Qt2BC &>(getController().bc());
}
void Qt2Base::show() void Qt2Base::show()
{ {
if (!form()) { if (!form()) {
@ -77,29 +85,29 @@ void Qt2Base::changed()
void Qt2Base::slotWMHide() void Qt2Base::slotWMHide()
{ {
CancelButton(); getController().CancelButton();
} }
void Qt2Base::slotApply() void Qt2Base::slotApply()
{ {
ApplyButton(); getController().ApplyButton();
} }
void Qt2Base::slotOK() void Qt2Base::slotOK()
{ {
OKButton(); getController().OKButton();
} }
void Qt2Base::slotClose() void Qt2Base::slotClose()
{ {
CancelButton(); getController().CancelButton();
} }
void Qt2Base::slotRestore() void Qt2Base::slotRestore()
{ {
RestoreButton(); getController().RestoreButton();
} }

View File

@ -21,7 +21,6 @@
#include "LString.h" #include "LString.h"
#include "debug.h" #include "debug.h"
#include "ButtonPolicies.h" #include "ButtonPolicies.h"
#include "ControlButtons.h"
#include <boost/scoped_ptr.hpp> #include <boost/scoped_ptr.hpp>
@ -34,12 +33,12 @@ class Qt2BC;
/** This class is an Qt2 GUI base class. /** This class is an Qt2 GUI base class.
*/ */
class Qt2Base : public QObject, public ViewBC<Qt2BC> class Qt2Base : public QObject, public ViewBase
{ {
Q_OBJECT Q_OBJECT
public: public:
/// ///
Qt2Base(ControlButtons &, QString const &); Qt2Base(QString const &);
/// ///
virtual ~Qt2Base() {} virtual ~Qt2Base() {}
@ -59,6 +58,9 @@ protected:
/// is the dialog currently valid ? /// is the dialog currently valid ?
virtual bool isValid(); virtual bool isValid();
///
Qt2BC & bc();
/// are we updating ? /// are we updating ?
bool updating_; bool updating_;
@ -92,7 +94,7 @@ template <class Dialog>
class Qt2DB: public Qt2Base class Qt2DB: public Qt2Base
{ {
protected: protected:
Qt2DB(ControlButtons &, QString const &); Qt2DB(QString const &);
/// update the dialog /// update the dialog
virtual void update(); virtual void update();
@ -110,8 +112,8 @@ protected:
template <class Dialog> template <class Dialog>
Qt2DB<Dialog>::Qt2DB(ControlButtons & c, QString const & t) Qt2DB<Dialog>::Qt2DB(QString const & t)
: Qt2Base(c, t) : Qt2Base(t)
{} {}
@ -163,23 +165,31 @@ public:
protected: protected:
/// ///
Qt2CB(ControlButtons &, QString const &); Qt2CB(QString const &);
/// The parent controller /// The parent controller
Controller & controller() const; Controller & controller();
/// The parent controller
Controller const & controller() const;
}; };
template <class Controller, class Base> template <class Controller, class Base>
Qt2CB<Controller, Base>::Qt2CB(ControlButtons & c, QString const & t) Qt2CB<Controller, Base>::Qt2CB(QString const & t)
: Base(c, t) : Base(t)
{} {}
template <class Controller, class Base> template <class Controller, class Base>
Controller & Qt2CB<Controller, Base>::controller() const Controller & Qt2CB<Controller, Base>::controller()
{ {
return static_cast<Controller &>(controller_); return static_cast<Controller &>(getController());
//return dynamic_cast<Controller &>(controller_); }
template <class Controller, class Base>
Controller const & Qt2CB<Controller, Base>::controller() const
{
return static_cast<Controller const &>(getController());
} }

View File

@ -65,7 +65,7 @@ QtView::QtView(unsigned int width, unsigned int height)
connect(menuBar(), SIGNAL(activated(int)), connect(menuBar(), SIGNAL(activated(int)),
this, SLOT(activated(int))); this, SLOT(activated(int)));
toolbar_.reset(new Toolbar(this, *getDialogs(), 0, 0, toolbardefaults)); toolbar_.reset(new Toolbar(this, 0, 0, toolbardefaults));
statusBar()->setSizeGripEnabled(false); statusBar()->setSizeGripEnabled(false);

View File

@ -93,7 +93,7 @@ public:
}; };
Toolbar::Pimpl::Pimpl(LyXView * o, Dialogs &, int, int) Toolbar::Pimpl::Pimpl(LyXView * o, int, int)
: owner_(static_cast<QtView *>(o)), : owner_(static_cast<QtView *>(o)),
combo_(0) combo_(0)
{ {

View File

@ -36,7 +36,7 @@ struct Toolbar::Pimpl {
friend class ToolbarProxy; friend class ToolbarProxy;
public: public:
Pimpl(LyXView * o, Dialogs &, int x, int y); Pimpl(LyXView * o, int x, int y);
~Pimpl(); ~Pimpl();

View File

@ -180,7 +180,7 @@ extern "C" {
{ {
static GUI<ControlAboutlyx, QAbout, static GUI<ControlAboutlyx, QAbout,
OkCancelPolicy, Qt2BC> cal(lv, d); OkCancelPolicy, Qt2BC> cal(lv, d);
cal.show(); cal.controller().show();
} }
@ -188,7 +188,7 @@ extern "C" {
{ {
static GUI<ControlBibitem, QBibitem, static GUI<ControlBibitem, QBibitem,
OkCancelReadOnlyPolicy, Qt2BC> cbi(lv, d); OkCancelReadOnlyPolicy, Qt2BC> cbi(lv, d);
cbi.showInset(ic); cbi.controller().showInset(ic);
} }
@ -196,31 +196,31 @@ extern "C" {
{ {
static GUI<ControlBibtex, QBibtex, static GUI<ControlBibtex, QBibtex,
OkCancelReadOnlyPolicy, Qt2BC> cbt(lv, d); OkCancelReadOnlyPolicy, Qt2BC> cbt(lv, d);
cbt.showInset(ic); cbt.controller().showInset(ic);
} }
void gui_ShowCharacter(LyXView & lv, Dialogs & d) void gui_ShowCharacter(LyXView & lv, Dialogs & d)
{ {
controlCharacterSingleton.get(lv, d).show(); controlCharacterSingleton.get(lv, d).controller().show();
} }
void gui_SetUserFreeFont(LyXView & lv, Dialogs & d) void gui_SetUserFreeFont(LyXView & lv, Dialogs & d)
{ {
controlCharacterSingleton.get(lv, d).apply(); controlCharacterSingleton.get(lv, d).controller().apply();
} }
void gui_ShowCitation(InsetCommand * ic, LyXView & lv, Dialogs & d) void gui_ShowCitation(InsetCommand * ic, LyXView & lv, Dialogs & d)
{ {
controlCitationSingleton.get(lv, d).showInset(ic); controlCitationSingleton.get(lv, d).controller().showInset(ic);
} }
void gui_CreateCitation(string const & s, LyXView & lv, Dialogs & d) void gui_CreateCitation(string const & s, LyXView & lv, Dialogs & d)
{ {
controlCitationSingleton.get(lv, d).createInset(s); controlCitationSingleton.get(lv, d).controller().createInset(s);
} }
@ -235,19 +235,19 @@ extern "C" {
{ {
static GUI<ControlError, QError, static GUI<ControlError, QError,
OkCancelPolicy, Qt2BC> ce(lv, d); OkCancelPolicy, Qt2BC> ce(lv, d);
ce.showInset(ie); ce.controller().showInset(ie);
} }
void gui_ShowERT(InsetERT * ie, LyXView & lv, Dialogs & d) void gui_ShowERT(InsetERT * ie, LyXView & lv, Dialogs & d)
{ {
controlERTSingleton.get(lv, d).showInset(ie); controlERTSingleton.get(lv, d).controller().showInset(ie);
} }
void gui_UpdateERT(InsetERT * ie, LyXView & lv, Dialogs & d) void gui_UpdateERT(InsetERT * ie, LyXView & lv, Dialogs & d)
{ {
controlERTSingleton.get(lv, d).showInset(ie); controlERTSingleton.get(lv, d).controller().showInset(ie);
} }
@ -255,7 +255,7 @@ extern "C" {
{ {
static GUI<ControlExternal, QExternal, static GUI<ControlExternal, QExternal,
OkApplyCancelReadOnlyPolicy, Qt2BC> ce(lv, d); OkApplyCancelReadOnlyPolicy, Qt2BC> ce(lv, d);
ce.showInset(ie); ce.controller().showInset(ie);
} }
@ -263,7 +263,7 @@ extern "C" {
{ {
static GUI<ControlShowFile, QShowFile, static GUI<ControlShowFile, QShowFile,
OkCancelPolicy, Qt2BC> csf(lv, d); OkCancelPolicy, Qt2BC> csf(lv, d);
csf.showFile(f); csf.controller().showFile(f);
} }
@ -271,7 +271,7 @@ extern "C" {
{ {
static GUI<ControlFloat, QFloat, static GUI<ControlFloat, QFloat,
NoRepeatedApplyReadOnlyPolicy, Qt2BC> cf(lv, d); NoRepeatedApplyReadOnlyPolicy, Qt2BC> cf(lv, d);
cf.showInset(ifl); cf.controller().showInset(ifl);
} }
@ -280,7 +280,7 @@ extern "C" {
#if 0 #if 0
static GUI<ControlForks, QForks, static GUI<ControlForks, QForks,
OkApplyCancelPolicy, Qt2BC> cf(lv, d); OkApplyCancelPolicy, Qt2BC> cf(lv, d);
cf.show(); cf.controller().show();
#endif #endif
} }
@ -289,7 +289,7 @@ extern "C" {
{ {
static GUI<ControlGraphics, QGraphics, static GUI<ControlGraphics, QGraphics,
NoRepeatedApplyReadOnlyPolicy, Qt2BC> cg(lv, d); NoRepeatedApplyReadOnlyPolicy, Qt2BC> cg(lv, d);
cg.showInset(ig); cg.controller().showInset(ig);
} }
@ -297,19 +297,19 @@ extern "C" {
{ {
static GUI<ControlInclude, QInclude, static GUI<ControlInclude, QInclude,
OkCancelReadOnlyPolicy, Qt2BC> ci(lv, d); OkCancelReadOnlyPolicy, Qt2BC> ci(lv, d);
ci.showInset(ii); ci.controller().showInset(ii);
} }
void gui_ShowIndex(InsetCommand * ic, LyXView & lv, Dialogs & d) void gui_ShowIndex(InsetCommand * ic, LyXView & lv, Dialogs & d)
{ {
controlIndexSingleton.get(lv, d).showInset(ic); controlIndexSingleton.get(lv, d).controller().showInset(ic);
} }
void gui_CreateIndex(LyXView & lv, Dialogs & d) void gui_CreateIndex(LyXView & lv, Dialogs & d)
{ {
controlIndexSingleton.get(lv, d).createInset(""); controlIndexSingleton.get(lv, d).controller().createInset("");
} }
@ -324,7 +324,7 @@ extern "C" {
{ {
static GUI<ControlLog, QLog, static GUI<ControlLog, QLog,
OkCancelPolicy, Qt2BC> cl(lv, d); OkCancelPolicy, Qt2BC> cl(lv, d);
cl.show(); cl.controller().show();
} }
@ -337,23 +337,23 @@ extern "C" {
void gui_ShowMinipage(InsetMinipage * im, LyXView & lv, Dialogs & d) void gui_ShowMinipage(InsetMinipage * im, LyXView & lv, Dialogs & d)
{ {
controlMinipageSingleton.get(lv, d).showInset(im); controlMinipageSingleton.get(lv, d).controller().showInset(im);
} }
void gui_UpdateMinipage(InsetMinipage * im, LyXView & lv, Dialogs & d) void gui_UpdateMinipage(InsetMinipage * im, LyXView & lv, Dialogs & d)
{ {
controlMinipageSingleton.get(lv, d).showInset(im); controlMinipageSingleton.get(lv, d).controller().showInset(im);
} }
void gui_ShowParagraph(LyXView & lv, Dialogs & d) void gui_ShowParagraph(LyXView & lv, Dialogs & d)
{ {
controlParagraphSingleton.get(lv, d).show(); controlParagraphSingleton.get(lv, d).controller().show();
#if 0 #if 0
static GUI<ControlParagraph, QParagraph, static GUI<ControlParagraph, QParagraph,
OkApplyCancelReadOnlyPolicy, Qt2BC> cp(lv, d); OkApplyCancelReadOnlyPolicy, Qt2BC> cp(lv, d);
cp.show(); cp.controller().show();
#endif #endif
} }
@ -376,7 +376,7 @@ extern "C" {
{ {
static GUI<ControlPreamble, QPreamble, static GUI<ControlPreamble, QPreamble,
NoRepeatedApplyReadOnlyPolicy, Qt2BC> cp(lv, d); NoRepeatedApplyReadOnlyPolicy, Qt2BC> cp(lv, d);
cp.show(); cp.controller().show();
} }
@ -390,19 +390,19 @@ extern "C" {
{ {
static GUI<ControlPrint, QPrint, static GUI<ControlPrint, QPrint,
OkApplyCancelPolicy, Qt2BC> cp(lv, d); OkApplyCancelPolicy, Qt2BC> cp(lv, d);
cp.show(); cp.controller().show();
} }
void gui_ShowRef(InsetCommand * ic, LyXView & lv, Dialogs & d) void gui_ShowRef(InsetCommand * ic, LyXView & lv, Dialogs & d)
{ {
controlRefSingleton.get(lv, d).showInset(ic); controlRefSingleton.get(lv, d).controller().showInset(ic);
} }
void gui_CreateRef(string const & s, LyXView & lv, Dialogs & d) void gui_CreateRef(string const & s, LyXView & lv, Dialogs & d)
{ {
controlRefSingleton.get(lv, d).createInset(s); controlRefSingleton.get(lv, d).controller().createInset(s);
} }
@ -410,7 +410,7 @@ extern "C" {
{ {
static GUI<ControlSearch, QSearch, static GUI<ControlSearch, QSearch,
NoRepeatedApplyReadOnlyPolicy, Qt2BC> cs(lv, d); NoRepeatedApplyReadOnlyPolicy, Qt2BC> cs(lv, d);
cs.show(); cs.controller().show();
} }
@ -428,7 +428,7 @@ extern "C" {
{ {
static GUI<ControlSpellchecker, QSpellchecker, static GUI<ControlSpellchecker, QSpellchecker,
NoRepeatedApplyReadOnlyPolicy, Qt2BC> cp(lv, d); NoRepeatedApplyReadOnlyPolicy, Qt2BC> cp(lv, d);
cp.show(); cp.controller().show();
} }
@ -448,7 +448,7 @@ extern "C" {
{ {
static GUI<ControlTabularCreate, QTabularCreate, static GUI<ControlTabularCreate, QTabularCreate,
OkApplyCancelReadOnlyPolicy, Qt2BC> ctc(lv, d); OkApplyCancelReadOnlyPolicy, Qt2BC> ctc(lv, d);
ctc.show(); ctc.controller().show();
} }
@ -456,7 +456,7 @@ extern "C" {
{ {
static GUI<ControlTexinfo, QTexinfo, static GUI<ControlTexinfo, QTexinfo,
OkCancelPolicy, Qt2BC> ct(lv, d); OkCancelPolicy, Qt2BC> ct(lv, d);
ct.show(); ct.controller().show();
} }
@ -465,32 +465,32 @@ extern "C" {
#ifdef HAVE_LIBAIKSAURUS #ifdef HAVE_LIBAIKSAURUS
static GUI<ControlThesaurus, QThesaurus, static GUI<ControlThesaurus, QThesaurus,
OkApplyCancelReadOnlyPolicy, Qt2BC> ct(lv, d); OkApplyCancelReadOnlyPolicy, Qt2BC> ct(lv, d);
ct.showEntry(s); ct.controller().showEntry(s);
#endif #endif
} }
void gui_ShowTOC(InsetCommand * ic, LyXView & lv, Dialogs & d) void gui_ShowTOC(InsetCommand * ic, LyXView & lv, Dialogs & d)
{ {
controlTocSingleton.get(lv, d).showInset(ic); controlTocSingleton.get(lv, d).controller().showInset(ic);
} }
void gui_CreateTOC(string const & s, LyXView & lv, Dialogs & d) void gui_CreateTOC(string const & s, LyXView & lv, Dialogs & d)
{ {
controlTocSingleton.get(lv, d).createInset(s); controlTocSingleton.get(lv, d).controller().createInset(s);
} }
void gui_ShowUrl(InsetCommand * ic, LyXView & lv, Dialogs & d) void gui_ShowUrl(InsetCommand * ic, LyXView & lv, Dialogs & d)
{ {
controlUrlSingleton.get(lv, d).showInset(ic); controlUrlSingleton.get(lv, d).controller().showInset(ic);
} }
void gui_CreateUrl(string const & s, LyXView & lv, Dialogs & d) void gui_CreateUrl(string const & s, LyXView & lv, Dialogs & d)
{ {
controlUrlSingleton.get(lv, d).createInset(s); controlUrlSingleton.get(lv, d).controller().createInset(s);
} }
@ -498,7 +498,7 @@ extern "C" {
{ {
static GUI<ControlVCLog, QVCLog, static GUI<ControlVCLog, QVCLog,
OkCancelPolicy, Qt2BC> cv(lv, d); OkCancelPolicy, Qt2BC> cv(lv, d);
cv.show(); cv.controller().show();
} }
} // extern "C" } // extern "C"

View File

@ -1,3 +1,62 @@
2002-08-12 Angus Leeming <leeming@lyx.org>
* Dialogs.C (c-tor): connect the Tooltips::toggleEnabled method to
the Dialogs::toggleTooltips signal.
* FormAboutlyx.[Ch]:
* FormBibitem.[Ch]:
* FormBibtex.[Ch]:
* FormBrowser.[Ch]:
* FormCharacter.[Ch]:
* FormCitation.[Ch]:
* FormERT.[Ch]:
* FormError.[Ch]:
* FormExternal.[Ch]:
* FormFloat.[Ch]:
* FormForks.[Ch]:
* FormGraphics.[Ch]:
* FormInclude.[Ch]:
* FormIndex.[Ch]:
* FormLog.[Ch]:
* FormMinipage.[Ch]:
* FormParagraph.[Ch]:
* FormPreamble.[Ch]:
* FormPrint.[Ch]:
* FormRef.[Ch]:
* FormSearch.[Ch]:
* FormSendto.[Ch]:
* FormShowFile.[Ch]:
* FormSpellchecker.[Ch]:
* FormTabularCreate.[Ch]:
* FormTexinfo.[Ch]:
* FormThesaurus.[Ch]:
* FormToc.[Ch]:
* FormURL.[Ch]:
* FormVCLog.[Ch]:
No longer pass Controller or Dialogs to the c-tor.
No longer forward-declare Dialogs.
* FormBase.[Ch]: derives from ViewBase directly.
No longer passed ControlButtons & or Dialogs &.
(bc): new method, enabling the daughter classes to access the
ButtonController.
(C_FormBaseApplyCB):
(C_FormBaseOKCB):
(C_FormBaseCancelCB):
(C_FormBaseRestoreCB):
(C_WMHideCB): changes due to a change in the ViewBase class.
* Toolbar_pimpl.[Ch] (c-tor):
* Tooltips.[Ch] (c-tor): no longer passed a Dialogs &.
* Tooltips.h (toggleEnabled): made public for the Dialogs c-tor.
* XFormsView.[Ch] (c-tor, create_form_form_main): no longer pass
Dialogs & to the Toolbar.
* guiapi.C: access the controller methods by explicit invocation of the
controller.
2002-08-12 Lars Gullik Bjønnes <larsbj@gullik.net> 2002-08-12 Lars Gullik Bjønnes <larsbj@gullik.net>
* FormDocument.C (saveParamsAsDefault): ParagraphList changes * FormDocument.C (saveParamsAsDefault): ParagraphList changes

View File

@ -16,6 +16,8 @@
#include "Dialogs.h" #include "Dialogs.h"
#include "Tooltips.h" #include "Tooltips.h"
#include <boost/bind.hpp>
LyXView * dialogs_lyxview; LyXView * dialogs_lyxview;
@ -31,6 +33,7 @@ Dialogs::Dialogs(LyXView * lv)
#if 1 #if 1
dialogs_lyxview = lv; dialogs_lyxview = lv;
#endif #endif
toggleTooltips.connect(boost::bind(&Tooltips::toggleEnabled));
// reduce the number of connections needed in // reduce the number of connections needed in
// dialogs by a simple connection here. // dialogs by a simple connection here.
hideAll.connect(hideBufferDependent); hideAll.connect(hideBufferDependent);

View File

@ -25,8 +25,8 @@ using std::getline;
typedef FormCB<ControlAboutlyx, FormDB<FD_aboutlyx> > base_class; typedef FormCB<ControlAboutlyx, FormDB<FD_aboutlyx> > base_class;
FormAboutlyx::FormAboutlyx(ControlAboutlyx & c, Dialogs & d) FormAboutlyx::FormAboutlyx()
: base_class(c, d, _("About LyX"), false) : base_class(_("About LyX"), false)
{} {}

View File

@ -30,7 +30,7 @@ struct FD_aboutlyx_license;
class FormAboutlyx : public FormCB<ControlAboutlyx, FormDB<FD_aboutlyx> > { class FormAboutlyx : public FormCB<ControlAboutlyx, FormDB<FD_aboutlyx> > {
public: public:
/// ///
FormAboutlyx(ControlAboutlyx &, Dialogs &); FormAboutlyx();
private: private:
/// not needed. /// not needed.

View File

@ -12,8 +12,9 @@
#pragma implementation #pragma implementation
#endif #endif
#include "Dialogs.h"
#include "FormBase.h" #include "FormBase.h"
#include "ControlButtons.h"
#include "xformsBC.h" #include "xformsBC.h"
#include "xforms_resize.h" #include "xforms_resize.h"
#include "Tooltips.h" #include "Tooltips.h"
@ -32,10 +33,9 @@ static int C_PrehandlerCB(FL_OBJECT *, int, FL_Coord, FL_Coord, int, void *);
} // extern "C" } // extern "C"
FormBase::FormBase(ControlButtons & c, Dialogs & d, FormBase::FormBase(string const & t, bool allowResize)
string const & t, bool allowResize) : ViewBase(), minw_(0), minh_(0), allow_resize_(allowResize),
: ViewBC<xformsBC>(c), minw_(0), minh_(0), allow_resize_(allowResize), title_(t), tooltips_(new Tooltips())
title_(t), tooltips_(new Tooltips(d))
{} {}
@ -58,6 +58,13 @@ void FormBase::redraw()
} }
xformsBC & FormBase::bc()
{
return static_cast<xformsBC &>(getController().bc());
// return dynamic_cast<GUIbc &>(controller_ptr_->bc());
}
void FormBase::show() void FormBase::show()
{ {
if (!form()) { if (!form()) {
@ -102,9 +109,12 @@ void FormBase::show()
if (!allow_resize_) if (!allow_resize_)
fl_set_form_maxsize(form(), minw_, minh_); fl_set_form_maxsize(form(), minw_, minh_);
int const iconify = getController().IconifyWithMain() ?
FL_TRANSIENT : 0;
fl_show_form(form(), fl_show_form(form(),
FL_PLACE_MOUSE | FL_FREE_SIZE, FL_PLACE_MOUSE | FL_FREE_SIZE,
(controller_.IconifyWithMain() ? FL_TRANSIENT : 0), iconify,
title_.c_str()); title_.c_str());
} }
@ -166,26 +176,26 @@ extern "C" {
void C_FormBaseApplyCB(FL_OBJECT * ob, long) void C_FormBaseApplyCB(FL_OBJECT * ob, long)
{ {
GetForm(ob)->ApplyButton(); GetForm(ob)->getController().ApplyButton();
} }
void C_FormBaseOKCB(FL_OBJECT * ob, long) void C_FormBaseOKCB(FL_OBJECT * ob, long)
{ {
GetForm(ob)->OKButton(); GetForm(ob)->getController().OKButton();
} }
void C_FormBaseCancelCB(FL_OBJECT * ob, long) void C_FormBaseCancelCB(FL_OBJECT * ob, long)
{ {
FormBase * form = GetForm(ob); FormBase * form = GetForm(ob);
form->CancelButton(); form->getController().CancelButton();
} }
void C_FormBaseRestoreCB(FL_OBJECT * ob, long) void C_FormBaseRestoreCB(FL_OBJECT * ob, long)
{ {
GetForm(ob)->RestoreButton(); GetForm(ob)->getController().RestoreButton();
} }
@ -200,7 +210,7 @@ static int C_WMHideCB(FL_FORM * form, void *)
// Close the dialog cleanly, even if the WM is used to do so. // Close the dialog cleanly, even if the WM is used to do so.
lyx::Assert(form && form->u_vdata); lyx::Assert(form && form->u_vdata);
FormBase * ptr = static_cast<FormBase *>(form->u_vdata); FormBase * ptr = static_cast<FormBase *>(form->u_vdata);
ptr->CancelButton(); ptr->getController().CancelButton();
return FL_CANCEL; return FL_CANCEL;
} }

View File

@ -28,16 +28,15 @@
class xformsBC; class xformsBC;
class Tooltips; class Tooltips;
class Dialogs;
/** This class is an XForms GUI base class. /** This class is an XForms GUI base class.
*/ */
class FormBase : public ViewBC<xformsBC>, public FeedbackController class FormBase : public ViewBase, public FeedbackController
{ {
public: public:
/// ///
FormBase(ControlButtons &, Dialogs &, FormBase(string const &, bool allowResize);
string const &, bool allowResize);
/// ///
virtual ~FormBase(); virtual ~FormBase();
@ -64,6 +63,9 @@ protected:
*/ */
static void setPrehandler(FL_OBJECT * ob); static void setPrehandler(FL_OBJECT * ob);
///
xformsBC & bc();
private: private:
/// Pointer to the actual instantiation of xform's form /// Pointer to the actual instantiation of xform's form
virtual FL_FORM * form() const = 0; virtual FL_FORM * form() const = 0;
@ -93,8 +95,7 @@ class FormDB: public FormBase
{ {
protected: protected:
/// ///
FormDB(ControlButtons &, Dialogs &, FormDB(string const &, bool allowResize=true);
string const &, bool allowResize=true);
/// Pointer to the actual instantiation of xform's form /// Pointer to the actual instantiation of xform's form
virtual FL_FORM * form() const; virtual FL_FORM * form() const;
/// Real GUI implementation. /// Real GUI implementation.
@ -103,9 +104,8 @@ protected:
template <class Dialog> template <class Dialog>
FormDB<Dialog>::FormDB(ControlButtons & c, Dialogs & d, FormDB<Dialog>::FormDB(string const & t, bool allowResize)
string const & t, bool allowResize) : FormBase(t, allowResize)
: FormBase(c, d, t, allowResize)
{} {}
@ -122,25 +122,31 @@ class FormCB: public Base
{ {
protected: protected:
/// ///
FormCB(Controller &, Dialogs &, FormCB(string const &, bool allowResize = true);
string const &, bool allowResize = true);
/// The parent controller /// The parent controller
Controller & controller() const; Controller & controller();
///
Controller const & controller() const;
}; };
template <class Controller, class Base> template <class Controller, class Base>
FormCB<Controller, Base>::FormCB(Controller & c, Dialogs & d, FormCB<Controller, Base>::FormCB(string const & t, bool allowResize)
string const & t, bool allowResize) : Base(t, allowResize)
: Base(c, d, t, allowResize)
{} {}
template <class Controller, class Base> template <class Controller, class Base>
Controller & FormCB<Controller, Base>::controller() const Controller & FormCB<Controller, Base>::controller()
{ {
return static_cast<Controller &>(controller_); return static_cast<Controller &>(getController());
//return dynamic_cast<Controller &>(controller_); }
template <class Controller, class Base>
Controller const & FormCB<Controller, Base>::controller() const
{
return static_cast<Controller const &>(getController());
} }

View File

@ -43,7 +43,7 @@ FormBaseDeprecated::FormBaseDeprecated(LyXView * lv, Dialogs * d,
string const & t, bool allowResize) string const & t, bool allowResize)
: lv_(lv), d_(d), title_(t), : lv_(lv), d_(d), title_(t),
minw_(0), minh_(0), allow_resize_(allowResize), minw_(0), minh_(0), allow_resize_(allowResize),
tooltips_(new Tooltips(*d)) tooltips_(new Tooltips())
{ {
lyx::Assert(lv && d); lyx::Assert(lv && d);
} }

View File

@ -27,7 +27,7 @@
#include "forms_fwd.h" #include "forms_fwd.h"
//#include <boost/signals/trackable.hpp> #include <boost/signals/connection.hpp>
class Buffer; class Buffer;
class Dialogs; class Dialogs;

View File

@ -22,8 +22,8 @@
typedef FormCB<ControlBibitem, FormDB<FD_bibitem> > base_class; typedef FormCB<ControlBibitem, FormDB<FD_bibitem> > base_class;
FormBibitem::FormBibitem(ControlBibitem & c, Dialogs & d) FormBibitem::FormBibitem()
: base_class(c, d, _("Bibliography Entry")) : base_class(_("Bibliography Entry"))
{} {}

View File

@ -26,7 +26,7 @@ struct FD_bibitem;
class FormBibitem : public FormCB<ControlBibitem, FormDB<FD_bibitem> > { class FormBibitem : public FormCB<ControlBibitem, FormDB<FD_bibitem> > {
public: public:
/// ///
FormBibitem(ControlBibitem &, Dialogs &); FormBibitem();
private: private:
/// Set the Params variable for the Controller. /// Set the Params variable for the Controller.
virtual void apply(); virtual void apply();

View File

@ -36,8 +36,8 @@ using std::sort;
typedef FormCB<ControlBibtex, FormDB<FD_bibtex> > base_class; typedef FormCB<ControlBibtex, FormDB<FD_bibtex> > base_class;
FormBibtex::FormBibtex(ControlBibtex & c, Dialogs & d) FormBibtex::FormBibtex()
: base_class(c, d, _("BibTeX Database")) : base_class(_("BibTeX Database"))
{} {}

View File

@ -26,7 +26,7 @@ struct FD_bibtex;
class FormBibtex : public FormCB<ControlBibtex, FormDB<FD_bibtex> > { class FormBibtex : public FormCB<ControlBibtex, FormDB<FD_bibtex> > {
public: public:
/// ///
FormBibtex(ControlBibtex &, Dialogs &); FormBibtex();
private: private:
/// Set the Params variable for the Controller. /// Set the Params variable for the Controller.
virtual void apply(); virtual void apply();

View File

@ -16,9 +16,8 @@
#include "forms/form_browser.h" #include "forms/form_browser.h"
#include "xformsBC.h" #include "xformsBC.h"
FormBrowser::FormBrowser(ControlButtons & c, Dialogs & d, FormBrowser::FormBrowser(string const & t, bool allowResize)
string const & t, bool allowResize) : FormDB<FD_browser>(t, allowResize)
: FormDB<FD_browser>(c, d, t, allowResize)
{} {}

View File

@ -26,8 +26,7 @@ struct FD_browser;
class FormBrowser : public FormDB<FD_browser> { class FormBrowser : public FormDB<FD_browser> {
public: public:
/// ///
FormBrowser(ControlButtons &, Dialogs &, FormBrowser(string const &, bool allowResize = true);
string const &, bool allowResize = true);
private: private:
/// Build the dialog. /// Build the dialog.
virtual void build(); virtual void build();

View File

@ -36,8 +36,8 @@ using namespace frnt;
typedef FormCB<ControlCharacter, FormDB<FD_character> > base_class; typedef FormCB<ControlCharacter, FormDB<FD_character> > base_class;
FormCharacter::FormCharacter(ControlCharacter & c, Dialogs & d) FormCharacter::FormCharacter()
: base_class(c, d, _("Character Layout"), false) : base_class(_("Character Layout"), false)
{} {}

View File

@ -35,7 +35,7 @@ class FormCharacter
: public FormCB<ControlCharacter, FormDB<FD_character> > { : public FormCB<ControlCharacter, FormDB<FD_character> > {
public: public:
/// ///
FormCharacter(ControlCharacter &, Dialogs &); FormCharacter();
private: private:
/// Apply from dialog /// Apply from dialog

View File

@ -115,8 +115,8 @@ void updateStyle(FD_citation * dialog, string command)
typedef FormCB<ControlCitation, FormDB<FD_citation> > base_class; typedef FormCB<ControlCitation, FormDB<FD_citation> > base_class;
FormCitation::FormCitation(ControlCitation & c, Dialogs & d) FormCitation::FormCitation()
: base_class(c, d, _("Citation"), false) : base_class(_("Citation"), false)
{} {}

View File

@ -25,7 +25,7 @@ struct FD_citation;
class FormCitation : public FormCB<ControlCitation, FormDB<FD_citation> > { class FormCitation : public FormCB<ControlCitation, FormDB<FD_citation> > {
public: public:
/// ///
FormCitation(ControlCitation &, Dialogs &); FormCitation();
private: private:
/// ///
enum State { enum State {

View File

@ -23,8 +23,8 @@
typedef FormCB<ControlERT, FormDB<FD_ert> > base_class; typedef FormCB<ControlERT, FormDB<FD_ert> > base_class;
FormERT::FormERT(ControlERT & c, Dialogs & d) FormERT::FormERT()
: base_class(c, d, _("ERT Options")) : base_class(_("ERT Options"))
{} {}

View File

@ -26,7 +26,7 @@ class FormERT
: public FormCB<ControlERT, FormDB<FD_ert> > { : public FormCB<ControlERT, FormDB<FD_ert> > {
public: public:
/// ///
FormERT(ControlERT &, Dialogs &); FormERT();
private: private:
/// Set the Params variable for the Controller. /// Set the Params variable for the Controller.
virtual void apply(); virtual void apply();

View File

@ -21,8 +21,8 @@
typedef FormCB<ControlError, FormDB<FD_error> > base_class; typedef FormCB<ControlError, FormDB<FD_error> > base_class;
FormError::FormError(ControlError & c, Dialogs & d) FormError::FormError()
: base_class(c, d, _("LaTeX Error")) : base_class(_("LaTeX Error"))
{} {}

View File

@ -24,7 +24,7 @@ struct FD_error;
class FormError : public FormCB<ControlError, FormDB<FD_error> > { class FormError : public FormCB<ControlError, FormDB<FD_error> > {
public: public:
/// Constructor /// Constructor
FormError(ControlError &, Dialogs &); FormError();
private: private:
/// not needed. /// not needed.
virtual void apply() {} virtual void apply() {}

View File

@ -27,8 +27,8 @@
typedef FormCB<ControlExternal, FormDB<FD_external> > base_class; typedef FormCB<ControlExternal, FormDB<FD_external> > base_class;
FormExternal::FormExternal(ControlExternal & c, Dialogs & d) FormExternal::FormExternal()
: base_class(c, d, _("Edit external file")) : base_class(_("Edit external file"))
{} {}

View File

@ -26,7 +26,7 @@ struct FD_external;
class FormExternal : public FormCB<ControlExternal, FormDB<FD_external> > { class FormExternal : public FormCB<ControlExternal, FormDB<FD_external> > {
public: public:
/// ///
FormExternal(ControlExternal &, Dialogs &); FormExternal();
private: private:
/// apply changes /// apply changes
void apply(); void apply();

View File

@ -23,8 +23,8 @@
typedef FormCB<ControlFloat, FormDB<FD_float> > base_class; typedef FormCB<ControlFloat, FormDB<FD_float> > base_class;
FormFloat::FormFloat(ControlFloat & c, Dialogs & d) FormFloat::FormFloat()
: base_class(c, d, _("Float Options")) : base_class(_("Float Options"))
{} {}

Some files were not shown because too many files have changed in this diff Show More