[Extractor-gtk-cvslog] extractor extractor.c,1.3,1.4
Extract files from unusual archive formats
Brought to you by:
someone-guy
From: Reimar Döf. <som...@us...> - 2005-12-19 19:21:58
|
Update of /cvsroot/extractor-gtk/extractor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27759 Modified Files: extractor.c Log Message: Make file list sortable and add description labels for buttons Index: extractor.c =================================================================== RCS file: /cvsroot/extractor-gtk/extractor/extractor.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** extractor.c 18 Dec 2005 14:10:38 -0000 1.3 --- extractor.c 19 Dec 2005 19:21:42 -0000 1.4 *************** *** 169,174 **** --- 169,177 ---- GtkWidget *scrollwin; GtkWidget *treeview; + GtkWidget *lbl; GtkTreeViewColumn *column; GtkCellRenderer *renderer; + GtkTreeModel *sort; + int row = 0, col = 0; gtk_disable_setlocale(); *************** *** 183,186 **** --- 186,231 ---- gtk_container_add(GTK_CONTAINER(window), table); + scrollwin = gtk_scrolled_window_new(NULL, NULL); + gtk_table_attach(GTK_TABLE(table), scrollwin, col, col + 3, row, row + 1, + (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), + (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), 0, 0); + ftree = gtk_tree_store_new(N_COLS, coltypes[0], coltypes[1], coltypes[2], + coltypes[3]); + sort = gtk_tree_model_sort_new_with_model(GTK_TREE_MODEL(ftree)); + treeview = gtk_tree_view_new_with_model(sort); + gtk_tree_view_set_enable_search(GTK_TREE_VIEW(treeview), TRUE); + renderer = gtk_cell_renderer_text_new(); + column = gtk_tree_view_column_new_with_attributes(_("Filename"), renderer, + "text", FNAME_COL, NULL); + gtk_tree_view_column_set_sort_column_id(column, FNAME_COL); + gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column); + renderer = gtk_cell_renderer_text_new(); + column = gtk_tree_view_column_new_with_attributes(_("Size"), renderer, + "text", SIZE_COL, NULL); + gtk_tree_view_column_set_sort_column_id(column, SIZE_COL); + gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column); + renderer = gtk_cell_renderer_toggle_new(); + column = gtk_tree_view_column_new_with_attributes(_("Compressed"), renderer, + "active", COMPR_COL, NULL); + gtk_tree_view_column_set_sort_column_id(column, COMPR_COL); + gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column); + selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)); + gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE); + gtk_container_add(GTK_CONTAINER(scrollwin), treeview); + + row++; + col = 0; + lbl = gtk_label_new(_("Archive Filename")); + gtk_table_attach(GTK_TABLE(table), lbl, col, col + 1, row, row + 1, + (GtkAttachOptions)(GTK_FILL), + (GtkAttachOptions)(0), 5, 0); + col++; + lbl = gtk_label_new(_("Output Directory")); + gtk_table_attach(GTK_TABLE(table), lbl, col, col + 1, row, row + 1, + (GtkAttachOptions)(GTK_FILL), + (GtkAttachOptions)(0), 5, 0); + + row++; + col = 0; file_button = gtk_file_chooser_button_new(_("open"), GTK_FILE_CHOOSER_ACTION_OPEN); *************** *** 199,242 **** g_signal_connect(G_OBJECT(file_button), "selection-changed", G_CALLBACK(file_select), NULL); ! gtk_table_attach(GTK_TABLE(table), file_button, 0, 1, 1, 2, (GtkAttachOptions)(GTK_FILL), ! (GtkAttachOptions)(0), 0, 0); dir_button = gtk_file_chooser_button_new(_("select"), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER); ! gtk_table_attach(GTK_TABLE(table), dir_button, 1, 2, 1, 2, (GtkAttachOptions)(GTK_FILL), ! (GtkAttachOptions)(0), 0, 0); ! button = gtk_button_new_with_mnemonic(_("extract")); g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(extract_selected), NULL); ! gtk_table_attach(GTK_TABLE(table), button, 2, 3, 1, 2, (GtkAttachOptions)(GTK_FILL), ! (GtkAttachOptions)(0), 0, 0); ! ! scrollwin = gtk_scrolled_window_new(NULL, NULL); ! gtk_table_attach(GTK_TABLE(table), scrollwin, 0, 3, 0, 1, ! (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), ! (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), 0, 0); ! ftree = gtk_tree_store_new(N_COLS, coltypes[0], coltypes[1], coltypes[2], ! coltypes[3]); ! treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(ftree)); ! renderer = gtk_cell_renderer_text_new(); ! column = gtk_tree_view_column_new_with_attributes(_("Filename"), renderer, ! "text", FNAME_COL, NULL); ! gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column); ! renderer = gtk_cell_renderer_text_new(); ! column = gtk_tree_view_column_new_with_attributes(_("Size"), renderer, ! "text", SIZE_COL, NULL); ! gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column); ! renderer = gtk_cell_renderer_toggle_new(); ! column = gtk_tree_view_column_new_with_attributes(_("Compressed"), renderer, ! "active", COMPR_COL, NULL); ! gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column); ! selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)); ! gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE); ! gtk_container_add(GTK_CONTAINER(scrollwin), treeview); gtk_widget_show_all(window); gtk_main(); --- 244,267 ---- g_signal_connect(G_OBJECT(file_button), "selection-changed", G_CALLBACK(file_select), NULL); ! gtk_table_attach(GTK_TABLE(table), file_button, col, col + 1, row, row + 1, (GtkAttachOptions)(GTK_FILL), ! (GtkAttachOptions)(0), 5, 0); + col++; dir_button = gtk_file_chooser_button_new(_("select"), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER); ! gtk_table_attach(GTK_TABLE(table), dir_button, col, col + 1, row, row + 1, (GtkAttachOptions)(GTK_FILL), ! (GtkAttachOptions)(0), 5, 0); ! col++; ! button = gtk_button_new_with_mnemonic(_("extract selected")); g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(extract_selected), NULL); ! gtk_table_attach(GTK_TABLE(table), button, col, col + 1, row, row + 1, (GtkAttachOptions)(GTK_FILL), ! (GtkAttachOptions)(0), 5, 0); + gtk_window_set_default_size(GTK_WINDOW(window), -1, 400); gtk_widget_show_all(window); gtk_main(); |