ekiga r6885 - in trunk: . src/gui
- From: dsandras svn gnome org
- To: svn-commits-list gnome org
- Subject: ekiga r6885 - in trunk: . src/gui
- Date: Mon, 8 Sep 2008 20:39:28 +0000 (UTC)
Author: dsandras
Date: Mon Sep 8 20:39:28 2008
New Revision: 6885
URL: http://svn.gnome.org/viewvc/ekiga?rev=6885&view=rev
Log:
Fixed #551392.
Modified:
trunk/ChangeLog
trunk/src/gui/main.cpp
Modified: trunk/src/gui/main.cpp
==============================================================================
--- trunk/src/gui/main.cpp (original)
+++ trunk/src/gui/main.cpp Mon Sep 8 20:39:28 2008
@@ -161,6 +161,7 @@
GtkWidget *hold_button;
GtkWidget *transfer_call_popup;
GtkWidget *status_option_menu;
+ Ekiga::Presentity* presentity;
#ifndef WIN32
GdkGC* video_widget_gc;
@@ -296,9 +297,10 @@
static void gm_main_window_hide_call_panel (GtkWidget *self);
+void gm_main_window_clear_signal_levels (GtkWidget *main_window);
+
+void gm_main_window_selected_presentity_build_menu (GtkWidget *main_window);
-void
-gm_main_window_clear_signal_levels (GtkWidget *main_window);
/* Callbacks */
/* DESCRIPTION : This callback is called when the user selects a presentity
@@ -1923,7 +1925,7 @@
gtk_notebook_append_page (GTK_NOTEBOOK (mw->main_notebook),
roster_view, label);
g_signal_connect (G_OBJECT (roster_view), "presentity-selected",
- G_CALLBACK (on_presentity_selected), mw);
+ G_CALLBACK (on_presentity_selected), main_window);
}
@@ -2500,35 +2502,15 @@
static void
on_presentity_selected (G_GNUC_UNUSED GtkWidget* view,
Ekiga::Presentity* presentity,
- gpointer data)
+ gpointer self)
{
- GmMainWindow *mw = (GmMainWindow*)data;
- GtkWidget* menu = NULL;
+ GmMainWindow *mw = gm_mw_get_mw (GTK_WIDGET (self));
g_return_if_fail (mw != NULL);
- menu = gtk_menu_get_widget (mw->main_menu, "contact");
-
- g_return_if_fail (menu != NULL);
-
- if (presentity != NULL) {
-
- MenuBuilderGtk builder;
- gtk_widget_set_sensitive (menu, TRUE);
- if (presentity->populate_menu (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_unref (builder.menu);
- }
- } else {
+ mw->presentity = presentity;
- gtk_widget_set_sensitive (menu, FALSE);
- gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu), NULL);
- }
+ gm_main_window_selected_presentity_build_menu (GTK_WIDGET (self));
}
@@ -3231,7 +3213,7 @@
g_return_if_fail (mw!= NULL);
-
+ gm_main_window_selected_presentity_build_menu (main_window);
switch (calling_state)
{
case Standby:
@@ -3462,6 +3444,41 @@
}
void
+gm_main_window_selected_presentity_build_menu (GtkWidget *main_window)
+{
+ GmMainWindow *mw = NULL;
+ GtkWidget* menu = NULL;
+
+ g_return_if_fail (main_window != NULL);
+
+ mw = gm_mw_get_mw (main_window);
+
+ g_return_if_fail (mw != NULL);
+
+ menu = gtk_menu_get_widget (mw->main_menu, "contact");
+ if (mw->presentity != NULL) {
+
+ MenuBuilderGtk builder;
+ gtk_widget_set_sensitive (menu, TRUE);
+ if (mw->presentity->populate_menu (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_unref (builder.menu);
+ }
+ }
+ else {
+
+ gtk_widget_set_sensitive (menu, FALSE);
+ gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu), NULL);
+ }
+}
+
+void
gm_main_window_set_panel_section (GtkWidget *main_window,
int section)
{
@@ -3913,6 +3930,7 @@
/* The GMObject data */
mw = new GmMainWindow (core);
+ mw->presentity = NULL;
mw->transfer_call_popup = NULL;
mw->current_call = NULL;
mw->timeout_id = -1;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]