From a6acc98e0b1b2da3a8c56a1ae2b46e97f35bad65 Mon Sep 17 00:00:00 2001
From: Alexandre Savard <alexandresavard@msavard.(none)>
Date: Tue, 28 Jun 2011 16:26:16 -0400
Subject: [PATCH] #6109: Implement playback recorded file callback in client

---
 sflphone-client-gnome/src/uimanager.c       | 18 +++++++++++++++---
 sflphone-common/src/history/historyitem.cpp |  2 ++
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/sflphone-client-gnome/src/uimanager.c b/sflphone-client-gnome/src/uimanager.c
index 22b37d47e8..63b890d8ce 100644
--- a/sflphone-client-gnome/src/uimanager.c
+++ b/sflphone-client-gnome/src/uimanager.c
@@ -715,10 +715,22 @@ call_record (void)
 }
 
 static void
-playback_record(void)
+playback_record_cb(void)
 {
-
     DEBUG("UIManager: Playback button pressed");
+
+    callable_obj_t *selectedCall = calltab_get_selected_call (history);
+    conference_obj_t *selectedConf = calltab_get_selected_conf (history);
+
+    if((selectedCall == NULL) && (selectedConf == NULL)) {
+        ERROR("UIManager: Error: No selected object in playback record callback");
+	return;
+    }
+
+    if(selectedCall)
+        dbus_start_recorded_file_playback(selectedCall->_recordfile);
+    else if(selectedConf)
+	dbus_start_recorded_file_playback(selectedConf->_recordfile);
 }
 
 static void
@@ -989,7 +1001,7 @@ static const GtkActionEntry menu_entries[] = {
     { "Quit", GTK_STOCK_CLOSE, N_ ("_Quit"), "<control>Q",
       N_ ("Quit the program"), G_CALLBACK (call_quit) },
     { "PlayRecord", GTK_STOCK_MEDIA_PLAY,  N_ ("_Playback record"), NULL,
-      N_ ("Playback recorded file"), G_CALLBACK (playback_record) },
+      N_ ("Playback recorded file"), G_CALLBACK (playback_record_cb) },
 
     // Edit Menu
     { "Edit", NULL, N_ ("_Edit"), NULL, NULL, NULL },
diff --git a/sflphone-common/src/history/historyitem.cpp b/sflphone-common/src/history/historyitem.cpp
index d864ffde86..39c369577a 100644
--- a/sflphone-common/src/history/historyitem.cpp
+++ b/sflphone-common/src/history/historyitem.cpp
@@ -127,6 +127,8 @@ HistoryItem::HistoryItem (std::string serialized_form)
 
     _confID = confID;
     _timeAdded = timeAdded;
+
+    _recording_file = recordFile;
 }
 
 HistoryItem::~HistoryItem ()
-- 
GitLab