From 223423c16fc400d87393973ec1649cc754acb5a9 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Sat, 15 Oct 2005 10:02:29 +0000 Subject: [PATCH] lable display options for eaps in menus from ilLogict - modified to be simpler though SVN revision: 17572 --- src/bin/e_config.c | 11 +++- src/bin/e_config.h | 5 +- src/bin/e_int_menus.c | 16 +++++- src/bin/e_ipc_handlers.h | 122 ++++++++++++++++++++++++++++++++++++++++++ src/bin/e_ipc_handlers_list.h | 11 ++++ 5 files changed, 162 insertions(+), 3 deletions(-) diff --git a/src/bin/e_config.c b/src/bin/e_config.c index b558ee2..2f01166 100644 --- a/src/bin/e_config.c +++ b/src/bin/e_config.c @@ -356,7 +356,10 @@ e_config_init(void) 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) { @@ -481,6 +484,9 @@ e_config_init(void) 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 = 0; { E_Config_Module *em; @@ -1435,6 +1441,9 @@ e_config_init(void) 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 */ diff --git a/src/bin/e_config.h b/src/bin/e_config.h index fc53f96..3343d6a 100644 --- a/src/bin/e_config.h +++ b/src/bin/e_config.h @@ -50,7 +50,7 @@ typedef Eet_Data_Descriptor E_Config_DD; * defaults for e to work - started at 100 when we introduced this config * versioning feature */ -#define E_CONFIG_FILE_VERSION 126 +#define E_CONFIG_FILE_VERSION 127 #define E_EVAS_ENGINE_DEFAULT 0 #define E_EVAS_ENGINE_SOFTWARE_X11 1 @@ -182,6 +182,9 @@ struct _E_Config 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 diff --git a/src/bin/e_int_menus.c b/src/bin/e_int_menus.c index a9508af..692b045 100644 --- a/src/bin/e_int_menus.c +++ b/src/bin/e_int_menus.c @@ -426,8 +426,22 @@ _e_int_menus_apps_scan(E_Menu *m) if (e_app_valid_exe_get(a) || (!a->exe)) { + int opt = 0; + char label[4096]; + mi = e_menu_item_new(m); - e_menu_item_label_set(mi, a->name); + if (e_config->menu_eap_name_show && a->name) opt |= 0x4; + if (e_config->menu_eap_generic_show && a->generic) opt |= 0x2; + if (e_config->menu_eap_comment_show && a->comment) opt |= 0x1; + if (opt == 0x7) snprintf(label, sizeof(label), "%s (%s) [%s]", a->name, a->generic, a->comment); + else if (opt == 0x6) snprintf(label, sizeof(label), "%s (%s)", a->name, a->generic); + else if (opt == 0x5) snprintf(label, sizeof(label), "%s [%s]", a->name, a->comment); + else if (opt == 0x4) snprintf(label, sizeof(label), "%s", a->name); + else if (opt == 0x3) snprintf(label, sizeof(label), "%s [%s]", a->generic, a->comment); + else if (opt == 0x2) snprintf(label, sizeof(label), "%s", a->generic); + else if (opt == 0x1) snprintf(label, sizeof(label), "%s", a->comment); + else snprintf(label, sizeof(label), "%s", a->name); + e_menu_item_label_set(mi, label); if (a->exe) { e_menu_item_icon_edje_set(mi, a->path, "icon"); diff --git a/src/bin/e_ipc_handlers.h b/src/bin/e_ipc_handlers.h index deb099f..0cf5bcb 100644 --- a/src/bin/e_ipc_handlers.h +++ b/src/bin/e_ipc_handlers.h @@ -6650,3 +6650,125 @@ break; #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 + +/****************************************************************************/ diff --git a/src/bin/e_ipc_handlers_list.h b/src/bin/e_ipc_handlers_list.h index 0cecf62..7ae3836 100644 --- a/src/bin/e_ipc_handlers_list.h +++ b/src/bin/e_ipc_handlers_list.h @@ -318,3 +318,14 @@ #define E_IPC_OP_ENGINE_SET 303 #define E_IPC_OP_ENGINE_GET 304 #define E_IPC_OP_ENGINE_GET_REPLY 305 + +#define E_IPC_OP_MENU_EAP_NAME_SHOW_SET 306 +#define E_IPC_OP_MENU_EAP_NAME_SHOW_GET 307 +#define E_IPC_OP_MENU_EAP_NAME_SHOW_GET_REPLY 308 +#define E_IPC_OP_MENU_EAP_GENERIC_SHOW_SET 309 +#define E_IPC_OP_MENU_EAP_GENERIC_SHOW_GET 310 +#define E_IPC_OP_MENU_EAP_GENERIC_SHOW_GET_REPLY 311 +#define E_IPC_OP_MENU_EAP_COMMENT_SHOW_SET 312 +#define E_IPC_OP_MENU_EAP_COMMENT_SHOW_GET 313 +#define E_IPC_OP_MENU_EAP_COMMENT_SHOW_GET_REPLY 314 + -- 2.7.4