Author: colossus
Date: 2008-07-09 12:56:02 +0000 (Wed, 09 Jul 2008)
New Revision: 27245

Modified:
   xarchiver/trunk/src/archive.c
   xarchiver/trunk/src/archive.h
   xarchiver/trunk/src/extract_dialog.c
   xarchiver/trunk/src/interface.c
   xarchiver/trunk/src/interface.h
   xarchiver/trunk/src/main.c
   xarchiver/trunk/src/rar.c
   xarchiver/trunk/src/rpm.c
   xarchiver/trunk/src/string_utils.c
   xarchiver/trunk/src/string_utils.h
   xarchiver/trunk/src/window.c
   xarchiver/trunk/src/window.h
Log:
Moved xa_update_window_with_archive_entries() to window.c from archive.c
Made the current selected sidepane row to be unselected when the user navigates 
to the root entry.
Made the sidepane row to expand when clicked on it.
Made the menu entry "Save As" in xa_set_button_state().
Removed unused parameter XArchive* from xa_escape_filenames() in string_utils.c


Modified: xarchiver/trunk/src/archive.c
===================================================================
--- xarchiver/trunk/src/archive.c       2008-07-09 10:04:28 UTC (rev 27244)
+++ xarchiver/trunk/src/archive.c       2008-07-09 12:56:02 UTC (rev 27245)
@@ -20,7 +20,6 @@
 #include <gtk/gtk.h>
 #include "config.h"
 #include "archive.h"
-#include "mime.h"
 #include "support.h"
 #include "window.h"
 
@@ -76,7 +75,7 @@
                g_error_free (error);
                g_strfreev ( argv );
                archive->child_pid = 0;
-               xa_set_button_state 
(1,1,1,archive->can_add,archive->can_extract,archive->has_sfx,archive->has_test,archive->has_properties);
+               xa_set_button_state 
(1,1,1,1,archive->can_add,archive->can_extract,archive->has_sfx,archive->has_test,archive->has_properties);
                return;
        }
        g_strfreev ( argv );
@@ -524,107 +523,6 @@
        return entry->columns;
 }
 
