[ekiga] Changing pages in the main window notebook handles selected heaps and groups in the roster
- From: Julien Puydt <jpuydt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ekiga] Changing pages in the main window notebook handles selected heaps and groups in the roster
- Date: Fri, 8 Oct 2010 14:11:20 +0000 (UTC)
commit 4e348beda1bad70fbbec040a03ff7ea01090371c
Author: Julien Puydt <jpuydt gnome org>
Date: Fri Oct 8 15:57:11 2010 +0200
Changing pages in the main window notebook handles selected heaps and groups in the roster
That is a little stupid because just selecting doesn't work yet, so you
have to select, change page and come back to see the feature... but still,
it works!
src/gui/main_window.cpp | 52 +++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 52 insertions(+), 0 deletions(-)
---
diff --git a/src/gui/main_window.cpp b/src/gui/main_window.cpp
index 9e2340f..8554a49 100644
--- a/src/gui/main_window.cpp
+++ b/src/gui/main_window.cpp
@@ -1927,6 +1927,52 @@ on_presentity_selected (G_GNUC_UNUSED GtkWidget* view,
on_item_selected (mw, (Ekiga::LiveObject*)presentity);
}
+static void
+on_heap_selected (G_GNUC_UNUSED GtkWidget* view,
+ Ekiga::Heap* heap,
+ gpointer self)
+{
+ EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (self);
+ on_item_selected (mw, (Ekiga::LiveObject*)heap);
+}
+
+
+static void
+on_heap_group_selected (G_GNUC_UNUSED GtkWidget* view,
+ Ekiga::Heap* heap,
+ gchar* group,
+ gpointer self)
+{
+ EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (self);
+ GtkWidget *menu = gtk_menu_get_widget (mw->priv->main_menu, "contact");
+
+ mw->priv->selected_item_updated_connection.disconnect ();
+ mw->priv->selected_item_removed_connection.disconnect ();
+
+ if (heap && group != NULL) {
+
+ MenuBuilderGtk builder;
+ gtk_widget_set_sensitive (menu, TRUE);
+ // we can't get updates about the groups as the contact api currently stands
+ mw->priv->selected_item_updated_connection = heap->updated.connect (boost::bind (&on_selected_item_removed, mw));
+ mw->priv->selected_item_removed_connection = heap->removed.connect (boost::bind (&on_selected_item_removed, mw));
+
+ if (heap->populate_menu_for_group (group, builder)) {
+
+ gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu), builder.menu);
+ gtk_widget_show_all (builder.menu);
+ } else {
+
+ gtk_widget_set_sensitive (menu, FALSE);
+ g_object_ref_sink (builder.menu);
+ g_object_unref (builder.menu);
+ }
+ } else {
+
+ gtk_widget_set_sensitive (menu, FALSE);
+ gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu), NULL);
+ }
+}
static void
on_chat_unread_alert (G_GNUC_UNUSED GtkWidget* widget,
@@ -1976,6 +2022,12 @@ panel_section_changed_nt (G_GNUC_UNUSED gpointer id,
if (presentity)
on_presentity_selected (mw->priv->roster_view, presentity, data);
+ if (heap && group == NULL)
+ on_heap_selected (mw->priv->roster_view, heap, data);
+
+ if (heap && group != NULL)
+ on_heap_group_selected (mw->priv->roster_view, heap, group, data);
+
if (group)
g_free (group);
} else if (section == mw->priv->call_history_page_number) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]