Author: colossus
Date: 2008-08-06 13:05:59 +0000 (Wed, 06 Aug 2008)
New Revision: 27426

Added:
   xarchiver/trunk/src/dlg-open-with.c
   xarchiver/trunk/src/dlg-open-with.h
Modified:
   xarchiver/trunk/TODO
   xarchiver/trunk/src/Makefile.am
   xarchiver/trunk/src/archive.c
   xarchiver/trunk/src/archive.h
   xarchiver/trunk/src/interface.c
   xarchiver/trunk/src/interface.h
   xarchiver/trunk/src/pref_dialog.h
   xarchiver/trunk/src/string_utils.c
   xarchiver/trunk/src/string_utils.h
   xarchiver/trunk/src/window.c
   xarchiver/trunk/src/window.h
Log:
Added skeleton files for the "Open With..." dialog.
Made the cut/copy/paste options of the popupmenu to work.
Changed open to view in the popupmenu.
Updated TODO file.


Modified: xarchiver/trunk/TODO
===================================================================
--- xarchiver/trunk/TODO        2008-08-05 12:28:29 UTC (rev 27425)
+++ xarchiver/trunk/TODO        2008-08-06 13:05:59 UTC (rev 27426)
@@ -1,4 +1,7 @@
 - reduce the loading time when opening large archives.
+- finish developing the callbacks for the popup menu.
+- develop the dlg-open dialog.
+- develop the extract multi archive.
 - fix crash when opening rar archives produces under winzozz.
 - recurse with opendir for arj when using the switches from cmd-line
 - fix the remaining bugs in bugzilla.xfce.org

Modified: xarchiver/trunk/src/Makefile.am
===================================================================
--- xarchiver/trunk/src/Makefile.am     2008-08-05 12:28:29 UTC (rev 27425)
+++ xarchiver/trunk/src/Makefile.am     2008-08-06 13:05:59 UTC (rev 27426)
@@ -33,6 +33,7 @@
        extract_dialog.c extract_dialog.h \
        add_dialog.c add_dialog.h \
        new_dialog.c new_dialog.h \
+       dlg-open-with.c dlg-open-with.h \
        pref_dialog.c pref_dialog.h \
        glib-mem.h
 

Modified: xarchiver/trunk/src/archive.c
===================================================================
--- xarchiver/trunk/src/archive.c       2008-08-05 12:28:29 UTC (rev 27425)
+++ xarchiver/trunk/src/archive.c       2008-08-06 13:05:59 UTC (rev 27426)
@@ -32,7 +32,7 @@
 
 extern delete_func     delete  [XARCHIVETYPE_COUNT];
 extern add_func                add     [XARCHIVETYPE_COUNT];
-extern extract_func    extract [XARCHIVETYPE_COUNT];
+extern extract_func extract    [XARCHIVETYPE_COUNT];
 extern test_func       test    [XARCHIVETYPE_COUNT];
 extern Prefs_dialog_data *prefs_window;
 extern gboolean batch_mode;
@@ -273,6 +273,8 @@
                        archive->comment = NULL;
                }
        }
+       if (archive->clipboard_data)
+               xa_clipboard_clear(NULL,archive);
        g_free (archive);
 }
 

Modified: xarchiver/trunk/src/archive.h
===================================================================
--- xarchiver/trunk/src/archive.h       2008-08-05 12:28:29 UTC (rev 27425)
+++ xarchiver/trunk/src/archive.h       2008-08-06 13:05:59 UTC (rev 27426)
@@ -67,6 +67,7 @@
 };
 
 typedef struct _XArchive XArchive;
+typedef struct _XAClipboard XAClipboard;
 
 typedef void (*parse_output_func)      (gchar *line, gpointer);
 typedef void (*delete_func)                    (XArchive *,GSList *);
@@ -80,6 +81,7 @@
        XArchiveStatus status;
        XEntry *root_entry;
        XEntry *current_entry;
+       XAClipboard *clipboard_data;
        GSList *back;
        GSList *forward;
        gchar *path;
@@ -101,6 +103,7 @@
        gboolean can_add;
        gboolean can_extract;
        gboolean has_properties;
+       gboolean cut_copy_string;
        GString *comment;
        GSList *error_output;
        GType *column_types;
@@ -126,6 +129,23 @@
        extract_func extract;
        test_func test;
 };
