Enlightenment CVS committal Author : lordchaos Project : e17 Module : proto
Dir : e17/proto/entropy/src/plugins Modified Files: Makefile.am action_simple.c layout_ewl_simple.c Added Files: ewl_mime_dialog.c Log Message: * Work on the MIME engine =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/entropy/src/plugins/Makefile.am,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- Makefile.am 29 Oct 2005 06:57:39 -0000 1.6 +++ Makefile.am 24 Nov 2005 04:03:13 -0000 1.7 @@ -39,7 +39,7 @@ action_simple_la_LIBADD = @EWL_LIBS@ -layout_ewl_simple_la_SOURCES = layout_ewl_simple.c $(top_srcdir)/src/entropy_debug.c +layout_ewl_simple_la_SOURCES = ewl_mime_dialog.c layout_ewl_simple.c $(top_srcdir)/src/entropy_debug.c layout_ewl_simple_la_CFLAGS = @EWL_CFLAGS@ layout_ewl_simple_la_LDFLAGS = -module -avoid-version layout_ewl_simple_la_LIBADD = @EWL_LIBS@ =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/entropy/src/plugins/action_simple.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- action_simple.c 21 Nov 2005 11:50:54 -0000 1.5 +++ action_simple.c 24 Nov 2005 04:03:13 -0000 1.6 @@ -20,7 +20,7 @@ char fullname[1024]; entropy_gui_event* gui_event; entropy_core* core = ((entropy_gui_component_instance*)requestor)->core; - char* app; + entropy_mime_action* app; char* uri; entropy_generic_file* file = (entropy_generic_file*)obj; @@ -67,15 +67,15 @@ /*First get the app associated with this mime type*/ - app = entropy_config_str_get("action_simple", ((entropy_generic_file*)obj)->mime_type); + app = entropy_core_mime_hint_get( ((entropy_generic_file*)obj)->mime_type); if (app) { - sprintf(fullname, "%s \"%s/%s\"", app, ((entropy_generic_file*)obj)->path, ((entropy_generic_file*)obj)->filename); + sprintf(fullname, "%s \"%s/%s\"", app->executable, + ((entropy_generic_file*)obj)->path, ((entropy_generic_file*)obj)->filename); //printf ("Hit action callback\n"); //printf("Exe: %s\n", fullname); ecore_exe_run(fullname, NULL); - entropy_free(app); } else { printf("action_simple: No action associated with %s\n", ((entropy_generic_file*)obj)->mime_type); } @@ -96,28 +96,5 @@ entropy_core_component_event_register(instance, entropy_core_gui_event_get(ENTROPY_GUI_EVENT_ACTION_FILE)); - /*Load config*/ - config = entropy_config_int_get("action_simple", "init"); - if (!config) { - printf (" *** Initializing action provider config\n"); - entropy_config_int_set("action_simple", "init", 1); - - /*Set default apps to run*/ - entropy_config_str_set("action_simple", "image/jpeg", "entice"); - entropy_config_str_set("action_simple", "image/png", "entice"); - entropy_config_str_set("action_simple", "image/gif", "entice"); - entropy_config_str_set("action_simple", "text/html", "/usr/bin/firefox"); - entropy_config_str_set("action_simple", "text/csrc", "gvim"); - entropy_config_str_set("action_simple", "audio/x-mp3", "xmms"); - entropy_config_str_set("action_simple", "video/x-ms-wmv", "mplayer"); - entropy_config_str_set("action_simple", "video/mpeg", "mplayer"); - entropy_config_str_set("action_simple", "application/msword", "abiword"); - entropy_config_str_set("action_simple", "application/vnd.ms-excel", "gnumeric"); - entropy_config_str_set("action_simple", "video/x-msvideo", "mplayer"); - - /*Archives*/ - //entropy_config_str_set("action_simple", "application/x-gtar", "file-roller"); - } - return instance; } =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/entropy/src/plugins/layout_ewl_simple.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- layout_ewl_simple.c 20 Nov 2005 03:04:29 -0000 1.14 +++ layout_ewl_simple.c 24 Nov 2005 04:03:13 -0000 1.15 @@ -4,6 +4,7 @@ #include <Ecore.h> #include <stdlib.h> #include <stdio.h> +#include "ewl_mime_dialog.h" static Ewl_Widget* win; static Ecore_List* components; @@ -99,6 +100,11 @@ ewl_widget_destroy(EWL_WIDGET(user_data)); } +void mime_cb(Ewl_Widget *main_win, void *ev_data, void *user_data) { + ewl_mime_dialog_display(); +} + + void location_add_cb(Ewl_Widget *main_win, void *ev_data, void *user_data) { entropy_gui_component_instance* instance = (entropy_gui_component_instance*)user_data; @@ -489,6 +495,9 @@ Ewl_Widget* expand_button; Ewl_Widget* scrollpane; Ewl_Widget* add_button; + Ewl_Widget* menubar; + Ewl_Widget* menu; + Ewl_Widget* item; entropy_plugin* plugin; Ewl_Widget* iconbox; @@ -545,6 +554,40 @@ ewl_object_maximum_size_set(EWL_OBJECT(expand_button), 20, 10); ewl_object_fill_policy_set(EWL_OBJECT(hbox), EWL_FLAG_FILL_VSHRINK); + /*Main menu setup*/ + menubar = ewl_menubar_new(); + ewl_widget_show(menubar); + + + menu = ewl_menu_new(); + ewl_menu_item_text_set(EWL_MENU_ITEM(menu), "File"); + ewl_container_child_append(EWL_CONTAINER(menubar), menu); + ewl_widget_show(menu); + + menu = ewl_menu_new(); + ewl_menu_item_text_set(EWL_MENU_ITEM(menu), "Tools"); + ewl_container_child_append(EWL_CONTAINER(menubar), menu); + ewl_widget_show(menu); + + item = ewl_menu_item_new(); + ewl_menu_item_text_set(EWL_MENU_ITEM(item), "Add Location..."); + ewl_container_child_append(EWL_CONTAINER(menu), item); + ewl_callback_append(EWL_WIDGET(item), EWL_CALLBACK_CLICKED, location_add_cb, layout); + ewl_widget_show(item); + + item = ewl_menu_item_new(); + ewl_menu_item_text_set(EWL_MENU_ITEM(item), "Setup MIME Actions..."); + ewl_container_child_append(EWL_CONTAINER(menu), item); + ewl_callback_append(EWL_WIDGET(item), EWL_CALLBACK_CLICKED, mime_cb, layout); + ewl_widget_show(item); + + + menu = ewl_menu_new(); + ewl_menu_item_text_set(EWL_MENU_ITEM(menu), "Help"); + ewl_container_child_append(EWL_CONTAINER(menubar), menu); + ewl_widget_show(menu); + /*-------------------------------*/ + ewl_container_child_append(EWL_CONTAINER(hbox), expand_button); @@ -567,9 +610,10 @@ ewl_callback_append(EWL_WIDGET(add_button), EWL_CALLBACK_CLICKED, location_add_cb, layout); - ewl_widget_show(add_button); + /*ewl_widget_show(add_button);*/ /*--------------------------*/ + ewl_container_child_append(EWL_CONTAINER(box), menubar); ewl_container_child_append(EWL_CONTAINER(box),paned); //ewl_container_child_append(EWL_CONTAINER(scrollpane), tree); ewl_container_child_append(EWL_CONTAINER(paned), tree); ------------------------------------------------------- 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