file-roller r2238 - in trunk: . src



Author: paobac
Date: Sun Apr 13 17:32:28 2008
New Revision: 2238
URL: http://svn.gnome.org/viewvc/file-roller?rev=2238&view=rev

Log:
2008-04-13  Paolo Bacchilega  <paobac svn gnome org>

	* src/fr-window.c: 
	
	Fixed bug #516043 â status bar / progress bar artifact

	* src/ui.h: 
	
	Added keyboard shortcut to deselect all.  Moved add files and add 
	folders	down in the edit menu.  Moved stop and reaload at the bottom of
	the view menu.  Removed the sort by submenu.
	
	* src/fr-window.h: 
	* src/fr-window.c: 
	* src/actions.c: 
	
	Allow to specify a password when converting an archive to another 
	format.


Modified:
   trunk/ChangeLog
   trunk/src/actions.c
   trunk/src/fr-command-rar.c
   trunk/src/fr-command-zip.c
   trunk/src/fr-window.c
   trunk/src/fr-window.h
   trunk/src/ui.h

Modified: trunk/src/actions.c
==============================================================================
--- trunk/src/actions.c	(original)
+++ trunk/src/actions.c	Sun Apr 13 17:32:28 2008
@@ -42,10 +42,27 @@
 #include "glib-utils.h"
 
 
+typedef struct {
+	FrWindow  *window;
+	
+	GtkWidget *file_sel;
+	GtkWidget *combo_box;
+	GtkWidget *password;
+} SaveAsData;
+
+
 /* -- new archive -- */
 
 
 static void
+new_archive_dialog_destroy_cb (GtkWidget  *w,
+		               SaveAsData *data)
+{
+	g_free (data);
+}
+
+
+static void
 new_archive (GtkWidget *file_sel,
 	     FrWindow  *window, 
 	     char      *uri)
@@ -87,16 +104,14 @@
 
 
 static char *
-get_full_path (GtkWidget *file_sel)
+get_full_path (SaveAsData *data)
 {
-	GtkWidget   *combo_box;
 	char        *full_path = NULL;
 	char        *path;
 	const char  *filename;
 	int          idx;
 
-	combo_box = g_object_get_data (G_OBJECT (file_sel), "fr_combo_box");
-	path = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (file_sel));
+	path = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (data->file_sel));
 
 	if ((path == NULL) || (*path == 0))
 		return NULL;
@@ -107,7 +122,7 @@
 		return NULL;
 	}
 
