Add PlaylistEditorRestrictedMenus option, similar to PlayerRestrictedMenus.
[dcpomatic.git] / src / lib / config.cc
index 8dce6237a0f2b9339abea394aa852fed2861a77f..160ef7645b008d0326b6fb329e3196bc851d7c27 100644 (file)
@@ -177,6 +177,8 @@ Config::set_defaults ()
        _gdc_username = optional<string>();
        _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;
@@ -592,6 +594,9 @@ try
                _player_mode = PLAYER_MODE_DUAL;
        }
 
+       _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");
        if (vc && *vc == "opengl") {
@@ -1075,6 +1080,14 @@ Config::write_config () const
                break;
        }
 
+       if (_player_restricted_menus) {
+               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) {