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.
11 #include "GShowFile.h"
12 #include "ControlShowFile.h"
21 GShowFile::GShowFile(Dialog & parent)
22 : GViewCB<ControlShowFile, GViewGladeB>(parent, _("Show File"), false)
26 void GShowFile::doBuild()
28 string const gladeName = findGladeFile("showfile");
29 xml_ = Gnome::Glade::Xml::create(gladeName);
31 Gtk::Button * closebutton;
32 xml_->get_widget("Close", closebutton);
33 setCancel(closebutton);
35 Gtk::TextView * contentview;
36 xml_->get_widget("ContentView", contentview);
37 contentbuffer_ = contentview->get_buffer();
41 void GShowFile::update()
43 string const title = controller().getFileName();
48 string const contents = controller().getFileContents();
50 if (!contents.empty())
51 contentbuffer_->set_text(contents);
53 contentbuffer_->set_text(_("Error reading file!"));
56 } // namespace frontend