-void xa_update_window_with_archive_entries (XArchive *archive,XEntry *entry)
-{
-       GdkPixbuf *pixbuf = NULL;
-       GtkTreeIter iter;
-       GtkTreeIter *last_dir_iter = NULL;
-       unsigned short int i;
-       gpointer current_column;
-
-       archive->current_entry = entry;
-       if (entry == NULL)
-       {
-               entry = archive->root_entry->child;
-               gtk_entry_set_text(GTK_ENTRY(location_entry),"\0");
-               if (archive->location_entry_path != NULL)
-               {
-                       g_free(archive->location_entry_path);
-                       archive->location_entry_path = NULL;
-               }
-               gtk_widget_set_sensitive(back_button,FALSE);
-               gtk_widget_set_sensitive(up_button,FALSE);
-               gtk_widget_set_sensitive(home_button,FALSE);
-       }
-       else
-       {
-               if (archive->location_entry_path != NULL)
-               {
-                       g_free(archive->location_entry_path);
-                       archive->location_entry_path = NULL;
-               }
-               gtk_widget_set_sensitive(back_button,TRUE);
-               gtk_widget_set_sensitive(up_button,TRUE);
-               gtk_widget_set_sensitive(home_button,TRUE);
-               archive->location_entry_path = 
xa_build_full_path_name_from_entry(entry);
-               
gtk_entry_set_text(GTK_ENTRY(location_entry),archive->location_entry_path);
-               entry = entry->child;
-       }
-       gtk_list_store_clear(archive->liststore);
-
-       while (entry)
-       {
-               current_column = entry->columns;
-               //gtk_list_store_append (archive->liststore, &iter);
-               if (entry->is_dir)
-               {
-                       if (last_dir_iter == NULL)
-                               gtk_list_store_prepend(archive->liststore, 
&iter);
-                       else
-                       {
-                               gtk_list_store_insert_after(archive->liststore, 
&iter, last_dir_iter);
-                               gtk_tree_iter_free(last_dir_iter);
-                       }
-                       last_dir_iter = gtk_tree_iter_copy(&iter);
-               }
-               else
-                       gtk_list_store_append(archive->liststore, &iter);
-
-               if(!g_utf8_validate(entry->filename, -1, NULL) )
-               {
-                       gchar *dummy = g_convert(entry->filename, -1, "UTF-8", 
"WINDOWS-1252", NULL, NULL, NULL);
-                       if (dummy != NULL)
-                       {
-                               g_free (entry->filename);
-                               entry->filename = dummy;
-                       }
-               }
-               if (entry->is_dir)
-                       pixbuf = xa_get_pixbuf_icon_from_cache("folder");
-               else if (entry->is_encrypted)
-               {
-                       pixbuf = xa_get_pixbuf_icon_from_cache("lock");
-                       archive->has_passwd = TRUE;
-               }
-               else
-                       pixbuf = xa_get_pixbuf_icon_from_cache(entry->filename);
-
-               gtk_list_store_set (archive->liststore,&iter,archive->nc+1, 
entry,-1);
-               gtk_list_store_set 
(archive->liststore,&iter,0,pixbuf,1,entry->filename,-1);
-
-               for (i = 0; i < archive->nc; i++)
-               {
-                       switch(archive->column_types[i+2])
-                       {
-                               case G_TYPE_STRING:
-                                       //g_message ("%d - %s",i,(*((gchar 
**)current_column)));
-                                       gtk_list_store_set 
(archive->liststore,&iter,i+2,(*((gchar **)current_column)),-1);
-                                       current_column += sizeof(gchar *);
-                               break;
-
-                               case G_TYPE_UINT64:
-                                       //g_message ("*%d - %lu",i,(*((guint64 
*)current_column)));
-                                       gtk_list_store_set 
(archive->liststore,&iter,i+2,(*((guint64 *)current_column)),-1);
-                                       current_column += sizeof(guint64);
-                               break;
-                       }
-               }
-               entry = entry->next;
-       }
-       xa_fill_dir_sidebar(archive,FALSE);
-       xa_handle_selected_rows(NULL,archive);
-}
-
 XEntry* xa_find_entry_from_path (XEntry *root_entry,const gchar *fullpathname)
 {
        gchar **components = NULL;
@@ -852,6 +750,7 @@
        XEntry *entry;
        GtkTreeIter iter;
        GtkTreeIter parent;
+       GtkTreePath *path;
        GtkTreeModel *model;
        GString *string = g_string_new("");
        gchar *dir;
@@ -863,6 +762,10 @@
 
        if (gtk_tree_selection_get_selected (selection,&model,&iter))
        {
+               path = gtk_tree_model_get_path(model,&iter);
+               if ( ! 
gtk_tree_view_row_expanded(GTK_TREE_VIEW(archive_dir_treeview),path))
+                       
gtk_tree_view_expand_to_path(GTK_TREE_VIEW(archive_dir_treeview),path);
+               gtk_tree_path_free(path);
                /* Let get the last selected dir */
                gtk_tree_model_get(model,&iter,1,&dir,-1);
                g_string_prepend_c(string,'/');

Modified: xarchiver/trunk/src/archive.h
===================================================================
--- xarchiver/trunk/src/archive.h       2008-07-09 10:04:28 UTC (rev 27244)
+++ xarchiver/trunk/src/archive.h       2008-07-09 12:56:02 UTC (rev 27245)
@@ -142,7 +142,6 @@
 XEntry *xa_find_child_entry(XEntry *entry, gchar *string);
 XEntry *xa_set_archive_entries_for_each_row(XArchive *archive,gchar 
*filename,gpointer *items);
 gpointer *xa_fill_archive_entry_columns_for_each_row (XArchive *archive,XEntry 
*entry,gpointer *items);
-void xa_update_window_with_archive_entries(XArchive *archive,XEntry *entry);
 XEntry* xa_find_entry_from_path(XEntry *root_entry,const gchar *fullpathname);
 gchar *xa_build_full_path_name_from_entry(XEntry *entry);
 void xa_fill_list_with_recursed_entries(XEntry *entry,GString 
**p_file_list,gchar *current_path);

Modified: xarchiver/trunk/src/extract_dialog.c
===================================================================
--- xarchiver/trunk/src/extract_dialog.c        2008-07-09 10:04:28 UTC (rev 
27244)
+++ xarchiver/trunk/src/extract_dialog.c        2008-07-09 12:56:02 UTC (rev 
27245)
@@ -399,7 +399,7 @@
                                gtk_widget_set_sensitive (Stop_button,FALSE);
                                Update_StatusBar (_("Operation canceled."));
                                gtk_widget_hide (viewport2);
-                               xa_set_button_state 
(1,1,GTK_WIDGET_IS_SENSITIVE(close1),0,0,0,0,0);
+                               xa_set_button_state 
(1,1,GTK_WIDGET_IS_SENSITIVE(save1),GTK_WIDGET_IS_SENSITIVE(close1),0,0,0,0,0);
                                archive->status = XA_ARCHIVESTATUS_IDLE;
                        }
                        break;

Modified: xarchiver/trunk/src/interface.c
===================================================================
--- xarchiver/trunk/src/interface.c     2008-07-09 10:04:28 UTC (rev 27244)
+++ xarchiver/trunk/src/interface.c     2008-07-09 12:56:02 UTC (rev 27245)
@@ -526,11 +526,11 @@
                        gtk_widget_set_sensitive (Stop_button , FALSE);
                        goto here;
                }
