[ekiga] Merged on_selected_presentity_updated and on_selected_history_contact_updated in the main window cod
- From: Julien Puydt <jpuydt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ekiga] Merged on_selected_presentity_updated and on_selected_history_contact_updated in the main window cod
- Date: Fri, 8 Oct 2010 14:11:05 +0000 (UTC)
commit 0d8ce42067427425373d2b8277307a33125a0f7f
Author: Julien Puydt <jpuydt gnome org>
Date: Fri Oct 8 10:05:54 2010 +0200
Merged on_selected_presentity_updated and on_selected_history_contact_updated in the main window code
I noticed that both History::Contact and Ekiga::Presentity inherit from Ekiga::LiveObject,
so there's no use to having twice the same code just because it's not the same type.
src/gui/main_window.cpp | 32 +++++---------------------------
1 files changed, 5 insertions(+), 27 deletions(-)
---
diff --git a/src/gui/main_window.cpp b/src/gui/main_window.cpp
index 7ca6454..39a60eb 100644
--- a/src/gui/main_window.cpp
+++ b/src/gui/main_window.cpp
@@ -1855,37 +1855,15 @@ on_selected_item_removed (EkigaMainWindow* mw)
}
static void
-on_selected_history_contact_updated (History::Contact* contact,
- EkigaMainWindow* mw)
+on_selected_item_updated (Ekiga::LiveObject* live,
+ EkigaMainWindow* mw)
{
MenuBuilderGtk builder;
GtkWidget *menu = gtk_menu_get_widget (mw->priv->main_menu, "contact");
gtk_widget_set_sensitive (menu, TRUE);
- if (contact->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_ref_sink (builder.menu);
- g_object_unref (builder.menu);
- }
-}
-
-static void
-on_selected_presentity_updated (Ekiga::Presentity* presentity,
- EkigaMainWindow* mw)
-{
- MenuBuilderGtk builder;
- GtkWidget *menu = gtk_menu_get_widget (mw->priv->main_menu, "contact");
-
- gtk_widget_set_sensitive (menu, TRUE);
-
- if (presentity->populate_menu (builder)) {
+ if (live->populate_menu (builder)) {
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu), builder.menu);
gtk_widget_show_all (builder.menu);
@@ -1913,7 +1891,7 @@ on_history_contact_selected (G_GNUC_UNUSED GtkWidget* view,
MenuBuilderGtk builder;
gtk_widget_set_sensitive (menu, TRUE);
- mw->priv->selected_item_updated_connection = contact->updated.connect (boost::bind (&on_selected_history_contact_updated, contact, mw));
+ mw->priv->selected_item_updated_connection = contact->updated.connect (boost::bind (&on_selected_item_updated, contact, mw));
mw->priv->selected_item_removed_connection = contact->removed.connect (boost::bind (&on_selected_item_removed, mw));
if (contact->populate_menu (builder)) {
@@ -1948,7 +1926,7 @@ on_presentity_selected (G_GNUC_UNUSED GtkWidget* view,
MenuBuilderGtk builder;
gtk_widget_set_sensitive (menu, TRUE);
- mw->priv->selected_item_updated_connection = presentity->updated.connect (boost::bind (&on_selected_presentity_updated, presentity, mw));
+ mw->priv->selected_item_updated_connection = presentity->updated.connect (boost::bind (&on_selected_item_updated, presentity, mw));
mw->priv->selected_item_removed_connection = presentity->removed.connect (boost::bind (&on_selected_item_removed, mw));
if (presentity->populate_menu (builder)) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]