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
12 #pragma implementation
16 #include "GnomeBase.h"
17 #include "support/LAssert.h"
19 #include "support/filetools.h"
20 #include "ControlButtons.h"
22 #include <gtkmm/dialog.h>
24 GnomeBase::GnomeBase(string const & name)
27 file_(name + ".glade"),
36 GnomeBase::~GnomeBase()
39 gnomeBC & GnomeBase::bc()
41 return static_cast<gnomeBC &>(getController().bc());
44 void GnomeBase::loadXML()
47 #warning Change this before declaring it production code! (be 20010325)
49 string const path("src/frontends/gnome/dialogs/;frontends/gnome/dialogs/;");
51 string const file = FileOpenSearch(path, file_, "glade");
54 lyxerr << "Cannot find glade file. Aborting." << std::endl;
58 lyxerr[Debug::GUI] << "Glade file to open is " << file << '\n';
60 xml_ = Gnome::Glade::Xml::create (file, widget_name_);
64 void GnomeBase::show()
71 void GnomeBase::hide()
76 bool GnomeBase::isValid()
81 void GnomeBase::OKClicked()
83 lyxerr[Debug::GUI] << "GnomeBase::OKClicked()\n";
84 getController().OKButton();
87 void GnomeBase::CancelClicked()
89 lyxerr[Debug::GUI] << "GnomeBase::CancelClicked()\n";
90 getController().CancelButton();
93 void GnomeBase::ApplyClicked()
95 lyxerr[Debug::GUI] << "GnomeBase::ApplyClicked()\n";
96 getController().ApplyButton();
99 void GnomeBase::RestoreClicked()
101 lyxerr[Debug::GUI] << "GnomeBase::RestoreClicked()\n";
102 getController().RestoreButton();
105 void GnomeBase::InputChanged()
107 bc().valid(isValid());
110 Gtk::Dialog * GnomeBase::dialog()
113 dialog_ = getWidget<Gtk::Dialog>(widget_name_);
118 bool GnomeBase::isVisible() const
120 return dialog_ && dialog_->is_visible();