[grisbi-cvs] grisbi/src categories_onglet.c, 1.179, 1.180 etats_onglet.c, 1.123, 1.124 file_obfuscate_qif.c, 1.2, 1.3

Martin Stromberger fabiolla at users.sourceforge.net
Sat Nov 22 10:44:23 CET 2008


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

Modified Files:
	categories_onglet.c etats_onglet.c file_obfuscate_qif.c 
Log Message:
modal file-chooser dialogs and overwrite-question for saving

Index: categories_onglet.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/categories_onglet.c,v
retrieving revision 1.179
retrieving revision 1.180
diff -u -d -r1.179 -r1.180
--- categories_onglet.c	16 Nov 2008 20:34:25 -0000	1.179
+++ categories_onglet.c	22 Nov 2008 09:44:21 -0000	1.180
@@ -310,9 +310,11 @@
 
     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 () );
-    file_selection_set_entry ( GTK_FILE_CHOOSER ( fenetre_nom ), ".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);
+
+    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 ));
 
@@ -345,10 +347,9 @@
     gint last_transaction_number;
     GtkFileFilter * filter;
 
-    dialog = file_selection_new ( _("Import categories"),
-				  FILE_SELECTION_IS_OPEN_DIALOG | FILE_SELECTION_MUST_EXIST);
+    dialog = file_selection_new ( _("Import categories"), FILE_SELECTION_IS_OPEN_DIALOG | FILE_SELECTION_MUST_EXIST);
     gtk_file_chooser_set_current_folder ( GTK_FILE_CHOOSER ( dialog ), gsb_file_get_last_path () );
-    file_selection_set_entry ( GTK_FILE_CHOOSER ( dialog ), ".cgsb" );
+    file_selection_set_entry ( GTK_FILE_CHOOSER ( dialog ), g_strconcat ( gsb_file_get_last_path (), ".cgsb", NULL ));
 
     filter = gtk_file_filter_new ();
     gtk_file_filter_set_name ( filter, _("Grisbi category files (*.cgsb)") );
@@ -361,6 +362,9 @@
     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.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- file_obfuscate_qif.c	25 Oct 2008 13:07:53 -0000	1.2
+++ file_obfuscate_qif.c	22 Nov 2008 09:44:21 -0000	1.3
@@ -86,11 +86,9 @@
 	GtkFileFilter * filter;
 	gchar *qif_name;
 
-	file_selection = file_selection_new ( _("Open a QIF file"),
-						 FILE_SELECTION_MUST_EXIST);
-	gtk_window_set_position ( GTK_WINDOW ( file_selection ), GTK_WIN_POS_MOUSE);
-	gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (file_selection),
-					     gsb_file_get_last_path ());
+	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 ));
 
 	filter = gtk_file_filter_new ();
 	gtk_file_filter_set_name ( filter, _("QIF files (*.qif)") );
@@ -103,6 +101,9 @@
 	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: etats_onglet.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/etats_onglet.c,v
retrieving revision 1.123
retrieving revision 1.124
diff -u -d -r1.123 -r1.124
--- etats_onglet.c	29 Oct 2008 22:50:30 -0000	1.123
+++ etats_onglet.c	22 Nov 2008 09:44:21 -0000	1.124
@@ -1207,6 +1207,10 @@
 		       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 )
@@ -1278,11 +1282,9 @@
     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_MUST_EXIST);
-    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 ));
+    fenetre_nom = file_selection_new ( _("Import a report"), FILE_SELECTION_IS_OPEN_DIALOG | FILE_SELECTION_MUST_EXIST);
+    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 ));
 
     filter = gtk_file_filter_new ();
     gtk_file_filter_set_name ( filter, _("Grisbi report files (*.egsb)") );
@@ -1295,6 +1297,9 @@
     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 )



More information about the cvs mailing list