[grisbi-cvs] grisbi/src accueil.c, 1.227, 1.227.2.1 balance_estimate_future.c, 1.9, 1.9.4.1 balance_estimate_future.h, 1.5, 1.5.4.1 balance_estimate_tab.c, 1.65, 1.65.2.1 gsb_account_property.c, 1.52, 1.52.2.1 gsb_data_transaction.c, 1.87, 1.87.2.1 gsb_file_load.c, 1.220, 1.220.2.1 gsb_plugins.c, 1.23, 1.23.2.1 gsb_transactions_list_sort.c, 1.23, 1.23.4.1 gtk_combofix.c, 1.75, 1.75.4.1 main.c, 1.172, 1.172.2.1 main.h, 1.11, 1.11.2.1 parse_cmdline.c, 1.16, 1.16.4.1 structures.h, 1.245, 1.245.2.1

Pierre Biava pbiava at users.sourceforge.net
Sun Apr 25 16:13:40 CEST 2010


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

Modified Files:
      Tag: version_0_7_0
	accueil.c balance_estimate_future.c balance_estimate_future.h 
	balance_estimate_tab.c gsb_account_property.c 
	gsb_data_transaction.c gsb_file_load.c gsb_plugins.c 
	gsb_transactions_list_sort.c gtk_combofix.c main.c main.h 
	parse_cmdline.c structures.h 
Log Message:
init version_0_7_0

Index: structures.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/structures.h,v
retrieving revision 1.245
retrieving revision 1.245.2.1
diff -u -d -r1.245 -r1.245.2.1
--- structures.h	5 Apr 2010 21:24:53 -0000	1.245
+++ structures.h	25 Apr 2010 14:13:38 -0000	1.245.2.1
@@ -189,7 +189,8 @@
     SPP_ORIGIN_TRANSACTION,
     SPP_ORIGIN_SCHEDULED,
     SPP_ORIGIN_HISTORICAL,
-    SPP_ORIGIN_FUTURE
+    SPP_ORIGIN_FUTURE,
+    SPP_ORIGIN_ACCOUNT
 };
 
 

Index: gsb_data_transaction.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_data_transaction.c,v
retrieving revision 1.87
retrieving revision 1.87.2.1
diff -u -d -r1.87 -r1.87.2.1
--- gsb_data_transaction.c	18 Apr 2010 07:53:06 -0000	1.87
+++ gsb_data_transaction.c	25 Apr 2010 14:13:38 -0000	1.87.2.1
@@ -647,7 +647,7 @@
     if ( !transaction )
 	return NULL;
 
-    if ( transaction -> value_date )
+    if ( transaction -> value_date && g_date_valid ( transaction -> value_date ) )
         return transaction -> value_date;
     else
         return transaction -> date;

Index: gtk_combofix.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gtk_combofix.c,v
retrieving revision 1.75
retrieving revision 1.75.4.1
diff -u -d -r1.75 -r1.75.4.1
--- gtk_combofix.c	5 Apr 2010 21:24:53 -0000	1.75
+++ gtk_combofix.c	25 Apr 2010 14:13:38 -0000	1.75.4.1
@@ -1575,6 +1575,8 @@
 
         if ( tmp_str
          &&
+         tmp_item
+         &&
          g_utf8_collate ( g_utf8_casefold ( tmp_str, -1 ),
          g_utf8_casefold ( tmp_item, -1 ) ) == 0 )
             break;
@@ -1820,6 +1822,11 @@
             gchar *cmp_string_1;
             gchar *cmp_string_2;
 