+
+#define XA_CLIPBOARD (gdk_atom_intern_static_string 
("XARCHIVER_OWN_CLIPBOARD")) 
+#define XA_INFO_LIST (gdk_atom_intern_static_string 
("application/xarchiver-info-list"))
+
+typedef enum
+{
+       XA_CLIPBOARD_CUT,
+       XA_CLIPBOARD_COPY
+} XAClipboardMode;
+
+struct _XAClipboard
+{
+       gchar *filename;
+       XAClipboardMode mode;
+       GSList *files;
+};
+
 void xa_spawn_async_process (XArchive *, gchar *);
 gchar *xa_split_command_line(XArchive *archive,GSList *list);
 XArchive *xa_init_archive_structure(gint);

Added: xarchiver/trunk/src/dlg-open-with.c
===================================================================
--- xarchiver/trunk/src/dlg-open-with.c                         (rev 0)
+++ xarchiver/trunk/src/dlg-open-with.c 2008-08-06 13:05:59 UTC (rev 27426)
@@ -0,0 +1,19 @@
+/*
+ *  Copyright (C) 2008 Giuseppe Torelli - <[EMAIL PROTECTED]>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
+ */
+
+#include "dlg-open-with.h"

Added: xarchiver/trunk/src/dlg-open-with.h
===================================================================
--- xarchiver/trunk/src/dlg-open-with.h                         (rev 0)
+++ xarchiver/trunk/src/dlg-open-with.h 2008-08-06 13:05:59 UTC (rev 27426)
@@ -0,0 +1,22 @@
+/*
+ *  Copyright (C) 2008 Giuseppe Torelli - <[EMAIL PROTECTED]>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __DLG_OPEN_H
+#define __DLG_OPEN_H
+#include <gtk/gtk.h>
+#endif

Modified: xarchiver/trunk/src/interface.c
===================================================================
--- xarchiver/trunk/src/interface.c     2008-08-05 12:28:29 UTC (rev 27425)
+++ xarchiver/trunk/src/interface.c     2008-08-06 13:05:59 UTC (rev 27426)
@@ -181,6 +181,12 @@
        gtk_widget_show (image2);
        gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM 
(extract_menu),image2);
 
+       delete_menu = gtk_image_menu_item_new_from_stock 
("gtk-delete",accel_group);
+       gtk_widget_set_sensitive (delete_menu,FALSE);
+       gtk_widget_show (delete_menu);
+       gtk_container_add (GTK_CONTAINER (menuitem2_menu),delete_menu);
+       gtk_widget_add_accelerator 
(delete_menu,"activate",accel_group,GDK_Delete,GDK_MODE_DISABLED,GTK_ACCEL_VISIBLE);
+
        rename_menu = gtk_image_menu_item_new_with_mnemonic (_("Rename"));
        gtk_widget_set_sensitive (rename_menu,FALSE);
        gtk_widget_show (rename_menu);
@@ -190,12 +196,6 @@
        gtk_widget_show (tmp_image);
        gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM 
(rename_menu),tmp_image);
 
-       delete_menu = gtk_image_menu_item_new_from_stock 
("gtk-delete",accel_group);
-       gtk_widget_set_sensitive (delete_menu,FALSE);
-       gtk_widget_show (delete_menu);
-       gtk_container_add (GTK_CONTAINER (menuitem2_menu),delete_menu);
-       gtk_widget_add_accelerator 
(delete_menu,"activate",accel_group,GDK_Delete,GDK_MODE_DISABLED,GTK_ACCEL_VISIBLE);
-
        separatormenuitem3 = gtk_separator_menu_item_new ();
        gtk_widget_show (separatormenuitem3);
        gtk_container_add (GTK_CONTAINER (menuitem2_menu),separatormenuitem3);
@@ -830,24 +830,22 @@
        GtkWidget *image6;
        GtkWidget *copy;
        GtkWidget *image7;
-       GtkWidget *paste;
        GtkWidget *image8;
        GtkWidget *separator;
-       GtkWidget *open;
+       GtkWidget *view;
        GtkWidget *extract;
        GtkWidget *image9;
        GtkWidget *image10;
        GtkWidget *image11;
 
        xa_popup_menu = gtk_menu_new();
+       view = gtk_image_menu_item_new_with_mnemonic (_("View"));
+       gtk_widget_show (view);
+       gtk_container_add (GTK_CONTAINER (xa_popup_menu),view);
 
-       open = gtk_image_menu_item_new_with_mnemonic (_("Open"));
-       gtk_widget_show (open);
-       gtk_container_add (GTK_CONTAINER (xa_popup_menu),open);
-
-       image9 = gtk_image_new_from_stock ("gtk-open",GTK_ICON_SIZE_MENU);
+       image9 = gtk_image_new_from_stock ("gtk-find",GTK_ICON_SIZE_MENU);
        gtk_widget_show (image9);
-       gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (open),image9);
+       gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (view),image9);
 
        extract = gtk_image_menu_item_new_with_mnemonic (_("Extract"));
        gtk_widget_show (extract);
@@ -879,6 +877,7 @@
        gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (copy),image7);
 
        paste = gtk_image_menu_item_new_with_mnemonic (_("Paste"));
+       gtk_widget_set_sensitive(paste,FALSE);
        gtk_widget_show (paste);
        gtk_container_add (GTK_CONTAINER (xa_popup_menu),paste);
 
@@ -908,10 +907,10 @@
        gtk_widget_show (image11);
        gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (rrename),image11);
 
-       /*g_signal_connect ((gpointer) cut,"activate",G_CALLBACK 
(on_xa_cut_activate),NULL);
-       g_signal_connect ((gpointer) copy,"activate",G_CALLBACK 
(on_xa_copy_activate),NULL);
-       g_signal_connect ((gpointer) paste,"activate",G_CALLBACK 
(on_xa_paste_activate),NULL);*/
-       g_signal_connect ((gpointer) open,       
"activate",G_CALLBACK(xa_open_from_popupmenu),NULL);
+       g_signal_connect ((gpointer) cut,       "activate",     
G_CALLBACK(xa_clipboard_cut),NULL);
+       g_signal_connect ((gpointer) copy,      "activate",     
G_CALLBACK(xa_clipboard_copy),NULL);
+       g_signal_connect ((gpointer) paste,     "activate",     
G_CALLBACK(xa_clipboard_paste),NULL);
+       g_signal_connect ((gpointer) view,      "activate",     
G_CALLBACK(xa_view_file),NULL);
        g_signal_connect ((gpointer) 
extract,"activate",G_CALLBACK(xa_extract_archive),NULL);
        g_signal_connect ((gpointer) 
ddelete,"activate",G_CALLBACK(xa_delete_archive),NULL);
        /*g_signal_connect ((gpointer) rrename,"activate",G_CALLBACK 
(on_xa_rename_activate),NULL);*/

Modified: xarchiver/trunk/src/interface.h
===================================================================
--- xarchiver/trunk/src/interface.h     2008-08-05 12:28:29 UTC (rev 27425)
+++ xarchiver/trunk/src/interface.h     2008-08-06 13:05:59 UTC (rev 27426)
@@ -39,7 +39,7 @@
 *prefs_menu,*password_entry_menu, *image1, *image2, *menuitem4, 
*select_all,*deselect_all,*select_pattern, *exe_menu, *menuitem4_menu,
 *about1, *help1, *toolbar1, *toolbar2, *hbox1, *tmp_image, *pad_image, 
*New_button, *Open_button, *back_button, *home_button, *forward_button,
 
*up_button,*separatortoolitem1,*separatortoolitem2,*separatortoolitem3,*AddFile_button,*Extract_button,*Stop_button,*toolitem1,*location_label,
-*location_entry,*hpaned1,*archive_dir_treeview,*scrolledwindow2,*ddelete,*rename_menu,*rrename;
+*location_entry,*hpaned1,*archive_dir_treeview,*scrolledwindow2,*ddelete,*rename_menu,*rrename,*paste;
 
 gchar *xa_create_password_dialog(XArchive *);
 void set_label (GtkWidget *label,gchar *);

Modified: xarchiver/trunk/src/pref_dialog.h
===================================================================
--- xarchiver/trunk/src/pref_dialog.h   2008-08-05 12:28:29 UTC (rev 27425)
+++ xarchiver/trunk/src/pref_dialog.h   2008-08-06 13:05:59 UTC (rev 27426)
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2007 Giuseppe Torelli - <[EMAIL PROTECTED]>
+ *  Copyright (C) 2008 Giuseppe Torelli - <[EMAIL PROTECTED]>
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by

Modified: xarchiver/trunk/src/string_utils.c
===================================================================
--- xarchiver/trunk/src/string_utils.c  2008-08-05 12:28:29 UTC (rev 27425)
+++ xarchiver/trunk/src/string_utils.c  2008-08-06 13:05:59 UTC (rev 27426)
@@ -295,3 +295,16 @@
                slist = slist->next;
        }
 }
+
+GSList *xa_slist_copy(GSList *list)
+{
+       GSList *x,*y = NULL;
+       x = list;
+
+       while (x)
+       {
+               y = g_slist_prepend(y,g_strdup(x->data));
+               x = x->next;
+       }
+       return g_slist_reverse(y);
+}

Modified: xarchiver/trunk/src/string_utils.h
===================================================================
--- xarchiver/trunk/src/string_utils.h  2008-08-05 12:28:29 UTC (rev 27425)
+++ xarchiver/trunk/src/string_utils.h  2008-08-06 13:05:59 UTC (rev 27426)
@@ -40,5 +40,6 @@
 gchar *xa_remove_path_from_archive_name(gchar *name);
 void xa_cat_filenames (XArchive *,GSList *,GString *);
 gchar *xa_escape_filename (gchar *filename,gchar *meta_chars);
+GSList *xa_slist_copy(GSList *);
 #endif
 

Modified: xarchiver/trunk/src/window.c
===================================================================
--- xarchiver/trunk/src/window.c        2008-08-05 12:28:29 UTC (rev 27425)
+++ xarchiver/trunk/src/window.c        2008-08-06 13:05:59 UTC (rev 27426)
@@ -1561,7 +1561,10 @@
 
        path = gtk_tree_path_new_first();
        if (! GTK_IS_TREE_MODEL(archive->model) || gtk_tree_model_get_iter 
(archive->model, &iter, path) == FALSE)
+       {
+               gtk_tree_path_free(path);
                return;
+       }
 
        switch (archive->type)
        {
@@ -2127,8 +2130,7 @@
        current_page = gtk_notebook_get_current_page(notebook);
        idx = xa_find_archive_index (current_page);
 
-       comment_dialog = gtk_dialog_new_with_buttons (_("Comment"),
-                                             
GTK_WINDOW(xa_main_window),GTK_DIALOG_MODAL,NULL);
+       comment_dialog = gtk_dialog_new_with_buttons 
(_("Comment"),GTK_WINDOW(xa_main_window),GTK_DIALOG_MODAL,NULL);
        gtk_window_set_position (GTK_WINDOW 
(comment_dialog),GTK_WIN_POS_CENTER);
        gtk_window_set_type_hint (GTK_WINDOW 
(comment_dialog),GDK_WINDOW_TYPE_HINT_DIALOG);
        gtk_dialog_set_has_separator (GTK_DIALOG (comment_dialog),FALSE);
@@ -2318,8 +2320,7 @@
 {
        XEntry *prev_entry = NULL;
        XEntry *new_entry  = NULL;
-       gint current_page;
-       gint idx;
+       gint current_page,idx;
 
        current_page = gtk_notebook_get_current_page (notebook);
        idx = xa_find_archive_index (current_page);
@@ -2379,8 +2380,179 @@
        return FALSE;
 }
 
-void xa_open_from_popupmenu(GtkMenuItem* item,gpointer data)
+XAClipboard *xa_clipboard_data_new()
 {
+       XAClipboard *data = NULL;
+
+       data = g_new0(XAClipboard,1);
+       
+       return data;
+}
+
+void xa_clipboard_cut(GtkMenuItem* item,gpointer data)
+{
+       gint idx,current_page;
+       
+       current_page = gtk_notebook_get_current_page (notebook);
+       idx = xa_find_archive_index (current_page);
+
+       xa_clipboard_cut_copy_operation(archive[idx],XA_CLIPBOARD_CUT);
+}
+
+void xa_clipboard_copy(GtkMenuItem* item,gpointer data)
+{
+       gint idx,current_page;
+
+       current_page = gtk_notebook_get_current_page (notebook);
+       idx = xa_find_archive_index (current_page);
+
+       xa_clipboard_cut_copy_operation(archive[idx],XA_CLIPBOARD_COPY);
+}
+
+void xa_clipboard_paste(GtkMenuItem* item,gpointer data)
+{
+       gint idx,current_page;
+       GtkClipboard *clipboard;
+       GtkSelectionData *selection;
+       XAClipboard *paste_data;
+       gchar *dummy_path        = NULL;
+       gchar *dummy_ex_path = NULL;
+       GSList *list = NULL;
+
+       current_page = gtk_notebook_get_current_page(notebook);
+       idx = xa_find_archive_index(current_page);
+
+       clipboard = gtk_clipboard_get(XA_CLIPBOARD);
+       selection = gtk_clipboard_wait_for_contents(clipboard,XA_INFO_LIST);
+       if (selection == NULL)
+               return;
+
+       paste_data = 
xa_get_paste_data_from_clipboard_selection((char*)selection->data);
+       gtk_selection_data_free (selection);
+       /* Let's extract the selected files to the archive tmp dir first */
+       if (archive[idx]->extraction_path)
+       {
+               dummy_ex_path = g_strdup(archive[idx]->extraction_path);
+               g_free(archive[idx]->extraction_path);
+       }
+       xa_create_temp_directory(archive[idx]);
+       archive[idx]->extraction_path = g_strdup(archive[idx]->tmp);
+       list = xa_slist_copy(paste_data->files);
+
+       dummy_path = g_strdup(archive[idx]->escaped_path);
+       g_free(archive[idx]->escaped_path);
+       archive[idx]->escaped_path = g_strdup(paste_data->filename);
+       
+       (*archive[idx]->extract) (archive[idx],list);
+       g_free(archive[idx]->extraction_path);
+       g_free(archive[idx]->escaped_path);
+       
+       archive[idx]->escaped_path = g_strdup(dummy_path);
+       g_free(dummy_path);
+
+       archive[idx]->extraction_path = NULL;
+       if (dummy_ex_path)
+       {
+               archive[idx]->extraction_path = g_strdup(dummy_ex_path);
+               g_free(dummy_ex_path);
+       }
+       /* Now let's add the extracted files in the tmp dir to the current 
archive */
+       list = xa_slist_copy(paste_data->files);
+       archive[idx]->status = XA_ARCHIVESTATUS_ADD;
+       chdir (archive[idx]->tmp);
+       (*archive[idx]->add) (archive[idx],list,NULL);
+       if (archive[idx]->status == XA_ARCHIVESTATUS_ERROR)
+               return;
+       /*if (paste_data->mode == XA_CLIPBOARD_CUT)
+       {
+               list = xa_slist_copy(paste_data->files);
+               archive[id]->status = XA_ARCHIVESTATUS_DELETE;
+               (*archive[id]->delete) (archive[id],list);              
+       }*/
+       /*TODO: modify all the extract routines of the zip,arj to return the 
command as gchar *
+        * so to simply add it in the gslist and then issue xa_run_command
+        * or (better) check if those (archive->extract) function can return a 
gboolean */
+}
+
+
+void xa_clipboard_cut_copy_operation(XArchive *archive, XAClipboardMode mode)
+{
+       GtkClipboard *clipboard;
+       XAClipboard *clipboard_data = NULL;
+       GSList *files = NULL;
+       GtkTreeSelection *selection;
+       GtkTargetEntry targets[] = 
+       {
+               { "application/xarchiver-info-list", 0, 1 }
+       };
+
+       selection = 
gtk_tree_view_get_selection(GTK_TREE_VIEW(archive->treeview));
+       
gtk_tree_selection_selected_foreach(selection,(GtkTreeSelectionForeachFunc) 
xa_concat_filenames,&files);
+
+       clipboard = gtk_clipboard_get (XA_CLIPBOARD);
+       clipboard_data = xa_clipboard_data_new();
+       if (clipboard_data == NULL)
+               return;
+
+       clipboard_data->files = files;
+       clipboard_data->mode  = mode;
+       gtk_clipboard_set_with_data (clipboard,targets,G_N_ELEMENTS 
(targets),xa_clipboard_get,xa_clipboard_clear,(gpointer)archive);
+       archive->clipboard_data = clipboard_data;
+       gtk_widget_set_sensitive(paste,TRUE);
+}
+
+XAClipboard *xa_get_paste_data_from_clipboard_selection(const char *data)
+{
+       gchar **uris;
+       gint i;
+       XAClipboard *clipboard_data;
+
+       clipboard_data = xa_clipboard_data_new();
+       uris = g_strsplit (data, "\r\n", -1);
+       clipboard_data->filename = g_strdup (uris[0]);
+       clipboard_data->mode = (strcmp (uris[1], "copy") == 0) ? 
XA_CLIPBOARD_COPY : XA_CLIPBOARD_CUT;
+       for (i = 2; uris[i] != NULL; i++)
+               if (uris[i][0] != '\0')
+                       clipboard_data->files = g_slist_prepend 
(clipboard_data->files, g_strdup (uris[i]));
+       clipboard_data->files = g_slist_reverse (clipboard_data->files);
+       g_strfreev(uris);
+       return clipboard_data;
+}
+
+void xa_clipboard_get (GtkClipboard *clipboard,GtkSelectionData 
*selection_data,guint info,gpointer user_data)
+{
+       XArchive *archive = user_data;
+       GSList *_files = archive->clipboard_data->files;
+       GString *params = g_string_new("");
+
+       if (selection_data->target != XA_INFO_LIST)
+               return;
+
+       g_string_append (params,g_strdup(archive->escaped_path));
+       g_string_append (params,"\r\n");
+       g_string_append (params, (archive->clipboard_data->mode == 
XA_CLIPBOARD_COPY) ? "copy" : "cut");
+       g_string_append (params,"\r\n");
+       while (_files)
+       {
+               g_string_append (params,_files->data);
+               g_string_append (params,"\r\n");
+               _files = _files->next;
+       }
+       gtk_selection_data_set (selection_data,selection_data->target,8,(guchar 
*) params->str,strlen(params->str));
+       g_string_free (params,TRUE);
+}
+
+void xa_clipboard_clear (GtkClipboard *clipboard,gpointer data)
+{
+       XArchive *archive = data;
+       g_slist_foreach (archive->clipboard_data->files, (GFunc) g_free, NULL);
+       g_slist_free (archive->clipboard_data->files);
+       g_free (archive->clipboard_data);       
+       archive->clipboard_data = NULL;
+}
+
+void xa_view_file(GtkMenuItem* item,gpointer data)
+{
        gint current_index,idx;
        GtkTreeSelection *selection;
        GtkTreeIter iter;
@@ -2394,13 +2566,13 @@
 
        selection = gtk_tree_view_get_selection (GTK_TREE_VIEW 
(archive[idx]->treeview));
        row_list = gtk_tree_selection_get_selected_rows(selection, 
&archive[idx]->model);
-       if (archive[idx]->extraction_path)
-       {
-               dummy = g_strdup(archive[idx]->extraction_path);
-               g_free(archive[idx]->extraction_path);
-       }
-       xa_create_temp_directory(archive[idx]);
-       archive[idx]->extraction_path = g_strdup(archive[idx]->tmp);
+       if (archive[idx]->extraction_path)
+       {
+               dummy = g_strdup(archive[idx]->extraction_path);
+               g_free(archive[idx]->extraction_path);
+       }
+       xa_create_temp_directory(archive[idx]);
+       archive[idx]->extraction_path = g_strdup(archive[idx]->tmp);
 
        if (row_list != NULL)
        {

Modified: xarchiver/trunk/src/window.h
===================================================================
--- xarchiver/trunk/src/window.h        2008-08-05 12:28:29 UTC (rev 27425)
+++ xarchiver/trunk/src/window.h        2008-08-06 13:05:59 UTC (rev 27426)
@@ -112,7 +112,15 @@
 void xa_destroy_comment_window(GtkButton *,gpointer);
 void xa_location_entry_activated (GtkEntry *,gpointer );
 int xa_mouse_button_event(GtkWidget *,GdkEventButton *,XArchive *);
-void xa_open_from_popupmenu(GtkMenuItem *,gpointer );
+XAClipboard *xa_clipboard_data_new();
+void xa_clipboard_cut(GtkMenuItem* ,gpointer );
+void xa_clipboard_copy(GtkMenuItem* ,gpointer );
+void xa_clipboard_paste(GtkMenuItem* ,gpointer );
+void xa_view_file(GtkMenuItem *,gpointer );
+void xa_clipboard_cut_copy_operation(XArchive *, XAClipboardMode );
+XAClipboard *xa_get_paste_data_from_clipboard_selection(const char *);
+void xa_clipboard_get (GtkClipboard *,GtkSelectionData *,guint ,gpointer );
+void xa_clipboard_clear (GtkClipboard *,gpointer );
 void xa_treeview_row_activated(GtkTreeView *,GtkTreePath *,GtkTreeViewColumn 
*,XArchive *);
 void xa_update_window_with_archive_entries(XArchive *,XEntry *);
 #endif

_______________________________________________
Xfce4-commits mailing list
Xfce4-commits@xfce.org
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to