[ekiga/ds-gtk-application] GActorMenu: Added support for menus supporting application actions.
- From: Damien Sandras <dsandras src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ekiga/ds-gtk-application] GActorMenu: Added support for menus supporting application actions.
- Date: Sun, 14 Dec 2014 15:23:44 +0000 (UTC)
commit bd7b5326a26ffbff2e0d5b4e37854982b44a6929
Author: Damien Sandras <dsandras seconix com>
Date: Sun Dec 14 16:19:55 2014 +0100
GActorMenu: Added support for menus supporting application actions.
lib/engine/gui/gtk-core/gactor-menu.cpp | 9 ++++++---
lib/engine/gui/gtk-core/gactor-menu.h | 4 +++-
2 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/lib/engine/gui/gtk-core/gactor-menu.cpp b/lib/engine/gui/gtk-core/gactor-menu.cpp
index b844f7a..7393c9f 100644
--- a/lib/engine/gui/gtk-core/gactor-menu.cpp
+++ b/lib/engine/gui/gtk-core/gactor-menu.cpp
@@ -58,10 +58,13 @@ action_activated (GSimpleAction *a,
Ekiga::GActorMenu::GActorMenu (Ekiga::Actor & _obj) : obj (_obj)
{
ctor_init ();
+ context = "win";
}
-Ekiga::GActorMenu::GActorMenu (Ekiga::Actor & _obj, const std::string & _name) : obj (_obj), name (_name)
+Ekiga::GActorMenu::GActorMenu (Ekiga::Actor & _obj,
+ const std::string & _name,
+ const std::string & _context) : obj (_obj), name (_name), context (_context)
{
ctor_init ();
}
@@ -125,7 +128,7 @@ Ekiga::GActorMenu::get_menu (const Ekiga::GActorMenuStore & store)
return NULL;
GtkWidget *menu = gtk_menu_new_from_model (model);
- gtk_widget_insert_action_group (menu, "win", G_ACTION_GROUP (g_application_get_default ()));
+ gtk_widget_insert_action_group (menu, context.c_str (), G_ACTION_GROUP (g_application_get_default ()));
g_object_ref (menu);
return menu;
@@ -223,7 +226,7 @@ Ekiga::GActorMenu::as_xml (const std::string & id,
xml_content +=
" <item>"
" <attribute name=\"label\" translatable=\"yes\">"+(*it)->get_description ()+"</attribute>"
- " <attribute name=\"action\">win."+(*it)->get_name ()+"</attribute>"
+ " <attribute name=\"action\">" + context + "."+(*it)->get_name ()+"</attribute>"
" </item>";
n++;
}
diff --git a/lib/engine/gui/gtk-core/gactor-menu.h b/lib/engine/gui/gtk-core/gactor-menu.h
index 679f963..95aa246 100644
--- a/lib/engine/gui/gtk-core/gactor-menu.h
+++ b/lib/engine/gui/gtk-core/gactor-menu.h
@@ -74,7 +74,8 @@ namespace Ekiga {
GActorMenu (Actor & obj);
GActorMenu (Actor & obj,
- const std::string & name);
+ const std::string & name,
+ const std::string & context = "win");
virtual ~GActorMenu ();
@@ -139,6 +140,7 @@ namespace Ekiga {
unsigned n;
GtkBuilder *builder;
std::string name;
+ std::string context;
};
}
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]