From c01fabbd1a57998d98e4bb442841c7439c7e1d4c Mon Sep 17 00:00:00 2001 From: fgerlits Date: Tue, 24 May 2005 16:58:30 +0000 Subject: [PATCH] fixed CuePlayer to support multiple selections --- .../products/gLiveSupport/src/CuePlayer.cxx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/livesupport/products/gLiveSupport/src/CuePlayer.cxx b/livesupport/products/gLiveSupport/src/CuePlayer.cxx index ec8a97a6a..9b9b46d82 100644 --- a/livesupport/products/gLiveSupport/src/CuePlayer.cxx +++ b/livesupport/products/gLiveSupport/src/CuePlayer.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.3 $ + Version : $Revision: 1.4 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/CuePlayer.cxx,v $ ------------------------------------------------------------------------------*/ @@ -111,21 +111,22 @@ CuePlayer :: ~CuePlayer(void) throw () void CuePlayer :: onPlayItem(void) throw () { - Glib::RefPtr refSelection = - treeView->get_selection(); + Glib::RefPtr + selection = treeView->get_selection(); + std::vector + selectedRows = selection->get_selected_rows(); - if (refSelection) { - Gtk::TreeModel::iterator iter = refSelection->get_selected(); + if (selectedRows.size() == 1) { + Gtk::TreePath path = selectedRows.front(); + Gtk::TreeIter iter = treeView->get_model()->get_iter(path); if (iter) { Ptr::Ref playable = (*iter)[modelColumns.playableColumn]; - try { gLiveSupport->playCueAudio(playable); } catch (std::logic_error &e) { std::cerr << "GLiveSupport::playCueAudio() error:" << std::endl << e.what() << std::endl; } - audioState = playingState; remove(*playButton); pack_end(*pauseButton, Gtk::PACK_SHRINK, 3);