diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-03-11 23:34:00 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-03-17 22:20:31 +0100 |
| commit | f1f30972e5d1dee08a607a05b6d782540c11595e (patch) | |
| tree | 51d183d98d7e31063c3ffd07f6a036383a175de6 /src/wx/screens_panel.h | |
| parent | 76de93fb16f8f2bb08fa2cde106a621169b973ee (diff) | |
Use a vector<pair<...>> to store screens and cinemas instead of a map.
In this way, ordering will be preserved (part of #2208).
Diffstat (limited to 'src/wx/screens_panel.h')
| -rw-r--r-- | src/wx/screens_panel.h | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/wx/screens_panel.h b/src/wx/screens_panel.h index fc7e9751c..c0b90dfcf 100644 --- a/src/wx/screens_panel.h +++ b/src/wx/screens_panel.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2015-2016 Carl Hetherington <cth@carlh.net> + Copyright (C) 2015-2022 Carl Hetherington <cth@carlh.net> This file is part of DCP-o-matic. @@ -18,6 +18,7 @@ */ + #include "lib/warnings.h" DCPOMATIC_DISABLE_WARNINGS #include <wx/wx.h> @@ -28,6 +29,7 @@ DCPOMATIC_ENABLE_WARNINGS #include <list> #include <map> + namespace dcpomatic { class Screen; } @@ -63,6 +65,12 @@ private: void checkbox_changed (wxTreeListEvent& ev); boost::optional<std::pair<wxTreeListItem, std::shared_ptr<Cinema>>> cinema_for_operation () const; + typedef std::vector<std::pair<wxTreeListItem, std::shared_ptr<Cinema>>> Cinemas; + typedef std::vector<std::pair<wxTreeListItem, std::shared_ptr<dcpomatic::Screen>>> Screens; + + Cinemas::iterator cinema_by_tree_list_item (wxTreeListItem item); + Screens::const_iterator screen_by_tree_list_item (wxTreeListItem item) const; + wxSearchCtrl* _search; wxTreeListCtrl* _targets; wxButton* _add_cinema; @@ -72,13 +80,10 @@ private: wxButton* _edit_screen; wxButton* _remove_screen; - typedef std::map<wxTreeListItem, std::shared_ptr<Cinema>> CinemaMap; - typedef std::map<wxTreeListItem, std::shared_ptr<dcpomatic::Screen>> ScreenMap; - - CinemaMap _cinemas; - ScreenMap _screens; - CinemaMap _selected_cinemas; - ScreenMap _selected_screens; + Cinemas _cinemas; + Screens _screens; + Cinemas _selected_cinemas; + Screens _selected_screens; bool _ignore_selection_change; |
