]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiLog.cpp
GuiTabular, InsetTabular: fix http://bugzilla.lyx.org/show_bug.cgi?id=5752
[lyx.git] / src / frontends / qt4 / GuiLog.cpp
index 438ecb6099dd8807ae963a39b82c94215dab0027..2ddadc9226af3b684354f14dc0578ebfe8d489c5 100644 (file)
 
 #include "GuiApplication.h"
 #include "qt_helpers.h"
-#include "gettext.h"
 #include "Lexer.h"
 
-#include <QCloseEvent>
+#include "support/docstring.h"
+#include "support/gettext.h"
+
 #include <QTextBrowser>
 #include <QSyntaxHighlighter>
 #include <QClipboard>
 #include <fstream>
 #include <sstream>
 
-using std::istringstream;
-using std::ostream;
-using std::string;
-
+using namespace std;
+using namespace lyx::support;
 
 namespace lyx {
 namespace frontend {
 
-using support::FileName;
-
 /////////////////////////////////////////////////////////////////////
 //
 // LogHighlighter
@@ -102,8 +99,8 @@ void LogHighlighter::highlightBlock(QString const & text)
 //
 /////////////////////////////////////////////////////////////////////
 
-GuiLog::GuiLog(LyXView & lv)
-       : GuiDialog(lv, "log"), type_(LatexLog)
+GuiLog::GuiLog(GuiView & lv)
+       : GuiDialog(lv, "log", qt_("LaTeX Log")), type_(LatexLog)
 {
        setupUi(this);
 
@@ -124,18 +121,11 @@ GuiLog::GuiLog(LyXView & lv)
 }
 
 
-void GuiLog::closeEvent(QCloseEvent * e)
-{
-       slotClose();
-       e->accept();
-}
-
-
 void GuiLog::updateContents()
 {
-       setViewTitle(title());
+       setTitle(toqstr(title()));
 
-       std::ostringstream ss;
+       ostringstream ss;
        getContents(ss);
 
        logTB->setPlainText(toqstr(ss.str()));
@@ -145,7 +135,7 @@ void GuiLog::updateContents()
 bool GuiLog::initialiseParams(string const & data)
 {
        istringstream is(data);
-       Lexer lex(0,0);
+       Lexer lex;
        lex.setStream(is);
 
        string logtype, logfile;
@@ -170,6 +160,9 @@ bool GuiLog::initialiseParams(string const & data)
                return false;
 
        logfile_ = FileName(logfile);
+
+       updateContents();
+
        return true;
 }
 
@@ -197,9 +190,9 @@ docstring GuiLog::title() const
 }
 
 
-void GuiLog::getContents(std::ostream & ss) const
+void GuiLog::getContents(ostream & ss) const
 {
-       std::ifstream in(logfile_.toFilesystemEncoding().c_str());
+       ifstream in(logfile_.toFilesystemEncoding().c_str());
 
        bool success = false;
 
@@ -237,10 +230,10 @@ void GuiLog::on_copyPB_clicked()
 }
 
 
-Dialog * createGuiLog(LyXView & lv) { return new GuiLog(lv); }
+Dialog * createGuiLog(GuiView & lv) { return new GuiLog(lv); }
 
 
 } // namespace frontend
 } // namespace lyx
 
-#include "GuiLog_moc.cpp"
+#include "moc_GuiLog.cpp"