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;
30 QShowFile::QShowFile()
31 : base_class(_("ShowFile"))
36 void QShowFile::build_dialog()
38 dialog_.reset(new QShowFileDialog(this));
40 bc().setCancel(dialog_->closePB);
44 void QShowFile::update_contents()
46 dialog_->setName(controller().getFileName().c_str());
48 string contents = controller().getFileContents();
49 if (contents.empty()) {
50 contents = "Error -> Cannot load file!";
53 dialog_->text->setText(contents.c_str());