projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
c7a0c82
)
Synchronise content list / timeline selection when the content list selection changes.
author
Carl Hetherington
<cth@carlh.net>
Mon, 1 Feb 2016 23:19:13 +0000
(23:19 +0000)
committer
Carl Hetherington
<cth@carlh.net>
Mon, 1 Feb 2016 23:19:13 +0000
(23:19 +0000)
ChangeLog
patch
|
blob
|
history
src/wx/content_panel.cc
patch
|
blob
|
history
src/wx/timeline.cc
patch
|
blob
|
history
src/wx/timeline.h
patch
|
blob
|
history
src/wx/timeline_dialog.cc
patch
|
blob
|
history
src/wx/timeline_dialog.h
patch
|
blob
|
history
diff --git
a/ChangeLog
b/ChangeLog
index d573e02fb694eab1cd2b492c9976e9c76d4d402b..3887105ace73072d82b0b70a97cb0f41e9c42a11 100644
(file)
--- a/
ChangeLog
+++ b/
ChangeLog
@@
-1,5
+1,8
@@
2016-02-01 Carl Hetherington <cth@carlh.net>
2016-02-01 Carl Hetherington <cth@carlh.net>
+ * Synchronise content list / timeline selection when
+ the content list selection changes.
+
* Move the preview to the start of a piece of content
when selecting it (suggested by Carsten Kurz).
* Move the preview to the start of a piece of content
when selecting it (suggested by Carsten Kurz).
diff --git
a/src/wx/content_panel.cc
b/src/wx/content_panel.cc
index e865504267b34564ff88e86a540e37bccf845740..6b2d30b9ca6153fe5256a6dcc8c03b410c4d69ea 100644
(file)
--- a/
src/wx/content_panel.cc
+++ b/
src/wx/content_panel.cc
@@
-244,6
+244,10
@@
ContentPanel::selection_changed ()
if (go_to) {
_film_viewer->set_position (go_to.get ());
}
if (go_to) {
_film_viewer->set_position (go_to.get ());
}
+
+ if (_timeline_dialog) {
+ _timeline_dialog->set_selection (selected ());
+ }
}
void
}
void
diff --git
a/src/wx/timeline.cc
b/src/wx/timeline.cc
index 8a61eccb07e39b3736fa527f313079fd80b46018..8dee9610fff24f33907f1866451ae71b1e6a7571 100644
(file)
--- a/
src/wx/timeline.cc
+++ b/
src/wx/timeline.cc
@@
-462,3
+462,14
@@
Timeline::selected_content () const
return sel;
}
return sel;
}
+
+void
+Timeline::set_selection (ContentList selection)
+{
+ for (TimelineViewList::iterator i = _views.begin(); i != _views.end(); ++i) {
+ shared_ptr<TimelineContentView> cv = dynamic_pointer_cast<TimelineContentView> (*i);
+ if (cv) {
+ cv->set_selected (find (selection.begin(), selection.end(), cv->content ()) != selection.end ());
+ }
+ }
+}
diff --git
a/src/wx/timeline.h
b/src/wx/timeline.h
index e8becf906e4ee61c6a26298cc49fd34965a44c9a..e8ae2120f7ad392f4def9eda9b6fb759df9f1484 100644
(file)
--- a/
src/wx/timeline.h
+++ b/
src/wx/timeline.h
@@
-74,6
+74,8
@@
public:
return _snap;
}
return _snap;
}
+ void set_selection (ContentList selection);
+
private:
void paint ();
void left_down (wxMouseEvent &);
private:
void paint ();
void left_down (wxMouseEvent &);
diff --git
a/src/wx/timeline_dialog.cc
b/src/wx/timeline_dialog.cc
index 9caa629338e34a7110fdacf849041fb206e4fad4..f054763c864a5676ca11c03fd9db52d7051c9384 100644
(file)
--- a/
src/wx/timeline_dialog.cc
+++ b/
src/wx/timeline_dialog.cc
@@
-94,3
+94,9
@@
TimelineDialog::film_changed (Film::Property p)
_sequence_video->SetValue (film->sequence_video ());
}
}
_sequence_video->SetValue (film->sequence_video ());
}
}
+
+void
+TimelineDialog::set_selection (ContentList selection)
+{
+ _timeline.set_selection (selection);
+}
diff --git
a/src/wx/timeline_dialog.h
b/src/wx/timeline_dialog.h
index b760c2c5b22f54162680468a661db44d1d1fcef5..bc5b7228bc01d087b651aabdb22e1a25efb26fc8 100644
(file)
--- a/
src/wx/timeline_dialog.h
+++ b/
src/wx/timeline_dialog.h
@@
-29,6
+29,8
@@
class TimelineDialog : public wxDialog
public:
TimelineDialog (ContentPanel *, boost::shared_ptr<Film>);
public:
TimelineDialog (ContentPanel *, boost::shared_ptr<Film>);
+ void set_selection (ContentList selection);
+
private:
void snap_toggled ();
void sequence_video_toggled ();
private:
void snap_toggled ();
void sequence_video_toggled ();