+            if ( string_1 == NULL )
+                return -1;
+            if ( string_2 == NULL )
+                return 1;
+
             cmp_string_1 = g_utf8_collate_key (string_1, -1);
             cmp_string_2 = g_utf8_collate_key (string_2, -1);
             return_value = g_ascii_strcasecmp ( cmp_string_1,

Index: balance_estimate_future.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/balance_estimate_future.h,v
retrieving revision 1.5
retrieving revision 1.5.4.1
diff -u -d -r1.5 -r1.5.4.1
--- balance_estimate_future.h	3 Apr 2010 19:57:41 -0000	1.5
+++ balance_estimate_future.h	25 Apr 2010 14:13:38 -0000	1.5.4.1
@@ -8,6 +8,8 @@
 
 
 /* START_DECLARATION */
+gboolean bet_account_new_line_dialog ( GtkTreeModel *tab_model,
+                        gchar *str_date );
 gboolean bet_future_modify_line ( gint account_number,
                         gint number,
                         gint mother_row );

Index: parse_cmdline.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/parse_cmdline.c,v
retrieving revision 1.16
retrieving revision 1.16.4.1
diff -u -d -r1.16 -r1.16.4.1
--- parse_cmdline.c	23 Nov 2008 09:44:40 -0000	1.16
+++ parse_cmdline.c	25 Apr 2010 14:13:38 -0000	1.16.4.1
@@ -166,7 +166,7 @@
 void show_version(void)
 {
 #ifdef HAVE_PLUGINS
-    gsb_plugins_scan_dir ( PLUGINS_DIR );
+    gsb_plugins_scan_dir ( PLUGINS_DIRECTORY );
 #endif
 
     g_print(N_("Grisbi version %s, %s\n"), VERSION, gsb_plugin_get_list());
@@ -195,7 +195,7 @@
  *
  * \private
  */
-void   show_usage(gint errval, gchar* extra)
+void show_usage ( gint errval, gchar* extra )
 {
     show_errstr(errval,extra);
     g_printerr(USAGE_STRING);

Index: gsb_account_property.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_account_property.c,v
retrieving revision 1.52
retrieving revision 1.52.2.1
diff -u -d -r1.52 -r1.52.2.1
--- gsb_account_property.c	18 Apr 2010 14:38:28 -0000	1.52
+++ gsb_account_property.c	25 Apr 2010 14:13:38 -0000	1.52.2.1
@@ -627,6 +627,7 @@
 
     /* fill bank information */
     bank_number = gsb_data_account_get_bank (current_account);
+    gsb_account_property_set_label_code_bic ( bank_number );
 
     gsb_account_property_iban_set_iban (
                         gsb_data_account_get_bank_account_iban (current_account) );

Index: accueil.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/accueil.c,v
retrieving revision 1.227
retrieving revision 1.227.2.1
diff -u -d -r1.227 -r1.227.2.1
--- accueil.c	20 Apr 2010 21:34:33 -0000	1.227
+++ accueil.c	25 Apr 2010 14:13:38 -0000	1.227.2.1
@@ -2022,7 +2022,7 @@
     /* create the model */
     list_store = gsb_partial_balance_create_model ( );
 
-    /* remplit le modèle si nécessaire */
+    /* populate the model if necessary */
     if ( g_slist_length ( gsb_data_partial_balance_get_list ( ) ) > 0 )
         gsb_partial_balance_fill_model ( list_store );
 

Index: gsb_transactions_list_sort.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_transactions_list_sort.c,v
retrieving revision 1.23
retrieving revision 1.23.4.1
diff -u -d -r1.23 -r1.23.4.1
--- gsb_transactions_list_sort.c	5 Apr 2010 21:24:53 -0000	1.23
+++ gsb_transactions_list_sort.c	25 Apr 2010 14:13:38 -0000	1.23.4.1
@@ -538,36 +538,42 @@
                         gint transaction_number_2 )
 {
     gint return_value;
+    gint party_number_1;
+    gint party_number_2;
 
-    if ( gsb_data_transaction_get_party_number ( transaction_number_1)== gsb_data_transaction_get_party_number ( transaction_number_2))
-	return_value = gsb_transactions_list_sort_by_transaction_date_and_no(transaction_number_1, transaction_number_2);
+    party_number_1 = gsb_data_transaction_get_party_number ( transaction_number_1 );
+    party_number_2 = gsb_data_transaction_get_party_number ( transaction_number_2 );
+
+    if (  party_number_1 == party_number_2 )
+	    return_value = gsb_transactions_list_sort_by_transaction_date_and_no (
+                        transaction_number_1, transaction_number_2 );
     else
     {
-	const gchar *temp_1;
-	const gchar *temp_2;
+        const gchar *temp_1;
+        const gchar *temp_2;
 
-	temp_1 = gsb_data_payee_get_name ( gsb_data_transaction_get_party_number ( transaction_number_1),
-					   TRUE );
-	temp_2 = gsb_data_payee_get_name ( gsb_data_transaction_get_party_number ( transaction_number_2),
-					   TRUE );
+        temp_1 = gsb_data_payee_get_name ( party_number_1, TRUE );
+        if ( temp_1 == NULL )
+            return -1;
 
-	/* g_utf8_collate is said not very fast, must try with big big account to check
-	 * if it's enough, for me it's ok (cedric), eventually, change with gsb_strcasecmp */
-	return_value = g_utf8_collate ( g_utf8_casefold ( temp_1 ? temp_1 : "",
-							  -1 ),
-					g_utf8_casefold ( temp_2 ? temp_2 : "",
-							  -1 ));
+        temp_2 = gsb_data_payee_get_name ( party_number_2, TRUE );
+        if ( temp_2 == NULL )
+            return 1;
+
+        /* g_utf8_collate is said not very fast, must try with big big account to check
+         * if it's enough, for me it's ok (cedric), eventually, change with gsb_strcasecmp */
+        return_value = g_utf8_collate ( g_utf8_casefold ( temp_1 ? temp_1 : "", -1 ),
+                        g_utf8_casefold ( temp_2 ? temp_2 : "", -1 ));
     }
 
     if ( return_value )
-	return return_value;
+        return return_value;
     else
-	return gsb_transactions_list_sort_by_transaction_date_and_no (transaction_number_1, transaction_number_2);
+        return gsb_transactions_list_sort_by_transaction_date_and_no (
+                        transaction_number_1, transaction_number_2);
 }
 
 
-
-
 /** used to compare 2 iters and sort the by budgetary first, and 
  * by date and no transaction after
  * always put the white line below
@@ -580,40 +586,52 @@
                         gint transaction_number_2 )
 {
     gint return_value;
+    gint budgetary_number_1;
+    gint budgetary_number_2;
+    gint sub_budgetary_number_1;
+    gint sub_budgetary_number_2;
 
-    if ( gsb_data_transaction_get_budgetary_number ( transaction_number_1) == gsb_data_transaction_get_budgetary_number ( transaction_number_2)
+    budgetary_number_1 = gsb_data_transaction_get_budgetary_number ( transaction_number_1 );
+    budgetary_number_2 = gsb_data_transaction_get_budgetary_number ( transaction_number_2 );
+    sub_budgetary_number_1 = gsb_data_transaction_get_sub_budgetary_number ( transaction_number_1 );
+    sub_budgetary_number_2 = gsb_data_transaction_get_sub_budgetary_number ( transaction_number_2 );
+
+    if ( budgetary_number_1 == budgetary_number_2
 	 &&
-	 gsb_data_transaction_get_sub_budgetary_number ( transaction_number_1)== gsb_data_transaction_get_sub_budgetary_number ( transaction_number_2))
-	return_value = gsb_transactions_list_sort_by_transaction_date_and_no(transaction_number_1, transaction_number_2);
+	 sub_budgetary_number_1 == sub_budgetary_number_2 )
+	    return_value = gsb_transactions_list_sort_by_transaction_date_and_no(
+                        transaction_number_1, transaction_number_2 );
     else
     {
-	const gchar *temp_1;
-	const gchar *temp_2;
+        const gchar *temp_1;
+        const gchar *temp_2;
 
-	temp_1 = gsb_data_budget_get_name ( gsb_data_transaction_get_budgetary_number ( transaction_number_1),
-					    gsb_data_transaction_get_sub_budgetary_number ( transaction_number_1),
-					    NULL );
-	temp_2 = gsb_data_budget_get_name ( gsb_data_transaction_get_budgetary_number ( transaction_number_2),
-					    gsb_data_transaction_get_sub_budgetary_number ( transaction_number_2),
-					    NULL);
+        temp_1 = gsb_data_budget_get_name ( budgetary_number_1,
+                            sub_budgetary_number_1,
+                            NULL );
+        if ( temp_1 == NULL )
+            return -1;
 
-	/* g_utf8_collate is said not very fast, must try with big big account to check
-	 * if it's enough, for me it's ok (cedric), eventually, change with gsb_strcasecmp */
-	return_value = g_utf8_collate ( g_utf8_casefold ( temp_1 ? temp_1 : "",
-							  -1 ),
-					g_utf8_casefold ( temp_2 ? temp_2 : "",
-							  -1 ));
+        temp_2 = gsb_data_budget_get_name ( budgetary_number_2,
+                            sub_budgetary_number_2,
+                            NULL);
+        if ( temp_2 == NULL )
+            return 1;
+
+        /* g_utf8_collate is said not very fast, must try with big big account to check
+         * if it's enough, for me it's ok (cedric), eventually, change with gsb_strcasecmp */
+        return_value = g_utf8_collate ( g_utf8_casefold ( temp_1 ? temp_1 : "", -1 ),
+                        g_utf8_casefold ( temp_2 ? temp_2 : "", -1 ) );
     }
 
     if ( return_value )
-	return return_value;
+	    return return_value;
     else
-	return gsb_transactions_list_sort_by_transaction_date_and_no(transaction_number_1, transaction_number_2);
+	    return gsb_transactions_list_sort_by_transaction_date_and_no (
+                        transaction_number_1, transaction_number_2);
 }
 
 
