Hello! I'm attaching a patch to display eap's generic and comment fields on menu, configurable via IPC. You can enable displaying of name/generic/comment field. With all activated it will look like name (generic) [comment] (default). As this was created before the Configuration Panel exists (was first created so that the shipped emblem and entangle eap will have the name placed and generic placed where they should be), it also adds the config-apps in the paths to search for eap's, so just add emblem.eap or entangle.eap to any .order file and they will show up in the menu (attached modified eaps)!
Hope this helps! Cheers! -- ilLogict Website: http://illogict.online.fr E-Mail: [EMAIL PROTECTED] AIM/NIM: illogict Yahoo: illogict MSN: [EMAIL PROTECTED] ICQ: #74274856 Infos: E17 rocks! Le nettoyage de ligne, quelle chose efficace ! (1900->4700 @60dB)
emblem.eap
Description: Binary data
entangle.eap
Description: Binary data
Index: e_apps.c =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_apps.c,v retrieving revision 1.67 diff -u -r1.67 e_apps.c --- e_apps.c 15 Sep 2005 06:25:28 -0000 1.67 +++ e_apps.c 24 Sep 2005 20:23:02 -0000 @@ -57,6 +57,7 @@ static E_App *_e_apps_all = NULL; static char *_e_apps_path_all = NULL; static char *_e_apps_path_trash = NULL; +static char *_e_apps_path_config_apps = NULL; static Evas_List *_e_apps_start_pending = NULL; /* externally accessible functions */ @@ -66,6 +67,9 @@ char *home; char buf[PATH_MAX]; + snprintf(buf, sizeof(buf), "%s/config-apps", e_prefix_data_get()); + _e_apps_path_config_apps = strdup(buf); + _e_apps_repositories = evas_list_append(_e_apps_repositories, strdup(buf)); home = e_user_homedir_get(); snprintf(buf, sizeof(buf), "%s/.e/e/applications/trash", home); _e_apps_path_trash = strdup(buf); Index: e_config.c =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_config.c,v retrieving revision 1.102 diff -u -r1.102 e_config.c --- e_config.c 22 Sep 2005 20:20:33 -0000 1.102 +++ e_config.c 24 Sep 2005 20:23:03 -0000 @@ -340,6 +340,9 @@ E_CONFIG_VAL(D, T, transient.desktop, INT); /**/ E_CONFIG_VAL(D, T, transient.iconify, INT); /**/ E_CONFIG_VAL(D, T, modal_windows, INT); /**/ + E_CONFIG_VAL(D, T, menu_eap_name_show, INT); /**/ + E_CONFIG_VAL(D, T, menu_eap_generic_show, INT); /**/ + E_CONFIG_VAL(D, T, menu_eap_comment_show, INT); /**/ e_config = e_config_domain_load("e", _e_config_edd); if (e_config) @@ -457,6 +460,9 @@ e_config->transient.desktop = 1; e_config->transient.iconify = 1; e_config->modal_windows = 1; + e_config->menu_eap_name_show = 1; + e_config->menu_eap_generic_show = 1; + e_config->menu_eap_comment_show = 1; { E_Config_Module *em; @@ -1396,6 +1402,9 @@ E_CONFIG_LIMIT(e_config->cursor_size, 0, 1024); E_CONFIG_LIMIT(e_config->menu_autoscroll_margin, 0, 50); E_CONFIG_LIMIT(e_config->menu_autoscroll_cursor_margin, 0, 50); + E_CONFIG_LIMIT(e_config->menu_eap_name_show, 0, 1); + E_CONFIG_LIMIT(e_config->menu_eap_generic_show, 0, 1); + E_CONFIG_LIMIT(e_config->menu_eap_comment_show, 0, 1); /* apply lang config - exception because config is loaded after intl setup */ Index: e_config.h =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_config.h,v retrieving revision 1.52 diff -u -r1.52 e_config.h --- e_config.h 22 Sep 2005 20:20:33 -0000 1.52 +++ e_config.h 24 Sep 2005 20:23:03 -0000 @@ -50,7 +50,7 @@ * defaults for e to work - started at 100 when we introduced this config * versioning feature */ -#define E_CONFIG_FILE_VERSION 125 +#define E_CONFIG_FILE_VERSION 126 #define E_EVAS_ENGINE_DEFAULT 0 #define E_EVAS_ENGINE_SOFTWARE_X11 1 @@ -160,6 +160,9 @@ int iconify; } transient; int modal_windows; + int menu_eap_name_show; + int menu_eap_generic_show; + int menu_eap_comment_show; }; struct _E_Config_Module Index: e_int_menus.c =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_int_menus.c,v retrieving revision 1.96 diff -u -r1.96 e_int_menus.c --- e_int_menus.c 22 Sep 2005 08:05:15 -0000 1.96 +++ e_int_menus.c 24 Sep 2005 20:23:04 -0000 @@ -27,7 +27,7 @@ static void _e_int_menus_main_run (void *data, E_Menu *m, E_Menu_Item*mi); static void _e_int_menus_main_restart (void *data, E_Menu *m, E_Menu_Item *mi); static void _e_int_menus_main_exit (void *data, E_Menu *m, E_Menu_Item *mi); -static void _e_int_menus_apps_scan (E_Menu *m); +static void _e_int_menus_apps_scan (E_Menu *m, int eap_fields); static void _e_int_menus_apps_start (void *data, E_Menu *m); static void _e_int_menus_apps_del_hook (void *obj); static void _e_int_menus_apps_free_hook (void *obj); @@ -166,15 +166,17 @@ } E_Menu * -e_int_menus_apps_new(char *dir) +e_int_menus_apps_new(char *dir, int eap_fields) { E_Menu *m; E_App *a; + int *data = (int *)malloc(sizeof(int)); + *data = eap_fields; m = e_menu_new(); a = e_app_new(dir, 0); e_object_data_set(E_OBJECT(m), a); - e_menu_pre_activate_callback_set(m, _e_int_menus_apps_start, NULL); + e_menu_pre_activate_callback_set(m, _e_int_menus_apps_start, data); e_object_del_attach_func_set(E_OBJECT(m), _e_int_menus_apps_del_hook); e_object_free_attach_func_set(E_OBJECT(m), _e_int_menus_apps_free_hook); return m; @@ -201,7 +203,7 @@ if (homedir) { snprintf(buf, sizeof(buf), "%s/.e/e/applications/favorite", homedir); - m = e_int_menus_apps_new(buf); + m = e_int_menus_apps_new(buf, (e_config->menu_eap_name_show?E_INT_MENUS_SHOW_NAME:0)|(e_config->menu_eap_generic_show?E_INT_MENUS_SHOW_GENERIC:0)|(e_config->menu_eap_comment_show?E_INT_MENUS_SHOW_COMMENT:0)); free(homedir); return m; } @@ -393,7 +395,7 @@ } static void -_e_int_menus_apps_scan(E_Menu *m) +_e_int_menus_apps_scan(E_Menu *m, int eap_fields) { E_Menu_Item *mi; E_App *a; @@ -406,10 +408,51 @@ e_app_subdir_scan(a, 0); for (l = a->subapps; l; l = l->next) { + char label[PATH_MAX] = ""; + int show_count = 0; + a = l->data; mi = e_menu_item_new(m); - e_menu_item_label_set(mi, a->name); + + if (eap_fields & E_INT_MENUS_SHOW_NAME) + { + snprintf(label, sizeof(label), "%s", a->name); + ++ show_count; + } + + if (a->generic && (eap_fields & E_INT_MENUS_SHOW_GENERIC)) + { + if (show_count) + { + char str[PATH_MAX]; + snprintf(str, sizeof(str), " (%s)", a->generic); + strncat(label, str, sizeof(label)); + } + else + { + snprintf(label, sizeof(label), "%s", a->generic); + } + ++ show_count; + } + + if (a->comment && (eap_fields & E_INT_MENUS_SHOW_COMMENT)) + { + if (show_count) + { + char str[PATH_MAX]; + snprintf(str, sizeof(str), " [%s]", a->comment); + strncat(label, str, sizeof(label)); + } + else + { + snprintf(label, sizeof(label), "%s", a->comment); + } + ++ show_count; //Yes, this is unneeded, but here anyway... + } + + e_menu_item_label_set(mi, label); + if (a->exe) { e_menu_item_icon_edje_set(mi, a->path, "icon"); @@ -422,7 +465,8 @@ snprintf(buf, sizeof(buf), "%s/.directory.eap", a->path); e_menu_item_icon_edje_set(mi, buf, "icon"); - e_menu_item_submenu_set(mi, e_int_menus_apps_new(a->path)); + e_menu_item_submenu_set(mi, e_int_menus_apps_new(a->path, + eap_fields)); app_count++; } } @@ -437,8 +481,12 @@ static void _e_int_menus_apps_start(void *data, E_Menu *m) { - _e_int_menus_apps_scan(m); + int *eap_fields = data; + + _e_int_menus_apps_scan(m, *eap_fields); e_menu_pre_activate_callback_set(m, NULL, NULL); + + free(data); } static void Index: e_int_menus.h =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_int_menus.h,v retrieving revision 1.14 diff -u -r1.14 e_int_menus.h --- e_int_menus.h 23 Aug 2005 10:26:44 -0000 1.14 +++ e_int_menus.h 24 Sep 2005 20:23:04 -0000 @@ -5,6 +5,10 @@ typedef struct _E_Int_Menu_Augmentation E_Int_Menu_Augmentation; +#define E_INT_MENUS_SHOW_NAME (1 << 0) +#define E_INT_MENUS_SHOW_GENERIC (1 << 1) +#define E_INT_MENUS_SHOW_COMMENT (1 << 2) + #else #ifndef E_INT_MENUS_H #define E_INT_MENUS_H @@ -20,7 +24,7 @@ EAPI E_Menu *e_int_menus_main_new(void); EAPI E_Menu *e_int_menus_desktops_new(void); EAPI E_Menu *e_int_menus_clients_new(void); -EAPI E_Menu *e_int_menus_apps_new(char *dir); +EAPI E_Menu *e_int_menus_apps_new(char *dir, int eap_fields); EAPI E_Menu *e_int_menus_favorite_apps_new(void); EAPI E_Menu *e_int_menus_config_new(void); EAPI E_Menu *e_int_menus_gadgets_new(void); Index: e_ipc_handlers.h =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_ipc_handlers.h,v retrieving revision 1.78 diff -u -r1.78 e_ipc_handlers.h --- e_ipc_handlers.h 23 Sep 2005 06:31:33 -0000 1.78 +++ e_ipc_handlers.h 24 Sep 2005 20:23:08 -0000 @@ -5935,3 +5935,126 @@ #elif (TYPE == E_REMOTE_IN) #endif #undef HDL + +/****************************************************************************/ +#define HDL E_IPC_OP_MENU_EAP_NAME_SHOW_SET +#if (TYPE == E_REMOTE_OPTIONS) + OP("-menu-eap-name-show-set", 1, "Set whether to show eapps' name field in menus", 0, HDL) +#elif (TYPE == E_REMOTE_OUT) + REQ_INT(atoi(params[0]), HDL); +#elif (TYPE == E_WM_IN) + START_INT(val, HDL); + e_config->menu_eap_name_show = val; + E_CONFIG_LIMIT(e_config->menu_eap_name_show, 0, 1); + SAVE; + END_INT; +#elif (TYPE == E_REMOTE_IN) +#endif +#undef HDL + +/****************************************************************************/ +#define HDL E_IPC_OP_MENU_EAP_NAME_SHOW_GET +#if (TYPE == E_REMOTE_OPTIONS) + OP("-menu-eap-name-show-get", 0, "Get whether eapps' name field is shown in menus", 1, HDL) +#elif (TYPE == E_REMOTE_OUT) + REQ_NULL(HDL); +#elif (TYPE == E_WM_IN) + SEND_INT(e_config->menu_eap_name_show, E_IPC_OP_MENU_EAP_NAME_SHOW_GET_REPLY, HDL); +#elif (TYPE == E_REMOTE_IN) +#endif +#undef HDL + +/****************************************************************************/ +#define HDL E_IPC_OP_MENU_EAP_NAME_SHOW_GET_REPLY +#if (TYPE == E_REMOTE_OPTIONS) +#elif (TYPE == E_REMOTE_OUT) +#elif (TYPE == E_WM_IN) +#elif (TYPE == E_REMOTE_IN) + START_INT(val, HDL); + printf("REPLY: %d\n", val); + END_INT; +#endif +#undef HDL + +/****************************************************************************/ +#define HDL E_IPC_OP_MENU_EAP_GENERIC_SHOW_SET +#if (TYPE == E_REMOTE_OPTIONS) + OP("-menu-eap-generic-show-set", 1, "Set whether to show eapps' generic field in menus", 0, HDL) +#elif (TYPE == E_REMOTE_OUT) + REQ_INT(atoi(params[0]), HDL); +#elif (TYPE == E_WM_IN) + START_INT(val, HDL); + e_config->menu_eap_generic_show = val; + E_CONFIG_LIMIT(e_config->menu_eap_generic_show, 0, 1); + SAVE; + END_INT; +#elif (TYPE == E_REMOTE_IN) +#endif +#undef HDL + +/****************************************************************************/ +#define HDL E_IPC_OP_MENU_EAP_GENERIC_SHOW_GET +#if (TYPE == E_REMOTE_OPTIONS) + OP("-menu-eap-generic-show-get", 0, "Get whether eapps' generic field is shown in menus", 1, HDL) +#elif (TYPE == E_REMOTE_OUT) + REQ_NULL(HDL); +#elif (TYPE == E_WM_IN) + SEND_INT(e_config->menu_eap_generic_show, E_IPC_OP_MENU_EAP_GENERIC_SHOW_GET_REPLY, HDL); +#elif (TYPE == E_REMOTE_IN) +#endif +#undef HDL + +/****************************************************************************/ +#define HDL E_IPC_OP_MENU_EAP_GENERIC_SHOW_GET_REPLY +#if (TYPE == E_REMOTE_OPTIONS) +#elif (TYPE == E_REMOTE_OUT) +#elif (TYPE == E_WM_IN) +#elif (TYPE == E_REMOTE_IN) + START_INT(val, HDL); + printf("REPLY: %d\n", val); + END_INT; +#endif +#undef HDL + +/****************************************************************************/ +#define HDL E_IPC_OP_MENU_EAP_COMMENT_SHOW_SET +#if (TYPE == E_REMOTE_OPTIONS) + OP("-menu-eap-comment-show-set", 1, "Set whether to show eapps' comment field in menus", 0, HDL) +#elif (TYPE == E_REMOTE_OUT) + REQ_INT(atoi(params[0]), HDL); +#elif (TYPE == E_WM_IN) + START_INT(val, HDL); + e_config->menu_eap_comment_show = val; + E_CONFIG_LIMIT(e_config->menu_eap_comment_show, 0, 1); + SAVE; + END_INT; +#elif (TYPE == E_REMOTE_IN) +#endif +#undef HDL + +/****************************************************************************/ +#define HDL E_IPC_OP_MENU_EAP_COMMENT_SHOW_GET +#if (TYPE == E_REMOTE_OPTIONS) + OP("-menu-eap-comment-show-get", 0, "Get whether eapps' comment field is shown in menus", 1, HDL) +#elif (TYPE == E_REMOTE_OUT) + REQ_NULL(HDL); +#elif (TYPE == E_WM_IN) + SEND_INT(e_config->menu_eap_comment_show, E_IPC_OP_MENU_EAP_COMMENT_SHOW_GET_REPLY, HDL); +#elif (TYPE == E_REMOTE_IN) +#endif +#undef HDL + +/****************************************************************************/ +#define HDL E_IPC_OP_MENU_EAP_COMMENT_SHOW_GET_REPLY +#if (TYPE == E_REMOTE_OPTIONS) +#elif (TYPE == E_REMOTE_OUT) +#elif (TYPE == E_WM_IN) +#elif (TYPE == E_REMOTE_IN) + START_INT(val, HDL); + printf("REPLY: %d\n", val); + END_INT; +#endif +#undef HDL + +/****************************************************************************/ + Index: e_ipc_handlers_list.h =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_ipc_handlers_list.h,v retrieving revision 1.23 diff -u -r1.23 e_ipc_handlers_list.h --- e_ipc_handlers_list.h 22 Sep 2005 20:20:34 -0000 1.23 +++ e_ipc_handlers_list.h 24 Sep 2005 20:23:08 -0000 @@ -272,3 +272,13 @@ #define E_IPC_OP_BINDING_WHEEL_LIST_REPLY 267 #define E_IPC_OP_BINDING_WHEEL_ADD 268 #define E_IPC_OP_BINDING_WHEEL_DEL 269 + +#define E_IPC_OP_MENU_EAP_NAME_SHOW_SET 270 +#define E_IPC_OP_MENU_EAP_NAME_SHOW_GET 271 +#define E_IPC_OP_MENU_EAP_NAME_SHOW_GET_REPLY 272 +#define E_IPC_OP_MENU_EAP_GENERIC_SHOW_SET 273 +#define E_IPC_OP_MENU_EAP_GENERIC_SHOW_GET 274 +#define E_IPC_OP_MENU_EAP_GENERIC_SHOW_GET_REPLY 275 +#define E_IPC_OP_MENU_EAP_COMMENT_SHOW_SET 276 +#define E_IPC_OP_MENU_EAP_COMMENT_SHOW_GET 277 +#define E_IPC_OP_MENU_EAP_COMMENT_SHOW_GET_REPLY 278