[grisbi-cvs] [SCM] grisbi branch, master, updated. upstream_version_0_9_1-8-g4e4ba6e

Pierre Biava nobody at users.sourceforge.net
Tue Apr 26 22:39:29 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  4e4ba6e80f43e4af143de18c03fca68bcd192933 (commit)
       via  6735852ad1f21571819bc74647eddfd7aa1e3d94 (commit)
       via  17260b2f59b1cdea7ea93385e818377d4b10cdae (commit)
       via  7daa4cf48b7c5857a357d0dec541704f1f2ec366 (commit)
      from  96c70b1cf47cafc224ed02140a634b909af0d57f (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 4e4ba6e80f43e4af143de18c03fca68bcd192933
Author: pbiava <pierre.biava at nerim.net>
Date:   Tue Apr 26 22:37:33 2011 +0200

    added support of the expander in the tree view of left panel

commit 6735852ad1f21571819bc74647eddfd7aa1e3d94
Author: pbiava <pierre.biava at nerim.net>
Date:   Tue Apr 26 22:34:16 2011 +0200

    Fix a time lag when displaying of the context menu by Philippe Delorme

commit 17260b2f59b1cdea7ea93385e818377d4b10cdae
Author: pbiava <pierre.biava at nerim.net>
Date:   Tue Apr 26 22:23:33 2011 +0200

    correction of the saving string of historical data

commit 7daa4cf48b7c5857a357d0dec541704f1f2ec366
Author: pbiava <pierre.biava at nerim.net>
Date:   Mon Apr 25 19:49:53 2011 +0200

    corrects a problem of selection in the menu of the tab forecasts

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

Changes:
diff --git a/src/bet_data.c b/src/bet_data.c
index 2f083af..d37d650 100644
--- a/src/bet_data.c
+++ b/src/bet_data.c
@@ -822,7 +822,7 @@ GPtrArray *bet_data_get_strings_to_save ( void )
         if ( g_hash_table_size ( shd -> sub_div_list ) == 0 )
         {
             tmp_str = g_markup_printf_escaped ( "\t<Bet_historical Nb=\"%d\" Ac=\"%d\" "
-                        "Ori=\"%d\"Div=\"%d\" Edit=\"%d\" Damount=\"%s\" SDiv=\"%d\" "
+                        "Ori=\"%d\" Div=\"%d\" Edit=\"%d\" Damount=\"%s\" SDiv=\"%d\" "
                         "SEdit=\"%d\" SDamount=\"%s\" />\n",
                         tab -> len + 1,
                         shd -> account_nb,
diff --git a/src/bet_tab.c b/src/bet_tab.c
index 94db064..11f0e97 100644
--- a/src/bet_tab.c
+++ b/src/bet_tab.c
@@ -91,7 +91,8 @@ static gboolean bet_array_list_button_press ( GtkWidget *tree_view,
 static void bet_array_list_change_menu ( GtkWidget *menu_item,
                         GtkTreeSelection *tree_selection );
 static GtkWidget *bet_array_list_create_toolbar ( GtkWidget *parent, GtkWidget *tree_view );
-static void bet_array_list_context_menu ( GtkWidget *tree_view );
+static void bet_array_list_context_menu ( GtkWidget *tree_view,
+                        GtkTreePath *path );
 static void bet_array_list_delete_all_menu ( GtkWidget *menu_item,
                         GtkTreeSelection *tree_selection );
 static void bet_array_list_delete_menu ( GtkWidget *menu_item,
@@ -1318,7 +1319,18 @@ gboolean bet_array_list_button_press ( GtkWidget *tree_view,
 {
 	/* show the popup */
 	if ( ev -> button == RIGHT_BUTTON )
-        bet_array_list_context_menu ( tree_view );
+    {
+        GtkTreePath *path = NULL;
+
+        if ( gtk_tree_view_get_path_at_pos ( GTK_TREE_VIEW ( tree_view ), ev -> x, ev -> y, &path, NULL, NULL, NULL ) )
+        {
+            bet_array_list_context_menu ( tree_view, path );
+            gtk_tree_path_free ( path );
+
+            return FALSE;
+        }
+    }
+        
     if ( ev -> type == GDK_2BUTTON_PRESS )
         bet_array_list_traite_double_click ( GTK_TREE_VIEW ( tree_view ) );
 
@@ -1332,7 +1344,8 @@ gboolean bet_array_list_button_press ( GtkWidget *tree_view,
  * \param
  *
  */
-void bet_array_list_context_menu ( GtkWidget *tree_view )
+void bet_array_list_context_menu ( GtkWidget *tree_view,
+                        GtkTreePath *path )
 {
     GtkWidget *image;
     GtkWidget *menu, *menu_item;
@@ -1347,12 +1360,10 @@ void bet_array_list_context_menu ( GtkWidget *tree_view )
     gint origine;
 
     tree_selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( tree_view ) );
+    model = gtk_tree_view_get_model ( GTK_TREE_VIEW ( tree_view ) );
 
-    if ( !gtk_tree_selection_get_selected ( GTK_TREE_SELECTION ( tree_selection ),
-     &model, &iter ) )
-        return;
-
-    gtk_tree_model_get ( model, &iter, 
+    gtk_tree_model_get_iter ( model, &iter, path );
+    gtk_tree_model_get ( model, &iter,
                         SPP_ESTIMATE_TREE_SELECT_COLUMN, &select,
                         SPP_ESTIMATE_TREE_ORIGIN_DATA, &origine,
                         SPP_ESTIMATE_TREE_DATE_COLUMN, &str_date,
diff --git a/src/etats_gtktable.c b/src/etats_gtktable.c
index accafb3..dc9477b 100644
--- a/src/etats_gtktable.c
+++ b/src/etats_gtktable.c
@@ -250,6 +250,10 @@ gint gtktable_initialise ( GSList * opes_selectionnees, gchar * filename )
     if ( scrolled_window_etat && GTK_BIN ( scrolled_window_etat ) -> child )
 	gtk_widget_hide ( GTK_BIN ( scrolled_window_etat ) -> child );
 
+    /* just update screen so that the user does not see the previous report anymore
+     * while we are processing the new report */
+    update_ecran ( );
+
     table_etat = gtk_table_new ( 0, nb_colonnes, FALSE );
     gtk_table_set_col_spacings ( GTK_TABLE ( table_etat ), 5 );
 
diff --git a/src/navigation.c b/src/navigation.c
index f566a5b..2b5ff23 100644
--- a/src/navigation.c
+++ b/src/navigation.c
@@ -70,6 +70,10 @@
 
 
 /*START_STATIC*/
+static void gsb_gui_navigation_activate_expander ( GtkTreeView *tree_view,
+                        GtkTreeIter *iter,
+                        GtkTreePath *path,
+                        gpointer user_data );
 static gboolean gsb_gui_navigation_button_press ( GtkWidget *tree_view,
                         GdkEventButton *ev,
                         gpointer null );
@@ -163,6 +167,10 @@ 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";
 
+/* gestion des expandeurs */
+static gboolean account_expander = TRUE;
+static gboolean report_expander = FALSE;
+
 
 /**
  * Create the navigation pane on the left of the GUI.  It contains
@@ -294,7 +302,6 @@ GtkWidget *gsb_gui_navigation_create_navigation_pane ( void )
     }
 
     /* Finish tree. */
-/*     gtk_tree_view_expand_all ( GTK_TREE_VIEW(navigation_tree_view) );  */
     gtk_box_pack_start ( GTK_BOX(vbox), sw, TRUE, TRUE, 0 );
 
     /* Create calendar (hidden for now). */
@@ -311,6 +318,15 @@ GtkWidget *gsb_gui_navigation_create_navigation_pane ( void )
 		                G_CALLBACK ( gsb_gui_navigation_button_press ),
 		                NULL );
 
+    g_signal_connect ( G_OBJECT ( navigation_tree_view ),
+		                "row-collapsed",
+		                G_CALLBACK ( gsb_gui_navigation_activate_expander ),
+		                GINT_TO_POINTER ( 0 ) );
+    g_signal_connect ( G_OBJECT ( navigation_tree_view ),
+		                "row-expanded",
+		                G_CALLBACK ( gsb_gui_navigation_activate_expander ),
+		                GINT_TO_POINTER ( 1 ) );
+
     gtk_widget_show_all ( vbox );
     gtk_widget_hide_all ( scheduler_calendar );
     gtk_widget_hide_all ( reconcile_panel );
@@ -488,9 +504,12 @@ void gsb_gui_navigation_create_account_list ( GtkTreeModel *model )
     }
 
     /* Expand stuff */
-    path = gtk_tree_model_get_path ( GTK_TREE_MODEL ( model ), &parent );
-    gtk_tree_view_expand_to_path ( GTK_TREE_VIEW ( navigation_tree_view ), path );
-    gtk_tree_path_free ( path );
+    if ( account_expander )
+    {
+        path = gtk_tree_model_get_path ( GTK_TREE_MODEL ( model ), &parent );
+        gtk_tree_view_expand_to_path ( GTK_TREE_VIEW ( navigation_tree_view ), path );
+        gtk_tree_path_free ( path );
+    }
 }
 
 
@@ -538,6 +557,14 @@ void gsb_gui_navigation_create_report_list ( GtkTreeModel *model )
 	
         tmp_list = tmp_list -> next;
     }
+
+    /* Expand stuff */
+    if ( report_expander )
+    {
+        path = gtk_tree_model_get_path ( GTK_TREE_MODEL ( model ), &parent );
+        gtk_tree_view_expand_to_path ( GTK_TREE_VIEW ( navigation_tree_view ), path );
+        gtk_tree_path_free ( path );
+    }
 }
 
 
@@ -1064,6 +1091,9 @@ gboolean gsb_gui_navigation_select_line ( GtkTreeSelection *selection,
     page_number = gsb_gui_navigation_get_current_page ();
     gtk_notebook_set_current_page ( GTK_NOTEBOOK ( gsb_gui_get_general_notebook ( ) ), page_number );
 
+    /* step forward in GUI loops (context menu, ...) */
+/*     update_ecran ( );  */
+
     if ( page_number != GSB_ACCOUNT_PAGE )
     {
         gsb_gui_sensitive_menu_item ( "/menubar/EditMenu/NewTransaction", FALSE );
@@ -2069,6 +2099,31 @@ void gsb_gui_navigation_context_menu ( GtkWidget *tree_view,
 }
 
 
+void gsb_gui_navigation_activate_expander ( GtkTreeView *tree_view,
+                        GtkTreeIter *iter,
+                        GtkTreePath *path,
+                        gpointer user_data )
+{
+    GtkTreeModel *model;
+    gint type_page;
+
+    model = gtk_tree_view_get_model ( GTK_TREE_VIEW ( tree_view ) );
+
+    gtk_tree_model_get ( model, iter, NAVIGATION_PAGE, &type_page, -1 );
+
+    switch ( type_page )
+    {
+        case GSB_HOME_PAGE :
+        case GSB_ACCOUNT_PAGE :
+            account_expander = GPOINTER_TO_INT ( user_data );
+        break;
+        case GSB_REPORTS_PAGE :
+            report_expander = GPOINTER_TO_INT ( user_data );
+        break;
+    }
+}
+
+
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */


hooks/post-receive
-- 
grisbi


More information about the cvs mailing list