-               xa_set_button_state (0,0,0,0,0,0,0,0);
+               xa_set_button_state (0,0,0,0,0,0,0,0,0);
                gtk_widget_set_sensitive ( Stop_button , TRUE);
                return;
        }
-       xa_set_button_state 
(1,1,GTK_WIDGET_IS_SENSITIVE(close1),archive[id]->can_add,archive[id]->can_extract,archive[id]->has_sfx,archive[id]->has_test,archive[id]->has_properties);
+       xa_set_button_state 
(1,1,1,GTK_WIDGET_IS_SENSITIVE(close1),archive[id]->can_add,archive[id]->can_extract,archive[id]->has_sfx,archive[id]->has_test,archive[id]->has_properties);
 
 here:
        xa_restore_navigation(id);
@@ -1152,13 +1152,14 @@
     g_free (tmp_markup);
 }
 
-void xa_set_button_state (gboolean New, gboolean Open,gboolean Close, gboolean 
add,gboolean extract, gboolean sfx, gboolean test, gboolean info)
+void xa_set_button_state (gboolean New, gboolean Open,gboolean save,gboolean 
Close, gboolean add,gboolean extract, gboolean sfx, gboolean test, gboolean 
info)
 {
        gtk_widget_set_sensitive (New_button, New);
     gtk_widget_set_sensitive (new1, New);
        gtk_widget_set_sensitive (Open_button, Open);
     gtk_widget_set_sensitive (open1, Open);
     gtk_widget_set_sensitive (close1, Close);
+    gtk_widget_set_sensitive (save1, save);
        gtk_widget_set_sensitive (AddFile_button, add);
        gtk_widget_set_sensitive (addfile, add);
        gtk_widget_set_sensitive (Extract_button, extract);
@@ -1327,7 +1328,7 @@
        if (archive[idx]->location_entry_path != NULL)
                g_free(archive[idx]->location_entry_path);
 
-       /* This to store the dragged files inside an archive dir */
+       /* This to store the dragged files inside the dropped archive dir */
        archive[idx]->location_entry_path = g_strdup(full_pathname->str);
        xa_cat_filenames_basename(archive[idx],list,names);
        dummy_password = archive[idx]->has_passwd;
@@ -1356,12 +1357,11 @@
 gboolean xa_sidepane_drag_motion (GtkWidget *widget,GdkDragContext 
*context,gint x,gint y,guint time,gpointer user_data)
 {
        GtkTreePath *path;
-       GtkTreeViewDropPosition pos;
        GtkTreeIter iter;
        GtkTreeModel *model;
        
        model = gtk_tree_view_get_model(GTK_TREE_VIEW(widget));
-       gtk_tree_view_get_dest_row_at_pos (GTK_TREE_VIEW 
(widget),x,y,&path,&pos);
+       gtk_tree_view_get_dest_row_at_pos (GTK_TREE_VIEW 
(widget),x,y,&path,NULL);
        if (path)
        {
                if (! gtk_tree_view_row_expanded(GTK_TREE_VIEW(widget),path))
@@ -1371,6 +1371,7 @@
                g_object_set_data(G_OBJECT(context),"current_path",path);
                /* This to set the focus on the dropped row */
                
gtk_tree_view_set_drag_dest_row(GTK_TREE_VIEW(widget),path,GTK_TREE_VIEW_DROP_INTO_OR_BEFORE);
+               gtk_tree_store_set(GTK_TREE_STORE(model),&iter,0,"gtk-open",-1);
        }
        gdk_drag_status (context, context->suggested_action, time);
        return TRUE;

Modified: xarchiver/trunk/src/interface.h
===================================================================
--- xarchiver/trunk/src/interface.h     2008-07-09 10:04:28 UTC (rev 27244)
+++ xarchiver/trunk/src/interface.h     2008-07-09 12:56:02 UTC (rev 27245)
@@ -136,7 +136,7 @@
 void xa_add_page (XArchive *);
 void xa_page_has_changed (GtkNotebook *, GtkNotebookPage *, guint , gpointer );
 void xa_close_page (GtkWidget *, gpointer );
-void xa_set_button_state (gboolean,gboolean,gboolean,gboolean,gboolean, 
gboolean, gboolean,gboolean);
+void xa_set_button_state 
(gboolean,gboolean,gboolean,gboolean,gboolean,gboolean, gboolean, 
gboolean,gboolean);
 void xa_restore_navigation(int idx);
 void xa_disable_delete_buttons (gboolean);
 void xa_sidepane_drag_data_received (GtkWidget *widget,GdkDragContext 
*context,int x,int y,GtkSelectionData *data, unsigned int info,unsigned int 
time,gpointer user_data);

Modified: xarchiver/trunk/src/main.c
===================================================================
--- xarchiver/trunk/src/main.c  2008-07-09 10:04:28 UTC (rev 27244)
+++ xarchiver/trunk/src/main.c  2008-07-09 12:56:02 UTC (rev 27245)
@@ -174,13 +174,13 @@
                                if (g_file_test 
(archive_name,G_FILE_TEST_EXISTS))
                                {
                                        _current_dir = 
g_path_get_basename(archive_name);
-                                       
xa_escape_filename(_current_dir,string,archive);
+                                       xa_escape_filename(_current_dir,string);
                                        g_free (_current_dir);
                                }
                                for (x = 1; x< argc; x++)
                                {
                                        _current_dir = 
g_path_get_basename(argv[x]);
-                                       
xa_escape_filename(_current_dir,string,archive);
+                                       xa_escape_filename(_current_dir,string);
                                        g_free (_current_dir);
                                }
                                if (archive->type == XARCHIVETYPE_7ZIP)

Modified: xarchiver/trunk/src/rar.c
===================================================================
--- xarchiver/trunk/src/rar.c   2008-07-09 10:04:28 UTC (rev 27244)
+++ xarchiver/trunk/src/rar.c   2008-07-09 12:56:02 UTC (rev 27245)
@@ -211,7 +211,7 @@
        GString *e_filenames = g_string_new("");
 
        archive->status = XA_ARCHIVESTATUS_DELETE;
-       xa_escape_filename(files->str,e_filenames,archive);
+       xa_escape_filename(files->str,e_filenames);
        command = g_strconcat ("rar d ",archive->escaped_path," 
",e_filenames->str,NULL);
        g_string_free(files,TRUE);
        g_string_free(e_filenames,TRUE);

Modified: xarchiver/trunk/src/rpm.c
===================================================================
--- xarchiver/trunk/src/rpm.c   2008-07-09 10:04:28 UTC (rev 27244)
+++ xarchiver/trunk/src/rpm.c   2008-07-09 12:56:02 UTC (rev 27245)
@@ -140,7 +140,7 @@
                                xa_show_cmd_line_output (NULL);
                        xa_delete_temp_directory (archive[idx],1);
                        g_free (cpio_tmp);
-                       xa_set_button_state 
(1,1,GTK_WIDGET_IS_SENSITIVE(close1),0,0,0,0,0);
+                       xa_set_button_state 
(1,1,GTK_WIDGET_IS_SENSITIVE(save1),GTK_WIDGET_IS_SENSITIVE(close1),0,0,0,0,0);
                        //TODO: xa_hide_progress_bar_stop_button(archive[idx]);
                        return FALSE;
                }

Modified: xarchiver/trunk/src/string_utils.c
===================================================================
--- xarchiver/trunk/src/string_utils.c  2008-07-09 10:04:28 UTC (rev 27244)
+++ xarchiver/trunk/src/string_utils.c  2008-07-09 12:56:02 UTC (rev 27245)
@@ -242,7 +242,7 @@
        return utf8_string;
 }
 
-void xa_escape_filename (gchar *filename,GString *data,XArchive *archive)
+void xa_escape_filename (gchar *filename,GString *data)
 {
        gchar *esc_filename = NULL;
        
@@ -261,11 +261,11 @@
                if (archive->location_entry_path != NULL)
                {
                        name = 
g_strconcat(archive->location_entry_path,slist->data,NULL);
-                       xa_escape_filename(name,data,archive);
+                       xa_escape_filename(name,data);
                        g_free(name);
                }
                else
-                       xa_escape_filename(slist->data,data,archive);
+                       xa_escape_filename(slist->data,data);
                slist = slist->next;
        }
 }
