[ekiga] Removed ekiga_main_window_selected_build_menu
- From: Julien Puydt <jpuydt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ekiga] Removed ekiga_main_window_selected_build_menu
- Date: Thu, 7 Oct 2010 20:07:56 +0000 (UTC)
commit dfa49449e0544625d07a5a4062f838a5a53fa5d3
Author: Julien Puydt <jpuydt gnome org>
Date: Thu Oct 7 18:01:50 2010 +0200
Removed ekiga_main_window_selected_build_menu
I don't get why it was called in ekiga_main_window_update_calling_state,
so I removed it... and once I removed it, it was used only once.
Then I moved its body in place... and saw it could simplify the code by
removing the 'presentity' member.
I saw a few possible bugs, so I'll move on and fix them.
src/gui/main_window.cpp | 57 +++++++++++++++++-----------------------------
1 files changed, 21 insertions(+), 36 deletions(-)
---
diff --git a/src/gui/main_window.cpp b/src/gui/main_window.cpp
index 3b09d28..c276690 100644
--- a/src/gui/main_window.cpp
+++ b/src/gui/main_window.cpp
@@ -202,8 +202,6 @@ struct _EkigaMainWindowPrivate
std::string received_video_codec;
std::string received_audio_codec;
- Ekiga::Presentity* presentity;
-
std::vector<boost::signals::connection> connections;
};
@@ -264,8 +262,6 @@ static void ekiga_main_window_hide_call_panel (EkigaMainWindow *mw);
void ekiga_main_window_clear_signal_levels (EkigaMainWindow *mw);
-static void ekiga_main_window_selected_presentity_build_menu (EkigaMainWindow *mw);
-
static void ekiga_main_window_incoming_call_dialog_show (EkigaMainWindow *mw,
boost::shared_ptr<Ekiga::Call> call);
@@ -1851,10 +1847,29 @@ on_presentity_selected (G_GNUC_UNUSED GtkWidget* view,
gpointer self)
{
EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (self);
+ GtkWidget *menu = gtk_menu_get_widget (mw->priv->main_menu, "contact");
+
+ 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 {
- mw->priv->presentity = presentity;
+ gtk_widget_set_sensitive (menu, FALSE);
+ g_object_ref_sink (builder.menu);
+ g_object_unref (builder.menu);
+ }
+ }
+ else {
- ekiga_main_window_selected_presentity_build_menu (mw);
+ gtk_widget_set_sensitive (menu, FALSE);
+ gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu), NULL);
+ }
}
@@ -2426,7 +2441,6 @@ ekiga_main_window_update_calling_state (EkigaMainWindow *mw,
{
g_return_if_fail (mw != NULL);
- ekiga_main_window_selected_presentity_build_menu (mw);
switch (calling_state)
{
case Standby:
@@ -2639,34 +2653,6 @@ ekiga_main_window_clear_signal_levels (EkigaMainWindow *mw)
gm_level_meter_clear (GM_LEVEL_METER (mw->priv->input_signal));
}
-static void
-ekiga_main_window_selected_presentity_build_menu (EkigaMainWindow *mw)
-{
- GtkWidget *menu = gtk_menu_get_widget (mw->priv->main_menu, "contact");
-
- if (mw->priv->presentity != NULL) {
-
- MenuBuilderGtk builder;
- gtk_widget_set_sensitive (menu, TRUE);
- if (mw->priv->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_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
ekiga_main_window_incoming_call_dialog_show (EkigaMainWindow *mw,
@@ -3752,7 +3738,6 @@ ekiga_main_window_init (EkigaMainWindow *mw)
gtk_window_add_accel_group (GTK_WINDOW (mw), mw->priv->accel);
g_object_unref (mw->priv->accel);
- mw->priv->presentity = NULL;
mw->priv->transfer_call_popup = NULL;
mw->priv->current_call = boost::shared_ptr<Ekiga::Call>();
mw->priv->timeout_id = -1;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]