]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiShowFile.cpp
* fix spelling in comments to please John.
[lyx.git] / src / frontends / qt4 / GuiShowFile.cpp
index ac4e514fd7e3b23cc652832355990c00b551b487..c2a4360b2fca7ff0b4f42ce9cb553ebaad23b297 100644 (file)
@@ -18,7 +18,6 @@
 
 #include <QTextBrowser>
 #include <QPushButton>
-#include <QCloseEvent>
 
 using namespace std;
 using namespace lyx::support;
@@ -28,10 +27,9 @@ namespace frontend {
 
 
 GuiShowFile::GuiShowFile(GuiView & lv)
-       : GuiDialog(lv, "file")
+       : GuiDialog(lv, "file", qt_("Show File"))
 {
        setupUi(this);
-       setViewTitle(_("Show File"));
 
        connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
 
@@ -40,22 +38,15 @@ GuiShowFile::GuiShowFile(GuiView & lv)
 }
 
 
-void GuiShowFile::closeEvent(QCloseEvent * e)
-{
-       slotClose();
-       e->accept();
-}
-
-
 void GuiShowFile::updateContents()
 {
-       setWindowTitle(toqstr(onlyFilename(filename_.absFilename())));
+       setWindowTitle(onlyFilename(toqstr(filename_.absFilename())));
 
-       docstring contents = filename_.fileContents("UTF-8");
-       if (contents.empty())
-               contents = _("Error -> Cannot load file!");
+       QString contents = toqstr(filename_.fileContents("UTF-8"));
+       if (contents.isEmpty())
+               contents = qt_("Error -> Cannot load file!");
 
-       textTB->setPlainText(toqstr(contents));
+       textTB->setPlainText(contents);
 }
 
 
@@ -78,4 +69,4 @@ Dialog * createGuiShowFile(GuiView & lv) { return new GuiShowFile(lv); }
 } // namespace frontend
 } // namespace lyx
 
-#include "GuiShowFile_moc.cpp"
+#include "moc_GuiShowFile.cpp"