[grisbi-cvs] grisbi/src dialog.c, 1.78, 1.79 gsb_transactions_list.c, 1.197, 1.198

Pierre Biava pbiava at users.sourceforge.net
Sun Mar 7 08:58:06 CET 2010


Update of /cvsroot/grisbi/grisbi/src
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv9924/src

Modified Files:
	dialog.c gsb_transactions_list.c 
Log Message:
Changes to make the optional messages on reconciliation.

Index: gsb_transactions_list.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_transactions_list.c,v
retrieving revision 1.197
retrieving revision 1.198
diff -u -d -r1.197 -r1.198
--- gsb_transactions_list.c	21 Feb 2010 20:48:39 -0000	1.197
+++ gsb_transactions_list.c	7 Mar 2010 07:58:04 -0000	1.198
@@ -164,6 +164,7 @@
 
 /*START_EXTERN*/
 extern GSList *liste_labels_titres_colonnes_liste_ope;
+extern struct conditional_message messages[];
 extern gint mise_a_jour_fin_comptes_passifs;
 extern gint mise_a_jour_liste_comptes_accueil;
 extern gint mise_a_jour_liste_echeances_auto_accueil;
@@ -1533,6 +1534,8 @@
     GtkTreeIter iter;
     gint r_column;
     GtkTreeModel *model;
+    gint msg_no = 0;
+    gchar *tmp_str;
 
     r_column = find_element_col (ELEMENT_MARK);
     if ( r_column == -1 )
@@ -1545,33 +1548,37 @@
     /* if we are reconciling, cancel the action */
     if (etat.equilibrage)
     {
-	dialogue_error ( _("You cannot switch a transaction between R and non R while reconciling.\nPlease finish or cancel the reconciliation first."));
-	return FALSE;
+        dialogue_error ( _("You cannot switch a transaction between R and non R "
+                         "while reconciling.\nPlease finish or cancel the "
+                         "reconciliation first.") );
+        return FALSE;
     }
 
     /* if it's a child, we ask if we want to work with the mother */
     if (gsb_data_transaction_get_mother_transaction_number (transaction_number))
     {
-	if (question_yes_no_hint ( _("Confirmation of manual (un)reconciliation"),
+        msg_no = question_conditional_yes_no_get_no_struct ( &messages[0],
+                        "reconcile-transaction" );
+    	tmp_str = g_strdup_printf ( 
 				   _("You are trying to reconcile or unreconcile a transaction manually, "
-				     "which is not a recommended action. Are you really sure you know what you are doing?"
-				     "manually a transaction which isn't a regular way to do.\n\n"
+				     "which is not a recommended action.This is the wrong approach.\n\n"
 				     "And moreover the transaction you try to reconcile is a child of split, so "
 				     "the modification will be done on the mother and all its children.\n\n"
-				     "Are you really sure to know what you do?"),
-				   GTK_RESPONSE_NO ))
-	    /* he says ok, so transaction_number becomes the mother */
-	    transaction_number = gsb_data_transaction_get_mother_transaction_number (transaction_number);
-	else
-	    return FALSE;
+				     "Are you really sure to know what you do?") );
+        messages[msg_no].message = tmp_str;
+        if ( question_conditional_yes_no_with_struct ( &messages[msg_no] ) )
+        {
+            /* he says ok, so transaction_number becomes the mother */
+            transaction_number = gsb_data_transaction_get_mother_transaction_number (
+                        transaction_number );
+        }
+	    else
+	        return FALSE;
     }
     else
-	/* it's a normal transaction, ask to be sure */
-	if ( !question_yes_no_hint ( _("Confirmation of manual (un)reconciliation"),
-				     _("You are trying to reconcile or unreconcile a transaction manually, "
-				       "which is not a recommended action. Are you really sure you know what you are doing?"),
-				     GTK_RESPONSE_NO ))
-	    return FALSE;
+	    /* it's a normal transaction, ask to be sure */
+        if ( !question_conditional_yes_no ( "reconcile-transaction" ) )
+	        return FALSE;
 
     model = GTK_TREE_MODEL (transaction_model_get_model());
 
@@ -1587,9 +1594,7 @@
 	/* ok, this is a R transaction, we just un-R it but keep the reconcile_number into the transaction */
 	gsb_data_transaction_set_marked_transaction ( transaction_number,
 						      OPERATION_NORMALE );
-	transaction_list_set ( &iter,
-			       r_column, NULL,
-			       -1 );
+	transaction_list_set ( &iter, r_column, NULL, -1 );
     }
     else
     {
@@ -1599,7 +1604,7 @@
 	gint reconcile_number;
 
 	reconcile_number = gsb_transactions_list_choose_reconcile ( account_number,
-								    gsb_data_transaction_get_reconcile_number (transaction_number));
+						gsb_data_transaction_get_reconcile_number (transaction_number));
 	if (!reconcile_number)
 	    return FALSE;
 
@@ -1609,9 +1614,7 @@
 						    reconcile_number );
 
 	/* set the R on the transaction */
-	transaction_list_set ( &iter,
-			       r_column, g_strdup ( _("R") ),
-			       -1 );
+	transaction_list_set ( &iter, r_column, g_strdup ( _("R") ), -1 );
 
 	/* if we don't want to see the marked R transactions, we re-filter the model */
 	if ( !gsb_data_account_get_r (account_number) )
@@ -1650,6 +1653,7 @@
 
 	    list_tmp_transactions = list_tmp_transactions -> next;
 	}
+        transaction_list_update_element ( ELEMENT_MARK );
     }
     /* need to update the marked amount on the home page */
     mise_a_jour_liste_comptes_accueil = 1;

Index: dialog.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/dialog.c,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -d -r1.78 -r1.79
--- dialog.c	10 Jan 2010 20:11:36 -0000	1.78
+++ dialog.c	7 Mar 2010 07:58:04 -0000	1.79
@@ -94,6 +94,12 @@
       N_("Grisbi found no known inconsistency in accounts processed."),
       FALSE, FALSE, },
 
+    { "reconcile-transaction", N_("Confirmation of manual (un)reconciliation"),
+      N_("You are trying to reconcile or unreconcile a transaction manually, "
+	  "which is not a recommended action.\n"
+      "Are you really sure you know what you are doing?"), 
+      FALSE, FALSE, },
+
     { "reconcile-start-end-dates", N_("Reconcile start and end dates."),
       N_("In previous versions, Grisbi did not save start date, end date and balance for "
       "reconciliation.  This is now done, so Grisbi will try to guess values from your "



More information about the cvs mailing list