No-op; fix GPL address and use the explicit-program-name version.
[dcpomatic.git] / src / wx / screens_panel.h
1 /*
2     Copyright (C) 2015-2016 Carl Hetherington <cth@carlh.net>
3
4     This file is part of DCP-o-matic.
5
6     DCP-o-matic is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     DCP-o-matic is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
18
19 */
20
21 #include <wx/wx.h>
22 #include <wx/srchctrl.h>
23 #include <wx/treectrl.h>
24 #include <boost/shared_ptr.hpp>
25 #include <list>
26 #include <map>
27
28 class Cinema;
29 class Screen;
30
31 class ScreensPanel : public wxPanel
32 {
33 public:
34         ScreensPanel (wxWindow* parent);
35         ~ScreensPanel ();
36
37         std::list<boost::shared_ptr<Screen> > screens () const;
38         void setup_sensitivity ();
39
40         boost::signals2::signal<void ()> ScreensChanged;
41
42 private:
43         void add_cinemas ();
44         void add_cinema (boost::shared_ptr<Cinema>);
45         boost::optional<wxTreeItemId> add_screen (boost::shared_ptr<Cinema>, boost::shared_ptr<Screen>);
46         void add_cinema_clicked ();
47         void edit_cinema_clicked ();
48         void remove_cinema_clicked ();
49         void add_screen_clicked ();
50         void edit_screen_clicked ();
51         void remove_screen_clicked ();
52         void selection_changed_shim (wxTreeEvent &);
53         void selection_changed ();
54         void search_changed ();
55
56         wxSearchCtrl* _search;
57         wxTreeCtrl* _targets;
58         wxButton* _add_cinema;
59         wxButton* _edit_cinema;
60         wxButton* _remove_cinema;
61         wxButton* _add_screen;
62         wxButton* _edit_screen;
63         wxButton* _remove_screen;
64         wxTreeItemId _root;
65
66         typedef std::map<wxTreeItemId, boost::shared_ptr<Cinema> > CinemaMap;
67         typedef std::map<wxTreeItemId, boost::shared_ptr<Screen> > ScreenMap;
68
69         CinemaMap _cinemas;
70         ScreenMap _screens;
71         CinemaMap _selected_cinemas;
72         ScreenMap _selected_screens;
73
74         bool _ignore_selection_change;
75 };