Enlightenment CVS committal

Author  : lordchaos
Project : e17
Module  : proto

Dir     : e17/proto/entropy/src/plugins


Modified Files:
        etk_list_viewer.c remote_thumbnailer.c 


Log Message:
* API Consolidation
* File delete for etk-entropy: use 'delete' key on list viewer.  Warning: No 
dialog box confirmation yet

===================================================================
RCS file: 
/cvsroot/enlightenment/e17/proto/entropy/src/plugins/etk_list_viewer.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -3 -r1.29 -r1.30
--- etk_list_viewer.c   1 Mar 2006 11:40:12 -0000       1.29
+++ etk_list_viewer.c   1 Mar 2006 23:50:03 -0000       1.30
@@ -156,6 +156,38 @@
 }
 
 
+/* Called when the user presses a key */
+static void _etk_entropy_list_viewer_key_down_cb(Etk_Object *object, void 
*event, void *data)
+{
+   Etk_Event_Key_Up_Down *key_event = event;
+
+   Etk_Tree* tree;
+   Evas_List* row_list;
+   gui_file* file;
+
+   /*entropy_gui_component_instance* instance;
+   entropy_etk_file_list_viewer* viewer;*/
+       
+   tree = ETK_TREE(object);
+   row_list = etk_tree_selected_rows_get(tree);
+
+
+   if (!strcmp(key_event->key, "Delete")) {
+          printf("Delete pressed!\n");
+
+         for (; row_list; row_list = row_list->next ) {
+               file = ((gui_file*)ecore_hash_get(row_hash, row_list->data));
+
+               if (file) {
+                       printf("Deleting '%s'...\n", file->file->filename);
+                       entropy_plugin_filesystem_file_remove(file->file);
+               }
+
+         }
+
+   }
+
+}
 
 
 static void _entropy_etk_list_viewer_drag_begin_cb(Etk_Object *object, void 
*data)
@@ -163,12 +195,10 @@
    Etk_Tree *tree;
    const char **types;
    unsigned int num_types;
-   void *drag_data;
    Etk_Drag *drag;
    Etk_Widget *image;
    entropy_gui_component_instance* instance;
    entropy_etk_file_list_viewer* viewer;
-   int i=0;
    char buffer[8192]; /* Um - help - what do we size this to? */
    int count = 0;
    Evas_List* rows;
@@ -264,6 +294,19 @@
 
 
 void
+gui_file_remove_destroy_single(entropy_gui_component_instance * comp,
+               gui_file* file)
+{
+       entropy_etk_file_list_viewer *view = comp->data;
+       
+       ecore_hash_remove(view->gui_hash, file->file);
+       ecore_hash_remove(row_hash, file->icon);
+
+       entropy_free(file);
+       
+}
+
+void
 gui_object_destroy_and_free (entropy_gui_component_instance * comp,
                             Ecore_Hash * gui_hash)
 {
@@ -336,6 +379,21 @@
 }
 
 
+void
+list_viewer_remove_row(entropy_gui_component_instance* instance,
+               entropy_generic_file* file)
+{
+       entropy_etk_file_list_viewer* viewer = instance->data;
+       gui_file* event_file = NULL;
+
+       event_file = ecore_hash_get(viewer->gui_hash,file);
+
+       etk_tree_row_del(event_file->icon);
+
+       /*Destroy the gui_file object..*/
+       gui_file_remove_destroy_single(instance,event_file);
+       
+}
 
 void
 list_viewer_add_row (entropy_gui_component_instance * instance,
@@ -535,6 +593,12 @@
      }
      break;
 
+     case ENTROPY_NOTIFY_FILE_REMOVE_DIRECTORY:
+     case ENTROPY_NOTIFY_FILE_REMOVE:{
+           list_viewer_remove_row(comp, (entropy_generic_file *) el);
+     }
+     break;
+
      case ENTROPY_NOTIFY_THUMBNAIL_REQUEST:{
 
           /*Only bother if we have a thumbnail, and a component */
@@ -689,6 +753,9 @@
   etk_signal_connect("row_clicked", ETK_OBJECT( viewer->tree  ), 
                  ETK_CALLBACK(_etk_list_viewer_row_clicked), NULL);
 
+  etk_signal_connect("key_down", ETK_OBJECT(viewer->tree), 
+                 ETK_CALLBACK(_etk_entropy_list_viewer_key_down_cb), NULL);
+  
   printf("Initialising ETK list viewer...%p\n", instance);
 
   return instance;
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/proto/entropy/src/plugins/remote_thumbnailer.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- remote_thumbnailer.c        22 Feb 2006 14:25:54 -0000      1.8
+++ remote_thumbnailer.c        1 Mar 2006 23:50:03 -0000       1.9
@@ -137,7 +137,6 @@
        entropy_thumbnail *thumb;
        entropy_gui_event *gui_event;
        char *md5 = NULL;
-       entropy_plugin *plugin;
 
        entropy_gui_component_instance *instance = NULL;
 
@@ -178,11 +177,7 @@
            entropy_core_file_cache_remove_reference (listener->file->md5);
 
            /*Remove the d/led image */
-           plugin =
-             entropy_plugins_type_get_first (ENTROPY_PLUGIN_BACKEND_FILE,
-                                             ENTROPY_PLUGIN_SUB_TYPE_ALL);
-
-           entropy_plugin_filesystem_file_remove (plugin, tmp_file);
+           entropy_plugin_filesystem_file_remove (tmp_file);
          }
          else {
            printf ("Remote thumbnailer: Couldn't make thumbnail\n");




-------------------------------------------------------
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

Reply via email to