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"
14 #include "qt_helpers.h"
16 #include <QTextBrowser>
17 #include <QPushButton>
18 #include <QCloseEvent>
23 /////////////////////////////////////////////////////////////////////
27 /////////////////////////////////////////////////////////////////////
29 GuiShowFileDialog::GuiShowFileDialog(GuiShowFile * form)
33 connect(closePB, SIGNAL(clicked()), form, SLOT(slotClose()));
37 void GuiShowFileDialog::closeEvent(QCloseEvent * e)
44 /////////////////////////////////////////////////////////////////////
48 /////////////////////////////////////////////////////////////////////
51 GuiShowFile::GuiShowFile(GuiDialog & parent)
52 : GuiView<GuiShowFileDialog>(parent, _("Show File"))
57 void GuiShowFile::build_dialog()
59 dialog_.reset(new GuiShowFileDialog(this));
61 bc().setCancel(dialog_->closePB);
65 void GuiShowFile::update_contents()
67 dialog_->setWindowTitle(toqstr(controller().getFileName()));
69 std::string contents = controller().getFileContents();
70 if (contents.empty()) {
71 contents = "Error -> Cannot load file!";
74 dialog_->textTB->setPlainText(toqstr(contents));
77 } // namespace frontend
80 #include "GuiShowFile_moc.cpp"