X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiShowFile.cpp;h=8dc7a98df1f3b6b4597564b3d14b19af439c745f;hb=5a46224f7311067cda747e0cae32d22dd919f179;hp=ac4e514fd7e3b23cc652832355990c00b551b487;hpb=7c392af6eab5e06a4836146859cbd9f2c3764420;p=lyx.git diff --git a/src/frontends/qt4/GuiShowFile.cpp b/src/frontends/qt4/GuiShowFile.cpp index ac4e514fd7..8dc7a98df1 100644 --- a/src/frontends/qt4/GuiShowFile.cpp +++ b/src/frontends/qt4/GuiShowFile.cpp @@ -18,7 +18,6 @@ #include #include -#include 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"