-	idx = gtk_combo_box_get_active (GTK_COMBO_BOX (combo_box));
+	idx = gtk_combo_box_get_active (GTK_COMBO_BOX (data->combo_box));
 	if (idx > 0) {
 		const char *path_ext = fr_archive_utils__get_file_name_ext (path);
 		char       *default_ext = file_type_desc[save_type[idx-1]].ext;
@@ -124,21 +139,20 @@
 
 
 static char *
-get_archive_filename_from_selector (FrWindow  *window,
-				    GtkWidget *file_sel)
+get_archive_filename_from_selector (SaveAsData *data)
 {
 	char      *path = NULL;
 	GFile     *file, *dir;
 	GFileInfo *info;
 	GError    *err = NULL;
 
-	path = get_full_path (file_sel);
+	path = get_full_path (data);
 	if ((path == NULL) || (*path == 0)) {
 		GtkWidget *dialog;
 
 		g_free (path);
 
-		dialog = _gtk_error_dialog_new (GTK_WINDOW (file_sel),
+		dialog = _gtk_error_dialog_new (GTK_WINDOW (data->file_sel),
 						GTK_DIALOG_DESTROY_WITH_PARENT,
 						NULL,
 						_("Could not create the archive"),
@@ -176,7 +190,7 @@
 		g_object_unref (file);
 		g_free (path);
 
-		dialog = _gtk_error_dialog_new (GTK_WINDOW (file_sel),
+		dialog = _gtk_error_dialog_new (GTK_WINDOW (data->file_sel),
 						GTK_DIALOG_DESTROY_WITH_PARENT,
 						NULL,
 						_("Could not create the archive"),
@@ -191,13 +205,11 @@
 	/* if the user did not specify a valid extension use the filetype combobox current type
 	 * or tar.gz if automatic is selected. */
 	if (fr_archive_utils__get_file_name_ext (path) == NULL) {
-		GtkWidget *combo_box;
-		int        idx;
-		char      *new_path;
-		char      *ext = NULL;
+		int   idx;
+		char *new_path;
+		char *ext = NULL;
 
-		combo_box = g_object_get_data (G_OBJECT (file_sel), "fr_combo_box");
-		idx = gtk_combo_box_get_active (GTK_COMBO_BOX (combo_box));
+		idx = gtk_combo_box_get_active (GTK_COMBO_BOX (data->combo_box));
 		if (idx > 0)
 			ext = file_type_desc[save_type[idx-1]].ext;
 		else
@@ -212,8 +224,8 @@
 	if (uri_exists (path)) {
 		GtkWidget *dialog;
 
-		if (! is_supported_extension (file_sel, path)) {
-			dialog = _gtk_error_dialog_new (GTK_WINDOW (file_sel),
+		if (! is_supported_extension (data->file_sel, path)) {
+			dialog = _gtk_error_dialog_new (GTK_WINDOW (data->file_sel),
 							GTK_DIALOG_MODAL,
 							NULL,
 							_("Could not create the archive"),
@@ -228,7 +240,7 @@
 		g_file_delete (file, NULL, &err);
 		if (err != NULL) {
 			GtkWidget *dialog;
-			dialog = _gtk_error_dialog_new (GTK_WINDOW (file_sel),
+			dialog = _gtk_error_dialog_new (GTK_WINDOW (data->file_sel),
 							GTK_DIALOG_DESTROY_WITH_PARENT,
 							NULL,
 							_("Could not delete the old archive."),
@@ -249,32 +261,29 @@
 
 
 static void
-new_file_response_cb (GtkWidget *w,
-		      int        response,
-		      GtkWidget *file_sel)
+new_file_response_cb (GtkWidget  *w,
+		      int         response,
+		      SaveAsData *data)
 {
-	FrWindow *window;
-	char     *path;
-
-	window = g_object_get_data (G_OBJECT (file_sel), "fr_window");
+	char *path;
 
 	if ((response == GTK_RESPONSE_CANCEL) || (response == GTK_RESPONSE_DELETE_EVENT)) {
-		fr_archive_action_completed (window->archive,
+		fr_archive_action_completed (data->window->archive,
 					     FR_ACTION_CREATING_NEW_ARCHIVE,
 					     FR_PROC_ERROR_STOPPED,
 					     NULL);
-		gtk_widget_destroy (file_sel);
+		gtk_widget_destroy (data->file_sel);
 		return;
 	}
 
 	if (response == GTK_RESPONSE_HELP) {
-		show_help_dialog (GTK_WINDOW (file_sel), "file-roller-create");
+		show_help_dialog (GTK_WINDOW (data->file_sel), "file-roller-create");
 		return;
 	}
 
-	path = get_archive_filename_from_selector (window, file_sel);
+	path = get_archive_filename_from_selector (data);
 	if (path != NULL) {
-		new_archive (file_sel, window, path);
+		new_archive (data->file_sel, data->window, path);
 		g_free (path);
 	}
 }
@@ -282,7 +291,7 @@
 
 static void
 filetype_combobox_changed_cb (GtkComboBox *combo_box,
-			      GtkWidget   *file_sel)
+			      SaveAsData  *data)
 {
 	int         idx;
 	const char *uri, *basename;
@@ -291,11 +300,11 @@
 	char       *new_basename;
 	char       *new_basename_uft8;
 	
-	idx = gtk_combo_box_get_active (combo_box) - 1;
+	idx = gtk_combo_box_get_active (GTK_COMBO_BOX (data->combo_box)) - 1;
 	if (idx < 0)
 		return;
 
-	uri = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (file_sel));
+	uri = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (data->file_sel));
 	if (uri == NULL)
 		return;
 
@@ -309,7 +318,7 @@
 	new_ext = file_type_desc[save_type[idx]].ext;
 	new_basename = g_strconcat (basename_noext, new_ext, NULL);
 	new_basename_uft8 = g_uri_unescape_string (new_basename, NULL);
-	gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (file_sel), new_basename_uft8);
+	gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (data->file_sel), new_basename_uft8);
 
 	g_free (new_basename_uft8);
 	g_free (new_basename);
@@ -318,15 +327,18 @@
 
 
 void
-show_new_archive_dialog (FrWindow  *window,
+show_new_archive_dialog (FrWindow   *window,
 			 const char *archive_name)
 {
+	SaveAsData    *data;
 	GtkWidget     *file_sel;
 	GtkWidget     *hbox;
-	GtkWidget     *combo_box;
 	GtkFileFilter *filter;
 	int            i;
 
+	data = g_new0 (SaveAsData, 1);
+	data->window = window;
+	
 	file_sel = gtk_file_chooser_dialog_new (_("New"),
 						GTK_WINDOW (window),
 						GTK_FILE_CHOOSER_ACTION_SAVE,
@@ -334,6 +346,7 @@
 						GTK_STOCK_NEW, GTK_RESPONSE_OK,
 						GTK_STOCK_HELP, GTK_RESPONSE_HELP,
 						NULL);
+	data->file_sel = file_sel;
 
 	gtk_dialog_set_default_response (GTK_DIALOG (file_sel), GTK_RESPONSE_OK);
 	gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (file_sel), FALSE);
@@ -370,29 +383,29 @@
 			    gtk_label_new (_("Archive type:")),
 			    FALSE, FALSE, 0);
 
-	combo_box = gtk_combo_box_new_text ();
-	gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), _("Automatic"));
+	data->combo_box = gtk_combo_box_new_text ();
+	gtk_combo_box_append_text (GTK_COMBO_BOX (data->combo_box), _("Automatic"));
 	for (i = 0; save_type[i] != FR_FILE_TYPE_NULL; i++)
-		gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box),
+		gtk_combo_box_append_text (GTK_COMBO_BOX (data->combo_box),
 					   _(file_type_desc[save_type[i]].name));
-	gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), 0);
-	gtk_box_pack_start (GTK_BOX (hbox), combo_box, TRUE, TRUE, 0);
+	gtk_combo_box_set_active (GTK_COMBO_BOX (data->combo_box), 0);
+	gtk_box_pack_start (GTK_BOX (hbox), data->combo_box, TRUE, TRUE, 0);
 	gtk_widget_show_all (hbox);
 
 	/**/
 
-	g_object_set_data (G_OBJECT (file_sel), "fr_window", window);
-	g_object_set_data (G_OBJECT (file_sel), "fr_combo_box", combo_box);
-	g_object_set_data (G_OBJECT (window), "fr_file_sel", file_sel);
-
 	g_signal_connect (G_OBJECT (file_sel),
 			  "response", 
 			  G_CALLBACK (new_file_response_cb), 
-			  file_sel);
-	g_signal_connect (G_OBJECT (combo_box),
+			  data);
+	g_signal_connect (G_OBJECT (data->combo_box),
 			  "changed", 
 			  G_CALLBACK (filetype_combobox_changed_cb),
-			  file_sel);
+			  data);
+	g_signal_connect (G_OBJECT (file_sel),
+			  "destroy", 
+			  G_CALLBACK (new_archive_dialog_destroy_cb),
+			  data);
 
 	gtk_window_set_modal (GTK_WINDOW (file_sel),TRUE);
 	gtk_widget_show_all (file_sel);
@@ -505,52 +518,57 @@
 
 
 static void
-save_file_destroy_cb (GtkWidget *w,
-		      GtkWidget *file_sel)
+save_file_destroy_cb (GtkWidget  *w,
+		      SaveAsData *data)
 {
+	g_free (data);
 }
 
 
 static void
-save_file_response_cb (GtkWidget *w,
-		       gint       response,
-		       GtkWidget *file_sel)
+save_file_response_cb (GtkWidget  *w,
+		       gint        response,
+		       SaveAsData *data)
 {
-	FrWindow *window;
-	char     *path;
+	char *path;
 
 	if ((response == GTK_RESPONSE_CANCEL) || (response == GTK_RESPONSE_DELETE_EVENT)) {
-		gtk_widget_destroy (file_sel);
+		gtk_widget_destroy (data->file_sel);
 		return;
 	}
 
 	if (response == GTK_RESPONSE_HELP) {
-		show_help_dialog (GTK_WINDOW (file_sel), "file-roller-convert-archive");
+		show_help_dialog (GTK_WINDOW (data->file_sel), "file-roller-convert-archive");
 		return;
 	}
 
-	window = g_object_get_data (G_OBJECT (file_sel), "fr_window");
-
-	path = get_archive_filename_from_selector (window, file_sel);
+	path = get_archive_filename_from_selector (data);
 	if (path == NULL)
 		return;
-
-	fr_window_archive_save_as (window, path);
-	gtk_widget_destroy (file_sel);
+		
+	fr_window_archive_save_as (data->window, path, gtk_entry_get_text (GTK_ENTRY (data->password)));
+	
+	gtk_widget_destroy (data->file_sel);
 	g_free (path);
 }
 
 
 void
 activate_action_save_as (GtkAction *action,
-			 gpointer   data)
+			 gpointer   callback_data)
 {
-	FrWindow      *window = data;
+	FrWindow      *window = callback_data;
 	GtkWidget     *file_sel;
+	GtkWidget     *table;
 	GtkWidget     *hbox;
-	GtkWidget     *combo_box;
+	GtkWidget     *label;
+	SaveAsData    *data;
 	GtkFileFilter *filter;
 	int            i;
+	const char    *password;
+
+	data = g_new0 (SaveAsData, 1);
+	data->window = window;
 
 	file_sel = gtk_file_chooser_dialog_new (_("Save"),
 						GTK_WINDOW (window),
@@ -559,6 +577,8 @@
 						GTK_STOCK_SAVE, GTK_RESPONSE_OK,
 						GTK_STOCK_HELP, GTK_RESPONSE_HELP,
 						NULL);
+	data->file_sel = file_sel;
+	
 	gtk_dialog_set_default_response (GTK_DIALOG (file_sel), GTK_RESPONSE_OK);
 	gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (file_sel), FALSE);
 	gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (file_sel), TRUE);
@@ -601,41 +621,73 @@
 	gtk_file_filter_add_pattern (filter, "*");
 	gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (file_sel), filter);
 
+	data->password = gtk_entry_new (); 
+	gtk_entry_set_visibility (GTK_ENTRY (data->password), FALSE);
+	
 	/**/
 
-	hbox = gtk_hbox_new (FALSE, 12);
-	gtk_box_pack_start (GTK_BOX (hbox),
-			    gtk_label_new (_("Archive type:")),
-			    FALSE, FALSE, 0);
+	table = gtk_table_new (2, 2, FALSE);
+	gtk_table_set_row_spacings (GTK_TABLE (table), 6);
+	gtk_table_set_col_spacings (GTK_TABLE (table), 6);
+
+	/* archive type */
+
+	label = gtk_label_new_with_mnemonic (_("Archive _type:"));
+	gtk_misc_set_alignment (GTK_MISC (label), 0, 0);
+	gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1,
+			  (GtkAttachOptions) (GTK_FILL),
+			  (GtkAttachOptions) (0), 0, 0);
 
-	combo_box = gtk_combo_box_new_text ();
-	gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), _("Automatic"));
+	data->combo_box = gtk_combo_box_new_text ();
+	gtk_combo_box_append_text (GTK_COMBO_BOX (data->combo_box), _("Automatic"));
 	for (i = 0; save_type[i] != FR_FILE_TYPE_NULL; i++)
-		gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box),
+		gtk_combo_box_append_text (GTK_COMBO_BOX (data->combo_box),
 					   _(file_type_desc[save_type[i]].name));
-	gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), 0);
-	gtk_box_pack_start (GTK_BOX (hbox), combo_box, TRUE, TRUE, 0);
-	gtk_widget_show_all (hbox);
+	gtk_combo_box_set_active (GTK_COMBO_BOX (data->combo_box), 0);
+	gtk_table_attach (GTK_TABLE (table), data->combo_box, 1, 2, 0, 1,
+			  (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
+			  (GtkAttachOptions) (0), 0, 0);
 
-	gtk_file_chooser_set_extra_widget (GTK_FILE_CHOOSER (file_sel), hbox);
+	/* password */
 
-	/**/
+	hbox = gtk_hbox_new (FALSE, 0);
 
-	g_object_set_data (G_OBJECT (file_sel), "fr_window", window);
-	g_object_set_data (G_OBJECT (file_sel), "fr_combo_box", combo_box);
+	label = gtk_label_new_with_mnemonic (_("_Encrypt with password:"));
+	gtk_misc_set_alignment (GTK_MISC (label), 0, 0);
+	
+	gtk_box_pack_start (GTK_BOX (hbox), data->password, FALSE, TRUE, 0);
+	
+	gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2,
+			  (GtkAttachOptions) (GTK_FILL),
+			  (GtkAttachOptions) (0), 0, 0);
+	gtk_table_attach (GTK_TABLE (table), hbox, 1, 2, 1, 2,
+			  (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
+			  (GtkAttachOptions) (0), 0, 0);
+	
+	gtk_widget_show_all (table);
+	gtk_file_chooser_set_extra_widget (GTK_FILE_CHOOSER (file_sel), table);
+	
+	/* set the default data */
+	
+	password = fr_window_get_password (window);
+	if (password == NULL)
+		password = "";
+	gtk_entry_set_text (GTK_ENTRY (data->password), password);
+	
+	/**/
 
 	g_signal_connect (G_OBJECT (file_sel),
 			  "response", 
 			  G_CALLBACK (save_file_response_cb), 
-			  file_sel);
+			  data);
 	g_signal_connect (G_OBJECT (file_sel),
 			  "destroy", 
 			  G_CALLBACK (save_file_destroy_cb),
-			  file_sel);
-	g_signal_connect (G_OBJECT (combo_box),
+			  data);
+	g_signal_connect (G_OBJECT (data->combo_box),
 			  "changed", 
 			  G_CALLBACK (filetype_combobox_changed_cb),
-			  file_sel);
+			  data);
 
 	gtk_window_set_modal (GTK_WINDOW (file_sel), TRUE);
 	gtk_widget_show_all (file_sel);

