3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
13 #include "GnomeBase.h"
15 #include "support/filetools.h"
16 #include "ControlButtons.h"
19 #include <gtkmm/dialog.h>
22 GnomeBase::GnomeBase(string const & name)
25 file_(name + ".glade"),
34 GnomeBase::~GnomeBase()
37 gnomeBC & GnomeBase::bc()
39 return static_cast<gnomeBC &>(getController().bc());
42 void GnomeBase::loadXML()
45 #warning Change this before declaring it production code! (be 20010325)
47 string const path("src/frontends/gnome/dialogs/;frontends/gnome/dialogs/;");
49 string const file = FileOpenSearch(path, file_, "glade");
52 lyxerr << "Cannot find glade file. Aborting." << std::endl;
56 lyxerr[Debug::GUI] << "Glade file to open is " << file << endl;
58 xml_ = Gnome::Glade::Xml::create (file, widget_name_);
62 void GnomeBase::show()
69 void GnomeBase::hide()
74 bool GnomeBase::isValid()
79 void GnomeBase::OKClicked()
81 lyxerr[Debug::GUI] << "GnomeBase::OKClicked()" << endl;
82 getController().OKButton();
85 void GnomeBase::CancelClicked()
87 lyxerr[Debug::GUI] << "GnomeBase::CancelClicked()" << endl;
88 getController().CancelButton();
91 void GnomeBase::ApplyClicked()
93 lyxerr[Debug::GUI] << "GnomeBase::ApplyClicked()" << endl;
94 getController().ApplyButton();
97 void GnomeBase::RestoreClicked()
99 lyxerr[Debug::GUI] << "GnomeBase::RestoreClicked()" << endl;
100 getController().RestoreButton();
103 void GnomeBase::InputChanged()
105 bc().valid(isValid());
108 Gtk::Dialog * GnomeBase::dialog()
111 dialog_ = getWidget<Gtk::Dialog>(widget_name_);
116 bool GnomeBase::isVisible() const
118 return dialog_ && dialog_->is_visible();