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