Modified: trunk/src/fr-command-rar.c
==============================================================================
--- trunk/src/fr-command-rar.c	(original)
+++ trunk/src/fr-command-rar.c	Sun Apr 13 17:32:28 2008
@@ -174,21 +174,20 @@
 
 
 static void
-add_password_arg (FrCommand	*comm,
-		  const char	*password,
-		  gboolean	disable_query)
-{
-	if (password != NULL && password[0] != '\0') {
-		char *arg, *e_password;
-
-		e_password = escape_str (password, "\"*?[]'`()$!;");
-		g_assert (e_password != NULL);  /* since password is non-NULL */
-
-		arg = g_strconcat ("-p\"", e_password, "\"", NULL);
+add_password_arg (FrCommand  *comm,
+		  const char *password,
+		  gboolean    disable_query)
+{
+	if ((password != NULL) && (password[0] != '\0')) {
+		char *arg;
+		char *quoted_arg;
+		
+		arg = g_strdup_printf ("-p%s", password);
+		quoted_arg = g_shell_quote (arg);
 
-		fr_process_add_arg (comm->process, arg);
+		fr_process_add_arg (comm->process, quoted_arg);
 
-		g_free (e_password);
+		g_free (quoted_arg);
 		g_free (arg);
 	} 
 	else if (disable_query)

Modified: trunk/src/fr-command-zip.c
==============================================================================
--- trunk/src/fr-command-zip.c	(original)
+++ trunk/src/fr-command-zip.c	Sun Apr 13 17:32:28 2008
@@ -222,7 +222,7 @@
 		  const char    *password,
 		  gboolean       always_specify)
 {
-	if (always_specify || ((password != NULL) && (*password != 0))) {
+	if (always_specify || ((password != NULL) && (password[0] != '\0'))) {
 		char *arg;
 		char *e_password;
 

Modified: trunk/src/fr-window.c
==============================================================================
--- trunk/src/fr-window.c	(original)
+++ trunk/src/fr-window.c	Sun Apr 13 17:32:28 2008
@@ -119,6 +119,7 @@
 	guint      converting : 1;
 	char      *temp_dir;
 	FrArchive *new_archive;
+	char      *password;
 } FRConvertData;
 
 typedef enum {
@@ -1294,7 +1295,7 @@
 }
 
 
-static const char *
+/*static const char *
 get_action_from_sort_method (FRWindowSortMethod sort_method)
 {
 	switch (sort_method) {
@@ -1308,7 +1309,7 @@
 	}
 
 	return "SortByName";
-}
+}*/
 
 
 static void
@@ -2557,7 +2558,10 @@
 	window->priv->convert_data.temp_dir = NULL;
 
 	g_object_unref (window->priv->convert_data.new_archive);
+	g_free (window->priv->convert_data.password);
+	
 	window->priv->convert_data.new_archive = NULL;
+	window->priv->convert_data.password = NULL;
 }
 
 
@@ -2931,7 +2935,7 @@
 				  FALSE,
 				  TRUE,
 				  FALSE,
-				  window->priv->password,
+				  window->priv->convert_data.password,
 				  window->priv->compression);
 			g_free (source_dir);
 		}
@@ -4250,8 +4254,8 @@
 	window->priv->sort_method = get_sort_method_from_column (column_id);
 	window->priv->sort_type = order;
 
-	set_active (window, get_action_from_sort_method (window->priv->sort_method), TRUE);
-	set_active (window, "SortReverseOrder", (window->priv->sort_type == GTK_SORT_DESCENDING));
+	/*set_active (window, get_action_from_sort_method (window->priv->sort_method), TRUE);
+	set_active (window, "SortReverseOrder", (window->priv->sort_type == GTK_SORT_DESCENDING));*/
 }
 
 
