[grisbi-cvs] [SCM] grisbi branch, master, updated. upstream_version_0_9_2-5-g9845f1b

Pierre Biava nobody at users.sourceforge.net
Sun Jun 5 21:51:15 CEST 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grisbi".

The branch, master has been updated
       via  9845f1b9fb1301d4c29f31f680ea285a264461cf (commit)
      from  3473764e42b3fab9b5075215d8fb6647a9e7ab00 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 9845f1b9fb1301d4c29f31f680ea285a264461cf
Author: pbiava <pierre.biava at nerim.net>
Date:   Sun Jun 5 21:41:24 2011 +0200

    simplification of the code of the transaction list

-----------------------------------------------------------------------

Changes:
diff --git a/src/affichage_liste.c b/src/affichage_liste.c
index de6166a..d18e689 100644
--- a/src/affichage_liste.c
+++ b/src/affichage_liste.c
@@ -447,7 +447,7 @@ void recuperation_noms_colonnes_et_tips ( void )
 	for ( j=0 ; j<CUSTOM_MODEL_VISIBLE_COLUMNS ; j++ )
 	{
 	    /* 	    xxx changer ça pour faire une fonction comme gsb_form_widget_get_name */
-	    row[j] = gsb_variables_get_titre_colonne_liste_ope ( tab_affichage_ope[i][j] - 1 );
+	    row[j] = gsb_transaction_list_get_titre_colonne_liste_ope ( tab_affichage_ope[i][j] - 1 );
 
 	    /* on the first row, set for titles and tips, for others row, only for tips */
 	    if ( i )
@@ -1035,7 +1035,7 @@ gboolean gsb_transaction_list_config_drag_end ( GtkWidget *tree_view,
     old_element = tab_affichage_ope[end_drag_row][end_drag_column];
     if ( old_element )
     {
-        string = gsb_variables_get_titre_colonne_liste_ope ( old_element - 1 );
+        string = gsb_transaction_list_get_titre_colonne_liste_ope ( old_element - 1 );
         gsb_transaction_list_config_button_set_active_from_string ( tree_view, string, FALSE );
 
         g_free ( string );
@@ -1051,7 +1051,7 @@ gboolean gsb_transaction_list_config_drag_end ( GtkWidget *tree_view,
     /* modifie le titre de la colonne si nécessaire */
     if ( end_drag_row == 0 )
     {
-        string = gsb_variables_get_titre_colonne_liste_ope ( element - 1 );
+        string = gsb_transaction_list_get_titre_colonne_liste_ope ( element - 1 );
         gtk_tree_view_column_set_title  ( tree_column, string );
 
         g_free ( string );
@@ -1171,7 +1171,7 @@ gboolean gsb_transaction_list_config_fill_store ( GtkWidget *tree_view )
 
         for ( j=0 ; j<CUSTOM_MODEL_VISIBLE_COLUMNS ; j++ )
         {
-            row[j] = gsb_variables_get_titre_colonne_liste_ope ( tab_affichage_ope[i][j] - 1 );
+            row[j] = gsb_transaction_list_get_titre_colonne_liste_ope ( tab_affichage_ope[i][j] - 1 );
             /* on met le nom dans les lignes paires et le numéro de l'élément dans las lignes impaires */
             gtk_list_store_set ( GTK_LIST_STORE ( store ), &iter,
                         2*j, row[j],
@@ -1208,7 +1208,7 @@ GtkWidget *gsb_transaction_list_config_create_buttons_table ( GtkWidget *tree_vi
 	    gchar *string;
 	    gchar *changed_string;
 
-	    string = gsb_variables_get_titre_colonne_liste_ope ( current_number );
+	    string = gsb_transaction_list_get_titre_colonne_liste_ope ( current_number );
 
 	    if ( string )
 	    {
diff --git a/src/gsb_transactions_list.c b/src/gsb_transactions_list.c
index f2163e0..c6c81dc 100644
--- a/src/gsb_transactions_list.c
+++ b/src/gsb_transactions_list.c
@@ -160,8 +160,8 @@ gint current_tree_view_width = 0;
  * when some children didn't find their mother */
 GSList *orphan_child_transactions = NULL;
 
-/* names of the cells */
-static gchar *cell_views[] = {
+/* names of the data for transactions list */
+static gchar *labels_titres_colonnes_liste_ope[] = {
     N_("Date"),
     N_("Value date"),
     N_("Payee"),
@@ -2601,9 +2601,13 @@ GtkWidget *gsb_gui_create_cell_contents_menu ( int x, int y )
 
     menu = gtk_menu_new ();
 
-    for ( i = 0 ; cell_views[i] != NULL ; i++ )
+    for ( i = 0 ; i < 18 ; i++ )
     {
-        item = gtk_menu_item_new_with_label ( _(cell_views[i]) );
+        gchar *tmp_str;
+
+        tmp_str = gsb_transaction_list_get_titre_colonne_liste_ope ( i );
+        item = gtk_menu_item_new_with_label ( tmp_str );
+        g_free ( tmp_str );
 
         g_object_set_data ( G_OBJECT (item), "x", GINT_TO_POINTER (x) );
         g_object_set_data ( G_OBJECT (item), "y", GINT_TO_POINTER (y) );
@@ -3299,7 +3303,7 @@ gboolean gsb_transactions_list_title_column_button_press ( GtkWidget *button,
                 break;
 
                 default:
-                temp = gsb_variables_get_titre_colonne_liste_ope ( tab_affichage_ope[i][column_number] - 1 );
+                temp = gsb_transaction_list_get_titre_colonne_liste_ope ( tab_affichage_ope[i][column_number] - 1 );
             }
 
             if ( temp && strcmp ( temp, _("Balance") ) )
@@ -4482,6 +4486,19 @@ void gsb_transaction_list_set_visible_archived_button ( gboolean visible )
 }
 
 
+/**
+ * retourne le titre d'une colonne de la liste des opérations.
+ *
+ *\param numéro de l'élément demandé
+ *
+ *\return une chaine traduite qui doit être libérée.
+ * */
+gchar *gsb_transaction_list_get_titre_colonne_liste_ope ( gint element )
+{
+    return g_strdup ( gettext ( labels_titres_colonnes_liste_ope[element] ) );
+}
+
+
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */
diff --git a/src/gsb_transactions_list.h b/src/gsb_transactions_list.h
index 08c42b1..eb7de5b 100644
--- a/src/gsb_transactions_list.h
+++ b/src/gsb_transactions_list.h
@@ -62,6 +62,7 @@ gboolean gsb_transactions_list_edit_transaction_by_pointer ( gint *transaction_n
 gboolean gsb_transactions_list_fill_archive_store ( void );
 gfloat gsb_transactions_list_get_row_align ( void );
 GtkWidget *gsb_transactions_list_get_toolbar ( void );
+gchar *gsb_transaction_list_get_titre_colonne_liste_ope ( gint element );
 GtkWidget *gsb_transactions_list_get_tree_view (void);
 gchar *gsb_transactions_list_grep_cell_content ( gint transaction_number,
                         gint cell_content_number );
diff --git a/src/traitement_variables.c b/src/traitement_variables.c
index dfd970d..7ae28c6 100644
--- a/src/traitement_variables.c
+++ b/src/traitement_variables.c
@@ -88,28 +88,6 @@ static void initialise_number_separators ( void );
 static void initialise_tab_affichage_ope ( void );
 /*END_STATIC*/
 
-static gchar *labels_titres_colonnes_liste_ope[] = {
-    N_("Date"),
-    N_("Value date"),
-    N_("Payee"),
-    N_("Budgetary lines"),
-    N_("Debit"),
-    N_("Credit"),
-    N_("Balance"),
-    N_("Amount"),
-    N_("Method of payment"),
-    N_("Reconciliation ref."),
-    N_("Financial year"),
-    N_("Category"),
-    N_("C/R"),
-    N_("Voucher"),
-    N_("Notes"),
-    N_("Bank references"),
-    N_("Transaction number"),
-    N_("Number"),
-    NULL };
-
-
 /* background color */
 #define BG_COLOR_1_RED      55000
 #define BG_COLOR_1_GREEN    55000
@@ -826,19 +804,6 @@ void initialise_number_separators ( void )
 }
 
 
-/**
- * retourne le titre d'une colonne de la liste des opérations.
- *
- *\param numéro de l'élément demandé
- *
- *\return une chaine traduite qui doit être libérée.
- * */
-gchar *gsb_variables_get_titre_colonne_liste_ope ( gint element )
-{
-    return g_strdup ( gettext ( labels_titres_colonnes_liste_ope[element] ) );
-}
-
-
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */
diff --git a/src/traitement_variables.h b/src/traitement_variables.h
index 31bcc8f..51b420f 100644
--- a/src/traitement_variables.h
+++ b/src/traitement_variables.h
@@ -12,7 +12,6 @@ void free_variables ( void );
 void init_variables ( void );
 void initialisation_couleurs_listes ( void );
 void initialise_largeur_colonnes_tab_affichage_ope ( gint type_operation, const gchar *description );
-gchar *gsb_variables_get_titre_colonne_liste_ope ( gint element );
 void menus_sensitifs ( gboolean sensitif );
 void menus_view_sensitifs ( gboolean sensitif );
 void modification_fichier ( gboolean modif );


hooks/post-receive
-- 
grisbi


More information about the cvs mailing list