summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-05-06 14:21:21 +0100
committerCarl Hetherington <cth@carlh.net>2013-05-06 14:21:21 +0100
commitbe3aa4b102205b58c33d7bdfbfee743b5f6a5255 (patch)
treec6de8dbb7f7878d62b493ff0f4b9eec024304a9b /src
parent454a961e1a03f60cf05040b832c4f8f01b481fa7 (diff)
Make timeline non-modal.
Diffstat (limited to 'src')
-rw-r--r--src/wx/film_editor.cc11
-rw-r--r--src/wx/film_editor.h2
-rw-r--r--src/wx/timeline.cc9
-rw-r--r--src/wx/timeline.h1
4 files changed, 20 insertions, 3 deletions
diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc
index c50782452..a4afb6d69 100644
--- a/src/wx/film_editor.cc
+++ b/src/wx/film_editor.cc
@@ -73,6 +73,7 @@ FilmEditor::FilmEditor (shared_ptr<Film> f, wxWindow* parent)
: wxPanel (parent)
, _generally_sensitive (true)
, _audio_dialog (0)
+ , _timeline_dialog (0)
{
wxBoxSizer* s = new wxBoxSizer (wxVERTICAL);
_notebook = new wxNotebook (this, wxID_ANY);
@@ -1458,7 +1459,11 @@ FilmEditor::setup_playlist_description ()
void
FilmEditor::timeline_clicked (wxCommandEvent &)
{
- TimelineDialog* d = new TimelineDialog (this, _film->playlist ());
- d->ShowModal ();
- d->Destroy ();
+ if (_timeline_dialog) {
+ _timeline_dialog->Destroy ();
+ _timeline_dialog = 0;
+ }
+
+ _timeline_dialog = new TimelineDialog (this, _film->playlist ());
+ _timeline_dialog->Show ();
}
diff --git a/src/wx/film_editor.h b/src/wx/film_editor.h
index fddd213b9..9e9cfb831 100644
--- a/src/wx/film_editor.h
+++ b/src/wx/film_editor.h
@@ -34,6 +34,7 @@ class wxListEvent;
class Film;
class AudioDialog;
class AudioMappingView;
+class TimelineDialog;
/** @class FilmEditor
* @brief A wx widget to edit a film's metadata, and perform various functions.
@@ -188,4 +189,5 @@ private:
bool _generally_sensitive;
AudioDialog* _audio_dialog;
+ TimelineDialog* _timeline_dialog;
};
diff --git a/src/wx/timeline.cc b/src/wx/timeline.cc
index 828756362..52707e45c 100644
--- a/src/wx/timeline.cc
+++ b/src/wx/timeline.cc
@@ -27,6 +27,7 @@ using std::list;
using std::cout;
using std::max;
using boost::shared_ptr;
+using boost::bind;
int const Timeline::_track_height = 64;
@@ -43,6 +44,9 @@ Timeline::Timeline (wxWindow* parent, shared_ptr<Playlist> pl)
} else {
SetMinSize (wxSize (640, _track_height * (max (1UL, pl->audio().size()) + 1) + 96));
}
+
+ pl->Changed.connect (bind (&Timeline::playlist_changed, this));
+ pl->ContentChanged.connect (bind (&Timeline::playlist_changed, this));
}
template <class T>
@@ -189,3 +193,8 @@ Timeline::paint (wxPaintEvent &)
delete gc;
}
+void
+Timeline::playlist_changed ()
+{
+ Refresh ();
+}
diff --git a/src/wx/timeline.h b/src/wx/timeline.h
index 48aebc637..1993eb9c2 100644
--- a/src/wx/timeline.h
+++ b/src/wx/timeline.h
@@ -30,6 +30,7 @@ public:
private:
void paint (wxPaintEvent &);
+ void playlist_changed ();
static int const _track_height;