#include "debug.h"
#include "support/filetools.h"
#include <glib.h>
-
-#include <gnome--/dialog.h>
+#include <gtkmm/dialog.h>
GnomeBase::GnomeBase(ControlButtons & c,
string const & name)
: ViewBC<gnomeBC>(c)
, file_(name + ".glade"), widget_name_(name), xml_(0)
, dialog_(0)
-{}
-
-GnomeBase::~GnomeBase()
{
- if (xml_)
- gtk_object_unref(GTK_OBJECT(xml_));
+ loadXML();
}
+GnomeBase::~GnomeBase()
+{}
+
-void GnomeBase::loadXML() const
+void GnomeBase::loadXML()
{
#ifdef WITH_WARNINGS
#warning Change this before declaring it production code! (be 20010325)
#endif
- string const path("src/frontends/gnome/dialogs/;frontends/gnome/dialogs/;/home/baruch/prog/lyx/graphics/src/frontends/gnome/dialogs/");
+ string const path("src/frontends/gnome/dialogs/;frontends/gnome/dialogs/;");
string const file = FileOpenSearch(path, file_, "glade");
if (file.empty()) {
lyxerr[Debug::GUI] << "Glade file to open is " << file << '\n';
- xml_ = glade_xml_new(file.c_str(), widget_name_.c_str());
+ xml_ = Gnome::Glade::Xml::create (file, widget_name_);
}
void GnomeBase::show()
{
- if (!dialog_) {
- dialog_ = dialog();
- build();
- }
-
update();
- dialog_->show();
+ dialog()->show();
}
void GnomeBase::hide()
{
- if (dialog_)
- dialog_->hide();
+ dialog()->hide();
}
bool GnomeBase::validate()
void GnomeBase::OKClicked()
{
- lyxerr[Debug::GUI] << "OKClicked()\n";
+ lyxerr[Debug::GUI] << "GnomeBase::OKClicked()\n";
OKButton();
}
-void GnomeBase::CancelClicked()
-{
- CancelButton();
+void GnomeBase::CancelClicked()
+{
+ lyxerr[Debug::GUI] << "GnomeBase::CancelClicked()\n";
+ CancelButton();
}
-void GnomeBase::ApplyClicked()
-{
- ApplyButton();
+void GnomeBase::ApplyClicked()
+{
+ lyxerr[Debug::GUI] << "GnomeBase::ApplyClicked()\n";
+ ApplyButton();
}
-void GnomeBase::RestoreClicked()
-{
- RestoreButton();
+void GnomeBase::RestoreClicked()
+{
+ lyxerr[Debug::GUI] << "GnomeBase::RestoreClicked()\n";
+ RestoreButton();
}
void GnomeBase::InputChanged()
bc().valid(validate());
}
-Gnome::Dialog * GnomeBase::dialog()
+Gtk::Dialog * GnomeBase::dialog()
{
if (!dialog_)
- dialog_ = getWidget<Gnome::Dialog>(widget_name_.c_str());
+ dialog_ = getWidget<Gtk::Dialog>(widget_name_);
return dialog_;
}