3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Michael Koziarski
8 * Full author contact details are available in file CREDITS
12 #pragma implementation
21 #include <gtkmm/button.h>
22 #include <gtkmm/textview.h>
23 #include <gtkmm/dialog.h>
25 GLog::GLog(ControlLog & c)
26 : GnomeCB<ControlLog>(c, "GLog")
36 // Connect the buttons.
37 close_btn()->signal_clicked().connect(SigC::slot(*this, &GLog::CancelClicked));
38 refresh_btn()->signal_clicked().connect(SigC::slot(*this, &GLog::update));
40 // Manage the buttons state
41 bc().setCancel(close_btn());
52 pair<Buffer::LogType, string> const logfile = controller().logfile();
54 if (logfile.first == Buffer::buildlog)
55 dialog()->set_title(_("Build log"));
57 dialog()->set_title(_("LaTeX log"));
59 log_text()->get_buffer()->set_text("");
61 ifstream ifstr(logfile.second.c_str());
63 if (logfile.first == Buffer::buildlog)
64 log_text()->get_buffer()->set_text(_("No build log file found"));
66 log_text()->get_buffer()->set_text(_("No LaTeX log file found"));
73 while (getline(ifstr, line))
76 log_text()->get_buffer()->set_text(text);
80 Gtk::Button * GLog::refresh_btn() const
82 return getWidget<Gtk::Button>("r_refresh_btn");
84 Gtk::Button * GLog::close_btn() const
86 return getWidget<Gtk::Button>("r_close_btn");
88 Gtk::TextView * GLog::log_text() const
90 return getWidget<Gtk::TextView>("r_log_text");