-
-
 /**
  * used to compare 2 iters and sort the by credit amount first, and 
  * by date and no transaction after
@@ -707,7 +725,7 @@
 
     /* if it's the same type, we sort by the content of the types */
 
-    if ( gsb_data_transaction_get_method_of_payment_number ( transaction_number_1)== gsb_data_transaction_get_method_of_payment_number ( transaction_number_2))
+    if ( gsb_data_transaction_get_method_of_payment_number ( transaction_number_1) == gsb_data_transaction_get_method_of_payment_number ( transaction_number_2))
     {
 	return_value = g_utf8_collate ( g_utf8_casefold ( gsb_data_transaction_get_method_of_payment_content ( transaction_number_1) ? gsb_data_transaction_get_method_of_payment_content ( transaction_number_1) : "",
 							  -1 ),

Index: gsb_file_load.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_file_load.c,v
retrieving revision 1.220
retrieving revision 1.220.2.1
diff -u -d -r1.220 -r1.220.2.1
--- gsb_file_load.c	20 Apr 2010 21:34:33 -0000	1.220
+++ gsb_file_load.c	25 Apr 2010 14:13:38 -0000	1.220.2.1
@@ -1610,7 +1610,6 @@
     if ( !strcmp ( attribute_names[i],
                         "Owner_address" ))
     {
-        printf ("attribute_values[i] = %s\n",attribute_values[i]);
         if ( g_strstr_len ( attribute_values[i], -1, "
" ) )
         {
             gchar **owner_tab;

Index: main.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/main.h,v
retrieving revision 1.11
retrieving revision 1.11.2.1
diff -u -d -r1.11 -r1.11.2.1
--- main.h	5 Apr 2010 21:24:53 -0000	1.11
+++ main.h	25 Apr 2010 14:13:38 -0000	1.11.2.1
@@ -3,6 +3,7 @@
 /* START_INCLUDE_H */
 /* END_INCLUDE_H */
 
+gchar *PLUGINS_DIRECTORY;
 
 /* START_DECLARATION */
 gboolean gsb_grisbi_close ( void );

Index: gsb_plugins.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_plugins.c,v
retrieving revision 1.23
retrieving revision 1.23.2.1
diff -u -d -r1.23 -r1.23.2.1
--- gsb_plugins.c	5 Apr 2010 21:24:53 -0000	1.23
+++ gsb_plugins.c	25 Apr 2010 14:13:38 -0000	1.23.2.1
@@ -68,8 +68,7 @@
 	if ( strncmp ( split_filename[1], G_MODULE_SUFFIX, strlen(G_MODULE_SUFFIX) ) )
 	    continue;
 
-	complete_filename = g_build_filename ( PLUGINS_DIR,
-					       filename, NULL );
+	complete_filename = g_build_filename ( dirname, filename, NULL );
 
 	if ( ! ( plugin -> handle = 
 		 g_module_open (complete_filename, 0 ) ) )

Index: balance_estimate_tab.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/balance_estimate_tab.c,v
retrieving revision 1.65
retrieving revision 1.65.2.1
diff -u -d -r1.65 -r1.65.2.1
--- balance_estimate_tab.c	20 Apr 2010 21:34:33 -0000	1.65
+++ balance_estimate_tab.c	25 Apr 2010 14:13:38 -0000	1.65.2.1
@@ -97,6 +97,8 @@
 static gchar *bet_array_list_get_description ( gint account_number,
                         gint origine,
                         gpointer value );
+static void bet_array_list_insert_account_balance_menu ( GtkWidget *menu_item,
+                        GtkTreeSelection *tree_selection );
 static void bet_array_list_insert_menu ( GtkWidget *menu_item,
                         GtkTreeSelection *tree_selection );
 static void bet_array_list_redo_menu ( GtkWidget *menu_item,
@@ -216,7 +218,8 @@
         return -1;
 
     /* get first date to compare */
-    gtk_tree_model_get_value ( model, itera, SPP_ESTIMATE_TREE_SORT_DATE_COLUMN, &date_value_a );
+    gtk_tree_model_get_value ( model, itera, 
+                        SPP_ESTIMATE_TREE_SORT_DATE_COLUMN, &date_value_a );
     date_a = g_value_get_boxed ( &date_value_a );
     if ( date_a == NULL )
         return -1;
@@ -229,6 +232,40 @@
 
     gint result = g_date_compare (date_b, date_a);
 
+    if ( result == 0 )
+    {
+        gint origine;
+        gchar *str_amount_a;
+        gchar *str_amount_b;
+        gsb_real amount_a = null_real;
+        gsb_real amount_b = null_real;
+
+        gtk_tree_model_get ( GTK_TREE_MODEL ( model ), itera,
+                        SPP_ESTIMATE_TREE_ORIGIN_DATA, &origine,
+                        SPP_ESTIMATE_TREE_AMOUNT_COLUMN, &str_amount_a,
+                        -1 );
+
+        if ( origine == SPP_ORIGIN_HISTORICAL )
+        {
+            gtk_tree_model_get ( GTK_TREE_MODEL ( model ), iterb,
+                        SPP_ESTIMATE_TREE_ORIGIN_DATA, &origine,
+                        SPP_ESTIMATE_TREE_AMOUNT_COLUMN, &str_amount_b,
+                        -1 );
+            if ( origine != SPP_ORIGIN_HISTORICAL )
+                result = -1;
+            else
+            {
+                amount_a = gsb_real_import_from_string ( str_amount_a );
+                amount_b = gsb_real_import_from_string ( str_amount_b );
+                result = - ( gsb_real_cmp ( amount_a, amount_b ) );
+            }
+
+            g_free ( str_amount_b );
+        }
+
+        g_free ( str_amount_a );
+    }
+
     g_value_unset ( &date_value_b );
     g_value_unset ( &date_value_a );
 
@@ -1217,6 +1254,7 @@
  */
 void bet_array_list_context_menu ( GtkWidget *tree_view )
 {
+    GtkWidget *image;
     GtkWidget *menu, *menu_item;
     GtkTreeModel *model;
     GtkTreeSelection *tree_selection;
@@ -1224,6 +1262,7 @@
     GDate *date;
     GDate *date_jour;
     gchar *str_date;
+    gchar *tmp_str;
     gboolean select = FALSE;
     gint origine;
 
@@ -1281,7 +1320,7 @@
                     tree_selection );
     gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), menu_item );
 
-    /* Delete item */
+    /* Delete convert item */
     switch ( origine )
     {
         case SPP_ORIGIN_TRANSACTION:
@@ -1363,6 +1402,24 @@
     gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), gtk_separator_menu_item_new ( ) );
     gtk_widget_show ( menu_item );
 
+    /* Insert an account balance */
+    tmp_str = g_build_filename ( PIXMAPS_DIR, "ac_bank.png", NULL);
+    image = gtk_image_new_from_file ( tmp_str );
+    gtk_image_set_pixel_size ( GTK_IMAGE ( image ), GTK_ICON_SIZE_MENU );
+    g_free ( tmp_str );
+
+    menu_item = gtk_image_menu_item_new_with_label ( _("Insert account balance") );
+    gtk_image_menu_item_set_image ( GTK_IMAGE_MENU_ITEM ( menu_item ), image );
+    g_signal_connect ( G_OBJECT ( menu_item ),
+                    "activate",
+                    G_CALLBACK ( bet_array_list_insert_account_balance_menu ),
+                    tree_selection );
+    gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), menu_item );
+
+    /* Separator */
+    gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), gtk_separator_menu_item_new() );
+    gtk_widget_show ( menu_item );
+
     /* redo item */
     menu_item = gtk_image_menu_item_new_with_label ( _("Reset data") );
     gtk_image_menu_item_set_image ( GTK_IMAGE_MENU_ITEM ( menu_item ),
@@ -1549,6 +1606,36 @@
 
 
 /**
+ * insert an account balance
+ *
+ * /param menu item
+ * /param row selected
+ *
+ * */
+void bet_array_list_insert_account_balance_menu ( GtkWidget *menu_item,
+                        GtkTreeSelection *tree_selection )
+{
+    GtkTreeView *tree_view;
+    GtkTreeModel *model;
+    GtkTreeIter iter;
+    gchar *str_date;
+devel_debug (NULL);
+    if ( !gtk_tree_selection_get_selected ( GTK_TREE_SELECTION ( tree_selection ),
+     &model, &iter ) )
+        return;
+
+    gtk_tree_model_get ( GTK_TREE_MODEL ( model ), &iter,
+                        SPP_ESTIMATE_TREE_DATE_COLUMN, &str_date,
+                        -1 );
+
+    bet_account_new_line_dialog ( model, str_date );
+    //~ tree_view = gtk_tree_selection_get_tree_view ( tree_selection );
+    //~ bet_array_list_set_background_color ( GTK_WIDGET ( tree_view ) );
+    //~ bet_array_list_update_balance ( model );
+}
+
+
+/**
  * init data
  *
  * /param menu item

Index: main.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/main.c,v
retrieving revision 1.172
retrieving revision 1.172.2.1
diff -u -d -r1.172 -r1.172.2.1
--- main.c	14 Apr 2010 20:54:13 -0000	1.172
+++ main.c	25 Apr 2010 14:13:38 -0000	1.172.2.1
@@ -67,7 +67,6 @@
 static  void main_window_destroy_event( GObject* obj, gpointer data);
 /*END_STATIC*/
 
-
 /* vbox ajoutée dans la fenetre de base, contient le menu et la fenetre d'utilisation */
 G_MODULE_EXPORT GtkWidget *window = NULL;
 GtkWidget *window_vbox_principale = NULL;
@@ -114,14 +113,32 @@
 #if IS_DEVELOPMENT_VERSION == 1
 	struct lconv *conv;
 #endif
-
 #ifndef _WIN32
     struct sigaction sig_sev;
 #endif
 #ifdef _MSC_VER
-	gchar * gtkrc_file;
+	gchar *gtkrc_file;
+#endif
+
+#ifdef G_OS_UNIX
+    if ( g_file_test ( PLUGINS_DIR, G_FILE_TEST_IS_DIR ) )
+        PLUGINS_DIRECTORY = g_strdup ( PLUGINS_DIR );
+
+    else
+    {
+        gchar *ptr;
+        gchar *dir_name;
+
+        ptr = g_strrstr ( PLUGINS_DIR, "/grisbi" );
+        dir_name = g_strndup ( PLUGINS_DIR, ( ptr - PLUGINS_DIR ) );
+        dir_name = g_strconcat ( dir_name, "64/grisbi", NULL );
+        
+        if ( g_file_test ( dir_name, G_FILE_TEST_IS_DIR ) )
+            PLUGINS_DIRECTORY = dir_name;
+    }
 #endif
 
+
 #if GSB_GMEMPROFILE
     g_mem_set_vtable(glib_mem_profiler_table);
 #endif
@@ -178,7 +195,7 @@
     }
 
 #ifdef HAVE_PLUGINS
