]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/gnome/GnomeBase.C
ws cleanup
[lyx.git] / src / frontends / gnome / GnomeBase.C
index cb56013590aed57c5c43cc5df64a1dad1986f9f4..8bff90e9b7aca87d73a376f578fc856fb78514a8 100644 (file)
@@ -1,6 +1,6 @@
 /* This file is part of
  * =================================================
- * 
+ *
  *          LyX, The Document Processor
  *          Copyright 1995 Matthias Ettrich.
  *          Copyright 1995-2000 The LyX Team.
 
 #include <gnome--/dialog.h>
 
-GnomeBase::GnomeBase(ControlButtons & c, 
-               string const & glade_file, string const & name)
+GnomeBase::GnomeBase(ControlButtons & c,
+                string const & name)
        : ViewBC<gnomeBC>(c)
-       , file_(glade_file), widget_name_(name), xml_(0)
+       , file_(name + ".glade"), widget_name_(name), xml_(0)
        , dialog_(0)
 {}
-       
+
 GnomeBase::~GnomeBase()
 {
        if (xml_)
                gtk_object_unref(GTK_OBJECT(xml_));
 }
 
-       
+
 void GnomeBase::loadXML() const
 {
 #ifdef WITH_WARNINGS
@@ -46,9 +46,9 @@ void GnomeBase::loadXML() const
                lyxerr << "Cannot find glade file. Aborting." << std::endl;
                lyx::Assert(true);
        }
-       
+
        lyxerr[Debug::GUI] << "Glade file to open is " << file << '\n';
-       
+
        xml_ = glade_xml_new(file.c_str(), widget_name_.c_str());
 }
 
@@ -71,11 +71,41 @@ void GnomeBase::hide()
                dialog_->hide();
 }
 
+bool GnomeBase::validate()
+{
+       return true;
+}
+
+void GnomeBase::OKClicked()
+{
+       lyxerr[Debug::GUI] << "OKClicked()\n";
+       OKButton();
+}
+
+void GnomeBase::CancelClicked()
+{
+       CancelButton();
+}
+
+void GnomeBase::ApplyClicked()
+{
+       ApplyButton();
+}
+
+void GnomeBase::RestoreClicked()
+{
+       RestoreButton();
+}
+
+void GnomeBase::InputChanged()
+{
+       bc().valid(validate());
+}
 
 Gnome::Dialog * GnomeBase::dialog()
 {
-       if (!dialog_) 
+       if (!dialog_)
                dialog_ = getWidget<Gnome::Dialog>(widget_name_.c_str());
-               
+
        return dialog_;
 }