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 // Too hard to make concept checks work with this file
14 #ifdef _GLIBCXX_CONCEPT_CHECKS
15 #undef _GLIBCXX_CONCEPT_CHECKS
17 #ifdef _GLIBCPP_CONCEPT_CHECKS
18 #undef _GLIBCPP_CONCEPT_CHECKS
21 #include "GShowFile.h"
22 #include "ControlShowFile.h"
31 GShowFile::GShowFile(Dialog & parent)
32 : GViewCB<ControlShowFile, GViewGladeB>(parent, lyx::to_utf8(_("Show File")), false)
36 void GShowFile::doBuild()
38 string const gladeName = findGladeFile("showfile");
39 xml_ = Gnome::Glade::Xml::create(gladeName);
41 Gtk::Button * closebutton;
42 xml_->get_widget("Close", closebutton);
43 setCancel(closebutton);
45 Gtk::TextView * contentview;
46 xml_->get_widget("ContentView", contentview);
47 contentbuffer_ = contentview->get_buffer();
51 void GShowFile::update()
53 string const title = controller().getFileName();
58 string const contents = controller().getFileContents();
60 if (!contents.empty())
61 contentbuffer_->set_text(contents);
63 contentbuffer_->set_text(lyx::to_utf8(_("Error reading file!")));
66 } // namespace frontend