Enlightenment CVS committal

Author  : devilhorns
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_int_border_menu.c 


Log Message:
Added "Add App To Launcher" menu item for adding apps to ibar from window
menu.

===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_int_border_menu.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -3 -r1.47 -r1.48
--- e_int_border_menu.c 14 Oct 2006 09:43:12 -0000      1.47
+++ e_int_border_menu.c 16 Oct 2006 02:34:38 -0000      1.48
@@ -16,6 +16,7 @@
 static void _e_border_menu_cb_unmaximize(void *data, E_Menu *m, E_Menu_Item 
*mi);
 static void _e_border_menu_cb_shade(void *data, E_Menu *m, E_Menu_Item *mi);
 static void _e_border_menu_cb_icon_edit(void *data, E_Menu *m, E_Menu_Item 
*mi);
+static void _e_border_menu_cb_icon_add(void *data, E_Menu *m, E_Menu_Item *mi);
 static void _e_border_menu_cb_prop(void *data, E_Menu *m, E_Menu_Item *mi);
 static void _e_border_menu_cb_stick(void *data, E_Menu *m, E_Menu_Item *mi);
 static void _e_border_menu_cb_on_top(void *data, E_Menu *m, E_Menu_Item *mi);
@@ -289,6 +290,10 @@
             e_menu_item_label_set(mi, _("Create Icon"));
             e_menu_item_callback_set(mi, _e_border_menu_cb_icon_edit, bd);
          }
+       mi = e_menu_item_new(m);
+       e_menu_item_label_set(mi, _("Add App To Launcher"));
+       e_util_menu_item_edje_icon_set(mi, "enlightenment/applications");
+       e_menu_item_callback_set(mi, _e_border_menu_cb_icon_add, bd);
      }
    
    mi = e_menu_item_new(m);
@@ -625,6 +630,41 @@
                             "the time the window starts up, and does not<br>"
                             "change."));
      }
+}
+
+static void 
+_e_border_menu_cb_icon_add(void *data, E_Menu *m, E_Menu_Item *mi)
+{
+   E_App *a, *bar_apps;
+   E_Border *bd;
+   Evas_List *l;
+   char buf[4096];
+   int found = 0;
+   
+   bd = data;
+   a = bd->app;
+   if (!a)
+     return;
+   
+   snprintf(buf, sizeof(buf), "%s/.e/e/applications/bar/default", 
e_user_homedir_get());
+   bar_apps = e_app_new(buf, 0);
+   if (bar_apps)
+     e_app_subdir_scan(bar_apps, 0);
+   for (l = bar_apps->subapps; l; l = l->next) 
+     {
+       E_App *ap;
+       
+       ap = l->data;
+       if (!ap) continue;
+       if (!e_app_valid_exe_get(ap)) continue;
+       if (!strcmp(ap->name, a->name)) 
+         {
+            found = 1;
+            break;
+         }
+     }
+   if (!found)
+     e_app_list_append(a, bar_apps);
 }
 
 static void



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to