Enlightenment CVS committal Author : chaos Project : e17 Module : proto
Dir : e17/proto/entropy/src/plugins Modified Files: Makefile.am etk_list_viewer.c filesystem.c layout_etk_simple.c Log Message: * Migrate progress event handler to layout parent - one less thing for children to worry about =================================================================== RCS file: /cvs/e/e17/proto/entropy/src/plugins/Makefile.am,v retrieving revision 1.30 retrieving revision 1.31 diff -u -3 -r1.30 -r1.31 --- Makefile.am 4 Apr 2006 00:06:07 -0000 1.30 +++ Makefile.am 5 Apr 2006 06:09:11 -0000 1.31 @@ -96,6 +96,7 @@ if HAVE_ETK layout_etk_simple_la_SOURCES = layout_etk_simple.c $(top_srcdir)/src/entropy_debug.c \ + $(top_srcdir)/src/dialogs/etk_progress_dialog.c \ $(top_srcdir)/src/dialogs/etk_location_add_dialog.c \ $(top_srcdir)/src/dialogs/etk_mime_dialog_main.c \ $(top_srcdir)/src/dialogs/etk_file_cache_debug_dialog.c @@ -104,14 +105,12 @@ layout_etk_simple_la_LIBADD = @ETK_LIBS@ etk_structure_viewer_la_SOURCES = $(top_srcdir)/src/entropy_gui.c \ - $(top_srcdir)/src/dialogs/etk_progress_dialog.c \ etk_structure_viewer.c $(top_srcdir)/src/entropy_debug.c etk_structure_viewer_la_CFLAGS = @ETK_CFLAGS@ etk_structure_viewer_la_LDFLAGS = -module -avoid-version etk_structure_viewer_la_LIBADD = @ETK_LIBS@ etk_list_la_SOURCES = etk_list_viewer.c \ - $(top_srcdir)/src/dialogs/etk_progress_dialog.c \ $(top_srcdir)/src/entropy_gui.c \ $(top_srcdir)/src/entropy_debug.c \ $(top_srcdir)/src/dialogs/etk_interaction_dialog.c \ =================================================================== RCS file: /cvs/e/e17/proto/entropy/src/plugins/etk_list_viewer.c,v retrieving revision 1.56 retrieving revision 1.57 diff -u -3 -r1.56 -r1.57 --- etk_list_viewer.c 4 Apr 2006 03:48:35 -0000 1.56 +++ etk_list_viewer.c 5 Apr 2006 06:09:11 -0000 1.57 @@ -5,7 +5,6 @@ #include <limits.h> #include <time.h> #include <Etk.h> -#include "etk_progress_dialog.h" #include "etk_user_interaction_dialog.h" #include "etk_directory_add_dialog.h" #include "etk_properties_dialog.h" @@ -30,8 +29,6 @@ Ecore_List *gui_events; Ecore_List *files; /*The entropy_generic_file references we copy. */ - entropy_file_progress_window* progress; - Etk_Widget* popup; Etk_Widget* open_with_menu; Etk_Widget* open_with_menuitem; @@ -787,24 +784,6 @@ } break; - case ENTROPY_NOTIFY_FILE_PROGRESS:{ - entropy_etk_file_list_viewer *view = comp->data; - entropy_file_progress *progress = el; - - if (!view->progress) - view->progress = entropy_etk_progress_window_create(); - - entropy_etk_progress_dialog_show(view->progress); - entropy_etk_progress_dialog_set_file_from_to(view->progress, progress->file_from, progress->file_to); - entropy_etk_progress_dialog_set_progress_pct(view->progress, &progress->progress); - - if (progress->type == TYPE_END) - entropy_etk_progress_dialog_hide(view->progress); - - - } - break; - case ENTROPY_NOTIFY_FILE_REMOVE_DIRECTORY: case ENTROPY_NOTIFY_FILE_REMOVE:{ list_viewer_remove_row(comp, (entropy_generic_file *) el); @@ -951,11 +930,6 @@ entropy_core_component_event_register (instance, entropy_core_gui_event_get (ENTROPY_GUI_EVENT_FILE_STAT_AVAILABLE)); - - /*We want to know about file transfer progress events */ - entropy_core_component_event_register (instance, - entropy_core_gui_event_get - (ENTROPY_GUI_EVENT_FILE_PROGRESS)); /*We want to know if the backend needs feedback */ entropy_core_component_event_register (instance, =================================================================== RCS file: /cvs/e/e17/proto/entropy/src/plugins/filesystem.c,v retrieving revision 1.62 retrieving revision 1.63 diff -u -3 -r1.62 -r1.63 --- filesystem.c 5 Apr 2006 02:59:22 -0000 1.62 +++ filesystem.c 5 Apr 2006 06:09:11 -0000 1.63 @@ -355,6 +355,8 @@ entropy_malloc (sizeof (entropy_file_progress)); char *uri = NULL; + request->identifier = data->resp_command.client_identifier; + ecore_list_goto_first(data->file_list.list); if (ecore_list_current(data->file_list.list)) { request->file_from = evfs_filereference_to_entropy_generic_file(ecore_list_current(data->file_list.list)); =================================================================== RCS file: /cvs/e/e17/proto/entropy/src/plugins/layout_etk_simple.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -3 -r1.35 -r1.36 --- layout_etk_simple.c 5 Apr 2006 04:38:29 -0000 1.35 +++ layout_etk_simple.c 5 Apr 2006 06:09:11 -0000 1.36 @@ -2,6 +2,7 @@ #include "entropy.h" #include "entropy_gui.h" #include "etk_location_add_dialog.h" +#include "etk_progress_dialog.h" #include "etk_mime_dialog.h" #include "etk_file_cache_dialog.h" #include <dlfcn.h> @@ -36,8 +37,7 @@ Etk_Tree_Row* delete_row; /*The row pending deletion, if any*/ Etk_Widget* popup; - - Ecore_Hash* config_hash; + Ecore_Hash* progress_hash; /*Track progress events->dialogs*/ }; typedef enum _Etk_Menu_Item_Type @@ -177,7 +177,7 @@ plugin->gui_functions.layout_create = &entropy_plugin_layout_create; plugin->gui_functions.toolkit_get= &entropy_plugin_toolkit_get; - return plugin; + return base; } char * @@ -325,6 +325,37 @@ gui_event_callback (entropy_notify_event * eevent, void *requestor, void *el, entropy_gui_component_instance * comp) { + entropy_layout_gui* view = (entropy_layout_gui*)comp->data; + + switch (eevent->event_type) { + case ENTROPY_NOTIFY_FILE_PROGRESS:{ + entropy_file_progress_window* window; + entropy_file_progress *progress = el; + + + if (! (window = ecore_hash_get(view->progress_hash, (long*)progress->identifier))) { + window = entropy_etk_progress_window_create(); + entropy_etk_progress_dialog_show(window); + entropy_etk_progress_dialog_set_file_from_to(window, progress->file_from, progress->file_to); + entropy_etk_progress_dialog_set_progress_pct(window, &progress->progress); + + ecore_hash_set(view->progress_hash, (long*)progress->identifier, window); + } else { + entropy_etk_progress_dialog_set_file_from_to(window, progress->file_from, progress->file_to); + entropy_etk_progress_dialog_set_progress_pct(window, &progress->progress); + } + + if (progress->type == TYPE_END) { + window = ecore_hash_get(view->progress_hash, (long*)progress->identifier); + if (window) { + ecore_hash_remove(view->progress_hash, (long*)progress->identifier); + entropy_etk_progress_dialog_destroy(window); + } + } + + } + break; + } } entropy_gui_component_instance * @@ -373,6 +404,7 @@ gui = entropy_malloc (sizeof (entropy_layout_gui)); layout->data = gui; layout->core = core; + gui->progress_hash = ecore_hash_new(ecore_direct_hash, ecore_direct_compare); /*Register this layout container with the core, so our children can get events */ entropy_core_layout_register (core, layout); ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs