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.
18 #include <gtkmm/button.h>
19 #include <gtkmm/textview.h>
20 #include <gtkmm/dialog.h>
23 : GnomeCB<ControlLog>("GLog")
33 // Connect the buttons.
34 close_btn()->signal_clicked().connect(SigC::slot(*this, &GLog::CancelClicked));
35 refresh_btn()->signal_clicked().connect(SigC::slot(*this, &GLog::update));
37 // Manage the buttons state
38 bc().setCancel(close_btn());
49 pair<Buffer::LogType, string> const logfile = controller().logfile();
51 if (logfile.first == Buffer::buildlog)
52 dialog()->set_title(_("Build log"));
54 dialog()->set_title(_("LaTeX log"));
56 log_text()->get_buffer()->set_text("");
58 ifstream ifstr(logfile.second.c_str());
60 if (logfile.first == Buffer::buildlog)
61 log_text()->get_buffer()->set_text(_("No build log file found."));
63 log_text()->get_buffer()->set_text(_("No LaTeX log file found."));
70 while (getline(ifstr, line))
73 log_text()->get_buffer()->set_text(text);
77 Gtk::Button * GLog::refresh_btn() const
79 return getWidget<Gtk::Button>("r_refresh_btn");
81 Gtk::Button * GLog::close_btn() const
83 return getWidget<Gtk::Button>("r_close_btn");
85 Gtk::TextView * GLog::log_text() const
87 return getWidget<Gtk::TextView>("r_log_text");