+
+docstring GuiLog::title() const
+{
+ switch (type_) {
+ case LatexLog:
+ return _("LaTeX Log");
+ case LiterateLog:
+ return _("Literate Programming Build Log");
+ case Lyx2lyxLog:
+ return _("lyx2lyx Error Log");
+ case VCLog:
+ return _("Version Control Log");
+ default:
+ return docstring();
+ }
+}
+
+
+void GuiLog::getContents(ostream & ss) const
+{
+ ifstream in(logfile_.toFilesystemEncoding().c_str());
+
+ bool success = false;
+
+ // FIXME UNICODE
+ // Our caller interprets the file contents as UTF8, but is that
+ // correct?
+ if (in) {
+ ss << in.rdbuf();
+ success = ss.good();
+ }
+
+ if (success)
+ return;
+
+ switch (type_) {
+ case LatexLog:
+ ss << to_utf8(_("No LaTeX log file found."));
+ break;
+ case LiterateLog:
+ ss << to_utf8(_("No literate programming build log file found."));
+ break;
+ case Lyx2lyxLog:
+ ss << to_utf8(_("No lyx2lyx error log file found."));
+ break;
+ case VCLog:
+ ss << to_utf8(_("No version control log file found."));
+ break;
+ }
+}
+
+
+void GuiLog::on_copyPB_clicked()
+{
+ qApp->clipboard()->setText(logTB->toPlainText());
+}
+
+
+Dialog * createGuiLog(GuiView & lv) { return new GuiLog(lv); }
+
+