#include "ViewBase.h"
#include "gnomeBC.h"
-
namespace Gtk {
class Dialog;
};
* This is a base class for Gnome dialogs. It handles all the common
* work that is needed for all dialogs.
*/
-class GnomeBase : public ViewBC<gnomeBC>, public SigC::Object {
+class GnomeBase : public ViewBase, public SigC::Object {
public:
///
- GnomeBase(ControlButtons & c, string const & name);
+ GnomeBase(string const & name);
///
virtual ~GnomeBase();
/// Build the dialog. Also connects signals and prepares it for work.
virtual void build() = 0;
/// Dialog is valid
- virtual bool validate();
+ virtual bool isValid();
+ /// dialog is visible
+ virtual bool isVisible() const;
/// Default OK behaviour
virtual void OKClicked();
/// Default Cancel behaviour
/// Default changed input behaviour
virtual void InputChanged();
+ ///
+ gnomeBC & bc();
+
+ /// are we updating ?
+ bool updating_;
private:
/// Loads the glade file to memory.
void loadXML();
* of the libglade GladeXML structure.
*/
Gtk::Dialog * dialog_;
+
+ /// dialog title, displayed by WM.
+ string title_;
};
template <class Controller>
class GnomeCB : public GnomeBase {
public:
- GnomeCB(Controller & c, string const & name);
+ GnomeCB(string const & name);
protected:
Controller & controller();
};
template <class Controller>
-GnomeCB<Controller>::GnomeCB(Controller & c, string const & name)
- : GnomeBase(c, name)
+GnomeCB<Controller>::GnomeCB(string const & name)
+ : GnomeBase(name)
{}
template <class Controller>
Controller &
GnomeCB<Controller>::controller()
{
- return static_cast<Controller &>(controller_);
+ return static_cast<Controller &>(getController());
}
#endif