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>
26 typedef QController<ControlShowFile, QView<QShowFileDialog> > base_class;
29 QShowFile::QShowFile(Dialog & parent)
30 : base_class(parent, _("LyX: Show File"))
35 void QShowFile::build_dialog()
37 dialog_.reset(new QShowFileDialog(this));
39 bcview().setCancel(dialog_->closePB);
43 void QShowFile::update_contents()
45 dialog_->setName(toqstr(controller().getFileName()));
47 string contents = controller().getFileContents();
48 if (contents.empty()) {
49 contents = "Error -> Cannot load file!";
52 dialog_->text->setText(toqstr(contents));