[Xfce4-commits] r27192 - xarchiver/trunk/src
Giuseppe Torelli
colossus at xfce.org
Wed Jul 2 11:08:48 CEST 2008
Author: colossus
Date: 2008-07-02 09:08:48 +0000 (Wed, 02 Jul 2008)
New Revision: 27192
Modified:
xarchiver/trunk/src/archive.c
xarchiver/trunk/src/archive.h
xarchiver/trunk/src/bzip2.c
xarchiver/trunk/src/interface.c
xarchiver/trunk/src/interface.h
xarchiver/trunk/src/main.c
xarchiver/trunk/src/pref_dialog.c
xarchiver/trunk/src/pref_dialog.h
xarchiver/trunk/src/string_utils.c
xarchiver/trunk/src/window.c
xarchiver/trunk/src/window.h
xarchiver/trunk/src/zip.c
Log:
Changed the layout of the error dialog and delete confirmation buttons to Ok/Cancel.
Xarchiver now shows in a side bar the directories content of the archive (many thanks to John Berthels for helping me).
Added option Show archive dir tree in the Window tab of prefs dialog.
Fixed behaviour of error dialog when the 'Store archiver output' option is unchecked.
Fixed a small regression in xa_open_bzip2_lzma with the revision 27183.
Fixed deletion again from archives.
Fixed return error code in main.c:217
Deleted View option from the menu and from the toolbar.
No more errors are issued when opening an empty zip file.
Menu item Cmd-line output respects the settings in Store Archiver output.
Modified: xarchiver/trunk/src/archive.c
===================================================================
--- xarchiver/trunk/src/archive.c 2008-07-02 07:01:03 UTC (rev 27191)
+++ xarchiver/trunk/src/archive.c 2008-07-02 09:08:48 UTC (rev 27192)
@@ -168,7 +168,11 @@
{
status = g_io_channel_read_line (ioc, &line, NULL, NULL, NULL);
if (line != NULL)
- archive->error_output = g_slist_prepend (archive->error_output,line);
+ {
+ if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(prefs_window->store_output)))
+ archive->error_output = g_slist_prepend (archive->error_output,g_strdup(line));
+ g_free(line);
+ }
}
while (status == G_IO_STATUS_NORMAL);
if (status == G_IO_STATUS_ERROR || status == G_IO_STATUS_EOF)
@@ -351,7 +355,6 @@
break;
else if(xa_main_window)
gtk_main_iteration_do (FALSE);
- //usleep(1000); //give the processor time to rest (0.1 sec)
}
result = xa_check_child_for_error_on_exit(archive,status);
if (result == FALSE)
@@ -529,7 +532,7 @@
void xa_update_window_with_archive_entries (XArchive *archive,XEntry *entry)
{
GdkPixbuf *pixbuf = NULL;
- GtkTreeIter iter;
+ GtkTreeIter iter,dummy_iter;
unsigned short int i;
gpointer current_column;
@@ -610,6 +613,9 @@
}
entry = entry->next;
}
+ if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(archive_dir_model),&dummy_iter));
+ else
+ xa_browse_dir_sidebar(archive->root_entry,archive_dir_model,NULL,NULL);
}
XEntry* xa_find_entry_from_path (XEntry *root_entry,const gchar *fullpathname)
@@ -648,55 +654,58 @@
void xa_fill_list_with_recursed_entries(XEntry *entry,GString **p_file_list,gchar *current_path)
{
+ gchar *full_path, *_full_path = NULL;
+ gchar *quoted_path = NULL;
gint idx,current_page;
- gchar *full_path, *_dummy = NULL;
- gchar *quoted_path, *parent_dir = NULL;
if (entry == NULL)
return;
-
+
current_page = gtk_notebook_get_current_page (notebook);
idx = xa_find_archive_index (current_page);
- if (entry == archive[idx]->root_entry)
- parent_dir = "";
- else
- parent_dir = g_strdup(archive[idx]->location_entry_path);
-
/* Recurse to siblings with the same path */
- xa_fill_list_with_recursed_entries(entry->next,p_file_list,current_path);
+ if (entry->prev->is_dir)
+ xa_fill_list_with_recursed_entries(entry->next,p_file_list,current_path);
if (strlen(current_path) == 0)
full_path = g_strdup(entry->filename);
else
full_path = g_strconcat(current_path,"/",entry->filename,NULL);
- if (parent_dir)
- _dummy = g_strconcat (parent_dir,entry->filename,NULL);
+ if (entry->child)
+ {
+ xa_fill_list_with_recursed_entries(entry->child, p_file_list,full_path);
+ g_free(full_path);
+ }
else
- _dummy = g_strdup(entry->filename);
-
- quoted_path = g_shell_quote(_dummy);
- g_free(_dummy);
- *p_file_list = g_string_prepend (*p_file_list,quoted_path);
- *p_file_list = g_string_prepend_c (*p_file_list,' ');
- g_free(parent_dir);
- if (entry->child)
- xa_fill_list_with_recursed_entries(entry->child, p_file_list, full_path);
- g_free(full_path);
+ {
+ if (archive[idx]->location_entry_path != NULL)
+ {
+ if (entry->is_dir)
+ _full_path = g_strconcat(archive[idx]->location_entry_path,full_path,"/",NULL);
+ else
+ _full_path = g_strconcat(archive[idx]->location_entry_path,full_path,NULL);
+ g_free (full_path);
+ full_path = _full_path;
+ }
+ quoted_path = g_shell_quote(full_path);
+ *p_file_list = g_string_prepend (*p_file_list,quoted_path);
+ *p_file_list = g_string_prepend_c (*p_file_list,' ');
+ }
return;
}
void xa_entries_to_filelist(XEntry *entry,GString **p_file_list,gchar *current_path)
{
- gchar *full_path = NULL;
+ gchar *full_path;
gchar *quoted_path = NULL;
if (entry == NULL)
return;
-
+
/* Recurse to siblings with the same path */
- xa_entries_to_filelist(entry->next,p_file_list,current_path);
+ xa_entries_to_filelist(entry->next,p_file_list,current_path);
if (strlen(current_path) == 0)
full_path = g_strdup(entry->filename);
@@ -714,7 +723,6 @@
*p_file_list = g_string_prepend (*p_file_list,quoted_path);
*p_file_list = g_string_prepend_c (*p_file_list,' ');
}
- return;
}
gboolean xa_detect_encrypted_archive (XArchive *archive)
@@ -801,3 +809,28 @@
return flag;
}
+void xa_browse_dir_sidebar (XEntry *entry, GtkTreeStore *model,gchar *path, GtkTreeIter *containing_iter)
+{
+ GtkTreeIter child_iter;
+
+ if (!entry)
+ return;
+
+ if (strlen(entry->filename) == 0)
+ return xa_browse_dir_sidebar(entry->child, model, path, containing_iter);
+
+ if (entry->is_dir)
+ {
+ gtk_tree_store_append(model,&child_iter,containing_iter);
+ gtk_tree_store_set(model,&child_iter,0,"gtk-directory",1,entry->filename,2,"",-1);
+ }
+ xa_browse_dir_sidebar(entry->child,model,NULL,&child_iter);
+ xa_browse_dir_sidebar(entry->next, model,NULL,containing_iter);
+
+}
+
+void xa_clean_dir_sidebar()
+{
+ gtk_tree_store_clear(GTK_TREE_STORE(model));
+}
+
Modified: xarchiver/trunk/src/archive.h
===================================================================
--- xarchiver/trunk/src/archive.h 2008-07-02 07:01:03 UTC (rev 27191)
+++ xarchiver/trunk/src/archive.h 2008-07-02 09:08:48 UTC (rev 27192)
@@ -142,5 +142,7 @@
void xa_fill_list_with_recursed_entries(XEntry *entry,GString **p_file_list,gchar *current_path);
void xa_entries_to_filelist(XEntry *, GString **, gchar *);
gboolean xa_detect_encrypted_archive (XArchive *archive);
+void xa_browse_dir_sidebar (XEntry *, GtkTreeStore *,gchar *,GtkTreeIter *);
+void xa_clean_dir_sidebar();
XArchive *archive[100];
#endif
Modified: xarchiver/trunk/src/bzip2.c
===================================================================
--- xarchiver/trunk/src/bzip2.c 2008-07-02 07:01:03 UTC (rev 27191)
+++ xarchiver/trunk/src/bzip2.c 2008-07-02 09:08:48 UTC (rev 27192)
@@ -36,21 +36,23 @@
gboolean result;
dummy = g_string_new("");
- archive->delete = (void *)delete[archive->type];
- archive->add = (void *)add[archive->type];
- archive->extract = (void *)extract[archive->type];
-
if (g_str_has_suffix(archive->escaped_path,".tar.bz2") || g_str_has_suffix (archive->escaped_path,".tar.bz")
|| g_str_has_suffix ( archive->escaped_path , ".tbz") || g_str_has_suffix (archive->escaped_path,".tbz2") )
{
archive->type = XARCHIVETYPE_TAR_BZ2;
archive->format = "TAR.BZIP2";
+ archive->delete = (void *)delete[archive->type];
+ archive->add = (void *)add[archive->type];
+ archive->extract = (void *)extract[archive->type];
xa_open_tar_compressed_file(archive);
}
else if (g_str_has_suffix(archive->escaped_path,".tar.lzma") || g_str_has_suffix (archive->escaped_path,".tlz"))
{
archive->type = XARCHIVETYPE_TAR_LZMA;
archive->format = "TAR.LZMA";
+ archive->delete = (void *)delete[archive->type];
+ archive->add = (void *)add[archive->type];
+ archive->extract = (void *)extract[archive->type];
xa_open_tar_compressed_file(archive);
}
else
Modified: xarchiver/trunk/src/interface.c
===================================================================
--- xarchiver/trunk/src/interface.c 2008-07-02 07:01:03 UTC (rev 27191)
+++ xarchiver/trunk/src/interface.c 2008-07-02 09:08:48 UTC (rev 27192)
@@ -47,9 +47,10 @@
extern gboolean unrar;
-void xa_create_main_window (GtkWidget *xa_main_window,gboolean show_location)
+void xa_create_main_window (GtkWidget *xa_main_window,gboolean show_location,gboolean show_output_menu_item,gboolean show_sidebar)
{
GdkPixbuf *icon;
+
xa_create_popup_menu();
tooltips = gtk_tooltips_new ();
accel_group = gtk_accel_group_new ();
@@ -60,11 +61,11 @@
gtk_window_set_icon (GTK_WINDOW(xa_main_window),icon);
g_signal_connect (G_OBJECT (xa_main_window), "delete-event", G_CALLBACK (xa_quit_application), NULL);
- /* Create the menus */
- vbox1 = gtk_vbox_new (FALSE, 0);
+ vbox1 = gtk_vbox_new (FALSE,2);
gtk_widget_show (vbox1);
gtk_container_add (GTK_CONTAINER (xa_main_window), vbox1);
-
+
+ /* Create the menus */
menubar1 = gtk_menu_bar_new ();
gtk_widget_show (menubar1);
gtk_box_pack_start (GTK_BOX (vbox1), menubar1, FALSE, FALSE, 0);
@@ -156,16 +157,6 @@
gtk_container_add (GTK_CONTAINER (menuitem2_menu), delete_menu);
gtk_widget_add_accelerator (delete_menu, "activate",accel_group,GDK_d, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
- view_menu = gtk_image_menu_item_new_with_mnemonic (_("_View"));
- gtk_widget_set_sensitive (view_menu, FALSE);
- gtk_widget_show (view_menu);
- gtk_container_add (GTK_CONTAINER (menuitem2_menu), view_menu);
- gtk_widget_add_accelerator (view_menu, "activate",accel_group,GDK_v, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
-
- image2 = gtk_image_new_from_stock ("gtk-find", GTK_ICON_SIZE_MENU);
- gtk_widget_show (image2);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (view_menu), image2);
-
separatormenuitem3 = gtk_separator_menu_item_new ();
gtk_widget_show (separatormenuitem3);
gtk_container_add (GTK_CONTAINER (menuitem2_menu), separatormenuitem3);
@@ -226,17 +217,21 @@
view_shell_output1 = gtk_image_menu_item_new_with_mnemonic (_("C_md-line output"));
gtk_container_add (GTK_CONTAINER (menuitem2_menu), view_shell_output1);
gtk_widget_add_accelerator (view_shell_output1, "activate",accel_group,GDK_m, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
+ if (show_output_menu_item)
+ gtk_widget_set_sensitive(view_shell_output1,TRUE);
+ else
+ gtk_widget_set_sensitive(view_shell_output1,FALSE);
gtk_widget_show (view_shell_output1);
image2 = gtk_image_new_from_stock ("gtk-find-and-replace", GTK_ICON_SIZE_MENU);
gtk_widget_show (image2);
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (view_shell_output1), image2);
- password_entry = gtk_image_menu_item_new_with_mnemonic (_("Reset passwo_rd"));
- gtk_widget_show (password_entry);
- gtk_widget_set_sensitive ( password_entry , FALSE );
- gtk_container_add (GTK_CONTAINER (menuitem2_menu), password_entry);
- gtk_widget_add_accelerator (password_entry, "activate",accel_group,GDK_r, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
+ password_entry_menu = gtk_image_menu_item_new_with_mnemonic (_("Reset passwo_rd"));
+ gtk_widget_show (password_entry_menu);
+ gtk_widget_set_sensitive ( password_entry_menu , FALSE );
+ gtk_container_add (GTK_CONTAINER (menuitem2_menu), password_entry_menu);
+ gtk_widget_add_accelerator (password_entry_menu, "activate",accel_group,GDK_r, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
separatormenuitem6 = gtk_separator_menu_item_new ();
gtk_widget_show (separatormenuitem6);
@@ -352,15 +347,6 @@
gtk_container_add (GTK_CONTAINER (toolbar1), Extract_button);
gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (Extract_button), tooltips, _("Extract files"), NULL);
- tmp_image = gtk_image_new_from_stock ("gtk-find", tmp_toolbar_icon_size);
- gtk_widget_show (tmp_image);
- View_button = (GtkWidget*) gtk_tool_button_new (tmp_image, _("View"));
- gtk_widget_show (View_button);
- gtk_widget_set_sensitive (View_button,FALSE);
- gtk_tool_item_set_homogeneous (GTK_TOOL_ITEM (View_button), FALSE);
- gtk_container_add (GTK_CONTAINER (toolbar1), View_button);
- gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (View_button), tooltips, _("View file with an external editor/viewer"), NULL);
-
separatortoolitem2 = (GtkWidget*) gtk_separator_tool_item_new ();
gtk_widget_show (separatortoolitem2);
gtk_container_add (GTK_CONTAINER (toolbar1), separatortoolitem2);
@@ -394,9 +380,47 @@
if (show_location)
gtk_widget_show_all(toolbar2);
+ /* Create the paned widgets */
+ hpaned1 = gtk_hpaned_new ();
+ gtk_widget_show (hpaned1);
+ gtk_box_pack_start (GTK_BOX (vbox1),hpaned1,TRUE,TRUE,0);
+ //gtk_paned_set_position (GTK_PANED (hpaned1),200);
+
+ scrolledwindow2 = gtk_scrolled_window_new (NULL, NULL);
+ if (show_sidebar)
+ gtk_widget_show (scrolledwindow2);
+ else
+ gtk_widget_hide (scrolledwindow2);
+ gtk_paned_pack1 (GTK_PANED (hpaned1), scrolledwindow2, FALSE, TRUE);
+ g_object_set (G_OBJECT (scrolledwindow2),"hscrollbar-policy", GTK_POLICY_AUTOMATIC,"vscrollbar-policy", GTK_POLICY_AUTOMATIC, NULL);
+
+ archive_dir_model = gtk_tree_store_new (3,G_TYPE_STRING,G_TYPE_STRING,G_TYPE_STRING);
+ archive_dir_treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(archive_dir_model));
+ gtk_container_add (GTK_CONTAINER (scrolledwindow2), archive_dir_treeview);
+ gtk_widget_show(archive_dir_treeview);
+ gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (archive_dir_treeview), FALSE);
+ gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(archive_dir_model),1,GTK_SORT_ASCENDING);
+
+ /*g_signal_connect (G_OBJECT (archive_dir_treeview),"row-expanded",G_CALLBACK(xa_expand_dir),dialog_data->destination_path_entry);
+ g_signal_connect (G_OBJECT (archive_dir_treeview),"row-activated",G_CALLBACK(xa_row_activated),dialog_data->destination_path_entry);
+ GtkTreeSelection *sel = gtk_tree_view_get_selection(GTK_TREE_VIEW (archive_dir_treeview));
+ g_signal_connect (sel,"changed",G_CALLBACK (xa_tree_view_row_selected),dialog_data->destination_path_entry);*/
+
+ column = gtk_tree_view_column_new();
+ archive_dir_renderer = gtk_cell_renderer_pixbuf_new();
+ gtk_tree_view_column_pack_start(column,archive_dir_renderer,FALSE);
+ gtk_tree_view_column_set_attributes(column,archive_dir_renderer, "stock-id",0,NULL);
+
+ archive_dir_renderer = gtk_cell_renderer_text_new();
+ gtk_tree_view_column_pack_start(column,archive_dir_renderer,TRUE);
+ gtk_tree_view_column_set_attributes(column,archive_dir_renderer,"text",1,NULL);
+ gtk_tree_view_append_column (GTK_TREE_VIEW (archive_dir_treeview),column);
+ /*g_signal_connect (renderer, "editing-canceled",G_CALLBACK (xa_cell_edited_canceled),dialog_data);
+ g_signal_connect (renderer, "edited",G_CALLBACK (xa_cell_edited),dialog_data);*/
+
/* Create the notebook widget */
notebook = GTK_NOTEBOOK(gtk_notebook_new() );
- gtk_box_pack_start (GTK_BOX(vbox1), GTK_WIDGET(notebook),TRUE,TRUE,0);
+ gtk_paned_pack2(GTK_PANED (hpaned1),GTK_WIDGET(notebook),TRUE,TRUE);
gtk_notebook_set_tab_pos (notebook, GTK_POS_TOP);
gtk_notebook_set_scrollable (notebook,TRUE);
gtk_notebook_popup_enable (notebook);
@@ -438,12 +462,11 @@
g_signal_connect ((gpointer) select_all, "activate", G_CALLBACK (xa_select_all), NULL);
g_signal_connect ((gpointer) deselect_all, "activate", G_CALLBACK (xa_deselect_all), NULL);
g_signal_connect ((gpointer) select_pattern, "activate", G_CALLBACK (xa_create_delete_dialog), NULL);
- g_signal_connect ((gpointer) password_entry, "activate", G_CALLBACK (xa_reset_password), NULL);
+ g_signal_connect ((gpointer) password_entry_menu, "activate", G_CALLBACK (xa_reset_password), NULL);
g_signal_connect ((gpointer) prefs_menu, "activate", G_CALLBACK (xa_show_prefs_dialog), NULL);
g_signal_connect ((gpointer) close1, "activate", G_CALLBACK (xa_close_archive), NULL);
g_signal_connect ((gpointer) quit1, "activate", G_CALLBACK (xa_quit_application), NULL);
g_signal_connect ((gpointer) delete_menu, "activate", G_CALLBACK (xa_delete_archive), NULL);
- g_signal_connect ((gpointer) view_menu, "activate", G_CALLBACK (xa_view_file_inside_archive), NULL);
g_signal_connect ((gpointer) comment_menu, "activate", G_CALLBACK (xa_show_archive_comment), NULL);
g_signal_connect ((gpointer) help1, "activate", G_CALLBACK (xa_show_help), NULL);
g_signal_connect ((gpointer) about1, "activate", G_CALLBACK (xa_about), NULL);
@@ -458,7 +481,6 @@
g_signal_connect ((gpointer) AddFile_button,"clicked", G_CALLBACK (xa_add_files_archive), NULL);
g_signal_connect ((gpointer) Extract_button,"clicked", G_CALLBACK (xa_extract_archive), NULL);
- g_signal_connect ((gpointer) View_button, "clicked", G_CALLBACK (xa_view_file_inside_archive),NULL);
g_signal_connect ((gpointer) Stop_button, "clicked", G_CALLBACK (xa_cancel_archive), NULL);
g_signal_connect (xa_main_window, "key-press-event", G_CALLBACK (key_press_function), NULL);
@@ -514,23 +536,13 @@
selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW (archive[id]->treeview) );
gint selected = gtk_tree_selection_count_selected_rows ( selection );
if (selected == 0)
- xa_disable_delete_view_buttons (FALSE);
+ xa_disable_delete_buttons (FALSE);
else
{
if (archive[id]->type == XARCHIVETYPE_RAR && unrar)
gtk_widget_set_sensitive ( delete_menu , FALSE );
else if ( archive[id]->type != XARCHIVETYPE_RPM && archive[id]->type != XARCHIVETYPE_DEB )
gtk_widget_set_sensitive ( delete_menu , TRUE );
- if (selected > 1 )
- {
- gtk_widget_set_sensitive ( View_button , FALSE);
- gtk_widget_set_sensitive ( view_menu, FALSE );
- }
- else
- {
- gtk_widget_set_sensitive ( View_button , TRUE );
- gtk_widget_set_sensitive ( view_menu, TRUE );
- }
}
/* Let's set the location bar */
if (archive[id]->location_entry_path != NULL)
@@ -591,6 +603,7 @@
gtk_notebook_append_page_menu (notebook, archive->scrollwindow,page_hbox,tab_label);
gtk_notebook_set_current_page(notebook, -1);
gtk_notebook_set_tab_reorderable(notebook, archive->scrollwindow,TRUE);
+
archive->treeview = gtk_tree_view_new ();
gtk_container_add (GTK_CONTAINER (archive->scrollwindow), archive->treeview);
gtk_widget_show (archive->treeview);
@@ -611,71 +624,78 @@
void xa_close_page (GtkWidget *widget, gpointer data)
{
- xa_close_archive ( NULL , data );
+ xa_close_archive (NULL,data);
}
-gchar *password_dialog ()
+gchar *xa_create_password_dialog(gchar *archive_name)
{
- GtkWidget *passwd;
- GtkWidget *dialog_vbox1;
- GtkWidget *hbox1;
- GtkWidget *label1;
- GtkWidget *password_entry;
- GtkWidget *dialog_action_area1;
- GtkWidget *cancelbutton1;
- GtkWidget *okbutton1;
- gboolean done = FALSE;
+ GtkWidget *password_dialog,*dialog_vbox1,*vbox1,*hbox2,*image2,*vbox2,*label_pwd_required,*label_filename,*hbox1,*label34,*pw_password_entry;
gchar *password = NULL;
- gint current_page;
- gint idx;
+
+ password_dialog = gtk_dialog_new_with_buttons ("Xarchiver " VERSION,
+ GTK_WINDOW (xa_main_window), GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_STOCK_CANCEL,GTK_RESPONSE_CANCEL,GTK_STOCK_OK,GTK_RESPONSE_OK,NULL);
- current_page = gtk_notebook_get_current_page (notebook);
- idx = xa_find_archive_index (current_page);
+ gtk_container_set_border_width (GTK_CONTAINER (password_dialog), 6);
+ gtk_window_set_position (GTK_WINDOW (password_dialog), GTK_WIN_POS_CENTER_ON_PARENT);
+ gtk_window_set_resizable (GTK_WINDOW (password_dialog), FALSE);
+ gtk_window_set_type_hint (GTK_WINDOW (password_dialog), GDK_WINDOW_TYPE_HINT_DIALOG);
+ gtk_dialog_set_has_separator (GTK_DIALOG (password_dialog), FALSE);
- passwd = gtk_dialog_new ();
- gtk_window_set_title (GTK_WINDOW (passwd),_("Enter Archive Password"));
- gtk_window_set_type_hint (GTK_WINDOW (passwd), GDK_WINDOW_TYPE_HINT_DIALOG);
- gtk_window_set_transient_for ( GTK_WINDOW (passwd) , GTK_WINDOW (xa_main_window) );
- gtk_window_set_default_size(GTK_WINDOW(passwd), 300, 80);
+ dialog_vbox1 = GTK_DIALOG (password_dialog)->vbox;
+ gtk_widget_show (dialog_vbox1);
- dialog_vbox1 = GTK_DIALOG (passwd)->vbox;
- gtk_widget_show (dialog_vbox1);
+ vbox1 = gtk_vbox_new (FALSE, 12);
+ gtk_widget_show (vbox1);
+ gtk_box_pack_start (GTK_BOX (dialog_vbox1), vbox1, TRUE, TRUE, 0);
+ gtk_container_set_border_width (GTK_CONTAINER (vbox1), 6);
- hbox1 = gtk_hbox_new (FALSE, 0);
- gtk_widget_show (hbox1);
- gtk_box_pack_start (GTK_BOX (dialog_vbox1), hbox1, TRUE, FALSE, 0);
+ hbox2 = gtk_hbox_new (FALSE, 12);
+ gtk_widget_show (hbox2);
+ gtk_box_pack_start (GTK_BOX (vbox1), hbox2, TRUE, TRUE, 0);
- label1 = gtk_label_new (_("Password:"));
- gtk_widget_show (label1);
- gtk_box_pack_start (GTK_BOX (hbox1), label1, FALSE, FALSE, 0);
+ image2 = gtk_image_new_from_stock ("gtk-dialog-authentication", GTK_ICON_SIZE_DIALOG);
+ gtk_widget_show (image2);
+ gtk_box_pack_start (GTK_BOX (hbox2), image2, FALSE, TRUE, 0);
+ gtk_misc_set_alignment (GTK_MISC (image2), 0, 0);
- password_entry = gtk_entry_new ();
- gtk_box_pack_start (GTK_BOX (hbox1), password_entry, TRUE, TRUE, 0);
- gtk_entry_set_visibility (GTK_ENTRY (password_entry), FALSE);
- gtk_entry_set_activates_default(GTK_ENTRY(password_entry), TRUE);
+ vbox2 = gtk_vbox_new (FALSE, 0);
+ gtk_widget_show (vbox2);
+ gtk_box_pack_start (GTK_BOX (hbox2), vbox2, TRUE, TRUE, 0);
- if (current_page > 0 && archive[idx]->passwd != NULL)
- gtk_entry_set_text (GTK_ENTRY(password_entry),archive[idx]->passwd);
- gtk_widget_show (password_entry);
+ label_pwd_required = gtk_label_new (_("<span weight=\"bold\" size=\"larger\">Password required for</span>"));
+ gtk_widget_show (label_pwd_required);
+ gtk_box_pack_start (GTK_BOX (vbox2), label_pwd_required, FALSE, FALSE, 0);
+ gtk_label_set_use_markup (GTK_LABEL (label_pwd_required), TRUE);
+ gtk_misc_set_alignment (GTK_MISC (label_pwd_required), 0, 0.5);
- dialog_action_area1 = GTK_DIALOG (passwd)->action_area;
- gtk_widget_show (dialog_action_area1);
- gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END);
+ label_filename = gtk_label_new ("");
+ gtk_widget_show (label_filename);
+ gtk_box_pack_start (GTK_BOX (vbox2), label_filename, FALSE, FALSE, 12);
+ gtk_misc_set_alignment (GTK_MISC (label_filename), 0, 0.5);
- cancelbutton1 = gtk_button_new_from_stock ("gtk-cancel");
- gtk_widget_show (cancelbutton1);
- gtk_dialog_add_action_widget (GTK_DIALOG (passwd), cancelbutton1, GTK_RESPONSE_CANCEL);
- GTK_WIDGET_SET_FLAGS (cancelbutton1, GTK_CAN_DEFAULT);
+ if (archive_name != NULL)
+ gtk_label_set_text(GTK_LABEL(label_filename),archive_name);
+
+ hbox1 = gtk_hbox_new (FALSE, 5);
+ gtk_widget_show (hbox1);
+ gtk_box_pack_start (GTK_BOX (vbox2), hbox1, TRUE, TRUE, 0);
- okbutton1 = gtk_button_new_from_stock ("gtk-ok");
- gtk_widget_show (okbutton1);
- gtk_dialog_add_action_widget (GTK_DIALOG (passwd), okbutton1, GTK_RESPONSE_OK);
- GTK_WIDGET_SET_FLAGS (okbutton1, GTK_CAN_DEFAULT);
- gtk_dialog_set_default_response (GTK_DIALOG (passwd), GTK_RESPONSE_OK);
+ label34 = gtk_label_new_with_mnemonic (_("_Password:"));
+ gtk_widget_show (label34);
+ gtk_box_pack_start (GTK_BOX (hbox1), label34, FALSE, FALSE, 0);
- while ( ! done )
+ pw_password_entry = gtk_entry_new ();
+ gtk_widget_show (pw_password_entry);
+ gtk_box_pack_start (GTK_BOX (hbox1), pw_password_entry, TRUE, TRUE, 0);
+ gtk_entry_set_visibility (GTK_ENTRY (pw_password_entry), FALSE);
+ gtk_entry_set_invisible_char (GTK_ENTRY (pw_password_entry), 9679);
+ gtk_entry_set_activates_default (GTK_ENTRY (pw_password_entry), TRUE);
+ gtk_dialog_set_default_response (GTK_DIALOG (password_dialog), GTK_RESPONSE_OK);
+
+ while (! done)
{
- switch (gtk_dialog_run ( GTK_DIALOG (passwd ) ) )
+ switch (gtk_dialog_run (GTK_DIALOG(password_dialog)) )
{
case GTK_RESPONSE_CANCEL:
case GTK_RESPONSE_DELETE_EVENT:
@@ -684,7 +704,7 @@
break;
case GTK_RESPONSE_OK:
- password = g_strdup (gtk_entry_get_text ( GTK_ENTRY (password_entry) ));
+ password = g_strdup (gtk_entry_get_text(GTK_ENTRY(pw_password_entry)) );
if (strlen(password) == 0)
{
response = xa_show_message_dialog (GTK_WINDOW (xa_main_window),GTK_DIALOG_MODAL,GTK_MESSAGE_ERROR,GTK_BUTTONS_OK, _("You missed the password!"),_("Please enter it!") );
@@ -694,7 +714,7 @@
break;
}
}
- gtk_widget_destroy (passwd);
+ gtk_widget_destroy (password_dialog);
return password;
}
@@ -1220,3 +1240,9 @@
gtk_widget_set_sensitive(home_button,home);
}
+void xa_disable_delete_buttons (gboolean value)
+{
+ gtk_widget_set_sensitive (delete_menu,value);
+ //TODO: disable the popupmenu entries
+ //gtk_widget_set_sensitive (delete,value);
+}
Modified: xarchiver/trunk/src/interface.h
===================================================================
--- xarchiver/trunk/src/interface.h 2008-07-02 07:01:03 UTC (rev 27191)
+++ xarchiver/trunk/src/interface.h 2008-07-02 09:08:48 UTC (rev 27192)
@@ -72,11 +72,10 @@
GtkWidget *addfile;
GtkWidget *extract_menu;
GtkWidget *delete_menu;
-GtkWidget *view_menu;
GtkWidget *comment_menu;
GtkWidget *view_shell_output1;
GtkWidget *prefs_menu;
-GtkWidget *password_entry;
+GtkWidget *password_entry_menu;
GtkWidget *image1;
GtkWidget *image2;
GtkWidget *menuitem4;
@@ -102,15 +101,20 @@
GtkWidget *separatortoolitem3;
GtkWidget *AddFile_button;
GtkWidget *Extract_button;
-GtkWidget *View_button;
GtkWidget *Stop_button;
GtkWidget *toolitem1;
GtkWidget *location_label;
GtkWidget *location_entry;
+GtkWidget *hpaned1;
+GtkWidget *archive_dir_treeview,*scrolledwindow2;
+GtkTreeStore *archive_dir_model;
+GtkTreeViewColumn *column;
+GtkCellRenderer *archive_dir_renderer;
+GtkWidget *ebox;
GtkAccelGroup *accel_group;
GtkTooltips *tooltips;
-GtkWidget *ebox;
+
typedef struct
{
GtkWidget *dialog1;
@@ -118,12 +122,12 @@
GtkTextIter iter;
} widget_data;
-gchar *password_dialog();
+gchar *xa_create_password_dialog(gchar *archive_name);
void set_label (GtkWidget *label,gchar *text);
int xa_progressbar_pulse (gpointer data);
void xa_create_popup_menu();
widget_data *xa_create_output_window(gchar *);
-void xa_create_main_window (GtkWidget *xa_main_window,gboolean show_location);
+void xa_create_main_window (GtkWidget *xa_main_window,gboolean,gboolean,gboolean);
GtkWidget *create_archive_properties_window();
gboolean select_matched_rows(GtkTreeModel *model,GtkTreePath *path,GtkTreeIter *iter,gpointer data);
void xa_create_delete_dialog(GtkMenuItem *menuitem, gpointer user_data);
@@ -133,5 +137,6 @@
void xa_close_page (GtkWidget *widget, gpointer data);
void xa_set_button_state (gboolean,gboolean,gboolean,gboolean,gboolean, gboolean, gboolean,gboolean);
void xa_restore_navigation(int idx);
+void xa_disable_delete_buttons (gboolean value);
#endif
Modified: xarchiver/trunk/src/main.c
===================================================================
--- xarchiver/trunk/src/main.c 2008-07-02 07:01:03 UTC (rev 27191)
+++ xarchiver/trunk/src/main.c 2008-07-02 09:08:48 UTC (rev 27192)
@@ -128,7 +128,7 @@
if (xa_detect_encrypted_archive (archive))
{
archive->has_passwd = TRUE;
- archive->passwd = password_dialog (archive);
+ archive->passwd = xa_create_password_dialog(archive->escaped_path);
if (archive->passwd == NULL)
goto done;
}
@@ -214,22 +214,26 @@
g_list_free (ArchiveType);
if (archive != NULL)
xa_clean_archive_structure (archive);
- return status;
+ return WIFEXITED (status);
}
else
{
xa_main_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- xa_create_main_window (xa_main_window,gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (prefs_window->show_location_bar)));
+ xa_create_main_window (xa_main_window, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (prefs_window->show_location_bar)),
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (prefs_window->store_output)),
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (prefs_window->show_sidebar)));
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(prefs_window->check_save_geometry)) && prefs_window->geometry[0] != -1)
{
gtk_window_move (GTK_WINDOW(xa_main_window), prefs_window->geometry[0], prefs_window->geometry[1]);
gtk_window_set_default_size (GTK_WINDOW(xa_main_window), prefs_window->geometry[2], prefs_window->geometry[3]);
+ gtk_paned_set_position (GTK_PANED (hpaned1),prefs_window->geometry[4]);
}
else
{
gtk_window_set_position (GTK_WINDOW(xa_main_window),GTK_WIN_POS_CENTER);
gtk_window_set_default_size (GTK_WINDOW(xa_main_window), 600, 400);
+ gtk_paned_set_position (GTK_PANED (hpaned1),200);
}
Update_StatusBar ( _("Ready."));
gtk_widget_show (xa_main_window);
Modified: xarchiver/trunk/src/pref_dialog.c
===================================================================
--- xarchiver/trunk/src/pref_dialog.c 2008-07-02 07:01:03 UTC (rev 27191)
+++ xarchiver/trunk/src/pref_dialog.c 2008-07-02 09:08:48 UTC (rev 27192)
@@ -118,14 +118,15 @@
archive_type = g_list_next (archive_type);
}
- /*prefs_data->allow_dir_extract_with_dnd = gtk_check_button_new_with_mnemonic (_("Allow extracting dirs by drag and drop"));
- gtk_box_pack_start (GTK_BOX (vbox4), prefs_data->allow_dir_extract_with_dnd, FALSE, FALSE, 0);
- gtk_button_set_focus_on_click (GTK_BUTTON (prefs_data->allow_dir_extract_with_dnd), FALSE);*/
-
prefs_data->confirm_deletion = gtk_check_button_new_with_mnemonic (_("Confirm deletion of files"));
gtk_box_pack_start (GTK_BOX (vbox4), prefs_data->confirm_deletion, FALSE, FALSE, 0);
gtk_button_set_focus_on_click (GTK_BUTTON (prefs_data->confirm_deletion), FALSE);
+ prefs_data->check_sort_filename_column = gtk_check_button_new_with_mnemonic(_("Sort content by filename"));
+ gtk_box_pack_start (GTK_BOX (vbox4), prefs_data->check_sort_filename_column, FALSE, FALSE, 0);
+ gtk_button_set_focus_on_click (GTK_BUTTON (prefs_data->check_sort_filename_column), FALSE);
+ gtk_tooltips_set_tip(tooltips, prefs_data->check_sort_filename_column, _("The filename column is sort after loading the archive"), NULL);
+
prefs_data->store_output = gtk_check_button_new_with_mnemonic (_("Store archiver output"));
gtk_box_pack_start (GTK_BOX (vbox4), prefs_data->store_output, FALSE, FALSE, 0);
gtk_button_set_focus_on_click (GTK_BUTTON (prefs_data->store_output), FALSE);
@@ -178,14 +179,13 @@
(GtkAttachOptions) (GTK_SHRINK), 0, 0);
gtk_button_set_focus_on_click (GTK_BUTTON (prefs_data->check_show_comment), FALSE);
- prefs_data->check_sort_filename_column = gtk_check_button_new_with_mnemonic (_("Sort content by filename"));
- gtk_table_attach (GTK_TABLE (table1), prefs_data->check_sort_filename_column, 0, 2, 2, 3,
+ prefs_data->show_sidebar = gtk_check_button_new_with_mnemonic (_("Show archive tree sidebar"));
+ gtk_table_attach (GTK_TABLE (table1), prefs_data->show_sidebar, 0, 2, 2, 3,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (GTK_SHRINK), 0, 0);
- gtk_button_set_focus_on_click (GTK_BUTTON (prefs_data->check_sort_filename_column), FALSE);
- gtk_tooltips_set_tip(tooltips, prefs_data->check_sort_filename_column, _("The filename column is sort after loading the archive"), NULL);
+ gtk_button_set_focus_on_click (GTK_BUTTON (prefs_data->show_sidebar), FALSE);
- prefs_data->show_location_bar = gtk_check_button_new_with_mnemonic (_("Show location bar"));
+ prefs_data->show_location_bar = gtk_check_button_new_with_mnemonic (_("Show archive location bar"));
gtk_table_attach (GTK_TABLE (table1), prefs_data->show_location_bar, 0, 2, 4, 5,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (GTK_SHRINK), 0, 0);
@@ -310,6 +310,7 @@
//gtk_combo_box_set_active (GTK_COMBO_BOX(prefs_data->combo_archive_view),0);
gtk_combo_box_set_active (GTK_COMBO_BOX(prefs_data->combo_icon_size),0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (prefs_data->show_location_bar),TRUE);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (prefs_data->show_sidebar),TRUE);
gtk_combo_box_set_active (GTK_COMBO_BOX(prefs_data->combo_prefered_web_browser),0);
gtk_combo_box_set_active (GTK_COMBO_BOX(prefs_data->combo_prefered_editor),0);
@@ -327,14 +328,14 @@
GKeyFile *xa_key_file = g_key_file_new();
g_key_file_set_integer (xa_key_file,PACKAGE,"preferred_format",gtk_combo_box_get_active (GTK_COMBO_BOX(prefs_data->combo_prefered_format)));
- //key_file_set_boolean (xa_key_file,PACKAGE,"allow_ext_dir_by_dnd",gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (prefs_data->allow_dir_extract_with_dnd)));
g_key_file_set_boolean (xa_key_file,PACKAGE,"confirm_deletion",gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (prefs_data->confirm_deletion)));
+ g_key_file_set_boolean (xa_key_file,PACKAGE,"sort_filename_content",gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (prefs_data->check_sort_filename_column)));
g_key_file_set_boolean (xa_key_file,PACKAGE,"store_output",gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (prefs_data->store_output)));
//g_key_file_set_integer (xa_key_file,PACKAGE,"archive_view",gtk_combo_box_get_active (GTK_COMBO_BOX(prefs_data->combo_archive_view)));
g_key_file_set_integer (xa_key_file,PACKAGE,"icon_size",gtk_combo_box_get_active (GTK_COMBO_BOX(prefs_data->combo_icon_size)));
g_key_file_set_boolean (xa_key_file,PACKAGE,"show_archive_comment",gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (prefs_data->check_show_comment)));
- g_key_file_set_boolean (xa_key_file,PACKAGE,"sort_filename_content",gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (prefs_data->check_sort_filename_column)));
+ g_key_file_set_boolean (xa_key_file,PACKAGE,"show_sidebar",gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (prefs_data->show_sidebar)));
g_key_file_set_boolean (xa_key_file,PACKAGE,"show_location_bar",gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (prefs_data->show_location_bar)));
value = gtk_combo_box_get_active_text (GTK_COMBO_BOX(prefs_data->combo_prefered_web_browser));
@@ -361,11 +362,13 @@
g_key_file_set_string (xa_key_file,PACKAGE,"preferred_temp_dir",value);
g_free(value);
}
+
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(prefs_data->check_save_geometry)) )
{
+ prefs_data->geometry[4] = gtk_paned_get_position(GTK_PANED(hpaned1));
gtk_window_get_position (GTK_WINDOW(xa_main_window),&prefs_data->geometry[0],&prefs_data->geometry[1]);
gtk_window_get_size (GTK_WINDOW(xa_main_window),&prefs_data->geometry[2],&prefs_data->geometry[3]);
- g_key_file_set_integer_list(xa_key_file, PACKAGE, "geometry", prefs_data->geometry, 4);
+ g_key_file_set_integer_list(xa_key_file, PACKAGE, "geometry", prefs_data->geometry,5);
}
conf = g_key_file_to_data (xa_key_file, NULL, NULL);
len = strlen(conf);
@@ -412,7 +415,6 @@
{
/* set the options from the config file */
gtk_combo_box_set_active (GTK_COMBO_BOX(prefs_data->combo_prefered_format),g_key_file_get_integer(xa_key_file,PACKAGE,"preferred_format",NULL));
- //gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (prefs_data->allow_dir_extract_with_dnd),g_key_file_get_boolean(xa_key_file,PACKAGE,"allow_ext_dir_by_dnd",NULL));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (prefs_data->confirm_deletion),g_key_file_get_boolean(xa_key_file,PACKAGE,"confirm_deletion",NULL));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (prefs_data->store_output),g_key_file_get_boolean(xa_key_file,PACKAGE,"store_output",NULL));
@@ -421,6 +423,7 @@
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(prefs_data->check_show_comment),g_key_file_get_boolean(xa_key_file,PACKAGE,"show_archive_comment",NULL));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(prefs_data->check_sort_filename_column),g_key_file_get_boolean(xa_key_file,PACKAGE,"sort_filename_content",NULL));
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(prefs_data->show_sidebar),g_key_file_get_boolean(xa_key_file,PACKAGE,"show_sidebar",NULL));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(prefs_data->show_location_bar),g_key_file_get_boolean(xa_key_file,PACKAGE,"show_location_bar",NULL));
value = g_key_file_get_string(xa_key_file,PACKAGE,"preferred_web_browser",NULL);
@@ -470,6 +473,7 @@
prefs_data->geometry[1] = coords[1];
prefs_data->geometry[2] = coords[2];
prefs_data->geometry[3] = coords[3];
+ prefs_data->geometry[4] = coords[4];
}
}
g_key_file_free (xa_key_file);
@@ -522,7 +526,17 @@
gtk_widget_show_all (toolbar2);
else
gtk_widget_hide (toolbar2);
+
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(prefs_data->show_sidebar)))
+ gtk_widget_show(scrolledwindow2);
+ else
+ gtk_widget_hide(scrolledwindow2);
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(prefs_data->store_output)))
+ gtk_widget_set_sensitive(view_shell_output1,TRUE);
+ else
+ gtk_widget_set_sensitive(view_shell_output1,FALSE);
+
for (i = 0; i < gtk_notebook_get_n_pages(notebook) ; i++)
{
idx = xa_find_archive_index (i);
Modified: xarchiver/trunk/src/pref_dialog.h
===================================================================
--- xarchiver/trunk/src/pref_dialog.h 2008-07-02 07:01:03 UTC (rev 27191)
+++ xarchiver/trunk/src/pref_dialog.h 2008-07-02 09:08:48 UTC (rev 27192)
@@ -22,12 +22,12 @@
typedef struct
{
GtkWidget *dialog1,*dialog_vbox1,*combo_prefered_format;
- GtkWidget *allow_dir_extract_with_dnd, *confirm_deletion, *store_output,*combo_archive_view,*combo_icon_size;
- GtkWidget *check_show_comment, *check_sort_filename_column,*show_location_bar,*combo_prefered_viewer;
+ GtkWidget *confirm_deletion, *store_output,*combo_archive_view,*combo_icon_size;
+ GtkWidget *check_show_comment, *check_sort_filename_column,*show_location_bar,*show_sidebar,*combo_prefered_viewer;
GtkWidget *combo_prefered_web_browser, *combo_prefered_editor, *combo_prefered_temp_dir, *check_save_geometry,*prefs_notebook;
GtkListStore *prefs_liststore;
GtkTooltips *tooltips;
- gint geometry[4];
+ gint geometry[5];
} Prefs_dialog_data;
Prefs_dialog_data *xa_create_prefs_dialog ();
Modified: xarchiver/trunk/src/string_utils.c
===================================================================
--- xarchiver/trunk/src/string_utils.c 2008-07-02 07:01:03 UTC (rev 27191)
+++ xarchiver/trunk/src/string_utils.c 2008-07-02 09:08:48 UTC (rev 27192)
@@ -298,30 +298,30 @@
return retval;
}
-void xa_set_window_title (GtkWidget *window , gchar *title)
+void xa_set_window_title (GtkWidget *window,gchar *title)
{
gchar *x = NULL;
gchar *slash= NULL;
if (title == NULL)
- gtk_window_set_title (GTK_WINDOW (window) , "Xarchiver " VERSION);
+ gtk_window_set_title (GTK_WINDOW (window),"Xarchiver " VERSION);
else
{
slash = g_strrstr (title , "/");
if (slash == NULL)
{
- x = g_strconcat (title , " - " , "Xarchiver " , VERSION , NULL);
- gtk_window_set_title ( GTK_WINDOW (window) , x);
+ x = g_strconcat (title , " - ","Xarchiver ",VERSION,NULL);
+ gtk_window_set_title (GTK_WINDOW (window),x);
g_free (x);
return;
}
else
{
- x = g_strconcat (slash , " - " , "Xarchiver " , VERSION , NULL);
+ x = g_strconcat (slash, " - ","Xarchiver ",VERSION,NULL);
x++;
- gtk_window_set_title (GTK_WINDOW (window) , x);
+ gtk_window_set_title (GTK_WINDOW (window),x);
x--;
- g_free (x);
+ g_free(x);
}
}
}
@@ -341,7 +341,7 @@
i = 0;
while ((result != 0) && (patterns[i] != NULL))
{
- result = g_utf8_fnmatch (patterns[i], string, flags);
+ result = g_utf8_fnmatch (patterns[i],string,flags);
i++;
}
return (result == 0);
Modified: xarchiver/trunk/src/window.c
===================================================================
--- xarchiver/trunk/src/window.c 2008-07-02 07:01:03 UTC (rev 27191)
+++ xarchiver/trunk/src/window.c 2008-07-02 09:08:48 UTC (rev 27192)
@@ -51,10 +51,17 @@
{
if (WEXITSTATUS (status))
{
- xa_set_button_state (1,1,1,archive->can_add,archive->can_extract,0,archive->has_test,archive->has_properties);
+ if (WEXITSTATUS (status) == 1 && archive->type == XARCHIVETYPE_ZIP)
+ return TRUE;
Update_StatusBar ( _("Operation failed."));
- response = xa_show_message_dialog(GTK_WINDOW(xa_main_window),GTK_DIALOG_MODAL,GTK_MESSAGE_QUESTION,GTK_BUTTONS_YES_NO,_("An error occurred while accessing the archive."),_("Do you want to view the command line output?") );
- if (response == GTK_RESPONSE_YES)
+ if ( ! gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(prefs_window->store_output)))
+ {
+ response = xa_show_message_dialog(GTK_WINDOW(xa_main_window),GTK_DIALOG_MODAL,GTK_MESSAGE_ERROR,GTK_BUTTONS_OK,_("An error occurred!"),_("Please uncheck 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);
+ 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);
/* In case the user supplies a wrong password we reset it so he can try again */
if ( (archive->status == XA_ARCHIVESTATUS_TEST || archive->status == XA_ARCHIVESTATUS_SFX) && archive->passwd != NULL)
@@ -204,9 +211,9 @@
if ( xa_main_window != NULL && archive != NULL)
{
if (archive->has_passwd == FALSE && archive->passwd == NULL)
- gtk_widget_set_sensitive (password_entry,FALSE);
+ gtk_widget_set_sensitive (password_entry_menu,FALSE);
else
- gtk_widget_set_sensitive (password_entry,TRUE);
+ gtk_widget_set_sensitive (password_entry_menu,TRUE);
}
}
@@ -229,7 +236,7 @@
archive[current_page]->has_passwd = FALSE;
gtk_widget_set_sensitive(check_menu,FALSE);
gtk_widget_set_sensitive(properties,FALSE );
- xa_disable_delete_view_buttons(FALSE);
+ xa_disable_delete_buttons(FALSE);
Update_StatusBar ( _("Choose Add to begin creating the archive."));
@@ -342,7 +349,7 @@
archive[current_page]->status = XA_ARCHIVESTATUS_OPEN;
xa_add_page (archive[current_page]);
- xa_disable_delete_view_buttons (FALSE);
+ xa_disable_delete_buttons (FALSE);
g_free (path);
gtk_widget_set_sensitive (Stop_button,TRUE);
@@ -417,7 +424,7 @@
{
if ( archive[id]->passwd == NULL)
{
- archive[id]->passwd = password_dialog ();
+ archive[id]->passwd = xa_create_password_dialog (NULL);
if ( archive[id]->passwd == NULL)
return;
}
@@ -444,7 +451,7 @@
gtk_widget_set_sensitive (up_button,FALSE);
gtk_widget_set_sensitive (home_button,FALSE);
gtk_widget_set_sensitive (deselect_all,FALSE);
- xa_disable_delete_view_buttons (FALSE);
+ xa_disable_delete_buttons (FALSE);
xa_set_button_state (1,1,0,0,0,0,0,0);
xa_set_window_title (xa_main_window,NULL);
gtk_entry_set_text(GTK_ENTRY(location_entry),"");
@@ -537,8 +544,8 @@
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(prefs_window->confirm_deletion)))
{
- response = xa_show_message_dialog (GTK_WINDOW (xa_main_window),GTK_DIALOG_MODAL,GTK_MESSAGE_QUESTION,GTK_BUTTONS_YES_NO,"You are about to delete entries from the archive.",_( "Are you sure you want to do this?") );
- if (response == GTK_RESPONSE_NO || response == GTK_RESPONSE_DELETE_EVENT)
+ response = xa_show_message_dialog (GTK_WINDOW (xa_main_window),GTK_DIALOG_MODAL,GTK_MESSAGE_QUESTION,GTK_BUTTONS_OK_CANCEL,"You are about to delete entries from the archive.",_( "Are you sure you want to do this?") );
+ if (response == GTK_RESPONSE_CANCEL || response == GTK_RESPONSE_DELETE_EVENT)
return;
}
@@ -1194,7 +1201,7 @@
void xa_show_cmd_line_output (GtkMenuItem *menuitem)
{
GSList *output = NULL;
- widget_data *xa_cmd_line_output;
+ widget_data *xa_cmd_line_output = NULL;
gchar *line = NULL;
gchar *utf8_line;
gsize bytes_written;
@@ -1305,7 +1312,7 @@
{
if (archive[idx]->passwd == NULL)
{
- archive[idx]->passwd = password_dialog();
+ archive[idx]->passwd = xa_create_password_dialog(NULL);
if (archive[idx]->passwd == NULL)
return;
}
@@ -1480,23 +1487,13 @@
selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW (archive->treeview));
gint selected = gtk_tree_selection_count_selected_rows (selection);
if (selected == 0 )
- xa_disable_delete_view_buttons (FALSE);
+ xa_disable_delete_buttons (FALSE);
else
{
if (archive->type == XARCHIVETYPE_RAR && unrar)
gtk_widget_set_sensitive ( delete_menu,FALSE);
else if ( archive->type != XARCHIVETYPE_RPM && archive->type != XARCHIVETYPE_DEB)
gtk_widget_set_sensitive (delete_menu,TRUE);
- if (selected > 1 )
- {
- gtk_widget_set_sensitive (View_button,FALSE);
- gtk_widget_set_sensitive (view_menu,FALSE );
- }
- else
- {
- gtk_widget_set_sensitive (View_button,TRUE);
- gtk_widget_set_sensitive (view_menu,TRUE);
- }
}
}
@@ -1570,15 +1567,6 @@
gtk_label_set_text (GTK_LABEL(info_label),msg);
}
-void xa_disable_delete_view_buttons (gboolean value)
-{
- gtk_widget_set_sensitive (delete_menu,value);
- //TODO: disable the popupmenu entries
- //gtk_widget_set_sensitive (delete,value);
- gtk_widget_set_sensitive (View_button,value);
- gtk_widget_set_sensitive (view_menu,value);
-}
-
void drag_begin (GtkWidget *treeview1,GdkDragContext *context, gpointer data)
{
XArchive *archive = data;
@@ -1659,7 +1647,7 @@
{
if (archive->passwd == NULL)
{
- archive->passwd = password_dialog();
+ archive->passwd = xa_create_password_dialog(NULL);
if ( archive->passwd == NULL)
{
gtk_drag_finish (dc,FALSE,FALSE,t);
Modified: xarchiver/trunk/src/window.h
===================================================================
--- xarchiver/trunk/src/window.h 2008-07-02 07:01:03 UTC (rev 27191)
+++ xarchiver/trunk/src/window.h 2008-07-02 09:08:48 UTC (rev 27192)
@@ -103,7 +103,6 @@
void xa_shell_quote_filename (gchar *filename,GString *data,XArchive *archive);
void xa_cat_filenames (XArchive *archive,GSList *list,GString *data);
void xa_cat_filenames_basename (XArchive *archive,GSList *list,GString *data);
-void xa_disable_delete_view_buttons (gboolean value);
void Update_StatusBar (gchar *msg);
gchar *xa_open_file_dialog ();
Modified: xarchiver/trunk/src/zip.c
===================================================================
--- xarchiver/trunk/src/zip.c 2008-07-02 07:01:03 UTC (rev 27191)
+++ xarchiver/trunk/src/zip.c 2008-07-02 09:08:48 UTC (rev 27192)
@@ -240,7 +240,6 @@
archive->escaped_path , " -d ", archive->extraction_path,files->str,NULL);
g_string_free(files,TRUE);
list = g_slist_append(list,command);
-g_print ("%s\n",command);
xa_run_command (archive,list);
}
More information about the Xfce4-commits
mailing list