]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormShowFile.C
remove defaults stuff, let Qt handle no toolbar
[lyx.git] / src / frontends / xforms / FormShowFile.C
1 /**
2  * \file FormShowFile.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Herbert Voss
7  *
8  * Full author contact details are available in file CREDITS
9  */
10
11 #include <config.h>
12
13
14 #include "xformsBC.h"
15 #include "ControlShowFile.h"
16 #include "FormShowFile.h"
17 #include "forms/form_browser.h"
18 #include "gettext.h"
19 #include FORMS_H_LOCATION
20
21
22 FormShowFile::FormShowFile(Dialog & parent)
23         : FormController<ControlShowFile, FormBrowser>(parent, _("Show File"))
24 {}
25
26
27 void FormShowFile::update()
28 {
29         fl_hide_object(dialog_->button_update);
30         fl_clear_browser(dialog_->browser);
31
32         // courier medium
33         fl_set_browser_fontstyle(dialog_->browser,FL_FIXED_STYLE);
34
35         string const title = "LyX: " + controller().getFileName();
36         fl_set_form_title(dialog_->form, title.c_str());
37
38         string const contents = controller().getFileContents();
39         if (contents.empty())
40                 fl_add_browser_line(dialog_->browser,
41                                     "Error -> Cannot load file!");
42         else
43                 fl_add_browser_line(dialog_->browser, contents.c_str());
44 }