Enlightenment CVS committal Author : raster Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: e_exebuf.c e_int_menus.c Log Message: add exebuf to the main menu as run command, and add app menu config formatting to exebuf display of apps =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_exebuf.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- e_exebuf.c 7 Jan 2006 17:54:31 -0000 1.11 +++ e_exebuf.c 11 Jan 2006 04:23:38 -0000 1.12 @@ -767,6 +767,7 @@ E_Exebuf_Exe *exe; Evas_Coord mw, mh; Evas_Object *o; + int opt = 0; exe = calloc(1, sizeof(E_Exebuf_Exe)); eaps = evas_list_append(eaps, exe); @@ -776,7 +777,18 @@ exe->bg_object = o; e_theme_edje_object_set(o, "base/theme/exebuf", "widgets/exebuf/item"); - edje_object_part_text_set(o, "title_text", exe->app->name); + if (e_config->menu_eap_name_show && exe->app->name) opt |= 0x4; + if (e_config->menu_eap_generic_show && exe->app->generic) opt |= 0x2; + if (e_config->menu_eap_comment_show && exe->app->comment) opt |= 0x1; + if (opt == 0x7) snprintf(buf, sizeof(buf), "%s (%s) [%s]", exe->app->name, exe->app->generic, exe->app->comment); + else if (opt == 0x6) snprintf(buf, sizeof(buf), "%s (%s)", exe->app->name, exe->app->generic); + else if (opt == 0x5) snprintf(buf, sizeof(buf), "%s [%s]", exe->app->name, exe->app->comment); + else if (opt == 0x4) snprintf(buf, sizeof(buf), "%s", exe->app->name); + else if (opt == 0x3) snprintf(buf, sizeof(buf), "%s [%s]", exe->app->generic, exe->app->comment); + else if (opt == 0x2) snprintf(buf, sizeof(buf), "%s", exe->app->generic); + else if (opt == 0x1) snprintf(buf, sizeof(buf), "%s", exe->app->comment); + else snprintf(buf, sizeof(buf), "%s", exe->app->name); + edje_object_part_text_set(o, "title_text", buf); evas_object_show(o); if (edje_object_part_exists(exe->bg_object, "icon_swallow")) { =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_int_menus.c,v retrieving revision 1.125 retrieving revision 1.126 diff -u -3 -r1.125 -r1.126 --- e_int_menus.c 10 Jan 2006 04:23:43 -0000 1.125 +++ e_int_menus.c 11 Jan 2006 04:23:40 -0000 1.126 @@ -23,6 +23,7 @@ static void _e_int_menus_quit_cb (void *data); static void _e_int_menus_main_del_hook (void *obj); static void _e_int_menus_main_about (void *data, E_Menu *m, E_Menu_Item *mi); +static int _e_int_menus_main_run_defer_cb (void *data); 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); @@ -80,6 +81,11 @@ e_menu_item_submenu_set(mi, subm); mi = e_menu_item_new(m); + e_menu_item_label_set(mi, _("Run Command")); + e_util_menu_item_edje_icon_set(mi, "enlightenment/run"); + e_menu_item_callback_set(mi, _e_int_menus_main_run, NULL); + + mi = e_menu_item_new(m); e_menu_item_separator_set(mi, 1); subm = e_module_menu_new(); @@ -132,14 +138,6 @@ e_util_menu_item_edje_icon_set(mi, "enlightenment/e"); e_menu_item_callback_set(mi, _e_int_menus_main_about, NULL); - if (ecore_file_app_installed("exige")) - { - mi = e_menu_item_new(m); - e_menu_item_label_set(mi, _("Run Command")); - e_util_menu_item_edje_icon_set(mi, "enlightenment/run"); - e_menu_item_callback_set(mi, _e_int_menus_main_run, NULL); - } - mi = e_menu_item_new(m); e_menu_item_label_set(mi, _("Files")); e_util_menu_item_edje_icon_set(mi, "enlightenment/fileman"); @@ -370,13 +368,23 @@ if (about) e_theme_about_show(about); } +/* FIXME: this is a workaround for menus' haveing a key grab ANd exebuf + * wanting one too + */ +static int +_e_int_menus_main_run_defer_cb(void *data) +{ + E_Zone *zone; + + zone = data; + e_exebuf_show(zone); + return 0; +} + static void _e_int_menus_main_run(void *data, E_Menu *m, E_Menu_Item *mi) { - Ecore_Exe *exe; - - exe = ecore_exe_run("exige", NULL); - if (exe) ecore_exe_free(exe); + ecore_idle_enterer_add(_e_int_menus_main_run_defer_cb, m->zone); } static void ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs