Enlightenment CVS committal

Author  : lordchaos
Project : e17
Module  : proto

Dir     : e17/proto/entropy/src/plugins


Modified Files:
        ewl_icon_local_viewer.c ewl_properties_dialog.c mime.c 
        thumbnail_system.c 


Log Message:
* More work on mime-action assign

===================================================================
RCS file: 
/cvsroot/enlightenment/e17/proto/entropy/src/plugins/ewl_icon_local_viewer.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -3 -r1.32 -r1.33
--- ewl_icon_local_viewer.c     28 Nov 2005 08:34:41 -0000      1.32
+++ ewl_icon_local_viewer.c     29 Nov 2005 08:27:16 -0000      1.33
@@ -124,17 +124,19 @@
         Ewl_Filedialog_Event *e;
        entropy_gui_component_instance* instance = user_data;
        entropy_icon_viewer* viewer = instance->data;
+       char* file = ewl_filedialog_file_get (EWL_FILEDIALOG (w));
 
         e = EWL_FILEDIALOG_EVENT(ev);
         if (e->response == EWL_STOCK_OPEN) {
                printf("Curent directory is '%s'\n", viewer->current_dir);
-               entropy_config_str_set("iconbox_viewer", viewer->current_dir, 
ewl_filedialog_file_get (EWL_FILEDIALOG (w)));
+               entropy_config_str_set("iconbox_viewer", viewer->current_dir, 
file);
                ewl_widget_destroy(viewer->file_dialog_parent);
 
        } else if (e->response == EWL_STOCK_CANCEL) {
                ewl_widget_destroy(viewer->file_dialog_parent);
        }
 
+
 }
 
 
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/proto/entropy/src/plugins/ewl_properties_dialog.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- ewl_properties_dialog.c     29 Nov 2005 01:13:08 -0000      1.3
+++ ewl_properties_dialog.c     29 Nov 2005 08:27:16 -0000      1.4
@@ -5,14 +5,35 @@
 #include <dlfcn.h>
 #include <time.h>
 
+entropy_generic_file* local_file;
+
+
 void
  __destroy_properties_dialog(Ewl_Widget *dialog, void *ev_data, void 
*user_data)
  {
+       /*Remove a reference to this file*/
+       if (local_file) 
+               entropy_core_file_cache_remove_reference(local_file->md5);
+        
         ewl_widget_destroy(EWL_WIDGET(user_data));
 }
 
 
 void open_with_cb(Ewl_Widget *w , void *ev_data , void *user_data )  {
+       entropy_mime_action* action;
+       Ewl_Filedialog_Event* e = EWL_FILEDIALOG_EVENT(ev_data);        
+       char* file = ewl_filedialog_file_get (EWL_FILEDIALOG (w));
+       
+       if (e->response == EWL_STOCK_OPEN) {
+               action = entropy_core_mime_hint_get(local_file->mime_type);
+               if (action) {
+                       action->executable = strdup(file);
+               } else {
+                       entropy_core_mime_action_add(local_file->mime_type, 
file );
+               }
+       }
+
+       ewl_widget_destroy(EWL_WIDGET(user_data));
 }
 
 
@@ -21,7 +42,7 @@
        Ewl_Widget* window = ewl_window_new();
 
        ewl_filedialog_type_set(EWL_FILEDIALOG(file_dialog), 
EWL_FILEDIALOG_TYPE_OPEN);
-        ewl_callback_append (file_dialog, EWL_CALLBACK_VALUE_CHANGED, 
open_with_cb, NULL);
+        ewl_callback_append (file_dialog, EWL_CALLBACK_VALUE_CHANGED, 
open_with_cb, window);
        ewl_container_child_append(EWL_CONTAINER(window), file_dialog);
        ewl_widget_show(file_dialog);
        ewl_widget_show(window);
@@ -38,6 +59,13 @@
        char itext[100];
        time_t stime;
 
+       /*Save a local copy of this stat for affiliated functions*/
+       local_file = file_stat->file;
+
+       /*Add a reference to this file while the dialog is open*/
+       if (local_file) 
+               entropy_core_file_cache_add_reference(local_file->md5);
+
        
        window = ewl_window_new();
        ewl_window_title_set(EWL_WINDOW(window), "File Properties");
@@ -129,12 +157,14 @@
        ewl_container_child_append(EWL_CONTAINER(hbox), text);
        ewl_widget_show(text);
 
-       button = ewl_button_new();
-       ewl_callback_append(button, EWL_CALLBACK_CLICKED, 
ewl_properties_dialog_openwith_cb, NULL);
-       ewl_button_label_set(EWL_BUTTON(button), "Open with..");
-       ewl_object_custom_size_set(EWL_OBJECT(button), 70, 10);
-       ewl_container_child_append(EWL_CONTAINER(hbox), button);
-       ewl_widget_show(button);
+       if (strlen(file_stat->file->mime_type)) {
+               button = ewl_button_new();
+               ewl_callback_append(button, EWL_CALLBACK_CLICKED, 
ewl_properties_dialog_openwith_cb, NULL);
+               ewl_button_label_set(EWL_BUTTON(button), "Open with..");
+               ewl_object_custom_size_set(EWL_OBJECT(button), 70, 10);
+               ewl_container_child_append(EWL_CONTAINER(hbox), button);
+               ewl_widget_show(button);
+       }
        /*--------------------------------*/
 
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/entropy/src/plugins/mime.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- mime.c      16 Nov 2005 11:48:34 -0000      1.6
+++ mime.c      29 Nov 2005 08:27:16 -0000      1.7
@@ -40,6 +40,7 @@
        ecore_hash_set(mime_hash, ".bz2", "application/x-bzip2");
        ecore_hash_set(mime_hash, ".tar", "application/x-tar");
        ecore_hash_set(mime_hash, ".txt", "text/plain");
+       ecore_hash_set(mime_hash, ".mov", "video/quicktime");
 
        
 }
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/proto/entropy/src/plugins/thumbnail_system.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- thumbnail_system.c  5 Nov 2005 11:43:04 -0000       1.5
+++ thumbnail_system.c  29 Nov 2005 08:27:16 -0000      1.6
@@ -32,6 +32,7 @@
                ecore_list_append(types, "application/x-tar");
                ecore_list_append(types, "text/plain");
                ecore_list_append(types, "video/x-msvideo");
+               ecore_list_append(types, "video/quicktime");
                
        }
 
@@ -81,12 +82,15 @@
                strcpy(thumb->thumbnail_filename, PACKAGE_DATA_DIR 
"/icons/txt.png");
        } else if (!strcmp(file->mime_type, "video/x-msvideo")) {
                strcpy(thumb->thumbnail_filename, PACKAGE_DATA_DIR 
"/icons/video.png");
+       } else if (!strcmp(file->mime_type, "video/quicktime")) {
+               strcpy(thumb->thumbnail_filename, PACKAGE_DATA_DIR 
"/icons/video.png");
        }
 
 
 
 
 
+
        thumb->parent = file;
        file->thumbnail = thumb;
        




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

Reply via email to