summaryrefslogtreecommitdiff
path: root/src/wx
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-11-11 21:03:39 +0100
committerCarl Hetherington <cth@carlh.net>2023-11-11 21:03:39 +0100
commit00cc999455e060630a5914e7a70489ff98219b49 (patch)
tree7b67944a35939205c29823aa33cbe594d5cf8834 /src/wx
parenta22f1bda1083345a649ca9c4d893cae79b141191 (diff)
Move add_files_override_path to film_util
Diffstat (limited to 'src/wx')
-rw-r--r--src/wx/content_panel.cc18
-rw-r--r--src/wx/content_panel.h1
2 files changed, 4 insertions, 15 deletions
diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc
index 56c1d0524..8a98bc1a4 100644
--- a/src/wx/content_panel.cc
+++ b/src/wx/content_panel.cc
@@ -43,6 +43,7 @@
#include "lib/dcpomatic_log.h"
#include "lib/ffmpeg_content.h"
#include "lib/film.h"
+#include "lib/film_util.h"
#include "lib/image_content.h"
#include "lib/log.h"
#include "lib/playlist.h"
@@ -582,17 +583,6 @@ ContentPanel::check_selection ()
}
-optional<boost::filesystem::path>
-ContentPanel::add_files_override_path() const
-{
- DCPOMATIC_ASSERT(_film->directory());
- return Config::instance()->default_add_file_location() == Config::DefaultAddFileLocation::SAME_AS_PROJECT
- ? _film->directory()->parent_path()
- : boost::optional<boost::filesystem::path>();
-
-}
-
-
void
ContentPanel::add_file_clicked ()
{
@@ -612,7 +602,7 @@ ContentPanel::add_file_clicked ()
wxT("All files|*.*|Subtitle files|*.srt;*.xml|Audio files|*.wav;*.w64;*.flac;*.aif;*.aiff"),
wxFD_MULTIPLE | wxFD_CHANGE_DIR,
"AddFilesPath",
- add_files_override_path()
+ add_files_override_path(_film)
);
if (dialog.show()) {
@@ -624,7 +614,7 @@ ContentPanel::add_file_clicked ()
void
ContentPanel::add_folder_clicked ()
{
- DirDialog dialog(_splitter, _("Choose a folder"), wxDD_DIR_MUST_EXIST, "AddFilesPath", add_files_override_path());
+ DirDialog dialog(_splitter, _("Choose a folder"), wxDD_DIR_MUST_EXIST, "AddFilesPath", add_files_override_path(_film));
if (dialog.show()) {
add_folder(dialog.path());
}
@@ -667,7 +657,7 @@ ContentPanel::add_folder(boost::filesystem::path folder)
void
ContentPanel::add_dcp_clicked ()
{
- DirDialog dialog(_splitter, _("Choose a DCP folder"), wxDD_DIR_MUST_EXIST, "AddFilesPath", add_files_override_path());
+ DirDialog dialog(_splitter, _("Choose a DCP folder"), wxDD_DIR_MUST_EXIST, "AddFilesPath", add_files_override_path(_film));
if (dialog.show()) {
add_dcp(dialog.path());
}
diff --git a/src/wx/content_panel.h b/src/wx/content_panel.h
index 6ba9bb1bb..ca0d49719 100644
--- a/src/wx/content_panel.h
+++ b/src/wx/content_panel.h
@@ -109,7 +109,6 @@ private:
void later_clicked ();
void right_click (wxListEvent &);
void files_dropped (wxDropFilesEvent &);
- boost::optional<boost::filesystem::path> add_files_override_path() const;
void setup ();
void setup_sensitivity ();