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 // Too hard to make concept checks work with this file
12 #ifdef _GLIBCXX_CONCEPT_CHECKS
13 #undef _GLIBCXX_CONCEPT_CHECKS
16 #include "GShowFile.h"
17 #include "ControlShowFile.h"
26 GShowFile::GShowFile(Dialog & parent)
27 : GViewCB<ControlShowFile, GViewGladeB>(parent, _("Show File"), false)
31 void GShowFile::doBuild()
33 string const gladeName = findGladeFile("showfile");
34 xml_ = Gnome::Glade::Xml::create(gladeName);
36 Gtk::Button * closebutton;
37 xml_->get_widget("Close", closebutton);
38 setCancel(closebutton);
40 Gtk::TextView * contentview;
41 xml_->get_widget("ContentView", contentview);
42 contentbuffer_ = contentview->get_buffer();
46 void GShowFile::update()
48 string const title = controller().getFileName();
53 string const contents = controller().getFileContents();
55 if (!contents.empty())
56 contentbuffer_->set_text(contents);
58 contentbuffer_->set_text(_("Error reading file!"));
61 } // namespace frontend