summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-01-16 15:18:55 +0100
committerCarl Hetherington <cth@carlh.net>2022-01-16 17:35:51 +0100
commitcf7b7beb82606ca9a961bb705a3e2c550808b961 (patch)
tree4ee3aaefc7f96a44d3e8545546b5ffead744a6c9
parentb8be074080290e14b9ff7bf381f0ca0d69eee0df (diff)
Set window title based on the directory from Film.
-rw-r--r--src/tools/dcpomatic.cc24
-rw-r--r--src/wx/film_editor.cc7
-rw-r--r--src/wx/film_editor.h1
3 files changed, 12 insertions, 20 deletions
diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc
index fa61d4e1d..b7f9fcbec 100644
--- a/src/tools/dcpomatic.cc
+++ b/src/tools/dcpomatic.cc
@@ -366,9 +366,8 @@ public:
set_menu_sensitivity ();
- _film_editor->FileChanged.connect (bind (&DOMFrame::file_changed, this, _1));
_film_editor->content_panel()->SelectionChanged.connect (boost::bind (&DOMFrame::set_menu_sensitivity, this));
- file_changed ("");
+ set_title ();
JobManager::instance()->ActiveJobsChanged.connect (boost::bind (&DOMFrame::set_menu_sensitivity, this));
@@ -495,6 +494,7 @@ public:
_film->Message.connect (boost::bind(&DOMFrame::film_message, this, _1));
dcpomatic_log = _film->log ();
}
+ set_title ();
}
shared_ptr<Film> film () const {
@@ -523,16 +523,6 @@ private:
}
}
- void file_changed (boost::filesystem::path f)
- {
- auto s = wx_to_std(_("DCP-o-matic"));
- if (!f.empty ()) {
- s += " - " + f.string ();
- }
-
- SetTitle (std_to_wx (s));
- }
-
void file_new ()
{
auto d = new FilmNameLocationDialog (this, _("New Film"), true);
@@ -1515,6 +1505,16 @@ private:
d->Destroy();
}
+ void set_title ()
+ {
+ auto s = wx_to_std(_("DCP-o-matic"));
+ if (_film && _film->directory()) {
+ s += " - " + _film->directory()->string();
+ }
+
+ SetTitle (std_to_wx(s));
+ }
+
FilmEditor* _film_editor;
std::shared_ptr<FilmViewer> _film_viewer;
StandardControls* _controls;
diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc
index d604f678d..a99f6ed32 100644
--- a/src/wx/film_editor.cc
+++ b/src/wx/film_editor.cc
@@ -134,19 +134,12 @@ FilmEditor::set_film (shared_ptr<Film> film)
_dcp_panel->set_film (_film);
if (!_film) {
- FileChanged ("");
return;
}
_film->Change.connect (bind(&FilmEditor::film_change, this, _1, _2));
_film->ContentChange.connect (bind(&FilmEditor::film_content_change, this, _1, _3));
- if (_film->directory()) {
- FileChanged (_film->directory().get());
- } else {
- FileChanged ("");
- }
-
if (!_film->content().empty()) {
_content_panel->set_selection (_film->content().front());
}
diff --git a/src/wx/film_editor.h b/src/wx/film_editor.h
index 6aff127d8..e03c2ebfa 100644
--- a/src/wx/film_editor.h
+++ b/src/wx/film_editor.h
@@ -50,7 +50,6 @@ public:
void set_film (std::shared_ptr<Film>);
void first_shown ();
- boost::signals2::signal<void (boost::filesystem::path)> FileChanged;
boost::signals2::signal<void (void)> SelectionChanged;
/* Stuff for panels */