diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-03-08 23:24:31 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-03-08 23:24:32 +0100 |
| commit | 82f87c7711fb664b06b04d44792ed3820b3d1e01 (patch) | |
| tree | 74e803dcaf96f5e03a1be328e4ee8955455c92a8 /src/lib | |
| parent | a45f6245e8cc785fab436c9282fa3d1baf3a8575 (diff) | |
Add <PlayerRestrictedMenus> option to config.xml (#2725).
This hides all player menus except "File".
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/config.cc | 7 | ||||
| -rw-r--r-- | src/lib/config.h | 5 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc index 8dce6237a..56870145a 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -177,6 +177,7 @@ Config::set_defaults () _gdc_username = optional<string>(); _gdc_password = optional<string>(); _player_mode = PLAYER_MODE_WINDOW; + _player_restricted_menus = false; _image_display = 0; _video_view_type = VIDEO_VIEW_SIMPLE; _respect_kdm_validity_periods = true; @@ -592,6 +593,8 @@ try _player_mode = PLAYER_MODE_DUAL; } + _player_restricted_menus = f.optional_bool_child("PlayerRestrictedMenus").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 +1078,10 @@ Config::write_config () const break; } + if (_player_restricted_menus) { + root->add_child("PlayerRestrictedMenus")->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) { diff --git a/src/lib/config.h b/src/lib/config.h index 74b4316d2..a63830552 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -534,6 +534,10 @@ public: return _player_mode; } + bool player_restricted_menus() const { + return _player_restricted_menus; + } + int image_display () const { return _image_display; } @@ -1449,6 +1453,7 @@ private: boost::optional<std::string> _gdc_username; boost::optional<std::string> _gdc_password; PlayerMode _player_mode; + bool _player_restricted_menus = false; int _image_display; VideoViewType _video_view_type; bool _respect_kdm_validity_periods; |
