diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-05-20 22:51:49 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-05-06 20:42:50 +0200 |
| commit | a3fcbb3a76e079a5485a0552ea5d35b8d6739116 (patch) | |
| tree | 58f6476b7197c0e32b5aa3d52d0859a9b04db268 /src/wx/screens_panel.h | |
| parent | a4105c6e8dc83407abc9b12e80c958673c942888 (diff) | |
Use sqlite for cinema and DKDM recipient lists.
Diffstat (limited to 'src/wx/screens_panel.h')
| -rw-r--r-- | src/wx/screens_panel.h | 50 |
1 files changed, 21 insertions, 29 deletions
diff --git a/src/wx/screens_panel.h b/src/wx/screens_panel.h index 1e07b6236..98ec2c631 100644 --- a/src/wx/screens_panel.h +++ b/src/wx/screens_panel.h @@ -19,6 +19,7 @@ */ +#include "lib/cinema_list.h" #include "lib/collator.h" #include "lib/config.h" #include <dcp/warnings.h> @@ -38,7 +39,6 @@ namespace dcpomatic { } -class Cinema; class CheckBox; @@ -48,7 +48,7 @@ public: explicit ScreensPanel (wxWindow* parent); ~ScreensPanel (); - std::vector<std::shared_ptr<dcpomatic::Screen>> screens () const; + std::set<std::pair<CinemaID, ScreenID>> screens() const; void setup_sensitivity (); dcp::UTCOffset best_utc_offset() const; @@ -57,38 +57,35 @@ public: private: void add_cinemas (); - boost::optional<wxTreeListItem> add_cinema (std::shared_ptr<Cinema>, wxTreeListItem previous); - boost::optional<wxTreeListItem> add_screen (std::shared_ptr<Cinema>, std::shared_ptr<dcpomatic::Screen>); + boost::optional<wxTreeListItem> add_cinema(CinemaID cinema, wxTreeListItem previous); + boost::optional<wxTreeListItem> add_screen(CinemaID cinema, ScreenID screen); void add_cinema_clicked (); void edit_cinema_clicked (); - void edit_cinema(std::shared_ptr<Cinema> cinema); + void edit_cinema(CinemaID cinema_id); void remove_cinema_clicked (); void add_screen_clicked (); void edit_screen_clicked (); - void edit_screen(std::shared_ptr<dcpomatic::Screen> screen); + void edit_screen(CinemaID cinema_id, ScreenID screen_id); void remove_screen_clicked (); void selection_changed_shim (wxTreeListEvent &); void selection_changed (); void display_filter_changed(); void checkbox_changed (wxTreeListEvent& ev); void item_activated(wxTreeListEvent& ev); - std::shared_ptr<Cinema> cinema_for_operation () const; + boost::optional<CinemaID> cinema_for_operation() const; void set_screen_checked (wxTreeListItem item, bool checked); void setup_cinema_checked_state (wxTreeListItem screen); void check_all (); void uncheck_all (); - bool notify_cinemas_changed(); void clear_and_re_add(); - void config_changed(Config::Property); void convert_to_lower(std::string& s); - bool matches_search(std::shared_ptr<const Cinema> cinema, std::string search); - std::list<std::shared_ptr<Cinema>> sorted_cinemas() const; + bool matches_search(Cinema const& cinema, std::string search); void setup_show_only_checked(); - std::shared_ptr<Cinema> item_to_cinema (wxTreeListItem item) const; - std::shared_ptr<dcpomatic::Screen> item_to_screen (wxTreeListItem item) const; - boost::optional<wxTreeListItem> cinema_to_item (std::shared_ptr<Cinema> cinema) const; - boost::optional<wxTreeListItem> screen_to_item (std::shared_ptr<dcpomatic::Screen> screen) const; + boost::optional<CinemaID> item_to_cinema(wxTreeListItem item) const; + boost::optional<std::pair<CinemaID, ScreenID>> item_to_screen(wxTreeListItem item) const; + boost::optional<wxTreeListItem> cinema_to_item(CinemaID cinema) const; + boost::optional<wxTreeListItem> screen_to_item(ScreenID screen) const; wxBoxSizer* _overall_sizer; wxSearchCtrl* _search; @@ -106,24 +103,19 @@ private: /* We want to be able to search (and so remove selected things from the view) * but not deselect them, so we maintain lists of selected cinemas and screens. */ - std::vector<std::shared_ptr<Cinema>> _selected_cinemas; - std::vector<std::shared_ptr<dcpomatic::Screen>> _selected_screens; - /* Likewise with checked screens, except that we can work out which cinemas - * are checked from which screens are checked, so we don't need to store the - * cinemas. - */ - std::set<std::shared_ptr<dcpomatic::Screen>> _checked_screens; + std::vector<CinemaID> _selected_cinemas; + /* List of cinema_id, screen_id */ + std::vector<std::pair<CinemaID, ScreenID>> _selected_screens; + /* Likewise with checked screens */ + std::set<std::pair<CinemaID, ScreenID>> _checked_screens; - std::map<wxTreeListItem, std::shared_ptr<Cinema>> _item_to_cinema; - std::map<wxTreeListItem, std::shared_ptr<dcpomatic::Screen>> _item_to_screen; - std::map<std::shared_ptr<Cinema>, wxTreeListItem> _cinema_to_item; - std::map<std::shared_ptr<dcpomatic::Screen>, wxTreeListItem> _screen_to_item; + std::map<wxTreeListItem, CinemaID> _item_to_cinema; + std::map<wxTreeListItem, std::pair<CinemaID, ScreenID>> _item_to_screen; + std::map<CinemaID, wxTreeListItem> _cinema_to_item; + std::map<ScreenID, wxTreeListItem> _screen_to_item; bool _ignore_selection_change = false; bool _ignore_check_change = false; Collator _collator; - - boost::signals2::scoped_connection _config_connection; - bool _ignore_cinemas_changed = false; }; |
