1 /* This file is part of
2 * =================================================
4 * LyX, The Document Processor
5 * Copyright 1995 Matthias Ettrich.
6 * Copyright 1995-2000 The LyX Team.
8 * ================================================= */
11 #pragma implementation
15 #include "GnomeBase.h"
16 #include "support/LAssert.h"
18 #include "support/filetools.h"
21 #include <gnome--/dialog.h>
23 GnomeBase::GnomeBase(ControlButtons & c,
26 , file_(name + ".glade"), widget_name_(name), xml_(0)
30 GnomeBase::~GnomeBase()
33 gtk_object_unref(GTK_OBJECT(xml_));
37 void GnomeBase::loadXML() const
40 #warning Change this before declaring it production code! (be 20010325)
42 string const path("src/frontends/gnome/dialogs/;frontends/gnome/dialogs/;");
43 string const file = FileOpenSearch(path, file_, "glade");
46 lyxerr << "Cannot find glade file. Aborting." << std::endl;
50 lyxerr[Debug::GUI] << "Glade file to open is " << file << '\n';
52 xml_ = glade_xml_new(file.c_str(), widget_name_.c_str());
56 void GnomeBase::show()
63 void GnomeBase::hide()
68 bool GnomeBase::validate()
73 void GnomeBase::OKClicked()
75 lyxerr[Debug::GUI] << "GnomeBase::OKClicked()\n";
79 void GnomeBase::CancelClicked()
81 lyxerr[Debug::GUI] << "GnomeBase::CancelClicked()\n";
85 void GnomeBase::ApplyClicked()
87 lyxerr[Debug::GUI] << "GnomeBase::ApplyClicked()\n";
91 void GnomeBase::RestoreClicked()
93 lyxerr[Debug::GUI] << "GnomeBase::RestoreClicked()\n";
97 void GnomeBase::InputChanged()
99 bc().valid(validate());
102 Gnome::Dialog * GnomeBase::dialog()
105 dialog_ = getWidget<Gnome::Dialog>(widget_name_.c_str());