2 * \file GuiShowFile.cpp
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
13 #include "GuiShowFile.h"
15 #include "qt_helpers.h"
17 #include <QTextBrowser>
18 #include <QPushButton>
19 #include <QCloseEvent>
24 /////////////////////////////////////////////////////////////////////
28 /////////////////////////////////////////////////////////////////////
30 GuiShowFileDialog::GuiShowFileDialog(GuiShowFile * form)
34 connect(closePB, SIGNAL(clicked()), form, SLOT(slotClose()));
38 void GuiShowFileDialog::closeEvent(QCloseEvent * e)
45 /////////////////////////////////////////////////////////////////////
49 /////////////////////////////////////////////////////////////////////
52 GuiShowFile::GuiShowFile(Dialog & parent)
53 : GuiView<GuiShowFileDialog>(parent, _("Show File"))
58 void GuiShowFile::build_dialog()
60 dialog_.reset(new GuiShowFileDialog(this));
62 bcview().setCancel(dialog_->closePB);
66 void GuiShowFile::update_contents()
68 dialog_->setWindowTitle(toqstr(controller().getFileName()));
70 std::string contents = controller().getFileContents();
71 if (contents.empty()) {
72 contents = "Error -> Cannot load file!";
75 dialog_->textTB->setPlainText(toqstr(contents));
78 } // namespace frontend
81 #include "GuiShowFile_moc.cpp"