[ekiga/ds-gtk-application] Main Window: Fixed main menu content.
- From: Damien Sandras <dsandras src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ekiga/ds-gtk-application] Main Window: Fixed main menu content.
- Date: Sun, 30 Nov 2014 17:24:55 +0000 (UTC)
commit bf504a0cb0be5257766044e02051df040479c34c
Author: Damien Sandras <dsandras seconix com>
Date: Sun Nov 30 18:14:28 2014 +0100
Main Window: Fixed main menu content.
lib/engine/gui/gtk-frontend/main_window.cpp | 38 +++++----------------------
1 files changed, 7 insertions(+), 31 deletions(-)
---
diff --git a/lib/engine/gui/gtk-frontend/main_window.cpp b/lib/engine/gui/gtk-frontend/main_window.cpp
index 21dcfac..34c635b 100644
--- a/lib/engine/gui/gtk-frontend/main_window.cpp
+++ b/lib/engine/gui/gtk-frontend/main_window.cpp
@@ -150,9 +150,6 @@ struct _EkigaMainWindowPrivate
Ekiga::scoped_connections connections;
- /* Menu Dynamic Section */
- unsigned menu_dynamic_section_n_items;
-
/* GSettings */
boost::shared_ptr<Ekiga::Settings> user_interface_settings;
boost::shared_ptr<Ekiga::Settings> sound_events_settings;
@@ -172,12 +169,6 @@ static const char* win_menu =
"<?xml version='1.0'?>"
"<interface>"
" <menu id='menubar'>"
- " <section>"
- " <item>"
- " <attribute name='label' translatable='yes'>_Add Contact</attribute>"
- " <attribute name='action'>win.local-cluster-new</attribute>"
- " </item>"
- " </section>"
" </menu>"
"</interface>";
@@ -255,12 +246,6 @@ static void ekiga_main_window_init_actions_toolbar (EkigaMainWindow *mw);
-static GActionEntry win_entries[] =
-{
- { "close", close_activated, NULL, NULL, NULL, 0 }
-};
-
-
/*
* Callbacks
*/
@@ -568,21 +553,17 @@ actions_changed_cb (G_GNUC_UNUSED GtkWidget *widget,
gpointer data)
{
GMenu *menu = NULL;
+ int pos = 0;
g_return_if_fail (EKIGA_IS_MAIN_WINDOW (data));
- EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (data);
-
- menu = G_MENU (gtk_builder_get_object (mw->priv->builder, "menubar"));
+ EkigaMainWindow *self = EKIGA_MAIN_WINDOW (data);
- while (mw->priv->menu_dynamic_section_n_items-- > 0) {
- g_menu_remove (menu, 0);
- }
- mw->priv->menu_dynamic_section_n_items = 0;
+ menu = G_MENU (gtk_builder_get_object (self->priv->builder, "menubar"));
+ g_menu_remove_all (menu);
- if (model) {
- g_menu_insert_section (menu, 0, NULL, model);
- mw->priv->menu_dynamic_section_n_items = g_menu_model_get_n_items (model);
- }
+ /* Those are Actions from the selected Presentity and Heap */
+ if (model)
+ g_menu_insert_section (menu, pos++, NULL, model);
}
@@ -718,10 +699,6 @@ ekiga_main_window_init_menu (EkigaMainWindow *mw)
g_settings_create_action (mw->priv->user_interface_settings->get_g_settings (),
"panel-section"));
- g_action_map_add_action_entries (G_ACTION_MAP (g_application_get_default ()),
- win_entries, G_N_ELEMENTS (win_entries),
- mw);
-
gtk_widget_insert_action_group (GTK_WIDGET (mw), "win",
G_ACTION_GROUP (g_application_get_default ()));
}
@@ -882,7 +859,6 @@ ekiga_main_window_init (EkigaMainWindow *mw)
mw->priv->current_call = boost::shared_ptr<Ekiga::Call>();
mw->priv->calling_state = Standby;
- mw->priv->menu_dynamic_section_n_items = 0;
mw->priv->call_window = NULL;
mw->priv->user_interface_settings =
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]