]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlSplash.C
Added // -*- C++ -*- to the top of all files in controllers/ and xforms/
[lyx.git] / src / frontends / controllers / ControlSplash.C
1 // -*- C++ -*-
2 /**
3  * \file ControlSplash.C
4  * Copyright 2001 the LyX Team
5  * Read the file COPYING
6  *
7  * \author Allan Rae
8  * \author John Levon
9  * \author Angus Leeming, a.leeming@ic.ac.uk
10  */
11
12 #include <config.h>
13
14 #ifdef __GNUG__
15 #pragma implementation
16 #endif
17
18 #include "ControlSplash.h"
19 #include "Dialogs.h"
20 #include "ViewBase.h"
21 #include "version.h"
22 #include "support/filetools.h"
23 #include "lyxrc.h" // show_banner
24
25 ControlSplash::ControlSplash(Dialogs & d)
26         : d_(d)
27 {
28         c_ = d.showSplash.connect(SigC::slot(this, &ControlSplash::show));
29 }
30
31
32 string const & ControlSplash::bannerFile() const
33 {
34         return banner_file_;
35 }
36
37
38 string const & ControlSplash::LyXVersion() const
39 {
40         return version_;
41 }
42
43
44 void ControlSplash::show()
45 {
46         if (!lyxrc.show_banner)
47                 return;
48
49         banner_file_ = LibFileSearch("images", "banner", "xpm");
50         if (banner_file_.empty())
51                 return;
52
53         version_ = LYX_VERSION;
54
55         view().show();
56 }
57
58
59 void ControlSplash::hide()
60 {
61         view().hide();
62         c_.disconnect();
63         d_.destroySplash();
64 }