[grisbi-cvs] grisbi/src affichage.c, 1.146, 1.147 categories_onglet.c, 1.182, 1.183 etats_onglet.c, 1.124, 1.125 export.c, 1.21, 1.22 file_obfuscate_qif.c, 1.3, 1.4 gsb_assistant_archive_export.c, 1.12, 1.13 gsb_assistant_file.c, 1.13, 1.14 gsb_file.c, 1.36, 1.37 gsb_form.c, 1.101, 1.102 import.c, 1.257, 1.258 imputation_budgetaire.c, 1.147, 1.148

Martin Stromberger fabiolla at users.sourceforge.net
Fri Dec 26 21:06:57 CET 2008


Update of /cvsroot/grisbi/grisbi/src
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7043/src

Modified Files:
	affichage.c categories_onglet.c etats_onglet.c export.c 
	file_obfuscate_qif.c gsb_assistant_archive_export.c 
	gsb_assistant_file.c gsb_file.c gsb_form.c import.c 
	imputation_budgetaire.c 
Log Message:
unified gtk-file-chooser

Index: export.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/export.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- export.c	25 Dec 2008 23:14:58 -0000	1.21
+++ export.c	26 Dec 2008 20:06:55 -0000	1.22
@@ -33,12 +33,13 @@
 #include "./qif.h"
 #include "./structures.h"
 #include "./include.h"
+#include "./gsb_file.h"
 /*END_INCLUDE*/
 
 
 /*START_STATIC*/
 static GtkWidget * create_export_account_resume_page ( struct exported_account * account ) ;