-    gsb_plugins_scan_dir ( PLUGINS_DIR );
+    gsb_plugins_scan_dir ( PLUGINS_DIRECTORY );
 #endif
 
     /* create the icon of grisbi (set in the panel of gnome or other) */
@@ -328,6 +345,7 @@
     gtk_main ();
 
     gsb_plugins_release ( );
+    g_free ( PLUGINS_DIRECTORY );
 
     /* sauvegarde les raccourcis claviers */
     gtk_accel_map_save (path);

Index: balance_estimate_future.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/balance_estimate_future.c,v
retrieving revision 1.9
retrieving revision 1.9.4.1
diff -u -d -r1.9 -r1.9.4.1
--- balance_estimate_future.c	18 Apr 2010 07:53:06 -0000	1.9
+++ balance_estimate_future.c	25 Apr 2010 14:13:38 -0000	1.9.4.1
@@ -1658,6 +1658,184 @@
 
     return FALSE;
 }
+
+
+/**
+ *
+ *
+ *
+ *
+ * */
+gboolean bet_account_new_line_dialog ( GtkTreeModel *tab_model,
+                        gchar *str_date )
+{
+    GtkWidget *dialog;
+    GtkWidget *vbox;
+    GtkWidget *paddingbox;
+    GtkWidget *hbox, *widget, *sw, *tree_view;
+    GtkListStore *list_store;
+    GtkTreeViewColumn *column;
+    GtkCellRenderer *cell;
+    //~ GtkTreeSelection *selection;
+    GSList *tmp_list;
+    GDate *date;
+    GDate *date_jour;
+    gint account_number;
+    gint result;
+
+    account_number = gsb_gui_navigation_get_current_account ( );
+    if ( account_number == -1 )
+        return FALSE;
+    
+    /* Create the dialog */
+    dialog = gtk_dialog_new_with_buttons ( _("Select an account"),
+					   GTK_WINDOW ( window ),
+					   GTK_DIALOG_MODAL,
+					   GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+					   GTK_STOCK_OK, GTK_RESPONSE_OK,
+					   NULL );
+
+    gtk_window_set_position ( GTK_WINDOW ( dialog ), GTK_WIN_POS_CENTER_ON_PARENT );
+    gtk_window_set_resizable ( GTK_WINDOW ( dialog ), TRUE );
+    gtk_dialog_set_default_response ( GTK_DIALOG ( dialog ), GTK_RESPONSE_OK );
+
+	vbox = gtk_vbox_new ( FALSE, 0 );
+	gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG ( dialog )->vbox ), vbox, TRUE, TRUE, 0 );
+	gtk_container_set_border_width ( GTK_CONTAINER ( vbox ), 12 );
+
+    /* list of accounts */
+    paddingbox = new_paddingbox_with_title (vbox, FALSE,  _("List of accounts") );
+
+    hbox = gtk_hbox_new ( FALSE, 5 );
+    gtk_box_pack_start ( GTK_BOX ( paddingbox ), hbox, TRUE, TRUE, 5);
+
+    sw = gtk_scrolled_window_new (NULL, NULL);
+    gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw),
+                        GTK_SHADOW_ETCHED_IN);
+    gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
+                        GTK_POLICY_AUTOMATIC,
+                        GTK_POLICY_ALWAYS);
+    gtk_box_pack_start ( GTK_BOX (hbox), sw, TRUE,TRUE, 0 );
+
+    /* create the model */
+    list_store = gtk_list_store_new ( 4, G_TYPE_STRING,  G_TYPE_STRING,  G_TYPE_INT, G_TYPE_BOOLEAN );
+
+    /* populate the model if necessary */
+    tmp_list = gsb_data_account_get_list_accounts ( );
+    while ( tmp_list )
+    {
+        gint tmp_account_number;
+        GtkTreeIter iter;
+
+        tmp_account_number = gsb_data_account_get_no_account ( tmp_list -> data );
+        if ( tmp_account_number != account_number )
+        {
+
+            gtk_list_store_append ( list_store, &iter );
+            gtk_list_store_set ( list_store,
+                        &iter,
+                        0, gsb_data_account_get_name ( tmp_account_number ),
+                        1, _("standard account"),
+                        2, tmp_account_number,
+                        3, FALSE,
+                        -1 );
+
+        }
+
+	    tmp_list = tmp_list -> next;
+    }
+
+    tmp_list = gsb_data_partial_balance_get_list ( );
+    while ( tmp_list )
+    {
+        gint tmp_number;
+        GtkTreeIter iter;
+
+        tmp_number = gsb_data_partial_balance_get_number ( tmp_list -> data );
+        gtk_list_store_append ( list_store, &iter );
+        gtk_list_store_set ( list_store,
+                        &iter,
+                        0, gsb_data_partial_balance_get_name ( tmp_number ),
+                        1, _("Partial balance"),
+                        2, tmp_number,
+                        3, TRUE,
+                        -1 );
+
+	    tmp_list = tmp_list -> next;
+    }
+
+    /* create the treeview */
+    tree_view = gtk_tree_view_new_with_model ( GTK_TREE_MODEL ( list_store ) );
+    g_object_unref ( list_store );
+
+    gtk_tree_view_set_rules_hint ( GTK_TREE_VIEW ( tree_view ), TRUE );
+    gtk_widget_set_size_request ( tree_view, 400, 150 );
+    gtk_container_add (GTK_CONTAINER ( sw ), tree_view );
+    gtk_container_set_resize_mode (GTK_CONTAINER ( sw ), GTK_RESIZE_PARENT );
+    g_object_set_data ( G_OBJECT ( vbox ), "tree_view", tree_view );
+
+    /* Account_name */
+    cell = gtk_cell_renderer_text_new ( );
+    column = gtk_tree_view_column_new_with_attributes ( _("Name"),
+                        cell, "text", 0, NULL );
+    gtk_tree_view_column_set_expand ( column, TRUE );
+    gtk_tree_view_column_set_alignment ( column, 0.5 );
+    gtk_tree_view_column_set_sort_column_id ( column, 0 );
+    gtk_tree_view_append_column ( GTK_TREE_VIEW ( tree_view ), column );
+
+    /* type of account */
+    cell = gtk_cell_renderer_text_new ( );
+    column = gtk_tree_view_column_new_with_attributes ( _("Type"),
+                        cell, "text", 1, NULL );
+    gtk_tree_view_column_set_expand ( column, TRUE );
+    gtk_tree_view_column_set_alignment ( column, 0.5 );
+    gtk_tree_view_column_set_sort_column_id ( column, 1 );
+    gtk_tree_view_append_column ( GTK_TREE_VIEW ( tree_view ), column );
+
+    /* Effective Date */
+    paddingbox = new_paddingbox_with_title (vbox, FALSE,  _("Effective Date") );
+
+    hbox = gtk_hbox_new ( FALSE, 5 );
+    gtk_box_pack_start ( GTK_BOX ( paddingbox ), hbox, FALSE, TRUE, 5);
+
+    widget = gsb_calendar_entry_new ( FALSE );
+    gtk_box_pack_start ( GTK_BOX ( hbox ), widget, FALSE, FALSE, 5);
+
+    /* set date */
+    date = gsb_parse_date_string ( str_date );
+    date_jour = gdate_today ( ); 
+        
+    if ( g_date_valid ( date ) )
+    {
+        if ( g_date_compare ( date_jour, date ) >= 0 )
+        {
+            g_date_free ( date );
+            g_date_add_days ( date_jour, 1 );
+            date = date_jour;
+        }
+    }
+    else
+    {
+        g_date_add_days ( date_jour, 1 );
+        date = date_jour;
+    }
+
+    gsb_form_widget_set_empty ( widget, FALSE );
+    gsb_calendar_entry_set_date ( widget, date );
+
+    gtk_widget_show_all ( dialog );
+
+    //~ dialog_return:
+	result = gtk_dialog_run ( GTK_DIALOG ( dialog ) );
+
+    if ( result == GTK_RESPONSE_OK )
+    {
+    }
+
+    gtk_widget_destroy ( dialog );
+
+    return FALSE;
+}
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */



More information about the cvs mailing list