[grisbi-cvs] grisbi/src categories_onglet.c, 1.187, 1.188 imputation_budgetaire.c, 1.150, 1.151 tiers_onglet.c, 1.146, 1.147

Pierre Biava pbiava at users.sourceforge.net
Sun Feb 8 20:06:25 CET 2009


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

Modified Files:
	categories_onglet.c imputation_budgetaire.c tiers_onglet.c 
Log Message:
functions to create and editing a new category, payee and budgetary line + fr.po update strings

Index: categories_onglet.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/categories_onglet.c,v
retrieving revision 1.187
retrieving revision 1.188
diff -u -d -r1.187 -r1.188
--- categories_onglet.c	8 Feb 2009 17:54:29 -0000	1.187
+++ categories_onglet.c	8 Feb 2009 19:06:23 -0000	1.188
@@ -52,7 +52,7 @@
 static gboolean exporter_categ ( GtkButton * widget, gpointer data );
 static void importer_categ ( void );
 static gboolean popup_category_view_mode_menu ( GtkWidget * button );
-static void appui_sur_ajout_division ( GtkTreeModel * model );
+static void appui_sur_ajout_category ( GtkTreeModel * model );
 /*END_STATIC*/
 
 
@@ -61,6 +61,8 @@
 GtkWidget *arbre_categ = NULL;
 gint no_devise_totaux_categ;
 
+/* variable for the management of the cancelled edition */
+static gboolean sortie_edit_category = FALSE;
 
 /*START_EXTERN*/
 extern MetatreeInterface * category_interface ;
@@ -68,8 +70,6 @@
 /*END_EXTERN*/
 
 
-
-
 /**
  * Create and return contents of the "Category" notebook page.
  *
@@ -456,7 +456,7 @@
     button = gsb_automem_imagefile_button_new ( etat.display_toolbar,
 					       _("New\ncategory"),
 					       "new-categ.png",
-					       G_CALLBACK( appui_sur_ajout_division ),
+					       G_CALLBACK( appui_sur_ajout_category ),
 					       categ_tree_model );
     gtk_widget_set_tooltip_text ( GTK_WIDGET (button),
 				  SPACIFY(_("Create a new category")));
@@ -680,6 +680,7 @@
     {
 	if ( gtk_dialog_run ( GTK_DIALOG(dialog) ) != GTK_RESPONSE_OK )
 	{
+        sortie_edit_category = TRUE;
 	    gtk_widget_destroy ( GTK_WIDGET ( dialog ) );
 	    return FALSE;
 	}
@@ -759,14 +760,18 @@
 
 
 /**
- * function to create and editing a new category. it's very bad.
+ * function to create and editing a new category.
  *
  * \param the model for the division
  */
-void appui_sur_ajout_division ( GtkTreeModel * model )
+void appui_sur_ajout_category ( GtkTreeModel * model )
 {
     metatree_new_division ( model );
+    sortie_edit_category = FALSE;
     edit_category ( GTK_TREE_VIEW ( arbre_categ ) );
+    if ( sortie_edit_category )
+        supprimer_division ( GTK_TREE_VIEW ( arbre_categ ) );
+    sortie_edit_category = FALSE;
 }
 /* Local Variables: */
 /* c-basic-offset: 4 */

Index: tiers_onglet.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/tiers_onglet.c,v
retrieving revision 1.146
retrieving revision 1.147
diff -u -d -r1.146 -r1.147
--- tiers_onglet.c	2 Feb 2009 05:26:45 -0000	1.146
+++ tiers_onglet.c	8 Feb 2009 19:06:23 -0000	1.147
@@ -69,6 +69,7 @@
                         MetatreeInterface * iface, GtkTreeIter * iter,
                         gint division, gchar * old_payee );
 static gboolean popup_payee_view_mode_menu ( GtkWidget * button );
+static void appui_sur_ajout_payee ( GtkTreeModel * model );
 /*END_STATIC*/
 
 //~ GtkWidget *arbre_tiers = NULL;
@@ -78,6 +79,9 @@
 GtkWidget *payee_tree = NULL;
 GtkTreeStore *payee_tree_model = NULL;
 
