Enlightenment CVS committal Author : lordchaos Project : e17 Module : proto
Dir : e17/proto/entropy/src/plugins Modified Files: Makefile.am ewl_icon_local_viewer.c layout_ewl_simple.c Log Message: * Rename dialog work =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/entropy/src/plugins/Makefile.am,v retrieving revision 1.15 retrieving revision 1.16 diff -u -3 -r1.15 -r1.16 --- Makefile.am 16 Jan 2006 09:13:59 -0000 1.15 +++ Makefile.am 16 Jan 2006 11:17:31 -0000 1.16 @@ -28,6 +28,7 @@ ewl_local_icon_la_SOURCES = $(top_srcdir)/src/entropy_gui.c \ $(top_srcdir)/src/dialogs/ewl_progress_dialog.c \ + $(top_srcdir)/src/dialogs/ewl_rename_dialog.c \ ewl_icon_local_viewer.c $(top_srcdir)/src/dialogs/ewl_properties_dialog.c \ $(top_srcdir)/src/entropy_debug.c ewl_local_icon_la_CFLAGS = @EWL_CFLAGS@ @@ -36,6 +37,7 @@ ewl_list_la_SOURCES = $(top_srcdir)/src/entropy_gui.c \ $(top_srcdir)/src/dialogs/ewl_progress_dialog.c \ + $(top_srcdir)/src/dialogs/ewl_rename_dialog.c \ ewl_list_viewer.c $(top_srcdir)/src/dialogs/ewl_properties_dialog.c \ $(top_srcdir)/src/entropy_debug.c ewl_list_la_CFLAGS = @EWL_CFLAGS@ =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/entropy/src/plugins/ewl_icon_local_viewer.c,v retrieving revision 1.51 retrieving revision 1.52 diff -u -3 -r1.51 -r1.52 --- ewl_icon_local_viewer.c 11 Jan 2006 10:55:39 -0000 1.51 +++ ewl_icon_local_viewer.c 16 Jan 2006 11:17:31 -0000 1.52 @@ -4,6 +4,7 @@ #include "entropy_config.h" #include "ewl_properties_dialog.h" #include "ewl_progress_dialog.h" +#include "ewl_rename_dialog.h" #include <dlfcn.h> #include <time.h> @@ -31,13 +32,6 @@ int terminate; } event_idle_processor; - - -void gui_event_callback(entropy_notify_event* eevent, void* requestor, void* ret, void* user_data); -void ewl_icon_local_viewer_delete_selected(entropy_gui_component_instance* instance); - - - typedef struct entropy_icon_viewer entropy_icon_viewer; struct entropy_icon_viewer { Ewl_Widget* iconbox; @@ -61,7 +55,41 @@ }; -void entropy_file_wait_list_add(entropy_icon_viewer* viewer, Ecore_List* list) { +int entropy_plugin_type_get(); +int entropy_plugin_sub_type_get(); +char* entropy_plugin_identify(); + +void gui_event_callback(entropy_notify_event* eevent, void* requestor, void* ret, void* user_data); +void ewl_icon_local_viewer_delete_selected(entropy_gui_component_instance* instance); +void ewl_iconbox_background_remove_cb(Ewl_Widget *w , void *ev, void *user_data ); +void ewl_iconbox_background_set_file_cb(Ewl_Widget *w , void *ev, void *user_data ); +void entropy_file_wait_list_add(entropy_icon_viewer* viewer, Ecore_List* list); +void ewl_iconbox_background_set_cb(Ewl_Widget *w , void *ev_data , void *user_data ); +void hover_icon_mouse_move_cb(Ewl_Widget *w , void *ev_data , void *user_data ); +void icon_hover_properties_show_cb(Ewl_Widget *w , void *ev_data , void *user_data ); +void ewl_iconbox_file_paste_cb(Ewl_Widget *w , void *ev_data , void *user_data ); +void ewl_iconbox_file_copy_cb(Ewl_Widget *w , void *ev_data , void *user_data ) ; +void icon_properties_cb(Ewl_Widget *w , void *ev_data , void *user_data ) ; +void icon_click_cb(Ewl_Widget *w , void *ev_data , void *user_data ); +void ewl_icon_local_viewer_delete_cb(Ewl_Widget *w , void *ev_data , void *user_data ); +void ewl_icon_local_viewer_menu_rename_cb(Ewl_Widget *w , void *ev_data , void *user_data ); + + +int entropy_plugin_type_get() { + return ENTROPY_PLUGIN_GUI_COMPONENT; +} + +int entropy_plugin_sub_type_get() { + return ENTROPY_PLUGIN_GUI_COMPONENT_LOCAL_VIEW; +} + +char* entropy_plugin_identify() { + return (char*)"Icon View"; +} + + +void entropy_file_wait_list_add(entropy_icon_viewer* viewer, Ecore_List* list) +{ ecore_hash_set(viewer->file_wait_list, list, list); } @@ -69,7 +97,8 @@ /*---------------------------*/ /*Functions to handle custom background setting*/ -void ewl_iconbox_background_remove_cb(Ewl_Widget *w , void *ev, void *user_data ) { +void ewl_iconbox_background_remove_cb(Ewl_Widget *w , void *ev, void *user_data ) +{ entropy_gui_component_instance* instance = user_data; entropy_icon_viewer* viewer = instance->data; @@ -77,7 +106,8 @@ } -void ewl_iconbox_background_set_file_cb(Ewl_Widget *w , void *ev, void *user_data ) { +void ewl_iconbox_background_set_file_cb(Ewl_Widget *w , void *ev, void *user_data ) +{ Ewl_Dialog_Event *e; entropy_gui_component_instance* instance = user_data; entropy_icon_viewer* viewer = instance->data; @@ -96,7 +126,8 @@ } -void ewl_iconbox_background_set_cb(Ewl_Widget *w , void *ev_data , void *user_data ) { +void ewl_iconbox_background_set_cb(Ewl_Widget *w , void *ev_data , void *user_data ) +{ entropy_gui_component_instance* instance = user_data; entropy_icon_viewer* viewer = instance->data; @@ -111,7 +142,8 @@ /*------------------------------*/ -void hover_icon_mouse_move_cb(Ewl_Widget *w , void *ev_data , void *user_data ) { +void hover_icon_mouse_move_cb(Ewl_Widget *w , void *ev_data , void *user_data ) +{ entropy_gui_component_instance* instance = user_data; entropy_icon_viewer* viewer = instance->data; gui_file* local_file = ecore_hash_get( viewer->icon_hash, w); @@ -126,14 +158,16 @@ } -void icon_hover_properties_show_cb(Ewl_Widget *w , void *ev_data , void *user_data ) { +void icon_hover_properties_show_cb(Ewl_Widget *w , void *ev_data , void *user_data ) +{ entropy_gui_component_instance* instance = user_data; entropy_icon_viewer* viewer = instance->data; } /*-----------------------------*/ -void ewl_iconbox_file_paste_cb(Ewl_Widget *w , void *ev_data , void *user_data ) { +void ewl_iconbox_file_paste_cb(Ewl_Widget *w , void *ev_data , void *user_data ) +{ Ecore_List* selected; entropy_generic_file* file; entropy_gui_component_instance* instance = ((entropy_gui_component_instance*)user_data); @@ -155,7 +189,8 @@ } } -void ewl_iconbox_file_copy_cb(Ewl_Widget *w , void *ev_data , void *user_data ) { +void ewl_iconbox_file_copy_cb(Ewl_Widget *w , void *ev_data , void *user_data ) +{ Ecore_List* icon_list; gui_file* file; Ewl_Iconbox_Icon* list_item; @@ -178,7 +213,8 @@ } -void icon_properties_cb(Ewl_Widget *w , void *ev_data , void *user_data ) { +void icon_properties_cb(Ewl_Widget *w , void *ev_data , void *user_data ) +{ entropy_gui_component_instance* instance = (entropy_gui_component_instance*)user_data; entropy_icon_viewer* viewer = instance->data; entropy_gui_event* gui_event; @@ -198,7 +234,8 @@ } } -void icon_click_cb(Ewl_Widget *w , void *ev_data , void *user_data ) { +void icon_click_cb(Ewl_Widget *w , void *ev_data , void *user_data ) +{ Ewl_Event_Mouse_Down *ev = ev_data; entropy_gui_event* gui_event; gui_file* local_file = ecore_hash_get( ((entropy_icon_viewer*)user_data)->icon_hash, w); @@ -235,18 +272,6 @@ } -int entropy_plugin_type_get() { - return ENTROPY_PLUGIN_GUI_COMPONENT; -} - -int entropy_plugin_sub_type_get() { - return ENTROPY_PLUGIN_GUI_COMPONENT_LOCAL_VIEW; -} - -char* entropy_plugin_identify() { - return (char*)"Icon View"; -} - void gui_object_destroy_and_free(entropy_gui_component_instance* comp, Ecore_Hash* gui_hash) { Ecore_List* list; @@ -289,7 +314,8 @@ -void ewl_icon_local_viewer_delete_cb(Ewl_Widget *w , void *ev_data , void *user_data ) { +void ewl_icon_local_viewer_delete_cb(Ewl_Widget *w , void *ev_data , void *user_data ) +{ Ecore_List* file_list = user_data; const char* text = ewl_button_label_get(EWL_BUTTON(w)); entropy_generic_file* file; @@ -401,6 +427,31 @@ } + +void ewl_icon_local_viewer_menu_rename_cb(Ewl_Widget *w , void *ev_data , void *user_data ) +{ + entropy_gui_component_instance* instance = user_data; + entropy_icon_viewer* viewer = instance->data; + + Ecore_List* sel = ewl_iconbox_get_selection(EWL_ICONBOX(viewer->iconbox)); + + if (ecore_list_nodes(sel) == 1) { + Ewl_Iconbox_Icon* icon = ecore_list_remove_first(sel); + gui_file* local_file = ecore_hash_get( viewer->icon_hash, icon); + + if (icon) { + printf("Rename dialog..\n"); + entropy_core_file_cache_remove_reference(local_file->file->md5); + entropy_ewl_rename_dialog_new(entropy_file_gui_component_new_with_data(local_file->file,instance)); + } + } else { + printf("Can't rename more than 1 file\n"); + } + + ecore_list_destroy(sel); +} + + void ewl_icon_local_viewer_key_event_cb(Ewl_Iconbox* ib, void* data, char* key) { entropy_icon_viewer* viewer = ((entropy_gui_component_instance*)data)->data; @@ -502,7 +553,8 @@ /*Icon menu*/ context = ewl_menu_item_new(); ewl_menu_item_text_set(EWL_MENU_ITEM(context), "Rename"); - ewl_menu_item_image_set(EWL_MENU_ITEM(context), PACKAGE_DATA_DIR "/icons/e17_button_detail_delete.png"); + ewl_menu_item_image_set(EWL_MENU_ITEM(context), PACKAGE_DATA_DIR "/icons/e17_button_detail_rename.png"); + ewl_callback_append(context, EWL_CALLBACK_CLICKED, ewl_icon_local_viewer_menu_rename_cb, instance); ewl_widget_show(context); ewl_iconbox_icon_menu_item_add(EWL_ICONBOX(viewer->iconbox), context); @@ -517,7 +569,7 @@ /*Icon menu*/ context = ewl_menu_item_new(); ewl_menu_item_text_set(EWL_MENU_ITEM(context), "Properties"); - ewl_menu_item_image_set(EWL_MENU_ITEM(context), PACKAGE_DATA_DIR "/icons/e17_button_detail_delete.png"); + ewl_menu_item_image_set(EWL_MENU_ITEM(context), PACKAGE_DATA_DIR "/icons/e17_button_detail_properties.png"); ewl_widget_show(context); ewl_iconbox_icon_menu_item_add(EWL_ICONBOX(viewer->iconbox), context); ewl_callback_append(context, EWL_CALLBACK_CLICKED, icon_properties_cb, instance); =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/entropy/src/plugins/layout_ewl_simple.c,v retrieving revision 1.37 retrieving revision 1.38 diff -u -3 -r1.37 -r1.38 --- layout_ewl_simple.c 16 Jan 2006 09:13:59 -0000 1.37 +++ layout_ewl_simple.c 16 Jan 2006 11:17:31 -0000 1.38 @@ -817,6 +817,21 @@ ewl_callback_append(EWL_WIDGET(item), EWL_CALLBACK_CLICKED, layout_ewl_simple_structure_view_show_cb, layout); ewl_widget_show(item); + + menu = ewl_menu_new(); + ewl_menu_item_text_set(EWL_MENU_ITEM(menu), "Debug"); + ewl_container_child_append(EWL_CONTAINER(menubar), menu); + ewl_object_fill_policy_set(EWL_OBJECT(menu), EWL_FLAG_FILL_NONE); + ewl_widget_show(menu); + + item = ewl_menu_item_new(); + ewl_menu_item_text_set(EWL_MENU_ITEM(item), "File Cache"); + ewl_container_child_append(EWL_CONTAINER(menu), item); + ewl_widget_show(item); + + + + menu = ewl_spacer_new(); ------------------------------------------------------- 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