Enlightenment CVS committal
Author : chaos
Project : e17
Module : proto
Dir : e17/proto/entropy/src/dialogs
Modified Files:
etk_file_context_menu.c
Log Message:
* Squash warnings (my rule: one warning, per day - shouldn't take long)
* 'Cut' support! Finally!
* File create notify for icon view
===================================================================
RCS file: /cvs/e/e17/proto/entropy/src/dialogs/etk_file_context_menu.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -3 -r1.17 -r1.18
--- etk_file_context_menu.c 28 Aug 2006 10:47:12 -0000 1.17
+++ etk_file_context_menu.c 6 Sep 2006 11:09:22 -0000 1.18
@@ -164,8 +164,11 @@
static void
_entropy_etk_context_menu_group_file_paste_cb(Etk_Object *object, void *data)
{
+ Entropy_Selection_Type stype;
Ecore_List* files = entropy_core_selected_files_get();
+ stype = entropy_core_selection_type_get();
+
if (_entropy_etk_context_menu_current_file) {
if (!strcmp(_entropy_etk_context_menu_current_file->mime_type,
"file/folder"))
_entropy_etk_context_menu_current_folder =
_entropy_etk_context_menu_current_file;
@@ -175,21 +178,50 @@
if (_entropy_etk_context_menu_current_folder) {
char* f_uri =
_entropy_etk_context_menu_current_folder->uri;
- if (f_uri)
-
entropy_plugin_filesystem_file_copy_multi(files, f_uri,
-
_entropy_etk_context_menu_current_instance);
+ if (f_uri) {
+ if (stype == ENTROPY_SELECTION_COPY) {
+
entropy_plugin_filesystem_file_copy_multi(files, f_uri,
+
_entropy_etk_context_menu_current_instance);
+ } else if (stype == ENTROPY_SELECTION_CUT) {
+
entropy_plugin_filesystem_file_move_multi(files, f_uri,
+
_entropy_etk_context_menu_current_instance);
+ } else {
+ printf("Unsupported copy type at
context menu paste\n");
+ }
+ }
} else {
printf("Current folder is NULL at context menu\n");
}
}
- }
+}
static void
_entropy_etk_context_menu_group_file_copy_cb(Etk_Object *object, void *data)
{
entropy_core_selected_files_clear();
+ entropy_core_selection_type_set(ENTROPY_SELECTION_COPY);
+ if (_entropy_etk_context_menu_mode == 0) {
+
entropy_core_selected_file_add(_entropy_etk_context_menu_current_file);
+ } else {
+ entropy_generic_file* file;
+
+ ecore_list_goto_first(_entropy_etk_context_menu_selected_files);
+ while ( (file =
ecore_list_next(_entropy_etk_context_menu_selected_files))) {
+ entropy_core_selected_file_add(file);
+ }
+
+ }
+}
+
+/*No code reuse here - we may want to use special behaviour*/
+static void
+_entropy_etk_context_menu_group_file_cut_cb(Etk_Object *object, void *data)
+{
+ entropy_core_selected_files_clear();
+
+ entropy_core_selection_type_set(ENTROPY_SELECTION_CUT);
if (_entropy_etk_context_menu_mode == 0) {
entropy_core_selected_file_add(_entropy_etk_context_menu_current_file);
} else {
@@ -442,8 +474,12 @@
etk_signal_connect("activated", ETK_OBJECT(menu_item),
ETK_CALLBACK(_entropy_etk_context_menu_group_file_copy_cb),NULL);
+ menu_item =
_entropy_etk_menu_item_new(ETK_MENU_ITEM_NORMAL, _("Cut
(Ctrl-x)"),
ETK_STOCK_EDIT_CUT, ETK_MENU_SHELL(menu),NULL);
+ etk_signal_connect("activated", ETK_OBJECT(menu_item),
+ ETK_CALLBACK(_entropy_etk_context_menu_group_file_cut_cb),NULL);
+
menu_item =
_entropy_etk_menu_item_new(ETK_MENU_ITEM_NORMAL, _("Paste
(Ctrl-v)"),
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs