[grisbi-cvs] [SCM] grisbi branch, master, updated. upstream_version_0_9.0-142-gc4a6d9a

Pierre Biava nobody at users.sourceforge.net
Sat Apr 23 08:16:14 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  c4a6d9a81dd14376ad8ecf7692430d48c59d439f (commit)
      from  d5bac9f7d6bd104ea7390b398e3f1da2e7620aec (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 c4a6d9a81dd14376ad8ecf7692430d48c59d439f
Author: pbiava <pierre.biava at nerim.net>
Date:   Sat Apr 23 08:11:37 2011 +0200

    minor changes to the management of left panel of Grisbi.

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

Changes:
diff --git a/src/navigation.c b/src/navigation.c
index cf822e8..e6474b0 100644
--- a/src/navigation.c
+++ b/src/navigation.c
@@ -146,9 +146,15 @@ GtkWidget *reconcile_panel;
  * at the end of the switch, contains the current account number */
 static gint buffer_last_account = -1;
 
-/** contains a g_queue of struct_page */
+/* contains a g_queue of struct_page */
 static GQueue *pages_list = NULL;
 
+/* nombre de pages du panneau de gauche */
+static gint navigation_nbre_pages = 7;
+
+/* ordre par défaut des pages du panneau de gauche */
+const gchar *default_navigation_order_list = "0-2-3-4-5-6-7";
+
 
 /**
  * Create the navigation pane on the left of the GUI.  It contains
@@ -1718,13 +1724,23 @@ gboolean gsb_gui_navigation_set_page_list_order ( const gchar *order_list )
 {
     gchar **pointeur_char;
     gint i;
+    gint nbre_pages;
 
     if ( pages_list )
         gsb_gui_navigation_clear_pages_list ( );
 
     pointeur_char = g_strsplit ( order_list, "-", 0 );
 
-    for ( i = 0 ; i < g_strv_length ( pointeur_char ) ; i++ )
+    nbre_pages = g_strv_length ( pointeur_char );
+
+    if ( nbre_pages != navigation_nbre_pages )
+    {
+        g_strfreev ( pointeur_char );
+        pointeur_char = g_strsplit ( default_navigation_order_list, "-", 0 );
+        nbre_pages = navigation_nbre_pages;
+    }
+
+    for ( i = 0 ; i < nbre_pages ; i++ )
     {
         struct_page *page;
 
@@ -1735,6 +1751,8 @@ gboolean gsb_gui_navigation_set_page_list_order ( const gchar *order_list )
         g_queue_push_tail ( pages_list, page );
     }
 
+    g_strfreev ( pointeur_char );
+
     return TRUE;
 }
 
@@ -1744,13 +1762,13 @@ gboolean gsb_gui_navigation_set_page_list_order ( const gchar *order_list )
  *
  *
  */
-void gsb_gui_navigation_init_pages_list ( const gchar *order_list )
+void gsb_gui_navigation_init_pages_list ( void )
 {
     GQueue *new_queue;
 
-    new_queue = g_queue_new ( );   
+    new_queue = g_queue_new ( );
     pages_list = new_queue;
-    gsb_gui_navigation_set_page_list_order ( order_list );
+    gsb_gui_navigation_set_page_list_order ( default_navigation_order_list );
 }
 
 
diff --git a/src/navigation.h b/src/navigation.h
index e518863..7a70561 100644
--- a/src/navigation.h
+++ b/src/navigation.h
@@ -45,7 +45,7 @@ gint gsb_gui_navigation_get_last_account ( void );
 GtkTreeModel *gsb_gui_navigation_get_model ( void );
 GQueue *gsb_gui_navigation_get_pages_list ( void );
 GtkWidget *gsb_gui_navigation_get_tree_view ( void );
-void gsb_gui_navigation_init_pages_list ( const gchar *order_list );
+void gsb_gui_navigation_init_pages_list ( void );
 void gsb_gui_navigation_init_tree_view ( void );
 void gsb_gui_navigation_remove_account ( gint account_number );
 void gsb_gui_navigation_remove_report ( gint report_number );
diff --git a/src/traitement_variables.c b/src/traitement_variables.c
index ed80fcc..8319357 100644
--- a/src/traitement_variables.c
+++ b/src/traitement_variables.c
@@ -292,7 +292,6 @@ void init_variables ( void )
     gint transaction_col_width_init[CUSTOM_MODEL_VISIBLE_COLUMNS] = {10, 12, 36, 6, 12, 12, 12 };
     gint bet_array_col_width_init[BET_ARRAY_COLUMNS] = {15, 40, 15, 15, 15 };
     gint transaction_col_align_init[CUSTOM_MODEL_VISIBLE_COLUMNS] = { 1, 1, 0, 1, 2, 2, 2 };
-    gchar *default_navigation_order_list = "0-2-3-4-5-6-7";
     gint i;
     
 /* xxx on devrait séparer ça en 2 : les variables liées au fichier de compte, qui doivent être remises  à 0,
@@ -309,7 +308,7 @@ void init_variables ( void )
     initialise_number_separators ( );
 
     /* initialise l'ordre des pages du panneau de gauche */
-    gsb_gui_navigation_init_pages_list ( default_navigation_order_list );
+    gsb_gui_navigation_init_pages_list ( );
 
     /* if ever there is still something from the previous list,
      * erase now */


hooks/post-receive
-- 
grisbi


More information about the cvs mailing list