+
+ nextErrorPB->setEnabled(contains(exprError));
+ nextWarningPB->setEnabled(contains(exprWarning));
+}
+
+
+void GuiLog::typeChanged(int i)
+{
+ string const type =
+ fromqstr(logTypeCO->itemData(i).toString());
+ string ext;
+ if (type == "latex")
+ ext = "log";
+ else if (type == "bibtex")
+ ext = "blg";
+ else if (type == "index")
+ ext = "ilg";
+
+ if (!ext.empty())
+ logfile_.changeExtension(ext);
+
+ updateContents();
+}
+
+
+void GuiLog::find()
+{
+ logTB->find(findLE->text());
+}
+
+
+void GuiLog::on_nextErrorPB_clicked()
+{
+ goTo(exprError);
+}
+
+
+void GuiLog::on_nextWarningPB_clicked()
+{
+ goTo(exprWarning);
+}
+
+
+void GuiLog::goTo(QRegExp const & exp) const
+{
+ QTextCursor const newc =
+ logTB->document()->find(exp, logTB->textCursor());
+ logTB->setTextCursor(newc);
+}
+
+
+bool GuiLog::contains(QRegExp const & exp) const
+{
+ return !logTB->document()->find(exp, logTB->textCursor()).isNull();