Add PlaylistEditorRestrictedMenus option, similar to PlayerRestrictedMenus.
authorCarl Hetherington <cth@carlh.net>
Sun, 17 Mar 2024 11:24:02 +0000 (12:24 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 17 Mar 2024 11:45:46 +0000 (12:45 +0100)
src/lib/config.cc
src/lib/config.h
src/tools/dcpomatic_playlist.cc

index 56870145a6b5e62c873446a2d8877e80d9855efa..160ef7645b008d0326b6fb329e3196bc851d7c27 100644 (file)
@@ -178,6 +178,7 @@ Config::set_defaults ()
        _gdc_password = optional<string>();
        _player_mode = PLAYER_MODE_WINDOW;
        _player_restricted_menus = false;
+       _playlist_editor_restricted_menus = false;
        _image_display = 0;
        _video_view_type = VIDEO_VIEW_SIMPLE;
        _respect_kdm_validity_periods = true;
@@ -594,6 +595,7 @@ try
        }
 
        _player_restricted_menus = f.optional_bool_child("PlayerRestrictedMenus").get_value_or(false);
+       _playlist_editor_restricted_menus = f.optional_bool_child("PlaylistEditorRestrictedMenus").get_value_or(false);
 
        _image_display = f.optional_number_child<int>("ImageDisplay").get_value_or(0);
        auto vc = f.optional_string_child("VideoViewType");
@@ -1082,6 +1084,10 @@ Config::write_config () const
                root->add_child("PlayerRestrictedMenus")->add_child_text("1");
        }
 
+       if (_playlist_editor_restricted_menus) {
+               root->add_child("PlaylistEditorRestrictedMenus")->add_child_text("1");
+       }
+
        /* [XML] ImageDisplay Screen number to put image on in dual-screen player mode. */
        root->add_child("ImageDisplay")->add_child_text(raw_convert<string>(_image_display));
        switch (_video_view_type) {
index a6383055264698586ba22adbaacfc4e915eb1af5..ec804c9bf58cbdad822028f2da3f7f135b972706 100644 (file)
@@ -538,6 +538,10 @@ public:
                return _player_restricted_menus;
        }
 
+       bool playlist_editor_restricted_menus() const {
+               return _playlist_editor_restricted_menus;
+       }
+
        int image_display () const {
                return _image_display;
        }
@@ -1454,6 +1458,7 @@ private:
        boost::optional<std::string> _gdc_password;
        PlayerMode _player_mode;
        bool _player_restricted_menus = false;
+       bool _playlist_editor_restricted_menus = false;
        int _image_display;
        VideoViewType _video_view_type;
        bool _respect_kdm_validity_periods;
index d092ca5136f68d8e185f7a51ede4f7b9fd30ca55..b16a2be68338ed85a0195e8d174f49e4d3d120c0 100644 (file)
@@ -572,7 +572,9 @@ private:
                /* These just need to be appended somewhere, it seems - they magically
                 * get moved to the right place.
                 */
-               help->Append(wxID_PREFERENCES, _("&Preferences...\tCtrl-,"));
+               if (!Config::instance()->playlist_editor_restricted_menus()) {
+                       help->Append(wxID_PREFERENCES, _("&Preferences...\tCtrl-,"));
+               }
                help->Append(wxID_EXIT, _("&Exit"));
                help->Append(wxID_ABOUT, _("About DCP-o-matic"));
 
@@ -588,8 +590,10 @@ private:
                help->Append(wxID_ABOUT, _("About"));
 
                m->Append(file, _("&File"));
-               m->Append(edit, _("&Edit"));
-               m->Append(help, _("&Help"));
+               if (!Config::instance()->playlist_editor_restricted_menus()) {
+                       m->Append(edit, _("&Edit"));
+                       m->Append(help, _("&Help"));
+               }
 #endif
        }