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
14 #include "ControlShowFile.h"
15 #include "qt_helpers.h"
17 #include "QShowFile.h"
18 #include "QShowFileDialog.h"
21 #include <qtextview.h>
22 #include <qpushbutton.h>
24 typedef QController<ControlShowFile, QView<QShowFileDialog> > base_class;
27 QShowFile::QShowFile(Dialog & parent)
28 : base_class(parent, _("LyX: Show File"))
33 void QShowFile::build_dialog()
35 dialog_.reset(new QShowFileDialog(this));
37 bcview().setCancel(dialog_->closePB);
41 void QShowFile::update_contents()
43 dialog_->setName(toqstr(controller().getFileName()));
45 string contents = controller().getFileContents();
46 if (contents.empty()) {
47 contents = "Error -> Cannot load file!";
50 dialog_->text->setText(toqstr(contents));