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 "QShowFile.h"
14 #include "QShowFileDialog.h"
16 #include "qt_helpers.h"
18 #include "controllers/ControlShowFile.h"
20 #include <QTextBrowser>
21 #include <QPushButton>
28 typedef QController<ControlShowFile, QView<QShowFileDialog> > base_class;
31 QShowFile::QShowFile(Dialog & parent)
32 : base_class(parent, _("Show File"))
37 void QShowFile::build_dialog()
39 dialog_.reset(new QShowFileDialog(this));
41 bcview().setCancel(dialog_->closePB);
45 void QShowFile::update_contents()
47 dialog_->setWindowTitle(toqstr(controller().getFileName()));
49 string contents = controller().getFileContents();
50 if (contents.empty()) {
51 contents = "Error -> Cannot load file!";
54 dialog_->textTB->setPlainText(toqstr(contents));
57 } // namespace frontend