X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiShowFile.cpp;h=c2a4360b2fca7ff0b4f42ce9cb553ebaad23b297;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=c7c4c373191b9c5760ee2aaaad0432a6ddbf21bf;hpb=9abb7db46800e554f57e865a3e768602ffd9d6f1;p=lyx.git diff --git a/src/frontends/qt4/GuiShowFile.cpp b/src/frontends/qt4/GuiShowFile.cpp index c7c4c37319..c2a4360b2f 100644 --- a/src/frontends/qt4/GuiShowFile.cpp +++ b/src/frontends/qt4/GuiShowFile.cpp @@ -18,21 +18,18 @@ #include #include -#include using namespace std; +using namespace lyx::support; namespace lyx { namespace frontend { -using support::FileName; -using support::onlyFilename; 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())); @@ -41,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); } @@ -79,4 +69,4 @@ Dialog * createGuiShowFile(GuiView & lv) { return new GuiShowFile(lv); } } // namespace frontend } // namespace lyx -#include "GuiShowFile_moc.cpp" +#include "moc_GuiShowFile.cpp"