@@ -4763,6 +4767,8 @@
 	GtkWidget        *list_scrolled_window;
 	GtkWidget        *vbox;
 	GtkWidget        *location_box;
+	GtkStatusbar     *statusbar;
+	GtkWidget        *statusbar_box;
 	GtkWidget        *filter_box;
 	GtkWidget        *tree_scrolled_window;
 	GtkWidget        *sidepane_title;
@@ -4916,6 +4922,7 @@
 	window->priv->convert_data.converting = FALSE;
 	window->priv->convert_data.temp_dir = NULL;
 	window->priv->convert_data.new_archive = NULL;
+	window->priv->convert_data.password = NULL;
 
 	window->priv->stoppable = TRUE;
 
@@ -5346,6 +5353,14 @@
 	window->priv->list_info_cid = gtk_statusbar_get_context_id (GTK_STATUSBAR (window->priv->statusbar), "list_info");
 	window->priv->progress_cid = gtk_statusbar_get_context_id (GTK_STATUSBAR (window->priv->statusbar), "progress");
 
+	statusbar = GTK_STATUSBAR (window->priv->statusbar);
+	statusbar_box = gtk_hbox_new (FALSE, 4);
+	g_object_ref (statusbar->label);
+	gtk_container_remove (GTK_CONTAINER (statusbar->frame), statusbar->label);
+        gtk_box_pack_start (GTK_BOX (statusbar_box), statusbar->label, TRUE, TRUE, 0);
+	g_object_unref (statusbar->label);
+	gtk_container_add (GTK_CONTAINER (statusbar->frame), statusbar_box);
+	
 	window->priv->progress_bar = gtk_progress_bar_new ();
 	gtk_progress_bar_set_pulse_step (GTK_PROGRESS_BAR (window->priv->progress_bar), ACTIVITY_PULSE_STEP);
 	gtk_widget_set_size_request (window->priv->progress_bar, -1, PROGRESS_BAR_HEIGHT);