@@ -282,13 +282,13 @@
                        basename = g_path_get_basename (slist->data);
                        name = 
g_strconcat(archive->location_entry_path,basename,NULL);
                        g_free(basename);
-                       xa_escape_filename(name,data,archive);
+                       xa_escape_filename(name,data);
                        g_free(name);
                }
                else
                {
                        basename = g_path_get_basename (slist->data);
-                       xa_escape_filename(basename,data,archive);
+                       xa_escape_filename(basename,data);
                        g_free (basename);
                }
                slist = slist->next;

Modified: xarchiver/trunk/src/string_utils.h
===================================================================
--- xarchiver/trunk/src/string_utils.h  2008-07-09 10:04:28 UTC (rev 27244)
+++ xarchiver/trunk/src/string_utils.h  2008-07-09 12:56:02 UTC (rev 27245)
@@ -40,6 +40,6 @@
 gchar *xa_remove_path_from_archive_name(gchar *name);
 void xa_cat_filenames (XArchive *,GSList *,GString *);
 void xa_cat_filenames_basename (XArchive *,GSList *,GString *);
-void xa_escape_filename (gchar *,GString *data,XArchive *);
+void xa_escape_filename (gchar *,GString *data);
 #endif
 

Modified: xarchiver/trunk/src/window.c
===================================================================
--- xarchiver/trunk/src/window.c        2008-07-09 10:04:28 UTC (rev 27244)
+++ xarchiver/trunk/src/window.c        2008-07-09 12:56:02 UTC (rev 27245)
@@ -22,6 +22,7 @@
 
 #include "window.h"
 #include "archive.h"
