discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=6a92676cf805eeae0df1c90dc79530102c8d7fd2

commit 6a92676cf805eeae0df1c90dc79530102c8d7fd2
Author: Leif Middelschulte <leif.middelschu...@gmail.com>
Date:   Mon Nov 24 13:33:02 2014 -0500

    Implement FreeDesktop .deskop Additional Actions menu
    
    Summary:
    This implements the additional actions as specified in
    FreeDesktop.org's desktop entry specification 1.1.
    This version is implemented by Efreet 1.12
    
    The additional actions are presented as right-click
    menu entries.
    
    @feature
    
    Reviewers: zmike
    
    Subscribers: tasn, q66, cedric
    
    Differential Revision: https://phab.enlightenment.org/D1657
---
 src/modules/ibar/e_mod_main.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/src/modules/ibar/e_mod_main.c b/src/modules/ibar/e_mod_main.c
index 3f7f8a0..e583658 100644
--- a/src/modules/ibar/e_mod_main.c
+++ b/src/modules/ibar/e_mod_main.c
@@ -111,6 +111,7 @@ static void         _ibar_sep_create(IBar *b);
 static void         _ibar_icon_signal_emit(IBar_Icon *ic, char *sig, char 
*src);
 static void         _ibar_cb_app_change(void *data, E_Order *eo);
 static void         _ibar_cb_obj_moveresize(void *data, Evas *e, Evas_Object 
*obj, void *event_info);
+static void         _ibar_cb_menu_icon_action_exec(void *data, E_Menu *m, 
E_Menu_Item *mi);
 static void         _ibar_cb_menu_icon_new(void *data, E_Menu *m, E_Menu_Item 
*mi);
 static void         _ibar_cb_menu_icon_add(void *data, E_Menu *m, E_Menu_Item 
*mi);
 static void         _ibar_cb_menu_icon_properties(void *data, E_Menu *m, 
E_Menu_Item *mi);
@@ -1043,6 +1044,13 @@ _ibar_cb_obj_moveresize(void *data, Evas *e __UNUSED__, 
Evas_Object *obj __UNUSE
 }
 
 static void
+_ibar_cb_menu_icon_action_exec(void *data, E_Menu *m __UNUSED__, E_Menu_Item 
*mi __UNUSED__)
+{
+   Efreet_Desktop_Action *action = (Efreet_Desktop_Action*)data;
+   e_exec(NULL, NULL, action->exec, NULL, "ibar");
+}
+
+static void
 _ibar_cb_menu_icon_new(void *data __UNUSED__, E_Menu *m __UNUSED__, 
E_Menu_Item *mi __UNUSED__)
 {
    if (!e_configure_registry_exists("applications/new_application")) return;
@@ -1558,8 +1566,10 @@ _ibar_cb_icon_mouse_down(void *data, Evas *e __UNUSED__, 
Evas_Object *obj __UNUS
      }
    else if (ev->button == 3)
      {
+        Eina_List *it;
         E_Menu *m, *mo;
         E_Menu_Item *mi;
+        Efreet_Desktop_Action *action;
         char buf[256];
         int cx, cy;
 
@@ -1626,6 +1636,20 @@ _ibar_cb_icon_mouse_down(void *data, Evas *e __UNUSED__, 
Evas_Object *obj __UNUS
                                           mi);
         e_menu_item_submenu_set(mi, mo);
         e_object_unref(E_OBJECT(mo));
+
+        if (ic->app->actions)
+          {
+             EINA_LIST_FOREACH(ic->app->actions, it, action)
+               {
+                  mi = e_menu_item_new_relative(m, mi);
+                  e_menu_item_label_set(mi, action->name);
+                  e_util_menu_item_theme_icon_set(mi, action->icon);
+                  e_menu_item_callback_set(mi, _ibar_cb_menu_icon_action_exec, 
action);
+               }
+             mi = e_menu_item_new(m);
+             e_menu_item_separator_set(mi, 1);
+          }
+
         e_gadcon_client_menu_set(ic->ibar->inst->gcc, m);
 
         e_gadcon_canvas_zone_geometry_get(ic->ibar->inst->gcc->gadcon,

-- 


Reply via email to