Lines Matching refs:archive

63 static void xa_remove_columns (XArchive *archive)  in xa_remove_columns()  argument
65 GList *columns = gtk_tree_view_get_columns ( GTK_TREE_VIEW (archive->treeview)); in xa_remove_columns()
68 gtk_tree_view_remove_column (GTK_TREE_VIEW (archive->treeview),columns->data); in xa_remove_columns()
145 static gboolean xa_detect_archive_comment (int type, gchar *filename, XArchive *archive) in xa_detect_archive_comment() argument
197 archive->comment = g_string_new(""); in xa_detect_archive_comment()
201 g_string_append_c (archive->comment,sig); in xa_detect_archive_comment()
220 archive->comment = g_string_new(""); in xa_detect_archive_comment()
225 if (sig == 0 && archive->comment->len == 0) in xa_detect_archive_comment()
227 g_string_free (archive->comment,FALSE); in xa_detect_archive_comment()
228 archive->comment = NULL; in xa_detect_archive_comment()
233 g_string_append_c (archive->comment,sig); in xa_detect_archive_comment()
299 for (i = 2; i < archive[idx]->columns - 1; i++) in xa_print_entry_in_file()
301 switch(archive[idx]->column_types[i]) in xa_print_entry_in_file()
383 …ted (GtkCellRendererText *cell, const gchar *path_string, const gchar *new_name, XArchive *archive) in xa_rename_cell_edited() argument
392 model = gtk_tree_view_get_model(GTK_TREE_VIEW(archive->treeview)); in xa_rename_cell_edited()
395 gtk_tree_model_get(model, &iter, archive->columns - 1, &entry, -1); in xa_rename_cell_edited()
398 if (!xa_check_password(archive)) in xa_rename_cell_edited()
401 g_free(archive->extraction_dir); in xa_rename_cell_edited()
402 xa_create_working_directory(archive); in xa_rename_cell_edited()
403 archive->extraction_dir = g_strdup(archive->working_dir); in xa_rename_cell_edited()
408 archive->do_overwrite = archive->do_full_path = TRUE; in xa_rename_cell_edited()
410 archive->status = XARCHIVESTATUS_EXTRACT; in xa_rename_cell_edited()
411 result = (*archive->archiver->extract) (archive,names); in xa_rename_cell_edited()
426 …command = g_strconcat("mv -f ", archive->working_dir, "/", q_old_name, " ", archive->working_dir, … in xa_rename_cell_edited()
427 xa_run_command(archive, command); in xa_rename_cell_edited()
436 archive->status = XARCHIVESTATUS_DELETE; in xa_rename_cell_edited()
437 (*archive->archiver->delete)(archive, file_list); in xa_rename_cell_edited()
441 chdir(archive->working_dir); in xa_rename_cell_edited()
442 xa_execute_add_commands(archive, file_list, FALSE, NULL); in xa_rename_cell_edited()
448 static const gchar *xa_get_archive_format (XArchive *archive) in xa_get_archive_format() argument
452 pos = g_slist_index(archiver[archive->type].tags, GUINT_TO_POINTER(archive->tag)); in xa_get_archive_format()
455 return g_slist_nth_data(archiver[archive->type].tags, pos + 1); in xa_get_archive_format()
457 return archiver[archive->type].type->data; in xa_get_archive_format()
621 xa_create_working_directory(archive[idx]); in xa_comment_window_insert_in_archive()
622 tmp = g_strconcat(archive[idx]->working_dir, "/xa-tmp.comment", NULL); in xa_comment_window_insert_in_archive()
625 if (archive[idx]->comment == NULL) in xa_comment_window_insert_in_archive()
627 archive[idx]->comment = g_string_new(""); in xa_comment_window_insert_in_archive()
628 archive[idx]->has_comment = TRUE; in xa_comment_window_insert_in_archive()
631 if (strcmp(archive[idx]->comment->str,content) == 0) in xa_comment_window_insert_in_archive()
645 switch (archive[idx]->type) in xa_comment_window_insert_in_archive()
648 command = g_strconcat ("arj c ",archive[idx]->path[1]," -z",tmp,NULL); in xa_comment_window_insert_in_archive()
652 command = g_strconcat ("rar c ",archive[idx]->path[1]," -z",tmp,NULL); in xa_comment_window_insert_in_archive()
656 command = g_strconcat ("sh -c \"zip ",archive[idx]->path[1]," -z <",tmp,"\"",NULL); in xa_comment_window_insert_in_archive()
663 if (strlen(archive[idx]->comment->str) > 0) in xa_comment_window_insert_in_archive()
664 g_string_erase(archive[idx]->comment,0,strlen(archive[idx]->comment->str)); in xa_comment_window_insert_in_archive()
666 g_string_append(archive[idx]->comment,content); in xa_comment_window_insert_in_archive()
670 xa_run_command(archive[idx], command); in xa_comment_window_insert_in_archive()
703 …oard_get (GtkClipboard *clipboard, GtkSelectionData *selection_data, guint info, XArchive *archive) in xa_clipboard_get() argument
705 GSList *files = archive->clipboard->files; in xa_clipboard_get()
710 g_string_append(params, archive->clipboard->mode == XA_CLIPBOARD_COPY ? "copy" : "cut"); in xa_clipboard_get()
712 g_string_append_printf (params,"%p",archive); in xa_clipboard_get()
725 static void xa_clipboard_cut_copy_operation (XArchive *archive, XAClipboardMode mode) in xa_clipboard_cut_copy_operation() argument
736 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(archive->treeview)); in xa_clipboard_cut_copy_operation()
746 …ets), (GtkClipboardGetFunc) xa_clipboard_get, (GtkClipboardClearFunc) xa_clipboard_clear, archive); in xa_clipboard_cut_copy_operation()
747 archive->clipboard = clipboard_data; in xa_clipboard_cut_copy_operation()
751 if (archive->has_password) in xa_clipboard_cut_copy_operation()
753 if (!xa_check_password(archive)) in xa_clipboard_cut_copy_operation()
756 g_free(archive->extraction_dir); in xa_clipboard_cut_copy_operation()
757 xa_create_working_directory(archive); in xa_clipboard_cut_copy_operation()
758 archive->extraction_dir = g_strdup(archive->working_dir); in xa_clipboard_cut_copy_operation()
759 archive->do_full_path = TRUE; in xa_clipboard_cut_copy_operation()
760 archive->do_overwrite = TRUE; in xa_clipboard_cut_copy_operation()
762 archive->status = XARCHIVESTATUS_EXTRACT; in xa_clipboard_cut_copy_operation()
763 (*archive->archiver->extract) (archive,files); in xa_clipboard_cut_copy_operation()
766 static void xa_expand_containing_directory (XArchive *archive) in xa_expand_containing_directory() argument
768 if (xa_has_containing_directory(archive)) in xa_expand_containing_directory()
782 void xa_child_processed (XAChildProcess process, gboolean success, XArchive *archive) in xa_child_processed() argument
790 archive->child_pid = 0; in xa_child_processed()
795 …, 1, archive->can_test, 1, archive->can_add, archive->can_extract, archive->sorted, archive->can_s… in xa_child_processed()
799 if (--archive->child_ref == 0) in xa_child_processed()
801 if (archive->output) in xa_child_processed()
802 archive->output = g_slist_reverse(archive->output); in xa_child_processed()
808 if (archive->parse_output) in xa_child_processed()
813 xa_update_window_with_archive_entries(archive, NULL); in xa_child_processed()
814 xa_expand_containing_directory(archive); in xa_child_processed()
815 gtk_tree_view_set_model(GTK_TREE_VIEW(archive->treeview), archive->model); in xa_child_processed()
816 g_object_unref(archive->model); in xa_child_processed()
819 xa_set_statusbar_message_for_displayed_rows(archive); in xa_child_processed()
821 …if (archive->status == XARCHIVESTATUS_LIST && archive->has_comment && gtk_toggle_button_get_active… in xa_child_processed()
824 if (archive->status == XARCHIVESTATUS_TEST) in xa_child_processed()
826 if (archive->output) in xa_child_processed()
827 xa_show_archive_output(GUINT_TO_POINTER(TRUE), archive); in xa_child_processed()
833 archive->parse_output = NULL; in xa_child_processed()
834 archive->status = XARCHIVESTATUS_IDLE; in xa_child_processed()
838 if (xa_main_window && archive->parse_output) in xa_child_processed()
840 xa_update_window_with_archive_entries(archive, NULL); in xa_child_processed()
841 archive->parse_output = NULL; in xa_child_processed()
847 xa_show_archive_output(NULL, archive); in xa_child_processed()
853 …if (archive->password && (archive->status == XARCHIVESTATUS_TEST || archive->status == XARCHIVESTA… in xa_child_processed()
855 g_free(archive->password); in xa_child_processed()
856 archive->password = NULL; in xa_child_processed()
859 archive->status = XARCHIVESTATUS_ERROR; in xa_child_processed()
905 this_archive = archive[idx]; in xa_show_archive_output()
987 archive[current_page] = xa_new_archive_dialog(NULL, archive); in xa_new_archive()
989 if (archive[current_page] == NULL) in xa_new_archive()
992 xa_add_page (archive[current_page]); in xa_new_archive()
993archive[current_page]->can_test, 1, archive[current_page]->can_add, archive[current_page]->can_ext… in xa_new_archive()
996 xa_set_window_title(xa_main_window, archive[current_page]->path[0]); in xa_new_archive()
1029 filename = g_path_get_basename(archive[idx]->path[1]); in xa_save_archive()
1041 command = g_strconcat ("cp ",archive[idx]->path[1]," ",path,NULL); in xa_save_archive()
1043 xa_run_command(archive[idx], command); in xa_save_archive()
1068 if (strcmp(path, archive[current_page]->path[0]) == 0) in xa_open_archive()
1105 archive[current_page] = xa_init_archive_structure(xa); in xa_open_archive()
1106 if (archive[current_page] == NULL) in xa_open_archive()
1114archive[current_page]->has_comment = xa_detect_archive_comment (XARCHIVETYPE_ZIP,path,archive[curr… in xa_open_archive()
1116archive[current_page]->has_comment = xa_detect_archive_comment (XARCHIVETYPE_ARJ,path,archive[curr… in xa_open_archive()
1119 archive[current_page]->path[0] = g_strconcat(g_get_current_dir() ,"/", path, NULL); in xa_open_archive()
1121 archive[current_page]->path[0] = g_strdup(path); in xa_open_archive()
1123 archive[current_page]->path[1] = xa_escape_bad_chars(archive[current_page]->path[0], ESCAPES); in xa_open_archive()
1124 xa_add_page (archive[current_page]); in xa_open_archive()
1132 archive[current_page]->status = XARCHIVESTATUS_LIST; in xa_open_archive()
1133 (*archive[current_page]->archiver->list)(archive[current_page]); in xa_open_archive()
1142 if (archive[idx]->has_password) in xa_test_archive()
1144 if (!xa_check_password(archive[idx])) in xa_test_archive()
1149 archive[idx]->status = XARCHIVESTATUS_TEST; in xa_test_archive()
1150 (*archive[idx]->archiver->test)(archive[idx]); in xa_test_archive()
1180 filename = g_path_get_basename(archive[idx]->path[1]); in xa_list_archive()
1224 filename = g_filename_display_name(archive[idx]->path[1]); in xa_list_archive()
1243 stat(archive[idx]->path[0], &my_stat); in xa_list_archive()
1254 t = xa_set_size_string(archive[idx]->files_size); in xa_list_archive()
1264 g_fprintf(stream, "%u\n", archive[idx]->files); in xa_list_archive()
1267 if (archive[idx]->has_comment) in xa_list_archive()
1272 g_fprintf (stream,"%s",archive[idx]->comment->str); in xa_list_archive()
1293 xa_print_entry_in_file(archive[idx]->root_entry,idx,stream,bp); in xa_list_archive()
1330 xa_clean_archive_structure (archive[idx]); in xa_close_archive()
1331 archive[idx] = NULL; in xa_close_archive()
1341 if (idx > -1 && archive[idx]->child_pid) in xa_quit_application()
1347 if (archive[idx] != NULL) in xa_quit_application()
1349 xa_clean_archive_structure (archive[idx]); in xa_quit_application()
1350 archive[idx] = NULL; in xa_quit_application()
1391 GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(archive[idx]->treeview)); in xa_delete_archive()
1393 row_list = gtk_tree_selection_get_selected_rows(selection, &archive[idx]->model); in xa_delete_archive()
1398 gtk_tree_model_get_iter(archive[idx]->model, &iter, row_list->data); in xa_delete_archive()
1399 gtk_tree_model_get(archive[idx]->model, &iter, archive[idx]->columns - 1, &entry, -1); in xa_delete_archive()
1418 archive[idx]->status = XARCHIVESTATUS_DELETE; in xa_delete_archive()
1419 (*archive[idx]->archiver->delete)(archive[idx], list); in xa_delete_archive()
1420 xa_reload_archive_content(archive[idx]); in xa_delete_archive()
1429 xa_set_add_dialog_options(add_window,archive[idx]); in xa_add_files_archive()
1430 xa_parse_add_dialog_options (archive[idx],add_window); in xa_add_files_archive()
1439 GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(archive[idx]->treeview)); in xa_extract_archive()
1441 xa_set_extract_dialog_options(extract_window,selected,archive[idx]); in xa_extract_archive()
1442 xa_parse_extract_dialog_options(archive[idx],extract_window,selection); in xa_extract_archive()
1469 archive[idx]->status = XARCHIVESTATUS_SFX; in xa_convert_sfx()
1470 switch ( archive[idx]->type) in xa_convert_sfx()
1473 command = g_strconcat ("rar s -o+ ",archive[idx]->path[1],NULL); in xa_convert_sfx()
1474 xa_run_command(archive[idx], command); in xa_convert_sfx()
1520 archive_not_sfx = fopen(archive[idx]->path[0], "r"); in xa_convert_sfx()
1539 xa_run_command(archive[idx], command); in xa_convert_sfx()
1626 archive_not_sfx = fopen(archive[idx]->path[0], "r"); in xa_convert_sfx()
1644 xa_run_command(archive[idx], command); in xa_convert_sfx()
1653 command = g_strconcat ("arj y -je1 " ,archive[idx]->path[1],NULL); in xa_convert_sfx()
1654 xa_run_command(archive[idx], command); in xa_convert_sfx()
1884 void xa_create_liststore (XArchive *archive, const gchar *titles[]) in xa_create_liststore() argument
1894 archive->liststore = gtk_list_store_newv(archive->columns, archive->column_types); in xa_create_liststore()
1895 gtk_tree_view_set_model ( GTK_TREE_VIEW (archive->treeview),GTK_TREE_MODEL (archive->liststore)); in xa_create_liststore()
1897 archive->model = GTK_TREE_MODEL(archive->liststore); in xa_create_liststore()
1901 gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(archive->model), 1, GTK_SORT_ASCENDING); in xa_create_liststore()
1902 archive->sorted = TRUE; in xa_create_liststore()
1905 …le_set_sort_func(GTK_TREE_SORTABLE(archive->liststore), 1, (GtkTreeIterCompareFunc) xa_sort_dirs_b… in xa_create_liststore()
1907 g_object_ref(archive->model); in xa_create_liststore()
1908 gtk_tree_view_set_model(GTK_TREE_VIEW(archive->treeview),NULL); in xa_create_liststore()
1912 archive->pixbuf_renderer = gtk_cell_renderer_pixbuf_new(); in xa_create_liststore()
1913 gtk_tree_view_column_pack_start(column, archive->pixbuf_renderer, FALSE); in xa_create_liststore()
1914 gtk_tree_view_column_set_attributes(column, archive->pixbuf_renderer, "pixbuf", 0, NULL); in xa_create_liststore()
1916 archive->text_renderer = gtk_cell_renderer_text_new(); in xa_create_liststore()
1917 gtk_tree_view_column_pack_start(column, archive->text_renderer, TRUE); in xa_create_liststore()
1918 gtk_tree_view_column_set_attributes(column, archive->text_renderer, "text", 1, NULL); in xa_create_liststore()
1922 gtk_tree_view_append_column (GTK_TREE_VIEW (archive->treeview),column); in xa_create_liststore()
1924 …g_signal_connect(archive->text_renderer, "editing-canceled", G_CALLBACK(xa_rename_cell_edited_canc… in xa_create_liststore()
1925 g_signal_connect(archive->text_renderer, "edited", G_CALLBACK(xa_rename_cell_edited), archive); in xa_create_liststore()
1928 for (i = 0; i < archive->columns - 3; i++) in xa_create_liststore()
1934 gtk_tree_view_append_column(GTK_TREE_VIEW(archive->treeview), column); in xa_create_liststore()
1940 gtk_tree_view_append_column(GTK_TREE_VIEW(archive->treeview), column); in xa_create_liststore()
1965 kill (multi_extract_window->archive->child_pid,SIGINT); in xa_cancel_archive()
1969 if (archive[idx]->status == XARCHIVESTATUS_ADD || archive[idx]->status == XARCHIVESTATUS_SFX) in xa_cancel_archive()
1975 if (archive[idx]->child_pid) in xa_cancel_archive()
1976 kill (archive[idx]->child_pid,SIGINT); in xa_cancel_archive()
1994 if (stat(archive[idx]->path[0], &my_stat) == 0) in xa_archive_properties()
1999 dummy_string = g_path_get_basename(archive[idx]->path[1]); in xa_archive_properties()
2005 dummy_string = xa_remove_level_from_path(archive[idx]->path[0]); in xa_archive_properties()
2015 gtk_label_set_text(GTK_LABEL(type_data), xa_get_archive_format(archive[idx])); in xa_archive_properties()
2017 …t = g_strconcat(archiver[archive[idx]->type].program[0], archiver[archive[idx]->type].program[1] ?… in xa_archive_properties()
2032 t = xa_set_size_string(archive[idx]->files_size); in xa_archive_properties()
2036 if (archive[idx]->has_comment) in xa_archive_properties()
2044 content_size = (double) archive[idx]->files_size / file_size; in xa_archive_properties()
2052 t = g_strdup_printf("%u", archive[idx]->files); in xa_archive_properties()
2056 if (archive[idx]->has_password) in xa_archive_properties()
2063 void xa_set_statusbar_message_for_displayed_rows(XArchive *archive) in xa_set_statusbar_message_for_displayed_rows() argument
2074 …if (! GTK_IS_TREE_MODEL(archive->model) || gtk_tree_model_get_iter (archive->model,&iter,path) == … in xa_set_statusbar_message_for_displayed_rows()
2083 gtk_tree_model_get(archive->model, &iter, archive->size_column, &size, -1); in xa_set_statusbar_message_for_displayed_rows()
2084 gtk_tree_model_get(archive->model, &iter, archive->columns - 1, &entry, -1); in xa_set_statusbar_message_for_displayed_rows()
2091 while (gtk_tree_model_iter_next (archive->model,&iter)); in xa_set_statusbar_message_for_displayed_rows()
2097 void xa_row_selected (GtkTreeSelection *selection,XArchive *archive) in xa_row_selected() argument
2118 gtk_widget_set_sensitive(delete_menu, archive->can_delete); in xa_row_selected()
2119 gtk_widget_set_sensitive(rename_menu, selected == 1 ? can_rename(archive) : FALSE); in xa_row_selected()
2125 gtk_tree_model_get_iter(archive->model, &iter, list->data); in xa_row_selected()
2126 gtk_tree_model_get(archive->model, &iter, archive->size_column, &size, -1); in xa_row_selected()
2127 gtk_tree_model_get(archive->model, &iter, archive->columns - 1, &entry, -1); in xa_row_selected()
2142 void drag_begin (GtkWidget *widget, GdkDragContext *context, XArchive *archive) in drag_begin() argument
2149 if (archive->child_pid) in drag_begin()
2160 gtk_tree_model_get_iter(archive->model,&iter,(GtkTreePath*) (row_list->data)); in drag_begin()
2161 gtk_tree_model_get(GTK_TREE_MODEL(archive->liststore), &iter, archive->columns - 1, &entry, -1); in drag_begin()
2173 …widget, GdkDragContext *context, GtkSelectionData *data, guint info, guint time, XArchive *archive) in drag_data_get() argument
2182 if (archive->child_pid) in drag_data_get()
2185 selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (archive->treeview)); in drag_data_get()
2217 if (archive->has_password) in drag_data_get()
2219 if (!xa_check_password(archive)) in drag_data_get()
2242archive->do_full_path = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(extract_window->extract_ful… in drag_data_get()
2243archive->do_overwrite = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(extract_window->overwrite_c… in drag_data_get()
2244 g_free(archive->extraction_dir); in drag_data_get()
2245 archive->extraction_dir = xa_escape_bad_chars(extraction_dir, ESCAPES); in drag_data_get()
2248 archive->status = XARCHIVESTATUS_EXTRACT; in drag_data_get()
2249 (*archive->archiver->extract) (archive,names); in drag_data_get()
2306 archive[idx] = xa_new_archive_dialog(filename, archive); in on_drag_data_received()
2307 if (archive[idx] == NULL) in on_drag_data_received()
2309 xa_add_page (archive[idx]); in on_drag_data_received()
2314 if (!archive[idx]->can_add) in on_drag_data_received()
2321 archive[idx]->child_dir = g_filename_from_uri(current_dir, NULL, NULL); in on_drag_data_received()
2329archive[idx]->do_full_path = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(add_window->store_path… in on_drag_data_received()
2330 …xa_execute_add_commands(archive[idx], list, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(prefs_w… in on_drag_data_received()
2342 gtk_tree_model_get(model, iter, archive[idx]->columns - 1, &entry, -1); in xa_concat_selected_filenames()
2357 …gtk_tree_selection_select_all ( gtk_tree_view_get_selection (GTK_TREE_VIEW (archive[idx]->treeview… in xa_select_all()
2368 …gtk_tree_selection_unselect_all (gtk_tree_view_get_selection(GTK_TREE_VIEW(archive[idx]->treeview)… in xa_deselect_all()
2428 if (archive[idx] == NULL) in xa_enter_password()
2432 g_free(archive[idx]->password); in xa_enter_password()
2433 archive[idx]->password = NULL; in xa_enter_password()
2436 xa_check_password(archive[idx]); in xa_enter_password()
2498 if (archive[idx]->comment) in xa_show_archive_comment()
2500 if (g_utf8_validate(archive[idx]->comment->str, -1, NULL)) in xa_show_archive_comment()
2502 utf8_line = g_strdup(archive[idx]->comment->str); in xa_show_archive_comment()
2506 utf8_line = g_locale_to_utf8(archive[idx]->comment->str, -1, NULL, &len, NULL); in xa_show_archive_comment()
2529 xa_update_window_with_archive_entries(archive[idx],new_entry); in xa_location_entry_activated()
2534 new_entry = xa_find_entry_from_dirpath(archive[idx], pathname_local); in xa_location_entry_activated()
2538 if (archive[idx]->location_path) in xa_location_entry_activated()
2540 gchar *entry_utf8 = g_filename_display_name(archive[idx]->location_path); in xa_location_entry_activated()
2547 if (archive[idx]->location_path) in xa_location_entry_activated()
2548 prev_entry = xa_find_entry_from_dirpath(archive[idx], archive[idx]->location_path); in xa_location_entry_activated()
2551 archive[idx]->back = g_slist_prepend(archive[idx]->back,prev_entry); in xa_location_entry_activated()
2553 archive[idx]->back = g_slist_prepend(archive[idx]->back,NULL); in xa_location_entry_activated()
2556 xa_update_window_with_archive_entries(archive[idx],new_entry); in xa_location_entry_activated()
2559 gboolean xa_mouse_button_event (GtkWidget *widget, GdkEventButton *event, XArchive *archive) in xa_mouse_button_event() argument
2571 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(archive->treeview)); in xa_mouse_button_event()
2573 …gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(archive->treeview), event->x, event->y, &path, NULL, N… in xa_mouse_button_event()
2580 gtk_tree_model_get_iter(GTK_TREE_MODEL(archive->liststore), &iter, path); in xa_mouse_button_event()
2581 gtk_tree_model_get(archive->model, &iter, archive->columns - 1, &entry, -1); in xa_mouse_button_event()
2591 xa_treeview_row_activated(GTK_TREE_VIEW(archive->treeview), path, NULL, archive); in xa_mouse_button_event()
2594 gtk_widget_set_sensitive(open_popupmenu, !entry->is_dir && archive->can_extract); in xa_mouse_button_event()
2595 gtk_widget_set_sensitive(view, (selected == 1) && !entry->is_dir && archive->can_extract); in xa_mouse_button_event()
2596 gtk_widget_set_sensitive(rrename, (selected == 1) && !entry->is_dir && can_rename(archive)); in xa_mouse_button_event()
2606 pasteable = (strcmp(archive->path[1], paste_data->target->path[1]) != 0); in xa_mouse_button_event()
2609 gtk_widget_set_sensitive(eextract, archive->can_extract); in xa_mouse_button_event()
2610 gtk_widget_set_sensitive(cut, archive->can_extract && archive->can_delete); in xa_mouse_button_event()
2611 gtk_widget_set_sensitive(copy, archive->can_extract); in xa_mouse_button_event()
2612 gtk_widget_set_sensitive(paste, pasteable && archive->can_add); in xa_mouse_button_event()
2613 gtk_widget_set_sensitive(ddelete, archive->can_delete); in xa_mouse_button_event()
2631 xa_clipboard_cut_copy_operation(archive[idx],XA_CLIPBOARD_CUT); in xa_clipboard_cut()
2639 xa_clipboard_cut_copy_operation(archive[idx],XA_CLIPBOARD_COPY); in xa_clipboard_copy()
2661 archive[idx]->do_full_path = FALSE; in xa_clipboard_paste()
2662 archive[idx]->child_dir = g_strdup(paste_data->target->working_dir); in xa_clipboard_paste()
2663 xa_execute_add_commands(archive[idx], list, FALSE, NULL); in xa_clipboard_paste()
2664 if (archive[idx]->status == XARCHIVESTATUS_ERROR) in xa_clipboard_paste()
2677 void xa_clipboard_clear (GtkClipboard *clipboard, XArchive *archive) in xa_clipboard_clear() argument
2679 if (archive->clipboard != NULL) in xa_clipboard_clear()
2681 if (archive->clipboard->files != NULL) in xa_clipboard_clear()
2683 g_slist_free_full(archive->clipboard->files, g_free); in xa_clipboard_clear()
2684 archive->clipboard->files = NULL; in xa_clipboard_clear()
2687 g_free(archive->clipboard); in xa_clipboard_clear()
2688 archive->clipboard = NULL; in xa_clipboard_clear()
2702 selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (archive[idx]->treeview)); in xa_rename_archive()
2703 model = gtk_tree_view_get_model(GTK_TREE_VIEW (archive[idx]->treeview)); in xa_rename_archive()
2706 g_object_set(archive[idx]->text_renderer, "editable", TRUE, NULL); in xa_rename_archive()
2708 column = gtk_tree_view_get_column(GTK_TREE_VIEW (archive[idx]->treeview),0); in xa_rename_archive()
2709 gtk_tree_view_set_cursor(GTK_TREE_VIEW(archive[idx]->treeview),row_list->data,column,TRUE); in xa_rename_archive()
2729 selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (archive[idx]->treeview)); in xa_open_with_from_popupmenu()
2730 row_list = gtk_tree_selection_get_selected_rows(selection,&archive[idx]->model); in xa_open_with_from_popupmenu()
2737 gtk_tree_model_get_iter(archive[idx]->model,&iter,row_list->data); in xa_open_with_from_popupmenu()
2738 gtk_tree_model_get(archive[idx]->model, &iter, archive[idx]->columns - 1, &entry, -1); in xa_open_with_from_popupmenu()
2742 if (!xa_check_password(archive[idx])) in xa_open_with_from_popupmenu()
2749 g_free(archive[idx]->extraction_dir); in xa_open_with_from_popupmenu()
2750 xa_create_working_directory(archive[idx]); in xa_open_with_from_popupmenu()
2751 archive[idx]->extraction_dir = g_strdup(archive[idx]->working_dir); in xa_open_with_from_popupmenu()
2753 archive[idx]->do_full_path = FALSE; in xa_open_with_from_popupmenu()
2754 archive[idx]->do_overwrite = TRUE; in xa_open_with_from_popupmenu()
2757 archive[idx]->status = XARCHIVESTATUS_EXTRACT; in xa_open_with_from_popupmenu()
2758 result = (*archive[idx]->archiver->extract) (archive[idx],list); in xa_open_with_from_popupmenu()
2762 chdir(archive[idx]->working_dir); in xa_open_with_from_popupmenu()
2791 xa_create_working_directory(archive[idx]); in xa_view_from_popupmenu()
2793 selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (archive[idx]->treeview)); in xa_view_from_popupmenu()
2794 row_list = gtk_tree_selection_get_selected_rows(selection,&archive[idx]->model); in xa_view_from_popupmenu()
2795 gtk_tree_model_get_iter(archive[idx]->model,&iter,row_list->data); in xa_view_from_popupmenu()
2796 gtk_tree_model_get(archive[idx]->model, &iter, archive[idx]->columns - 1, &entry, -1); in xa_view_from_popupmenu()
2803 if (!xa_check_password(archive[idx])) in xa_view_from_popupmenu()
2807 filename = g_strconcat(archive[idx]->working_dir, "/", entry_local, NULL); in xa_view_from_popupmenu()
2811 g_free(archive[idx]->extraction_dir); in xa_view_from_popupmenu()
2812 archive[idx]->extraction_dir = g_strdup(archive[idx]->working_dir); in xa_view_from_popupmenu()
2813 archive[idx]->do_full_path = FALSE; in xa_view_from_popupmenu()
2814 archive[idx]->do_overwrite = TRUE; in xa_view_from_popupmenu()
2816 archive[idx]->status = XARCHIVESTATUS_EXTRACT; in xa_view_from_popupmenu()
2817 result = (*archive[idx]->archiver->extract) (archive[idx],list); in xa_view_from_popupmenu()
2826 …row_activated(GtkTreeView *tree_view,GtkTreePath *path,GtkTreeViewColumn *column,XArchive *archive) in xa_treeview_row_activated() argument
2834 if (! gtk_tree_model_get_iter (GTK_TREE_MODEL (archive->liststore),&iter,path)) in xa_treeview_row_activated()
2837 gtk_tree_model_get(GTK_TREE_MODEL(archive->liststore), &iter, archive->columns - 1, &entry, -1); in xa_treeview_row_activated()
2840 if (archive->location_path) in xa_treeview_row_activated()
2841archive->back = g_slist_prepend(archive->back, xa_find_entry_from_dirpath(archive, archive->locati… in xa_treeview_row_activated()
2844 archive->back = g_slist_prepend(archive->back,NULL); in xa_treeview_row_activated()
2852 if (!xa_check_password(archive)) in xa_treeview_row_activated()
2855 g_free(archive->extraction_dir); in xa_treeview_row_activated()
2856 xa_create_working_directory(archive); in xa_treeview_row_activated()
2857 archive->extraction_dir = g_strdup(archive->working_dir); in xa_treeview_row_activated()
2860 archive->do_full_path = FALSE; in xa_treeview_row_activated()
2861 archive->do_overwrite = TRUE; in xa_treeview_row_activated()
2862 archive->status = XARCHIVESTATUS_EXTRACT; in xa_treeview_row_activated()
2863 result = (*archive->archiver->extract) (archive,names); in xa_treeview_row_activated()
2868 file = g_strconcat(archive->working_dir, "/", entry_local, NULL); in xa_treeview_row_activated()
2875 void xa_update_window_with_archive_entries (XArchive *archive,XEntry *entry) in xa_update_window_with_archive_entries() argument
2886 if (archive->status == XARCHIVESTATUS_RELOAD && archive->location_path != NULL) in xa_update_window_with_archive_entries()
2888 entry = xa_find_entry_from_dirpath(archive, archive->location_path); in xa_update_window_with_archive_entries()
2890 if (entry) location_path = g_strdup(archive->location_path); in xa_update_window_with_archive_entries()
2893 archive->current_entry = entry; in xa_update_window_with_archive_entries()
2895 g_free(archive->location_path); in xa_update_window_with_archive_entries()
2896 archive->location_path = NULL; in xa_update_window_with_archive_entries()
2901 entry = archive->root_entry->child; in xa_update_window_with_archive_entries()
2911 reload = (archive->status == XARCHIVESTATUS_RELOAD); in xa_update_window_with_archive_entries()
2912 gtk_widget_set_sensitive(back_button, archive->back != NULL); in xa_update_window_with_archive_entries()
2915 archive->location_path = xa_build_full_path_name_from_entry(entry); in xa_update_window_with_archive_entries()
2916 entry_utf8 = g_filename_display_name(archive->location_path); in xa_update_window_with_archive_entries()
2921 gtk_list_store_clear(archive->liststore); in xa_update_window_with_archive_entries()
2926 gtk_list_store_prepend(archive->liststore, &iter); in xa_update_window_with_archive_entries()
2964 gtk_list_store_set(archive->liststore, &iter, archive->columns - 1, entry, -1); in xa_update_window_with_archive_entries()
2965 gtk_list_store_set (archive->liststore,&iter,0,pixbuf,1,entry->filename,-1); in xa_update_window_with_archive_entries()
2967 for (i = 2; i < archive->columns - 1; i++) in xa_update_window_with_archive_entries()
2969 switch(archive->column_types[i]) in xa_update_window_with_archive_entries()
2973 gtk_list_store_set(archive->liststore, &iter, i, *(gchar **) current_column, -1); in xa_update_window_with_archive_entries()
2979 gtk_list_store_set(archive->liststore, &iter, i, *(guint64 *) current_column, -1); in xa_update_window_with_archive_entries()
2986 xa_fill_dir_sidebar(archive, reload); in xa_update_window_with_archive_entries()
2990 entry = xa_find_entry_from_dirpath(archive, location_path); in xa_update_window_with_archive_entries()
2997 xa_set_statusbar_message_for_displayed_rows(archive); in xa_update_window_with_archive_entries()
3018 …gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(archive[idx]->model), GTK_TREE_SORTABLE_UNS… in xa_unsort()
3020 archive[idx]->sorted = FALSE; in xa_unsort()
3022 status = archive[idx]->status; in xa_unsort()
3023 archive[idx]->status = XARCHIVESTATUS_RELOAD; in xa_unsort()
3024 xa_update_window_with_archive_entries(archive[idx], NULL); in xa_unsort()
3025 archive[idx]->status = status; in xa_unsort()