+#include "mime.h"
 #include "string_utils.h"
 #include "interface.h"
 #include "support.h"
@@ -59,7 +60,7 @@
                                response = 
xa_show_message_dialog(GTK_WINDOW(xa_main_window),GTK_DIALOG_MODAL,GTK_MESSAGE_ERROR,GTK_BUTTONS_OK,_("An
 error occurred!"),_("Please check the 'Store archiver output' option to see 
it.") );       
                                return FALSE;
                        }
-                       xa_set_button_state 
(1,1,1,archive->can_add,archive->can_extract,0,archive->has_test,archive->has_properties);
+                       xa_set_button_state 
(1,1,1,1,archive->can_add,archive->can_extract,0,archive->has_test,archive->has_properties);
                        response = 
xa_show_message_dialog(GTK_WINDOW(xa_main_window),GTK_DIALOG_MODAL,GTK_MESSAGE_QUESTION,GTK_BUTTONS_OK_CANCEL,_("An
 error occurred while accessing the archive."),_("Do you want to view the 
command line output?") );
                        if (response == GTK_RESPONSE_OK)
                                xa_show_cmd_line_output (NULL);
@@ -88,7 +89,7 @@
                else
                        gtk_widget_set_sensitive (comment_menu,FALSE);
                        
-               xa_set_button_state 
(1,1,1,archive->can_add,archive->can_extract,archive->has_sfx,archive->has_test,archive->has_properties);
+               xa_set_button_state 
(1,1,1,1,archive->can_add,archive->can_extract,archive->has_sfx,archive->has_test,archive->has_properties);
 
                if (archive->has_comment && archive->status == 
XA_ARCHIVESTATUS_OPEN && 
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(prefs_window->check_show_comment)))
                        xa_show_archive_comment (NULL, NULL);
@@ -192,7 +193,7 @@
                else if (archive->status == XA_ARCHIVESTATUS_OPEN)
                        gtk_widget_set_sensitive (check_menu,FALSE );
 
-               xa_set_button_state 
(1,1,1,archive->can_add,archive->can_extract,archive->has_sfx,archive->has_test,archive->has_properties);
+               xa_set_button_state 
(1,1,1,1,archive->can_add,archive->can_extract,archive->has_sfx,archive->has_test,archive->has_properties);
                archive->status = XA_ARCHIVESTATUS_IDLE;
                return;
        }
@@ -222,7 +223,7 @@
 
        xa_add_page (archive[current_page]);
 
-       xa_set_button_state (1,1,1,1,0,0,0,0 );
+       xa_set_button_state (1,1,1,1,1,0,0,0,0 );
     archive[current_page]->has_passwd = FALSE;
     gtk_widget_set_sensitive(check_menu,FALSE);
     gtk_widget_set_sensitive(properties,FALSE );
@@ -384,7 +385,7 @@
 
        gtk_widget_set_sensitive (check_menu,FALSE);
        gtk_widget_set_sensitive (properties,FALSE);
-       xa_set_button_state ( 0,0,0,0,0,0,0,0);
+       xa_set_button_state ( 0,0,0,0,0,0,0,0,0);
        switch (archive[current_page]->type)
        {
                case XARCHIVETYPE_ARJ:
@@ -478,7 +479,7 @@
                gtk_widget_set_sensitive (home_button,FALSE);
                gtk_widget_set_sensitive (deselect_all,FALSE);
                xa_disable_delete_buttons (FALSE);
-               xa_set_button_state (1,1,0,0,0,0,0,0);
+               xa_set_button_state (1,1,0,0,0,0,0,0,0);
                xa_set_window_title (xa_main_window,NULL);
                gtk_tree_store_clear(GTK_TREE_STORE(archive_dir_model));
                gtk_entry_set_text(GTK_ENTRY(location_entry),"");
@@ -1784,7 +1785,7 @@
        
        gtk_tree_model_get (model,iter,archive[idx]->nc+1,&entry,-1);
        filename = xa_build_full_path_name_from_entry(entry);
-       xa_escape_filename (filename,data,archive[idx]);
+       xa_escape_filename (filename,data);
        g_free (filename);
 }
 
@@ -2004,3 +2005,105 @@
        xa_sidepane_select_row(entry);
        xa_update_window_with_archive_entries(archive,entry);
 }