+/* variable for the management of the cancelled edition */
+gboolean sortie_edit_payee = FALSE;
+
 /*START_EXTERN*/
 extern MetatreeInterface * payee_interface ;
 extern GtkWidget *window;
@@ -259,7 +263,7 @@
     /* Add various icons */
     button = gsb_automem_imagefile_button_new ( etat.display_toolbar,
 					       _("New payee"), "new-payee.png",
-					       G_CALLBACK(metatree_new_division),
+					       G_CALLBACK(appui_sur_ajout_payee),
 					       payee_tree_model );
     gtk_widget_set_tooltip_text ( GTK_WIDGET (button),
 				  SPACIFY(_("Create a new payee")));
@@ -561,6 +565,7 @@
     {
 	if ( gtk_dialog_run ( GTK_DIALOG(dialog) ) != GTK_RESPONSE_OK )
 	{
+        sortie_edit_payee = TRUE;
 	    gtk_widget_destroy ( GTK_WIDGET ( dialog ) );
         g_free ( title );
         g_free ( old_payee );
@@ -641,6 +646,21 @@
     }
 }
 
+
+/**
+ * function to create and editing a new payee.
+ *
+ * \param the model for the division
+ */
+void appui_sur_ajout_payee ( GtkTreeModel * model )
+{
+    metatree_new_division ( model );
+    sortie_edit_payee = FALSE;
+    edit_payee ( GTK_TREE_VIEW ( payee_tree ) );
+    if ( sortie_edit_payee )
+        supprimer_division ( GTK_TREE_VIEW ( payee_tree ) );
+    sortie_edit_payee = FALSE;
+}
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */

Index: imputation_budgetaire.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/imputation_budgetaire.c,v
retrieving revision 1.150
retrieving revision 1.151
diff -u -d -r1.150 -r1.151
--- imputation_budgetaire.c	9 Jan 2009 14:49:00 -0000	1.150
+++ imputation_budgetaire.c	8 Feb 2009 19:06:23 -0000	1.151
@@ -61,6 +61,7 @@
 static void exporter_ib ( void );
 static void importer_ib ( void );
 static gboolean popup_budgetary_line_view_mode_menu ( GtkWidget * button );
+static void appui_sur_ajout_imputation ( GtkTreeModel * model );
 /*END_STATIC*/
 
 
@@ -68,6 +69,8 @@
 GtkTreeStore *budgetary_line_tree_model = NULL;
 gint no_devise_totaux_ib;
 
+/* variable for the management of the cancelled edition */
+gboolean sortie_edit_budgetary_line = FALSE;
 
 /*START_EXTERN*/
 extern MetatreeInterface * budgetary_interface ;
@@ -486,7 +489,7 @@
     /* New budgetary line button */
     button = gsb_automem_imagefile_button_new ( etat.display_toolbar,
 					       _("New\nbudgetary line"), "new-ib.png",
-					       G_CALLBACK(metatree_new_division),
+					       G_CALLBACK(appui_sur_ajout_imputation),
 					       budgetary_line_tree_model );
     gtk_widget_set_tooltip_text ( GTK_WIDGET (button),
 				  SPACIFY(_("Create a new budgetary line")));
@@ -712,6 +715,7 @@
     {
 	if ( gtk_dialog_run ( GTK_DIALOG(dialog) ) != GTK_RESPONSE_OK )
 	{
+        sortie_edit_budgetary_line = TRUE;
 	    gtk_widget_destroy ( GTK_WIDGET ( dialog ) );
 	    return FALSE;
 	}
@@ -790,8 +794,20 @@
 }
 
 
-
-
+/**
+ * function to create and editing a new budgetary line.
+ *
+ * \param the model for the division
+ */
+void appui_sur_ajout_imputation ( GtkTreeModel * model )
+{
+    metatree_new_division ( model );
+    sortie_edit_budgetary_line = FALSE;
+    edit_budgetary_line ( GTK_TREE_VIEW ( budgetary_line_tree ) );
+    if ( sortie_edit_budgetary_line )
+        supprimer_division ( GTK_TREE_VIEW ( budgetary_line_tree ) );
+    sortie_edit_budgetary_line = FALSE;
+}
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */



More information about the cvs mailing list