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 #pragma implementation
17 #include "ControlShowFile.h"
20 #include "QShowFile.h"
21 #include "QShowFileDialog.h"
24 #include <qtextview.h>
25 #include <qpushbutton.h>
27 typedef Qt2CB<ControlShowFile, Qt2DB<QShowFileDialog> > base_class;
29 QShowFile::QShowFile()
30 : base_class(_("ShowFile"))
35 void QShowFile::build_dialog()
37 dialog_.reset(new QShowFileDialog(this));
39 bc().setCancel(dialog_->closePB);
43 void QShowFile::update_contents()
45 dialog_->setName(controller().getFileName().c_str());
47 string contents = controller().getFileContents();
48 if (contents.empty()) {
49 contents = "Error -> Cannot load file!";
52 dialog_->text->setText(contents.c_str());