From 82598b8d3bcd52c37a153621144f52d03e77fd20 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 2 Sep 2017 13:55:12 +0100 Subject: Remember the last directory used when opening DCPs in the player (#1121). --- src/lib/config.cc | 4 ++++ src/lib/config.h | 15 +++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) (limited to 'src/lib') diff --git a/src/lib/config.cc b/src/lib/config.cc index f595b960a..4f481ef30 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -354,6 +354,7 @@ try if (f.optional_string_child("CoverSheet")) { _cover_sheet = f.optional_string_child("CoverSheet").get(); } + _last_player_load_directory = f.optional_string_child("LastPlayerLoadDirectory"); /* Replace any cinemas from config.xml with those from the configured file */ if (boost::filesystem::exists (_cinemas_file)) { @@ -631,6 +632,9 @@ Config::write_config () const } /* [XML] CoverSheet Text of the cover sheet to write when making DCPs */ root->add_child("CoverSheet")->add_child_text (_cover_sheet); + if (_last_player_load_directory) { + root->add_child("LastPlayerLoadDirectory")->add_child_text(_last_player_load_directory->string()); + } try { doc.write_to_file_formatted(config_file().string()); diff --git a/src/lib/config.h b/src/lib/config.h index 0a81dee51..2d45f14f0 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -341,6 +341,10 @@ public: return _sound_output; } + boost::optional last_player_load_directory () const { + return _last_player_load_directory; + } + void set_master_encoding_threads (int n) { maybe_set (_master_encoding_threads, n); } @@ -567,13 +571,15 @@ public: maybe_set (_sound, s, SOUND); } - void set_sound_output (std::string o) - { + void set_sound_output (std::string o) { maybe_set (_sound_output, o, SOUND_OUTPUT); } - void unset_sound_output () - { + void set_last_player_load_directory (boost::filesystem::path d) { + maybe_set (_last_player_load_directory, d); + } + + void unset_sound_output () { if (!_sound_output) { return; } @@ -764,6 +770,7 @@ private: /** name of a specific sound output stream to use, or empty to use the default */ boost::optional _sound_output; std::string _cover_sheet; + boost::optional _last_player_load_directory; /** Singleton instance, or 0 */ static Config* _instance; -- cgit v1.2.3