From 8e81f31a04927594732cd6ee7903e839fd917357 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Sat, 21 Mar 2009 16:57:56 +0000 Subject: [PATCH] WIP: Added Sequence Chooser --- src/gui/panels/timeline-panel.cpp | 24 +++++++++++++++++++++--- src/gui/panels/timeline-panel.hpp | 6 ++++-- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/gui/panels/timeline-panel.cpp b/src/gui/panels/timeline-panel.cpp index 0e9b069cd..d912c1bf1 100644 --- a/src/gui/panels/timeline-panel.cpp +++ b/src/gui/panels/timeline-panel.cpp @@ -76,6 +76,10 @@ TimelinePanel::TimelinePanel(workspace::WorkspaceWindow notebook.signal_switch_page().connect( mem_fun(this, &TimelinePanel::on_page_switched)); notebook.popup_enable(); + + // Setup the sequence chooser; + sequenceChooser.show_all(); + panelBar.pack_start(sequenceChooser, PACK_EXPAND_WIDGET); // Setup the toolbar timeIndicatorButton.add(timeIndicator); @@ -104,15 +108,16 @@ TimelinePanel::TimelinePanel(workspace::WorkspaceWindow toolbar.append(zoomIn, mem_fun(this, &TimelinePanel::on_zoom_in)); toolbar.append(zoomOut, mem_fun(this, &TimelinePanel::on_zoom_out)); - + toolbar.show_all(); - panelBar.pack_start(toolbar, PACK_EXPAND_WIDGET); - + panelBar.pack_start(toolbar, PACK_SHRINK); + // Add the notebook pack_start(notebook, PACK_EXPAND_WIDGET); // Set the initial UI state update_notebook(); + update_sequence_chooser(); update_tool_buttons(); update_zoom_buttons(); show_time(0); @@ -215,6 +220,19 @@ void TimelinePanel::on_sequence_list_changed() { update_notebook(); + update_sequence_chooser(); +} + +void +TimelinePanel::update_sequence_chooser() +{ + sequenceChooser.clear_items(); + + BOOST_FOREACH( shared_ptr< model::Sequence > sequence, + workspace.get_project().get_sequences() ) + { + sequenceChooser.append_text(sequence->get_name()); + } } void diff --git a/src/gui/panels/timeline-panel.hpp b/src/gui/panels/timeline-panel.hpp index 34a9b05eb..79b130c61 100644 --- a/src/gui/panels/timeline-panel.hpp +++ b/src/gui/panels/timeline-panel.hpp @@ -80,6 +80,8 @@ private: private: + void update_sequence_chooser(); + void update_notebook(); void update_playback_buttons(); @@ -102,9 +104,9 @@ private: //----- Data -----// - // Widgets + // Grip Widgets ButtonBar toolbar; - Gtk::HBox toolStrip; + Gtk::ComboBoxText sequenceChooser; // Body Widgets Gtk::Notebook notebook;