[ekiga] Added the call_history_view_gtk_populate_menu_for_selected api call



commit ddc490a7f62b80875329b2c61dbb12e2c7f3fdc4
Author: Snark <jpuydt gnome org>
Date:   Tue Oct 12 21:18:11 2010 +0200

    Added the call_history_view_gtk_populate_menu_for_selected api call
    
    Yet another step towards fixing bug #631735.

 .../gui/gtk-frontend/call-history-view-gtk.cpp     |   26 ++++++++++++++++++++
 .../gui/gtk-frontend/call-history-view-gtk.h       |    5 ++++
 2 files changed, 31 insertions(+), 0 deletions(-)
---
diff --git a/lib/engine/gui/gtk-frontend/call-history-view-gtk.cpp b/lib/engine/gui/gtk-frontend/call-history-view-gtk.cpp
index ff1eaa6..470ee9c 100644
--- a/lib/engine/gui/gtk-frontend/call-history-view-gtk.cpp
+++ b/lib/engine/gui/gtk-frontend/call-history-view-gtk.cpp
@@ -439,3 +439,29 @@ call_history_view_gtk_get_selected (CallHistoryViewGtk* self,
   } else
     *contact = NULL;
 }
+
+bool
+call_history_view_gtk_populate_menu_for_selected (CallHistoryViewGtk* self,
+						  Ekiga::MenuBuilder &builder)
+{
+  g_return_val_if_fail (IS_CALL_HISTORY_VIEW_GTK (self), false);
+
+  bool result = false;
+  GtkTreeSelection* selection = NULL;
+  GtkTreeModel* model = NULL;
+  GtkTreeIter iter;
+
+  selection = gtk_tree_view_get_selection (self->priv->tree);
+
+  if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
+
+    Ekiga::Contact *contact = NULL;
+    gtk_tree_model_get (model, &iter,
+			COLUMN_CONTACT, &contact,
+			-1);
+    if (contact)
+      result = contact->populate_menu (builder);
+  }
+
+  return result;
+}
diff --git a/lib/engine/gui/gtk-frontend/call-history-view-gtk.h b/lib/engine/gui/gtk-frontend/call-history-view-gtk.h
index 8f6f860..33f1a90 100644
--- a/lib/engine/gui/gtk-frontend/call-history-view-gtk.h
+++ b/lib/engine/gui/gtk-frontend/call-history-view-gtk.h
@@ -57,6 +57,11 @@ void call_history_view_gtk_get_selected (CallHistoryViewGtk* self,
 					 History::Contact** contact);
 
 
+/* Whatever is selected, we want the view to populate the given menu builder
+ * for us with the possible actions */
+bool call_history_view_gtk_populate_menu_for_selected (CallHistoryViewGtk* self,
+						       Ekiga::MenuBuilder &builder);
+
 /* This widget emits two signals :
  * "contact-selected", comes with a pointer which is a History::Contact*
  * (or NULL if no contact is selected anymore)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]