-static gboolean export_account_change_format ( GtkWidget * combo, 
+static gboolean export_account_change_format ( GtkWidget * combo,
 					struct exported_account * account );
 static void export_account_toggled ( GtkCellRendererToggle *cell, gchar *path_str,
 			      GtkTreeModel * model );
@@ -71,7 +72,7 @@
     selected_accounts = NULL;
     exported_accounts = NULL;
 
-    dialog = gsb_assistant_new ( _("Exporting Grisbi accounts"), 
+    dialog = gsb_assistant_new ( _("Exporting Grisbi accounts"),
 				 _("This assistant will guide you through the process of "
 				   "exporting Grisbi accounts into QIF or CSV files.\n\n"
 				   "As QIF and CSV do not support currencies, all "
@@ -80,9 +81,9 @@
 				 "impexp.png",
 				 NULL );
 
-    gsb_assistant_add_page ( dialog, export_create_selection_page(dialog), 1, 0, 2, 
+    gsb_assistant_add_page ( dialog, export_create_selection_page(dialog), 1, 0, 2,
 			     G_CALLBACK ( export_resume_maybe_sensitive_next ) );
-    gsb_assistant_add_page ( dialog, export_create_resume_page(dialog), 2, 1, 3, 
+    gsb_assistant_add_page ( dialog, export_create_resume_page(dialog), 2, 1, 3,
 			     G_CALLBACK ( export_enter_resume_page ) );
 
 
@@ -173,15 +174,15 @@
     while ( tmp_list )
     {
 	gint i;
-	GtkTreeIter iter; 
+	GtkTreeIter iter;
 
 	i = gsb_data_account_get_no_account ( tmp_list -> data );
 
 	gtk_list_store_append ( GTK_LIST_STORE (model), &iter);
-	gtk_list_store_set ( GTK_LIST_STORE (model), &iter, 
+	gtk_list_store_set ( GTK_LIST_STORE (model), &iter,
 			     0, FALSE,
 			     1, gsb_data_account_get_name ( i ),
-			     2, i, 
+			     2, i,
 			     -1 );
 	tmp_list = tmp_list -> next;
     }
@@ -210,12 +211,12 @@
 
     buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
     gtk_text_buffer_create_tag ( buffer, "bold",
-				 "weight", PANGO_WEIGHT_BOLD, NULL);  
+				 "weight", PANGO_WEIGHT_BOLD, NULL);
     gtk_text_buffer_create_tag ( buffer, "x-large",
 				 "scale", PANGO_SCALE_X_LARGE, NULL);
     gtk_text_buffer_create_tag (buffer, "indented",
 				"left-margin", 24, NULL);
-  
+
     g_object_set_data ( G_OBJECT ( assistant ), "text-buffer", buffer );
 
     return view;
@@ -245,14 +246,14 @@
     gtk_text_buffer_create_tag ( buffer, "x-large",
 				 "scale", PANGO_SCALE_X_LARGE, NULL);
     gtk_text_buffer_get_iter_at_offset (buffer, &iter, 1);
-  
+
     gtk_text_buffer_insert (buffer, &iter, "\n", -1 );
     gtk_text_buffer_insert_with_tags_by_name (buffer, &iter,
 					      _("Export setup terminated"), -1,
 					      "x-large", NULL);
     gtk_text_buffer_insert (buffer, &iter, "\n\n", -1 );
-    gtk_text_buffer_insert (buffer, &iter, 
-			    _("You have successfully set up data export into Grisbi.  Press the 'Close' button to actually export data."), 
+    gtk_text_buffer_insert (buffer, &iter,
+			    _("You have successfully set up data export into Grisbi.  Press the 'Close' button to actually export data."),
 			    -1 );
     gtk_text_buffer_insert (buffer, &iter, "\n\n", -1 );
 
@@ -272,7 +273,7 @@
     GtkTextIter iter;
     GSList * list;
     gint page = 3;
-    
+
     buffer = g_object_get_data ( G_OBJECT ( assistant ), "text-buffer" );
     gtk_text_buffer_set_text (buffer, "\n", -1 );
     gtk_text_buffer_get_iter_at_offset (buffer, &iter, 1);
@@ -284,10 +285,10 @@
 						  "x-large", NULL);
 	gtk_text_buffer_insert (buffer, &iter, "\n\n", -1 );
 
-	gtk_text_buffer_insert (buffer, &iter, 
+	gtk_text_buffer_insert (buffer, &iter,
 				_("The following accounts are to be exported. "
 				  "In the next screens, you will choose what to do with "
-				  "each of them."), 
+				  "each of them."),
 				-1 );
 	gtk_text_buffer_insert (buffer, &iter, "\n\n", -1 );
 
@@ -303,17 +304,17 @@
 	    struct exported_account * account;
 	    gint i = GPOINTER_TO_INT(list -> data);
 
-	    gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, 
+	    gtk_text_buffer_insert_with_tags_by_name (buffer, &iter,
 						      g_strconcat ( "• ",
 								    gsb_data_account_get_name ( i ),
-								    "\n\n", 
+								    "\n\n",
 								    NULL ),
 						      -1, "indented", NULL );
-	    
+
 	    account = g_malloc0 ( sizeof ( struct exported_account ) );
 	    account -> account_nb = i;
 	    exported_accounts = g_slist_append ( exported_accounts, account );
-	    gsb_assistant_add_page ( assistant, 
+	    gsb_assistant_add_page ( assistant,
 				     create_export_account_resume_page ( account ),
 				     page, page - 1, page + 1, G_CALLBACK ( NULL ) );
 	    page ++;
@@ -322,7 +323,7 @@
 	}
 
 	/* And final page */
-	gsb_assistant_add_page ( assistant, export_create_final_page ( assistant ), 
+	gsb_assistant_add_page ( assistant, export_create_final_page ( assistant ),
 				 page, page - 1, -1, G_CALLBACK ( NULL ) );
 
 	/* Replace the "next" button of resume page */
@@ -339,7 +340,7 @@
  *
  *
  */
-GtkWidget * create_export_account_resume_page ( struct exported_account * account ) 
+GtkWidget * create_export_account_resume_page ( struct exported_account * account )
 {
     GtkWidget * vbox, * hbox, * label, * combo;
 
@@ -353,7 +354,7 @@
 			   g_strdup_printf ( _("<span size=\"x-large\">Export of : %s</span>"),
 					     gsb_data_account_get_name ( account -> account_nb ) ) );
     gtk_box_pack_start ( GTK_BOX ( vbox ), label, FALSE, FALSE, 0 );
-    
+
     /* Layout */
     hbox = gtk_hbox_new ( FALSE, 6 );
     gtk_box_pack_start ( GTK_BOX ( hbox ), gtk_label_new ( COLON ( _("Export format") ) ),
@@ -364,8 +365,8 @@
     gtk_combo_box_append_text ( GTK_COMBO_BOX(combo), _("QIF format" ) );
     gtk_combo_box_append_text ( GTK_COMBO_BOX(combo), _("CSV format" ) );
     gtk_box_pack_start ( GTK_BOX ( hbox ), combo, TRUE, TRUE, 0 );
-    g_signal_connect ( G_OBJECT(combo), "changed", 
-		       G_CALLBACK ( export_account_change_format ), 
+    g_signal_connect ( G_OBJECT(combo), "changed",
+		       G_CALLBACK ( export_account_change_format ),
 		       (gpointer) account );
 
     account -> chooser = gtk_file_chooser_widget_new ( GTK_FILE_CHOOSER_ACTION_SAVE );
@@ -381,17 +382,17 @@
 
 /**
  * Callback of the file format menu in the export dialog.
- * 
+ *
  * It responsible to change the default value of filename in the
  * selector.
- * 
+ *
  * \param combo		Combo box that triggered event.
  * \param account	A pointer to a structure representing attached
  *			account.
- * 
+ *
  * \return FALSE
  */
-gboolean export_account_change_format ( GtkWidget * combo, 
+gboolean export_account_change_format ( GtkWidget * combo,
 					struct exported_account * account )
 {
     gchar * extension = "", * title;
@@ -419,9 +420,8 @@
     }
 
     gtk_file_chooser_set_current_name ( GTK_FILE_CHOOSER(account -> chooser),
-					g_strconcat ( title, "-",
-						      gsb_data_account_get_name ( account -> account_nb ), 
-						      ".", extension, NULL ) );
+		       g_strconcat ( title, "-", gsb_data_account_get_name ( account -> account_nb ), ".", extension, NULL ) );
+    gtk_file_chooser_set_current_folder ( GTK_FILE_CHOOSER(account -> chooser), gsb_file_get_last_path () );
 
     return FALSE;
 }
@@ -445,8 +445,8 @@
 
     /* get toggled iter */
     gtk_tree_model_get_iter (GTK_TREE_MODEL(model), &iter, path);
-    gtk_tree_model_get (GTK_TREE_MODEL(model), &iter, 
-			0, &toggle_item, 
+    gtk_tree_model_get (GTK_TREE_MODEL(model), &iter,
+			0, &toggle_item,
 			2, &account_toggled,
 			-1);
 

Index: etats_onglet.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/etats_onglet.c,v
retrieving revision 1.124
retrieving revision 1.125
diff -u -d -r1.124 -r1.125
--- etats_onglet.c	22 Nov 2008 09:44:21 -0000	1.124
+++ etats_onglet.c	26 Dec 2008 20:06:55 -0000	1.125
@@ -127,7 +127,7 @@
     gtk_box_pack_start ( GTK_BOX ( hbox2 ), button, FALSE, FALSE, 0 );
 
     button = gsb_automem_stock_button_new ( etat.display_toolbar,
-					   GTK_STOCK_OPEN, 
+					   GTK_STOCK_OPEN,
 					   _("Import"),
 					   G_CALLBACK (importer_etat),
 					   NULL );
@@ -136,7 +136,7 @@
     gtk_box_pack_start ( GTK_BOX ( hbox2 ), button, FALSE, FALSE, 0 );
 
     bouton_exporter_etat = gsb_automem_stock_button_new ( etat.display_toolbar,
-							 GTK_STOCK_SAVE, 
+							 GTK_STOCK_SAVE,
 							 _("Export"),
 							 G_CALLBACK (exporter_etat),
 							 NULL );
@@ -149,7 +149,7 @@
     /* print button */
 #if GTK_CHECK_VERSION(2,10,0)
     bouton_imprimer_etat = gsb_automem_stock_button_new ( etat.display_toolbar,
-							  GTK_STOCK_PRINT, 
+							  GTK_STOCK_PRINT,
 							  _("Print"),
 							  G_CALLBACK (print_report),
 							  NULL );
@@ -160,7 +160,7 @@
 
 #else
     bouton_imprimer_etat = gsb_automem_stock_button_new ( etat.display_toolbar,
-							  GTK_STOCK_PRINT, 
+							  GTK_STOCK_PRINT,
 							  _("Print"),
 							  G_CALLBACK (impression_etat_courant),
 							  NULL );
@@ -170,7 +170,7 @@
     gtk_box_pack_start ( GTK_BOX ( hbox2 ), bouton_imprimer_etat, FALSE, FALSE, 0 );
 
     bouton_effacer_etat = gsb_automem_stock_button_new ( etat.display_toolbar,
-							 GTK_STOCK_DELETE, 
+							 GTK_STOCK_DELETE,
 							 _("Delete"),
 							 G_CALLBACK ( efface_etat ),
 							 NULL );
@@ -181,10 +181,10 @@
     gtk_box_pack_start ( GTK_BOX ( hbox2 ), bouton_effacer_etat, FALSE, FALSE, 0 );
 
     bouton_personnaliser_etat = gsb_automem_stock_button_new ( etat.display_toolbar,
-							      GTK_STOCK_PROPERTIES, 
+							      GTK_STOCK_PROPERTIES,
 							      _("Properties"),
 							      G_CALLBACK (personnalisation_etat),
-							      NULL ), 
+							      NULL ),
     g_signal_connect ( G_OBJECT (bouton_personnaliser_etat ), "destroy",
     		G_CALLBACK ( gtk_widget_destroyed), &bouton_personnaliser_etat );
     gtk_widget_set_tooltip_text ( GTK_WIDGET (bouton_personnaliser_etat),
@@ -192,10 +192,10 @@
     gtk_box_pack_start ( GTK_BOX ( hbox2 ), bouton_personnaliser_etat, FALSE, FALSE, 0 );
 
     bouton_dupliquer_etat = gsb_automem_stock_button_new ( etat.display_toolbar,
-							  GTK_STOCK_COPY, 
+							  GTK_STOCK_COPY,
 							  _("Clone"),
 							  G_CALLBACK (dupliquer_etat),
-							  NULL ), 
+							  NULL ),
     g_signal_connect ( G_OBJECT (bouton_dupliquer_etat ), "destroy",
     		G_CALLBACK ( gtk_widget_destroyed), &bouton_dupliquer_etat );
     gtk_widget_set_tooltip_text ( GTK_WIDGET (bouton_dupliquer_etat),
@@ -241,7 +241,7 @@
     scrolled_window_etat = gtk_scrolled_window_new ( FALSE, FALSE );
     g_signal_connect ( G_OBJECT (scrolled_window_etat ), "destroy",
     		G_CALLBACK ( gtk_widget_destroyed), &scrolled_window_etat );
-    gtk_scrolled_window_set_shadow_type ( GTK_SCROLLED_WINDOW(scrolled_window_etat), 
+    gtk_scrolled_window_set_shadow_type ( GTK_SCROLLED_WINDOW(scrolled_window_etat),
 					  GTK_SHADOW_NONE );
     gtk_scrolled_window_set_policy ( GTK_SCROLLED_WINDOW ( scrolled_window_etat ),
 				     GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC );
@@ -1040,7 +1040,7 @@
  */
 void gsb_gui_unsensitive_report_widgets ()
 {
-    if ( scrolled_window_etat && GTK_IS_WIDGET ( scrolled_window_etat ) && 
+    if ( scrolled_window_etat && GTK_IS_WIDGET ( scrolled_window_etat ) &&
 	 GTK_BIN ( scrolled_window_etat ) -> child )
 	gtk_widget_hide ( GTK_BIN ( scrolled_window_etat ) -> child );
 
@@ -1110,22 +1110,22 @@
 /**
  * Callback of the file format menu in the export report dialog.  It
  * is responsible to change the "format" object property of the
- * dialog, which is used when it is closed to determine format.  
- * 
+ * dialog, which is used when it is closed to determine format.
+ *
  * It is also responsible to change the default value of filename in
  * the selector.  For that, it uses the "basename" property set in the
  * chosser creation.  The "basename" property is the report name.
- * 
+ *
  * \param combo		Combo box that triggered event.
  * \param selector	GtkFileChooser containing combo.
- * 
+ *
  * \return FALSE
  */
 gboolean gsb_report_export_change_format ( GtkWidget * combo, GtkWidget * selector )
 {
     gchar * name, * extension;
 
-    g_object_set_data ( G_OBJECT(selector), "format", 
+    g_object_set_data ( G_OBJECT(selector), "format",
 			GINT_TO_POINTER ( gtk_combo_box_get_active ( GTK_COMBO_BOX(combo) ) ));
 
     name = safe_file_name ( g_object_get_data ( G_OBJECT ( selector ), "basename" ) );
@@ -1156,7 +1156,7 @@
 		break;
     }
 
-    gtk_file_chooser_set_current_name ( GTK_FILE_CHOOSER(selector), 
+    gtk_file_chooser_set_current_name ( GTK_FILE_CHOOSER(selector),
 					g_strconcat ( name, ".", extension, NULL ) );
     return FALSE;
 }
@@ -1170,7 +1170,7 @@
  */
 void exporter_etat ( void )
 {
-    GtkWidget * fenetre_nom, *hbox, * combo;
+    GtkWidget *fenetre_nom, *hbox, * combo;
     gint resultat, current_report_number;
     gchar * nom_etat;
     struct print_config * print_config_backup;
@@ -1179,17 +1179,25 @@
 
     if ( gtk_notebook_get_current_page ( GTK_NOTEBOOK ( notebook_general)) != GSB_REPORTS_PAGE )
 	gtk_notebook_set_page ( GTK_NOTEBOOK ( notebook_general), GSB_REPORTS_PAGE );
-    
-    fenetre_nom = file_selection_new ( _("Export report"), FILE_SELECTION_IS_SAVE_DIALOG );
-    gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (fenetre_nom),
-					 gsb_file_get_last_path ());
-    g_object_set_data ( G_OBJECT(fenetre_nom), "basename", 
-			gsb_data_report_get_report_name ( gsb_gui_navigation_get_current_report () ) );
-    
+
+    fenetre_nom = gtk_file_chooser_dialog_new ( _("Export report"),
+					   GTK_WINDOW ( window ),
+					   GTK_FILE_CHOOSER_ACTION_SAVE,
+					   GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+					   GTK_STOCK_SAVE, GTK_RESPONSE_OK,
+					   NULL);
+
+    gtk_file_chooser_set_current_folder ( GTK_FILE_CHOOSER ( fenetre_nom ), gsb_file_get_last_path () );
+    gtk_file_chooser_set_do_overwrite_confirmation ( GTK_FILE_CHOOSER ( fenetre_nom ), TRUE);
+    gtk_window_set_position ( GTK_WINDOW ( fenetre_nom ), GTK_WIN_POS_CENTER_ON_PARENT );
+
+    g_object_set_data ( G_OBJECT(fenetre_nom), "basename",
+			 gsb_data_report_get_report_name ( gsb_gui_navigation_get_current_report () ) );
+
     hbox = gtk_hbox_new ( FALSE, 6 );
-    gtk_box_pack_start ( GTK_BOX(hbox), gtk_label_new ( COLON(_("File format")) ), 
+    gtk_box_pack_start ( GTK_BOX(hbox), gtk_label_new ( COLON(_("File format")) ),
 			 FALSE, FALSE, 0 );
-    
+
     combo = gtk_combo_box_new_text();
     gtk_box_pack_start ( GTK_BOX(hbox), combo, TRUE, TRUE, 0 );
     gtk_combo_box_append_text ( GTK_COMBO_BOX(combo), _("Grisbi report file (egsb file)" ) );
@@ -1202,21 +1210,17 @@
     gtk_combo_box_set_active ( GTK_COMBO_BOX(combo), REPORT_HTML );
     gsb_report_export_change_format ( combo, fenetre_nom );
 
-    g_signal_connect ( G_OBJECT(combo), "changed", 
-		       G_CALLBACK ( gsb_report_export_change_format ), 
+    g_signal_connect ( G_OBJECT(combo), "changed",
+		       G_CALLBACK ( gsb_report_export_change_format ),
 		       fenetre_nom );
     gtk_widget_show_all ( hbox );
     gtk_file_chooser_set_extra_widget ( GTK_FILE_CHOOSER(fenetre_nom), hbox );
-    gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER ( fenetre_nom ), TRUE);
-
-    gtk_window_set_transient_for ( GTK_WINDOW ( fenetre_nom ), GTK_WINDOW ( window ));
-    gtk_window_set_modal ( GTK_WINDOW ( fenetre_nom ), TRUE );
 
     resultat = gtk_dialog_run ( GTK_DIALOG ( fenetre_nom ));
     if ( resultat == GTK_RESPONSE_OK )
     {
 	nom_etat = file_selection_get_filename ( GTK_FILE_CHOOSER ( fenetre_nom ));
-	
+
 	gsb_status_message ( _("Exporting report ...") );
 
 	gsb_status_wait ( TRUE );
@@ -1226,7 +1230,7 @@
 	    case REPORT_EGSB:		/* EGSB */
 		gsb_file_others_save_report ( nom_etat );
 		break;
-		
+
 	    case REPORT_HTML:		/* HTML */
 		export_etat_courant_vers_html ( nom_etat );
 		break;
@@ -1282,9 +1286,15 @@
     if ( gtk_notebook_get_current_page ( GTK_NOTEBOOK ( notebook_general)) != GSB_REPORTS_PAGE )
 	gtk_notebook_set_page ( GTK_NOTEBOOK ( notebook_general), GSB_REPORTS_PAGE );
 
-    fenetre_nom = file_selection_new ( _("Import a report"), FILE_SELECTION_IS_OPEN_DIALOG | FILE_SELECTION_MUST_EXIST);
+    fenetre_nom = gtk_file_chooser_dialog_new ( _("Import a report"),
+					   GTK_WINDOW ( window ),
+					   GTK_FILE_CHOOSER_ACTION_OPEN,
+					   GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+					   GTK_STOCK_OPEN, GTK_RESPONSE_OK,
+					   NULL);
+
     gtk_file_chooser_set_current_folder ( GTK_FILE_CHOOSER ( fenetre_nom ), gsb_file_get_last_path () );
-    file_selection_set_entry ( GTK_FILE_CHOOSER ( fenetre_nom ), g_strconcat ( gsb_file_get_last_path (), ".egsb", NULL ));
+    gtk_window_set_position ( GTK_WINDOW ( fenetre_nom ), GTK_WIN_POS_CENTER_ON_PARENT );
 
     filter = gtk_file_filter_new ();
     gtk_file_filter_set_name ( filter, _("Grisbi report files (*.egsb)") );
@@ -1297,9 +1307,6 @@
     gtk_file_filter_add_pattern ( filter, "*" );
     gtk_file_chooser_add_filter ( GTK_FILE_CHOOSER ( fenetre_nom ), filter );
 
-    gtk_window_set_transient_for ( GTK_WINDOW ( fenetre_nom ), GTK_WINDOW ( window ));
-    gtk_window_set_modal ( GTK_WINDOW ( fenetre_nom ), TRUE );
-
     resultat = gtk_dialog_run ( GTK_DIALOG ( fenetre_nom ));
 
     switch ( resultat )
@@ -1309,7 +1316,7 @@
 	    gsb_file_update_last_path (file_selection_get_last_directory (GTK_FILE_CHOOSER (fenetre_nom), TRUE));
 	    gtk_widget_destroy ( GTK_WIDGET ( fenetre_nom ));
 
-	    /* la vérification que c'est possible a été faite par la boite de selection*/
+	    /* la vérification que c'est possible a �t� faite par la boite de selection*/
 	    if ( !gsb_file_others_load_report ( nom_etat ))
 	    {
 		return;

Index: gsb_file.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_file.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- gsb_file.c	4 Dec 2008 19:58:41 -0000	1.36
+++ gsb_file.c	26 Dec 2008 20:06:55 -0000	1.37
@@ -104,9 +104,9 @@
  * Called by menu file -> new,
  * close the last file and open a new one
  * in fact just an assistant launcher, but need to check if the previous file is closed
- * 
+ *
  * \param none
- * 
+ *
  * \return FALSE
  * */
 gboolean gsb_file_new ( void )
@@ -215,9 +215,15 @@
     GtkWidget *selection_fichier;
     GtkFileFilter * filter;
 
-    selection_fichier = file_selection_new ( _("Open an accounts file"), FILE_SELECTION_IS_OPEN_DIALOG | FILE_SELECTION_MUST_EXIST);
-    gtk_window_set_position ( GTK_WINDOW ( selection_fichier ), GTK_WIN_POS_MOUSE);
-    gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (selection_fichier), gsb_file_get_last_path ());
+    selection_fichier = gtk_file_chooser_dialog_new ( _("Open an accounts file"),
+					   GTK_WINDOW ( window ),
+					   GTK_FILE_CHOOSER_ACTION_OPEN,
+					   GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+					   GTK_STOCK_OPEN, GTK_RESPONSE_OK,
+					   NULL);
+
+    gtk_file_chooser_set_current_folder ( GTK_FILE_CHOOSER ( selection_fichier ), gsb_file_get_last_path () );
+    gtk_window_set_position ( GTK_WINDOW ( selection_fichier ), GTK_WIN_POS_CENTER_ON_PARENT );
 
     filter = gtk_file_filter_new ();
     gtk_file_filter_set_name ( filter, _("Grisbi files (*.gsb)") );
@@ -230,9 +236,6 @@
     gtk_file_filter_add_pattern ( filter, "*" );
     gtk_file_chooser_add_filter ( GTK_FILE_CHOOSER ( selection_fichier ), filter );
 
-    gtk_window_set_transient_for ( GTK_WINDOW ( selection_fichier ), GTK_WINDOW ( window ));
-    gtk_window_set_modal ( GTK_WINDOW ( selection_fichier ), TRUE );
-
     switch ( gtk_dialog_run ( GTK_DIALOG (selection_fichier)))
     {
 	case GTK_RESPONSE_OK:
@@ -337,9 +340,9 @@
 /**
  * open a new grisbi file, don't check anything about another opened file that must
  * have been done before
- * 
+ *
  * \para filename the name of the file
- * 
+ *
  * \return TRUE ok, FALSE problem
  * */
 gboolean gsb_file_open_file ( gchar *filename )
@@ -423,7 +426,7 @@
     {
 	gint account_number;
 	volatile gint value;
-	
+
 	account_number = gsb_data_account_get_no_account ( list_tmp -> data );
 
 	gsb_data_account_calculate_current_and_marked_balances (account_number);
@@ -447,7 +450,7 @@
     gsb_status_stop_wait ( TRUE );
 
     /* go to the home page */
-    gsb_gui_navigation_set_selection ( GSB_HOME_PAGE, -1, NULL );    
+    gsb_gui_navigation_set_selection ( GSB_HOME_PAGE, -1, NULL );
 
     /* set the focus to the selection tree at left */
     gtk_widget_grab_focus (navigation_tree_view);
@@ -521,7 +524,7 @@
     {
         gchar* tmpstr1 = g_strdup_printf( _("Grisbi was unable to save this file because it is locked.  Please save it with another name or activate the \"%s\" option in preferences."),
 					       _("Force saving of locked files" ) );
-	gchar* tmpstr2 = g_strdup_printf( _("Can not save file \"%s\""), 
+	gchar* tmpstr2 = g_strdup_printf( _("Can not save file \"%s\""),
 					       nom_fichier_comptes );
 	dialogue_error_hint ( tmpstr1,
 			      tmpstr2 );
@@ -716,20 +719,20 @@
  * */
 static gint gsb_file_dialog_save ( void )
 {
-    gchar * hint; 
+    gchar * hint;
     gchar* time_elapsed;
     time_t now = time ( NULL );
     gint result;
     GtkWidget *dialog;
     gint difference = (gint) difftime ( now, etat.modification_fichier );
-    gchar* message; 
+    gchar* message;
 
     /*     si le fichier n'est pas modifié on renvoie qu'on ne veut pas enregistrer */
 
     if ( !etat.modification_fichier )
 	return GTK_RESPONSE_NO;
-    
-    if ( etat.sauvegarde_auto && 
+
+    if ( etat.sauvegarde_auto &&
 	 ( !etat.fichier_deja_ouvert || etat.force_enregistrement ) &&
 	 nom_fichier_comptes )
       return GTK_RESPONSE_OK;
@@ -737,9 +740,9 @@
     /*     si le fichier était déjà locké et que force enregistrement n'est pas mis, */
     /*     on prévient ici */
 
-    dialog = gtk_message_dialog_new ( GTK_WINDOW (window), 
+    dialog = gtk_message_dialog_new ( GTK_WINDOW (window),
 				      GTK_DIALOG_DESTROY_WITH_PARENT,
-				      GTK_MESSAGE_WARNING, 
+				      GTK_MESSAGE_WARNING,
 				      GTK_BUTTONS_NONE,
 				      " " );
     if ( etat.fichier_deja_ouvert
@@ -754,7 +757,7 @@
 				 _("Close without saving"), GTK_RESPONSE_NO,
 				 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
 				 NULL );
-	gtk_dialog_set_default_response ( GTK_DIALOG(dialog), GTK_RESPONSE_CANCEL ); 
+	gtk_dialog_set_default_response ( GTK_DIALOG(dialog), GTK_RESPONSE_CANCEL );
     }
     else
     {
@@ -766,7 +769,7 @@
 				 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
 				 GTK_STOCK_SAVE, GTK_RESPONSE_OK,
 				 NULL );
-	gtk_dialog_set_default_response ( GTK_DIALOG(dialog), GTK_RESPONSE_OK ); 
+	gtk_dialog_set_default_response ( GTK_DIALOG(dialog), GTK_RESPONSE_OK );
     }
 
     if ( difference >= 120 )
@@ -791,8 +794,8 @@
     g_free ( tmpstr1 );
     g_free ( tmpstr2 );
     g_free ( time_elapsed );
-    
-    gtk_label_set_markup ( GTK_LABEL ( GTK_MESSAGE_DIALOG(dialog)->label ), 
+
+    gtk_label_set_markup ( GTK_LABEL ( GTK_MESSAGE_DIALOG(dialog)->label ),
 			   make_hint ( hint, message ) );
 
     g_free ( message );
@@ -820,12 +823,16 @@
     GtkWidget *dialog;
     gint result;
 
-    dialog = file_selection_new ( _("Name the accounts file"), FILE_SELECTION_IS_SAVE_DIALOG );
-    gtk_file_chooser_set_current_folder ( GTK_FILE_CHOOSER ( dialog ), gsb_file_get_last_path () );
-    gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER ( dialog ), TRUE);
+    dialog = gtk_file_chooser_dialog_new ( _("Name the accounts file"),
+					   GTK_WINDOW ( window ),
+					   GTK_FILE_CHOOSER_ACTION_SAVE,
+					   GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+					   GTK_STOCK_SAVE, GTK_RESPONSE_OK,
+					   NULL);
 
-    gtk_window_set_transient_for ( GTK_WINDOW ( dialog ), GTK_WINDOW ( window ));
-    gtk_window_set_modal ( GTK_WINDOW ( dialog ), TRUE );
+    gtk_file_chooser_set_current_folder ( GTK_FILE_CHOOSER ( dialog ), gsb_file_get_last_path () );
+    gtk_file_chooser_set_do_overwrite_confirmation ( GTK_FILE_CHOOSER ( dialog ), TRUE);
+    gtk_window_set_position ( GTK_WINDOW ( dialog ), GTK_WIN_POS_CENTER_ON_PARENT );
 
     if ( ! nom_fichier_comptes )
     {
@@ -946,7 +953,7 @@
     gchar* tmpstr = titre;
     titre = g_strconcat ( tmpstr, " - ", _("Grisbi"), NULL );
     g_free ( tmpstr );
-    
+
     gtk_window_set_title ( GTK_WINDOW ( window ), titre );
     g_free ( titre );
 }
@@ -975,7 +982,7 @@
 	nb_derniers_fichiers_ouverts = 0;
 
     if ( !g_path_is_absolute ( nom_fichier_comptes ) )
-    {	
+    {
 	real_name = g_strdup( (gchar*)realpath ( nom_fichier_comptes, NULL ));
 	if ( ! real_name )
 	{

Index: imputation_budgetaire.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/imputation_budgetaire.c,v
retrieving revision 1.147
retrieving revision 1.148
diff -u -d -r1.147 -r1.148
--- imputation_budgetaire.c	8 Dec 2008 14:39:00 -0000	1.147
+++ imputation_budgetaire.c	26 Dec 2008 20:06:55 -0000	1.148
@@ -332,26 +332,30 @@
  */
 void exporter_ib ( void )
 {
-    GtkWidget *fenetre_nom;
+    GtkWidget *dialog;
     gint resultat;
     gchar *nom_ib;
 
-    fenetre_nom = file_selection_new ( _("Export the budgetary lines"), FILE_SELECTION_IS_SAVE_DIALOG );
-    gtk_file_chooser_set_current_name ( GTK_FILE_CHOOSER ( fenetre_nom ),  _("Budgetary-lines.igsb"));
-    gtk_file_chooser_set_current_folder ( GTK_FILE_CHOOSER ( fenetre_nom ), gsb_file_get_last_path () );
-    gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER ( fenetre_nom ), TRUE);
+    dialog = gtk_file_chooser_dialog_new ( _("Export the budgetary lines"),
+					   GTK_WINDOW ( window ),
+					   GTK_FILE_CHOOSER_ACTION_SAVE,
+					   GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+					   GTK_STOCK_SAVE, GTK_RESPONSE_OK,
+					   NULL);
 
-    gtk_window_set_transient_for ( GTK_WINDOW ( fenetre_nom ), GTK_WINDOW ( window ));
-    gtk_window_set_modal ( GTK_WINDOW ( fenetre_nom ), TRUE );
+    gtk_file_chooser_set_current_name ( GTK_FILE_CHOOSER ( dialog ),  _("Budgetary-lines.igsb"));
+    gtk_file_chooser_set_current_folder ( GTK_FILE_CHOOSER ( dialog ), gsb_file_get_last_path () );
+    gtk_file_chooser_set_do_overwrite_confirmation ( GTK_FILE_CHOOSER ( dialog ), TRUE);
+    gtk_window_set_position ( GTK_WINDOW ( dialog ), GTK_WIN_POS_CENTER_ON_PARENT );
 
-    resultat = gtk_dialog_run ( GTK_DIALOG ( fenetre_nom ));
+    resultat = gtk_dialog_run ( GTK_DIALOG ( dialog ));
 
     switch ( resultat )
     {
 	case GTK_RESPONSE_OK :
-	    nom_ib =file_selection_get_filename ( GTK_FILE_CHOOSER ( fenetre_nom ));
-	    gsb_file_update_last_path (file_selection_get_last_directory (GTK_FILE_CHOOSER (fenetre_nom), TRUE));
-	    gtk_widget_destroy ( GTK_WIDGET ( fenetre_nom ));
+	    nom_ib =file_selection_get_filename ( GTK_FILE_CHOOSER ( dialog ));
+	    gsb_file_update_last_path (file_selection_get_last_directory (GTK_FILE_CHOOSER (dialog), TRUE));
+	    gtk_widget_destroy ( GTK_WIDGET ( dialog ));
 
 	    /* vérification que c'est possible est faite par la boite de dialogue */
 
@@ -364,7 +368,7 @@
 	    break;
 
 	default :
-	    gtk_widget_destroy ( GTK_WIDGET ( fenetre_nom ));
+	    gtk_widget_destroy ( GTK_WIDGET ( dialog ));
 	    return;
     }
 }
@@ -381,9 +385,15 @@
     gint last_transaction_number;
     GtkFileFilter * filter;
 
-    dialog = file_selection_new ( _("Import budgetary lines"), FILE_SELECTION_IS_OPEN_DIALOG | FILE_SELECTION_MUST_EXIST);
+    dialog = gtk_file_chooser_dialog_new ( _("Import budgetary lines"),
+					   GTK_WINDOW ( window ),
+					   GTK_FILE_CHOOSER_ACTION_OPEN,
+					   GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+					   GTK_STOCK_OPEN, GTK_RESPONSE_OK,
+					   NULL);
+
     gtk_file_chooser_set_current_folder ( GTK_FILE_CHOOSER ( dialog ), gsb_file_get_last_path () );
-    file_selection_set_entry ( GTK_FILE_CHOOSER ( dialog ), g_strconcat ( gsb_file_get_last_path (), ".igsb", NULL ));
+    gtk_window_set_position ( GTK_WINDOW ( dialog ), GTK_WIN_POS_CENTER_ON_PARENT );
 
     filter = gtk_file_filter_new ();
     gtk_file_filter_set_name ( filter, _("Grisbi budgetary lines files (*.igsb)") );
@@ -396,9 +406,6 @@
     gtk_file_filter_add_pattern ( filter, "*" );
     gtk_file_chooser_add_filter ( GTK_FILE_CHOOSER ( dialog ), filter );
 
-    gtk_window_set_transient_for ( GTK_WINDOW ( dialog ), GTK_WINDOW ( window ));
-    gtk_window_set_modal ( GTK_WINDOW ( dialog ), TRUE );
-
     resultat = gtk_dialog_run ( GTK_DIALOG ( dialog ));
 
     if ( resultat != GTK_RESPONSE_OK  )

Index: gsb_assistant_archive_export.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_assistant_archive_export.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- gsb_assistant_archive_export.c	16 Dec 2008 20:40:21 -0000	1.12
+++ gsb_assistant_archive_export.c	26 Dec 2008 20:06:55 -0000	1.13
@@ -43,6 +43,7 @@
 #include "./structures.h"
 #include "./gsb_transactions_list.h"
 #include "./include.h"
+#include "./gsb_file.h"
 /*END_INCLUDE*/
 
 
@@ -387,17 +388,17 @@
 						     gsb_data_archive_get_name (archive_number));
 	    gtk_label_set_markup ( GTK_LABEL ( archive_export_label ), tmpstr);
 	    g_free ( tmpstr );
-        /* on remplace les slash des dates par des points 
+        /* on remplace les slash des dates par des points
          * avant de fixer le nom du fichier par défaut */
         tmpstr = ( gchar * )gsb_data_archive_get_name ( archive_number );
         tmpstr = my_strdelimit (tmpstr, "/", "." );
-	    gtk_file_chooser_set_current_name ( GTK_FILE_CHOOSER (archive_export_filechooser),
-						tmpstr );
+	    gtk_file_chooser_set_current_name ( GTK_FILE_CHOOSER (archive_export_filechooser), tmpstr );
+	    gtk_file_chooser_set_current_folder ( GTK_FILE_CHOOSER (archive_export_filechooser), gsb_file_get_last_path () );
 	    g_free ( tmpstr );
 	    /* need to set the next button to the next function,
 	     * because if the export failed and the user did previous button,
 	     * the next button stay in the close state */
-	    gsb_assistant_change_button_next ( assistant, GTK_STOCK_GO_FORWARD, 
+	    gsb_assistant_change_button_next ( assistant, GTK_STOCK_GO_FORWARD,
 					       GTK_RESPONSE_YES );
 
 	    break;

Index: gsb_form.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_form.c,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -d -r1.101 -r1.102
--- gsb_form.c	6 Dec 2008 21:23:57 -0000	1.101
+++ gsb_form.c	26 Dec 2008 20:06:55 -0000	1.102
@@ -2534,7 +2534,7 @@
 
 	    if (gsb_form_widget_check_empty (widget))
 	    {
-		if (!question ( _("Selected method of payment has an automatic incremental number\nbut doesn't contain any number.\nContinue anyway?")))
+		if (!question_yes_no ( _("Selected method of payment has an automatic incremental number\nbut doesn't contain any number.\nContinue anyway?"), GTK_RESPONSE_CANCEL))
 		    return (FALSE);
 	    }
 	    else
@@ -2548,7 +2548,7 @@
 		     &&
 		     tmp_transaction_number != transaction_number
 		     &&
-		     !question ( _("Warning: this cheque number is already used.\nContinue anyway?")))
+		     !question_yes_no ( _("Warning: this cheque number is already used.\nContinue anyway?"), GTK_RESPONSE_CANCEL))
 		    return FALSE;
 	    }
 	}

Index: affichage.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/affichage.c,v
retrieving revision 1.146
retrieving revision 1.147
diff -u -d -r1.146 -r1.147
--- affichage.c	14 Nov 2008 21:27:09 -0000	1.146
+++ affichage.c	26 Dec 2008 20:06:55 -0000	1.147
@@ -136,7 +136,7 @@
     hbox = gtk_hbox_new ( FALSE, 5 );
     gtk_box_pack_start ( GTK_BOX ( paddingbox ), hbox, FALSE, FALSE, 0 );
 
-    /*     le logo est grisé ou non suivant qu'on l'utilise ou pas */ 
+    /*     le logo est grisé ou non suivant qu'on l'utilise ou pas */
     gtk_widget_set_sensitive ( hbox, etat.utilise_logo );
     g_signal_connect ( G_OBJECT ( check_button ), "toggled",
 		       G_CALLBACK ( change_choix_utilise_logo ), hbox );
@@ -153,7 +153,7 @@
 
     if (!pixbuf)
     {
-	preview = gtk_image_new_from_stock ( GTK_STOCK_MISSING_IMAGE, 
+	preview = gtk_image_new_from_stock ( GTK_STOCK_MISSING_IMAGE,
 					     GTK_ICON_SIZE_BUTTON );
     }
     else
@@ -162,11 +162,11 @@
 	     gdk_pixbuf_get_height(pixbuf) > 64 )
 	{
 	    GdkPixbuf * tmp;
-	    tmp = gdk_pixbuf_new ( GDK_COLORSPACE_RGB, TRUE, 8, 
-				   gdk_pixbuf_get_width(pixbuf)/2, 
+	    tmp = gdk_pixbuf_new ( GDK_COLORSPACE_RGB, TRUE, 8,
+				   gdk_pixbuf_get_width(pixbuf)/2,
 				   gdk_pixbuf_get_height(pixbuf)/2 );
-	    gdk_pixbuf_scale ( pixbuf, tmp, 0, 0, 
-			       gdk_pixbuf_get_width(pixbuf)/2, 
+	    gdk_pixbuf_scale ( pixbuf, tmp, 0, 0,
+			       gdk_pixbuf_get_width(pixbuf)/2,
 			       gdk_pixbuf_get_height(pixbuf)/2,
 			       0, 0, 0.5, 0.5, GDK_INTERP_HYPER );
 	    pixbuf = tmp;
@@ -195,7 +195,7 @@
     gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON ( check_button ),
 				   etat.utilise_fonte_listes );
 
-    /*     on crée la vbox qui contiendra la font button et le raz */ 
+    /*     on crée la vbox qui contiendra la font button et le raz */
     vbox = gtk_vbox_new ( FALSE, 10 );
     gtk_box_pack_start ( GTK_BOX ( hbox ), vbox, FALSE, FALSE, 0 );
 
@@ -288,7 +288,7 @@
 	}
     }
     else
-	gtk_widget_destroy ( logo_accueil ); 
+	gtk_widget_destroy ( logo_accueil );
 
     modification_fichier ( TRUE );
 
@@ -386,7 +386,7 @@
 				     GTK_POLICY_AUTOMATIC );
     gtk_box_pack_start ( GTK_BOX ( paddingbox ), scrolled_window,
 			 FALSE, FALSE, 0);
-    gtk_scrolled_window_set_shadow_type ( GTK_SCROLLED_WINDOW(scrolled_window), 
+    gtk_scrolled_window_set_shadow_type ( GTK_SCROLLED_WINDOW(scrolled_window),
 					  GTK_SHADOW_IN );
     entry = gsb_automem_textview_new ( &adresse_commune, NULL, NULL );
     gtk_container_add ( GTK_CONTAINER ( scrolled_window ),
@@ -403,7 +403,7 @@
     gtk_scrolled_window_set_policy ( GTK_SCROLLED_WINDOW ( scrolled_window ),
 				     GTK_POLICY_AUTOMATIC,
 				     GTK_POLICY_AUTOMATIC );
-    gtk_scrolled_window_set_shadow_type ( GTK_SCROLLED_WINDOW(scrolled_window), 
+    gtk_scrolled_window_set_shadow_type ( GTK_SCROLLED_WINDOW(scrolled_window),
 					  GTK_SHADOW_IN );
     gtk_box_pack_start ( GTK_BOX ( paddingbox ), scrolled_window,
 			 FALSE, FALSE, 0);
@@ -448,7 +448,7 @@
 	else
 	{
 	    /* Update homepage logo */
-	    gtk_widget_destroy ( logo_accueil ); 
+	    gtk_widget_destroy ( logo_accueil );
 
 	    logo_accueil =  gtk_image_new_from_file ( chemin_logo );
 	    gtk_box_pack_start ( GTK_BOX ( hbox_title ), logo_accueil, FALSE, FALSE, 0 );
@@ -460,7 +460,7 @@
 	gtk_container_remove (GTK_CONTAINER(logo_button), preview);
 	if (!pixbuf)
 	{
-	    preview = gtk_image_new_from_stock ( GTK_STOCK_MISSING_IMAGE, 
+	    preview = gtk_image_new_from_stock ( GTK_STOCK_MISSING_IMAGE,
 						 GTK_ICON_SIZE_BUTTON );
 	}
 	else
@@ -469,11 +469,11 @@
 		 gdk_pixbuf_get_height(pixbuf) > 64)
 	    {
 		GdkPixbuf * tmp;
-		tmp = gdk_pixbuf_new ( GDK_COLORSPACE_RGB, TRUE, 8, 
-				       gdk_pixbuf_get_width(pixbuf)/2, 
+		tmp = gdk_pixbuf_new ( GDK_COLORSPACE_RGB, TRUE, 8,
+				       gdk_pixbuf_get_width(pixbuf)/2,
 				       gdk_pixbuf_get_height(pixbuf)/2 );
-		gdk_pixbuf_scale ( pixbuf, tmp, 0, 0, 
-				   gdk_pixbuf_get_width(pixbuf)/2, 
+		gdk_pixbuf_scale ( pixbuf, tmp, 0, 0,
+				   gdk_pixbuf_get_width(pixbuf)/2,
 				   gdk_pixbuf_get_height(pixbuf)/2,
 				   0, 0, 0.5, 0.5, GDK_INTERP_HYPER );
 		pixbuf = tmp;
@@ -497,20 +497,21 @@
     GtkWidget *file_selector;
     GtkWidget *preview;
 
-    file_selector = file_selection_new (_("Select a new logo"),
-					FILE_SELECTION_IS_OPEN_DIALOG|FILE_SELECTION_MUST_EXIST);
-    gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (file_selector),
-					 gsb_file_get_last_path ());
+    file_selector = gtk_file_chooser_dialog_new ( _("Select a new logo"),
+					   GTK_WINDOW ( fenetre_preferences ),
+					   GTK_FILE_CHOOSER_ACTION_OPEN,
+					   GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+					   GTK_STOCK_OPEN, GTK_RESPONSE_OK,
+					   NULL);
+
+    gtk_file_chooser_set_current_folder ( GTK_FILE_CHOOSER ( file_selector ), gsb_file_get_last_path () );
+    gtk_window_set_position ( GTK_WINDOW ( file_selector ), GTK_WIN_POS_CENTER_ON_PARENT );
 
     /* create the preview */
     preview = gtk_image_new ();
     gtk_file_chooser_set_preview_widget (GTK_FILE_CHOOSER (file_selector), preview);
     g_signal_connect (G_OBJECT (file_selector), "update-preview",
-		      G_CALLBACK (preferences_view_update_preview_logo), preview);
-
-    gtk_window_set_transient_for ( GTK_WINDOW ( file_selector ),
-				   GTK_WINDOW ( fenetre_preferences ));
-    gtk_window_set_modal ( GTK_WINDOW ( file_selector ), TRUE );
+    		G_CALLBACK (preferences_view_update_preview_logo), preview);
 
     switch ( gtk_dialog_run ( GTK_DIALOG ( file_selector ) ) )
     {
@@ -568,13 +569,13 @@
  * \param length Not used handler parameter.
  * \param position Not used handler parameter.
  */
-gboolean update_homepage_title (GtkEntry *entry, gchar *value, 
+gboolean update_homepage_title (GtkEntry *entry, gchar *value,
 				gint length, gint * position)
 {
     /* at the first use of grisbi,label_titre_fichier doesn't still exist */
     if (label_titre_fichier)
     {
-	gtk_label_set_text ( GTK_LABEL(label_titre_fichier), 
+	gtk_label_set_text ( GTK_LABEL(label_titre_fichier),
 			     (gchar *) gtk_entry_get_text (GTK_ENTRY (entry)) );
 
 	gchar* tmpstr = g_strconcat ("<span size=\"x-large\">",
@@ -599,7 +600,7 @@
  * buttons.
  *
  * \param button	Radio button that triggered event.
- * 
+ *
  * \return FALSE
  */
 gboolean change_toolbar_display_mode ( GtkRadioButton * button )
@@ -628,7 +629,7 @@
 
     vbox_pref = new_vbox_with_title_and_icon ( _("Toolbars"), "toolbar.png" );
 
-    paddingbox = new_paddingbox_with_title ( vbox_pref, FALSE, 
+    paddingbox = new_paddingbox_with_title ( vbox_pref, FALSE,
 					     _("Display toolbar buttons as") );
 
     radiogroup = radio = gtk_radio_button_new_with_label ( NULL, _("Text") );
@@ -636,25 +637,25 @@
     gtk_box_pack_start ( GTK_BOX(paddingbox), radio, FALSE, FALSE, 0 );
     if ( etat.display_toolbar == GSB_BUTTON_TEXT )
 	gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON (radio), TRUE );
-    g_signal_connect ( G_OBJECT(radio), "toggled", 
+    g_signal_connect ( G_OBJECT(radio), "toggled",
 		       G_CALLBACK(change_toolbar_display_mode), NULL );
 
-    radio = gtk_radio_button_new_with_label_from_widget ( GTK_RADIO_BUTTON(radiogroup), 
+    radio = gtk_radio_button_new_with_label_from_widget ( GTK_RADIO_BUTTON(radiogroup),
 							  _("Icons") );
     g_object_set_data ( G_OBJECT(radio), "display", GINT_TO_POINTER(GSB_BUTTON_ICON) );
     gtk_box_pack_start ( GTK_BOX(paddingbox), radio, FALSE, FALSE, 0 );
     if ( etat.display_toolbar == GSB_BUTTON_ICON )
 	gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON (radio), TRUE );
-    g_signal_connect ( G_OBJECT(radio), "toggled", 
+    g_signal_connect ( G_OBJECT(radio), "toggled",
 		       G_CALLBACK(change_toolbar_display_mode), NULL );
 
-    radio = gtk_radio_button_new_with_label_from_widget ( GTK_RADIO_BUTTON(radiogroup), 
+    radio = gtk_radio_button_new_with_label_from_widget ( GTK_RADIO_BUTTON(radiogroup),
 							  _("Both") );
     g_object_set_data ( G_OBJECT(radio), "display", GINT_TO_POINTER(GSB_BUTTON_BOTH) );
-    gtk_box_pack_start ( GTK_BOX(paddingbox), radio, FALSE, FALSE, 0 );    
+    gtk_box_pack_start ( GTK_BOX(paddingbox), radio, FALSE, FALSE, 0 );
     if ( etat.display_toolbar == GSB_BUTTON_BOTH )
 	gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON (radio), TRUE );
-    g_signal_connect ( G_OBJECT(radio), "toggled", 
+    g_signal_connect ( G_OBJECT(radio), "toggled",
 		       G_CALLBACK(change_toolbar_display_mode), NULL );
 
     gtk_widget_show_all ( vbox_pref );
@@ -670,7 +671,7 @@
 /* 						   NULL ), */
 /* 			 FALSE, FALSE, 0 ); */
 
-    gtk_box_pack_start ( GTK_BOX ( vbox_pref ), 
+    gtk_box_pack_start ( GTK_BOX ( vbox_pref ),
 			 gsb_automem_checkbutton_new ( _("Display headings bar"),
 						       &(etat.show_headings_bar),
 						       NULL, NULL ),

Index: gsb_assistant_file.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_assistant_file.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- gsb_assistant_file.c	26 Dec 2008 15:34:04 -0000	1.13
+++ gsb_assistant_file.c	26 Dec 2008 20:06:55 -0000	1.14
@@ -583,26 +583,24 @@
     GtkWidget *dialog;
     gchar *tmpstr;
 
-    dialog = gtk_file_chooser_dialog_new (_("Create filename"),
-					  GTK_WINDOW (window),
-					  GTK_FILE_CHOOSER_ACTION_SAVE,
-					  GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
-					  GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
-					  NULL);
-    gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), TRUE);
+    dialog = gtk_file_chooser_dialog_new ( _("Create filename"),
+					   GTK_WINDOW ( window ),
+					   GTK_FILE_CHOOSER_ACTION_SAVE,
+					   GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+					   GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
+					   NULL);
 
-    /* set the folder */
-    tmpstr = g_path_get_dirname (gtk_entry_get_text (GTK_ENTRY (entry)));
-    gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog),
-					 tmpstr);
+    tmpstr = g_path_get_basename (gtk_entry_get_text (GTK_ENTRY (entry)));
+    gtk_file_chooser_set_current_name ( GTK_FILE_CHOOSER ( dialog ), tmpstr );
     g_free (tmpstr);
 
-    /* set the new name */
-    tmpstr = g_path_get_basename (gtk_entry_get_text (GTK_ENTRY (entry)));
-    gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog),
-				       tmpstr );
+    tmpstr = g_path_get_dirname (gtk_entry_get_text (GTK_ENTRY (entry)));
+    gtk_file_chooser_set_current_folder ( GTK_FILE_CHOOSER ( dialog ), tmpstr );
     g_free (tmpstr);
 
+    gtk_file_chooser_set_do_overwrite_confirmation ( GTK_FILE_CHOOSER ( dialog ), TRUE);
+    gtk_window_set_position ( GTK_WINDOW ( dialog ), GTK_WIN_POS_CENTER_ON_PARENT );
+
     if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
     {
 	gchar *filename;

Index: categories_onglet.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/categories_onglet.c,v
retrieving revision 1.182
retrieving revision 1.183
diff -u -d -r1.182 -r1.183
--- categories_onglet.c	7 Dec 2008 21:40:06 -0000	1.182
+++ categories_onglet.c	26 Dec 2008 20:06:55 -0000	1.183
@@ -304,29 +304,33 @@
  */
 gboolean exporter_categ ( GtkButton * widget, gpointer data )
 {
-    GtkWidget * fenetre_nom;
+    GtkWidget *dialog;
     gint resultat;
     gchar *nom_categ;
 
-    fenetre_nom = file_selection_new ( _("Export categories"), FILE_SELECTION_IS_SAVE_DIALOG );
-	gtk_file_chooser_set_current_name ( GTK_FILE_CHOOSER ( fenetre_nom ),  _("Categories.cgsb"));
-    gtk_file_chooser_set_current_folder ( GTK_FILE_CHOOSER ( fenetre_nom ), gsb_file_get_last_path () );
-    gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER ( fenetre_nom ), TRUE);
+    dialog = gtk_file_chooser_dialog_new ( _("Export categories"),
+					   GTK_WINDOW ( window ),
+					   GTK_FILE_CHOOSER_ACTION_SAVE,
+					   GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+					   GTK_STOCK_SAVE, GTK_RESPONSE_OK,
+					   NULL);
 
-    gtk_window_set_transient_for ( GTK_WINDOW ( fenetre_nom ), GTK_WINDOW ( window ));
-    gtk_window_set_modal ( GTK_WINDOW ( fenetre_nom ), TRUE );
+    gtk_file_chooser_set_current_name ( GTK_FILE_CHOOSER ( dialog ),  _("Categories.cgsb"));
+    gtk_file_chooser_set_current_folder ( GTK_FILE_CHOOSER ( dialog ), gsb_file_get_last_path () );
+    gtk_file_chooser_set_do_overwrite_confirmation ( GTK_FILE_CHOOSER ( dialog ), TRUE);
+    gtk_window_set_position ( GTK_WINDOW ( dialog ), GTK_WIN_POS_CENTER_ON_PARENT );
 
-    resultat = gtk_dialog_run ( GTK_DIALOG ( fenetre_nom ));
+    resultat = gtk_dialog_run ( GTK_DIALOG ( dialog ));
 
     if ( resultat != GTK_RESPONSE_OK )
     {
-	gtk_widget_destroy ( fenetre_nom );
+	gtk_widget_destroy ( dialog );
 	return FALSE;
     }
 
-    nom_categ = file_selection_get_filename ( GTK_FILE_CHOOSER ( fenetre_nom ));
-    gsb_file_update_last_path (file_selection_get_last_directory (GTK_FILE_CHOOSER (fenetre_nom), TRUE));
-    gtk_widget_destroy ( GTK_WIDGET ( fenetre_nom ));
+    nom_categ = file_selection_get_filename ( GTK_FILE_CHOOSER ( dialog ));
+    gsb_file_update_last_path (file_selection_get_last_directory (GTK_FILE_CHOOSER (dialog), TRUE));
+    gtk_widget_destroy ( GTK_WIDGET ( dialog ));
 
     gsb_file_others_save_category ( nom_categ );
 
@@ -347,9 +351,15 @@
     gint last_transaction_number;
     GtkFileFilter * filter;
 
-    dialog = file_selection_new ( _("Import categories"), FILE_SELECTION_IS_OPEN_DIALOG | FILE_SELECTION_MUST_EXIST);
+    dialog = gtk_file_chooser_dialog_new ( _("Import categories"),
+					   GTK_WINDOW ( window ),
+					   GTK_FILE_CHOOSER_ACTION_OPEN,
+					   GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+					   GTK_STOCK_OPEN, GTK_RESPONSE_OK,
+					   NULL);
+
     gtk_file_chooser_set_current_folder ( GTK_FILE_CHOOSER ( dialog ), gsb_file_get_last_path () );
-    file_selection_set_entry ( GTK_FILE_CHOOSER ( dialog ), g_strconcat ( gsb_file_get_last_path (), ".cgsb", NULL ));
+    gtk_window_set_position ( GTK_WINDOW ( dialog ), GTK_WIN_POS_CENTER_ON_PARENT );
 
     filter = gtk_file_filter_new ();
     gtk_file_filter_set_name ( filter, _("Grisbi category files (*.cgsb)") );
@@ -362,9 +372,6 @@
     gtk_file_filter_add_pattern ( filter, "*" );
     gtk_file_chooser_add_filter ( GTK_FILE_CHOOSER ( dialog ), filter );
 
-    gtk_window_set_transient_for ( GTK_WINDOW ( dialog ), GTK_WINDOW ( window ));
-    gtk_window_set_modal ( GTK_WINDOW ( dialog ), TRUE );
-
     resultat = gtk_dialog_run ( GTK_DIALOG ( dialog ));
 
     if ( resultat != GTK_RESPONSE_OK  )

Index: file_obfuscate_qif.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/file_obfuscate_qif.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- file_obfuscate_qif.c	22 Nov 2008 09:44:21 -0000	1.3
+++ file_obfuscate_qif.c	26 Dec 2008 20:06:55 -0000	1.4
@@ -86,9 +86,15 @@
 	GtkFileFilter * filter;
 	gchar *qif_name;
 
-	file_selection = file_selection_new ( _("Open a QIF file"), FILE_SELECTION_IS_OPEN_DIALOG | FILE_SELECTION_MUST_EXIST);
-	gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (file_selection), gsb_file_get_last_path ());
-    file_selection_set_entry ( GTK_FILE_CHOOSER ( file_selection ), g_strconcat ( gsb_file_get_last_path (), ".qif", NULL ));
+    file_selection = gtk_file_chooser_dialog_new ( _("Open a QIF file"),
+					   GTK_WINDOW ( assistant ),
+					   GTK_FILE_CHOOSER_ACTION_OPEN,
+					   GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+					   GTK_STOCK_OPEN, GTK_RESPONSE_OK,
+					   NULL);
+
+    gtk_file_chooser_set_current_folder ( GTK_FILE_CHOOSER ( file_selection ), gsb_file_get_last_path () );
+    gtk_window_set_position ( GTK_WINDOW ( file_selection ), GTK_WIN_POS_CENTER_ON_PARENT );
 
 	filter = gtk_file_filter_new ();
 	gtk_file_filter_set_name ( filter, _("QIF files (*.qif)") );
@@ -101,9 +107,6 @@
 	gtk_file_filter_add_pattern ( filter, "*" );
 	gtk_file_chooser_add_filter ( GTK_FILE_CHOOSER ( file_selection ), filter );
 
-    gtk_window_set_transient_for ( GTK_WINDOW ( file_selection ), GTK_WINDOW ( assistant ));
-    gtk_window_set_modal ( GTK_WINDOW ( file_selection ), TRUE );
-
 	switch ( gtk_dialog_run ( GTK_DIALOG (file_selection)))
 	{
 	    case GTK_RESPONSE_OK:

Index: import.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/import.c,v
retrieving revision 1.257
retrieving revision 1.258
diff -u -d -r1.257 -r1.258
--- import.c	25 Dec 2008 23:14:58 -0000	1.257
+++ import.c	26 Dec 2008 20:06:55 -0000	1.258
@@ -637,13 +637,14 @@
     GSList *filenames = NULL;
 
     dialog = gtk_file_chooser_dialog_new ( _("Choose files to import."),
-					   GTK_WINDOW (window), GTK_FILE_CHOOSER_ACTION_OPEN,
+					   GTK_WINDOW ( window ),
+					   GTK_FILE_CHOOSER_ACTION_OPEN,
 					   GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
 					   GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
-					   NULL );
+					   NULL);
+
     gtk_file_chooser_set_select_multiple ( GTK_FILE_CHOOSER ( dialog ), TRUE );
-    gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog),
-					 gsb_file_get_last_path ());
+    gtk_file_chooser_set_current_folder ( GTK_FILE_CHOOSER ( dialog ), gsb_file_get_last_path () );
 
     /* Import filters */
     tmp = import_formats;



More information about the cvs mailing list