+
+void xa_update_window_with_archive_entries (XArchive *archive,XEntry *entry)
+{
+       GdkPixbuf *pixbuf = NULL;
+       GtkTreeIter iter;
+       GtkTreeIter *last_dir_iter = NULL;
+       unsigned short int i;
+       gpointer current_column;
+
+       archive->current_entry = entry;
+       if (entry == NULL)
+       {
+               entry = archive->root_entry->child;
+               gtk_entry_set_text(GTK_ENTRY(location_entry),"\0");
+               gtk_tree_selection_unselect_all(gtk_tree_view_get_selection 
(GTK_TREE_VIEW (archive_dir_treeview)));
+               if (archive->location_entry_path != NULL)
+               {
+                       g_free(archive->location_entry_path);
+                       archive->location_entry_path = NULL;
+               }
+               gtk_widget_set_sensitive(back_button,FALSE);
+               gtk_widget_set_sensitive(up_button,FALSE);
+               gtk_widget_set_sensitive(home_button,FALSE);
+       }
+       else
+       {
+               if (archive->location_entry_path != NULL)
+               {
+                       g_free(archive->location_entry_path);
+                       archive->location_entry_path = NULL;
+               }
+               gtk_widget_set_sensitive(back_button,TRUE);
+               gtk_widget_set_sensitive(up_button,TRUE);
+               gtk_widget_set_sensitive(home_button,TRUE);
+               archive->location_entry_path = 
xa_build_full_path_name_from_entry(entry);
+               
gtk_entry_set_text(GTK_ENTRY(location_entry),archive->location_entry_path);
+               entry = entry->child;
+       }
+       gtk_list_store_clear(archive->liststore);
+
+       while (entry)
+       {
+               current_column = entry->columns;
+               //gtk_list_store_append (archive->liststore, &iter);
+               if (entry->is_dir)
+               {
+                       if (last_dir_iter == NULL)
+                               gtk_list_store_prepend(archive->liststore, 
&iter);
+                       else
+                       {
+                               gtk_list_store_insert_after(archive->liststore, 
&iter, last_dir_iter);
+                               gtk_tree_iter_free(last_dir_iter);
+                       }
+                       last_dir_iter = gtk_tree_iter_copy(&iter);
+               }
+               else
+                       gtk_list_store_append(archive->liststore, &iter);
+
+               if(!g_utf8_validate(entry->filename, -1, NULL) )
+               {
+                       gchar *dummy = g_convert(entry->filename, -1, "UTF-8", 
"WINDOWS-1252", NULL, NULL, NULL);
+                       if (dummy != NULL)
+                       {
+                               g_free (entry->filename);
+                               entry->filename = dummy;
+                       }
+               }
+               if (entry->is_dir)
+                       pixbuf = xa_get_pixbuf_icon_from_cache("folder");
+               else if (entry->is_encrypted)
+               {
+                       pixbuf = xa_get_pixbuf_icon_from_cache("lock");
+                       archive->has_passwd = TRUE;
+               }
+               else
+                       pixbuf = xa_get_pixbuf_icon_from_cache(entry->filename);
+
+               gtk_list_store_set (archive->liststore,&iter,archive->nc+1, 
entry,-1);
+               gtk_list_store_set 
(archive->liststore,&iter,0,pixbuf,1,entry->filename,-1);
+
+               for (i = 0; i < archive->nc; i++)
+               {
+                       switch(archive->column_types[i+2])
+                       {
+                               case G_TYPE_STRING:
+                                       //g_message ("%d - %s",i,(*((gchar 
**)current_column)));
+                                       gtk_list_store_set 
(archive->liststore,&iter,i+2,(*((gchar **)current_column)),-1);
+                                       current_column += sizeof(gchar *);
+                               break;
+
+                               case G_TYPE_UINT64:
+                                       //g_message ("*%d - %lu",i,(*((guint64 
*)current_column)));
+                                       gtk_list_store_set 
(archive->liststore,&iter,i+2,(*((guint64 *)current_column)),-1);
+                                       current_column += sizeof(guint64);
+                               break;
+                       }
+               }
+               entry = entry->next;
+       }
+       xa_fill_dir_sidebar(archive,FALSE);
+       xa_handle_selected_rows(NULL,archive);
+}

Modified: xarchiver/trunk/src/window.h
===================================================================
--- xarchiver/trunk/src/window.h        2008-07-09 10:04:28 UTC (rev 27244)
+++ xarchiver/trunk/src/window.h        2008-07-09 12:56:02 UTC (rev 27245)
@@ -106,7 +106,8 @@
 gchar *xa_open_sfx_file_selector ();
 void xa_activate_link (GtkAboutDialog *about,const gchar *link,gpointer data);
 void xa_location_entry_activated (GtkEntry *entry,gpointer );
+int xa_mouse_button_event(GtkWidget *widget,GdkEventButton *event,gpointer 
data);
 void xa_treeview_row_activated(GtkTreeView *tree_view,GtkTreePath 
*path,GtkTreeViewColumn *column,gpointer );
-int xa_mouse_button_event(GtkWidget *widget,GdkEventButton *event,gpointer 
data);
+void xa_update_window_with_archive_entries(XArchive *archive,XEntry *entry);
 #endif
 

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

Reply via email to