#include <QTextBrowser>
#include <QPushButton>
-#include <QCloseEvent>
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()));
}
-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);
}
} // namespace frontend
} // namespace lyx
-#include "GuiShowFile_moc.cpp"
+#include "moc_GuiShowFile.cpp"