@@ -5353,10 +5368,11 @@
                 GtkWidget *vbox;
                 
                 vbox = gtk_vbox_new (FALSE, 0);
-                gtk_box_pack_start (GTK_BOX (window->priv->statusbar), vbox, FALSE, FALSE, 0);
-                gtk_box_pack_start (GTK_BOX (vbox), window->priv->progress_bar, TRUE, FALSE, 0);
+                gtk_box_pack_start (GTK_BOX (statusbar_box), vbox, FALSE, FALSE, 0);
+                gtk_box_pack_start (GTK_BOX (vbox), window->priv->progress_bar, TRUE, TRUE, 1);
                 gtk_widget_show (vbox);
         }
+        gtk_widget_show (statusbar_box);
 	gnome_app_set_statusbar (GNOME_APP (window), window->priv->statusbar);
 	gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (window->priv->statusbar), TRUE);
 
@@ -5558,9 +5574,43 @@
 }
 
 
+typedef struct {
+	char *uri;
+	char *password;
+} SaveAsData;
+
+
+static SaveAsData *
+save_as_data_new (const char *uri,
+		  const char *password)
+{
+	SaveAsData *sdata;
+	
+	sdata = g_new0 (SaveAsData, 1);
+	if (uri != NULL)
+		sdata->uri = g_strdup (uri);
+	if (password != NULL)
+		sdata->password = g_strdup (password);
+	
+	return sdata;
+}
+
+
+static void
+save_as_data_free (SaveAsData *sdata)
+{
+	if (sdata == NULL)
+		return;
+	g_free (sdata->uri);
+	g_free (sdata->password);
+	g_free (sdata);
+}
+
+
 void
 fr_window_archive_save_as (FrWindow   *window,
-			   const char *uri)
+			   const char *uri,
+			   const char *password)
 {
 	g_return_if_fail (window != NULL);
 	g_return_if_fail (uri != NULL);
@@ -5575,6 +5625,11 @@
 		g_object_unref (window->priv->convert_data.new_archive);
 		window->priv->convert_data.new_archive = NULL;
 	}
+	
+	if (window->priv->convert_data.password != NULL) {
+		g_free (window->priv->convert_data.password);
+		window->priv->convert_data.password = NULL;
+	}
 
 	/* create the new archive */
 
@@ -5609,10 +5664,13 @@
 
 	g_return_if_fail (window->priv->convert_data.new_archive->command != NULL);
 
+	if (password != NULL)
+		window->priv->convert_data.password = g_strdup (password);
+
 	fr_window_set_current_batch_action (window,
 					    FR_BATCH_ACTION_SAVE_AS,
-					    g_strdup (uri),
-					    (GFreeFunc) g_free);
+					    save_as_data_new (uri, password),
+					    (GFreeFunc) save_as_data_free);
 
 	g_signal_connect (G_OBJECT (window->priv->convert_data.new_archive),
 			  "start",
@@ -7940,6 +7998,7 @@
 	ExtractData   *edata;
 	RenameData    *rdata;
 	OpenFilesData *odata;
+	SaveAsData    *sdata;
 
 	switch (action->type) {
 	case FR_BATCH_ACTION_LOAD:
@@ -8036,7 +8095,8 @@
 	case FR_BATCH_ACTION_SAVE_AS:
 		debug (DEBUG_INFO, "[BATCH] SAVE_AS\n");
 
-		fr_window_archive_save_as (window, (char*) action->data);
+		sdata = action->data;
+		fr_window_archive_save_as (window, sdata->uri, sdata->password);
 		break;
 
 	case FR_BATCH_ACTION_TEST:

Modified: trunk/src/fr-window.h
==============================================================================
--- trunk/src/fr-window.h	(original)
+++ trunk/src/fr-window.h	Sun Apr 13 17:32:28 2008
@@ -116,7 +116,8 @@
 const char *fr_window_get_paste_archive_uri     (FrWindow      *window);
 gboolean    fr_window_archive_is_present        (FrWindow      *window);
 void        fr_window_archive_save_as           (FrWindow      *window,
-						 const char    *filename);
+						 const char    *filename,
+						 const char    *password);
 void        fr_window_archive_reload            (FrWindow      *window);
 void        fr_window_archive_rename            (FrWindow      *window,
 						 const char    *filename);

Modified: trunk/src/ui.h
==============================================================================
--- trunk/src/ui.h	(original)
+++ trunk/src/ui.h	Sun Apr 13 17:32:28 2008
@@ -109,7 +109,7 @@
 	  G_CALLBACK (activate_action_delete_folder_from_sidebar) },
 	  
 	{ "DeselectAll", NULL,
-	  N_("Dese_lect All"), NULL,
+	  N_("Dese_lect All"), "<shift><control>A",
 	  N_("Deselect all files"),
 	  G_CALLBACK (activate_action_deselect_all) },
 	{ "Extract", FR_STOCK_EXTRACT,
@@ -272,9 +272,6 @@
 "      <menuitem action='Close'/>"
 "    </menu>"
 "    <menu action='EditMenu'>"
-"      <menuitem action='AddFiles'/>"
-"      <menuitem action='AddFolder'/>"
-"      <separator/>"
 "      <menuitem action='Cut'/>"
 "      <menuitem action='Copy'/>"
 "      <menuitem action='Paste'/>"
@@ -286,16 +283,19 @@
 "      <separator/>"
 "      <menuitem action='Find'/>"
 "      <separator/>"
+"      <menuitem action='AddFiles'/>"
+"      <menuitem action='AddFolder'/>"
+"      <separator/>"
 "      <menuitem action='Password'/>"
 "    </menu>"
 "    <menu action='ViewMenu'>"
-"      <menuitem action='Stop'/>"
-"      <menuitem action='Reload'/>"
-"      <separator/>"
 "      <menuitem action='ViewToolbar'/>"
 "      <menuitem action='ViewStatusbar'/>"
 "      <menuitem action='ViewFolders'/>"
 "      <separator/>"
+"      <menuitem action='ViewAllFiles'/>"
+"      <menuitem action='ViewAsFolder'/>" 
+/*"      <separator/>"
 "      <menu action='ArrangeFilesMenu'>"
 "        <menuitem action='SortByName'/>"
 "        <menuitem action='SortBySize'/>"
@@ -304,12 +304,12 @@
 "        <menuitem action='SortByLocation'/>"
 "        <separator/>"
 "        <menuitem action='SortReverseOrder'/>"
-"      </menu>"
-"      <separator/>"
-"      <menuitem action='ViewAllFiles'/>"
-"      <menuitem action='ViewAsFolder'/>" 
+"      </menu>"*/
 "      <separator/>"
 "      <menuitem action='LastOutput'/>"
+"      <separator/>"
+"      <menuitem action='Stop'/>"
+"      <menuitem action='Reload'/>"
 "    </menu>"
 "    <menu action='HelpMenu'>"
 "      <menuitem action='Contents'/>"



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]