[grisbi-cvs] grisbi/src gsb_currency_link_config.c, 1.14, 1.15 gsb_data_currency_link.c, 1.16, 1.17 gsb_data_currency_link.h, 1.7, 1.8 gsb_file_load.c, 1.191, 1.192 gsb_file_save.c, 1.142, 1.143 gsb_form_transaction.c, 1.47, 1.48 gsb_form_transaction.h, 1.11, 1.12 gsb_form_widget.c, 1.36, 1.37 import.c, 1.297, 1.298

Pierre Biava pbiava at users.sourceforge.net
Sun Oct 18 19:46:23 CEST 2009


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

Modified Files:
	gsb_currency_link_config.c gsb_data_currency_link.c 
	gsb_data_currency_link.h gsb_file_load.c gsb_file_save.c 
	gsb_form_transaction.c gsb_form_transaction.h 
	gsb_form_widget.c import.c 
Log Message:
Added the modified date of the exchange rate and minor corrections

Index: gsb_currency_link_config.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_currency_link_config.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- gsb_currency_link_config.c	24 Aug 2009 13:11:48 -0000	1.14
+++ gsb_currency_link_config.c	18 Oct 2009 17:46:20 -0000	1.15
@@ -29,6 +29,7 @@
 
 /*START_INCLUDE*/
 #include "gsb_currency_link_config.h"
+#include "./utils_dates.h"
 #include "./gsb_currency.h"
 #include "./gsb_data_account.h"
 #include "./gsb_data_currency.h"
@@ -64,6 +65,7 @@
     LINK_EQUAL_COLUMN,
     LINK_EXCHANGE_COLUMN,
     LINK_CURRENCY2_COLUMN,
+    LINK_DATE_COLUMN,
     LINK_INVALID_COLUMN,
     LINK_NUMBER_COLUMN,
     NUM_LINKS_COLUMNS,
@@ -221,6 +223,7 @@
 	"",
 	_("Exchange"),
 	_("Second currency"),
+    _("Modified date"),
 	_("Invalid"),
     };
     GtkCellRenderer *cell_renderer;
@@ -231,6 +234,7 @@
 	   LINK_EQUAL_COLUMN,
 	   LINK_EXCHANGE_COLUMN,
 	   LINK_CURRENCY2_COLUMN,
+       LINK_DATE_COLUMN,
 	   LINK_NUMBER_COLUMN */
     model = gtk_list_store_new ( NUM_LINKS_COLUMNS,
 				 G_TYPE_STRING,
@@ -239,6 +243,7 @@
 				 G_TYPE_STRING,
 				 G_TYPE_STRING,
 				 G_TYPE_STRING,
+				 G_TYPE_STRING,
 				 G_TYPE_INT );
 
     /* Create tree tree_view */
@@ -334,32 +339,36 @@
     gchar *invalid;
     GtkTreeIter local_iter;
     GtkTreeIter *iter_ptr;
-	gchar* tmpstr;
+	gchar *tmpstr;
+    gchar *strdate;
 
     if (iter_to_fill)
 	iter_ptr = iter_to_fill;
     else
 	iter_ptr = &local_iter;
 
+    strdate = gsb_format_gdate ( gsb_data_currency_link_get_modified_date ( link_number ) );
+
     if ( gsb_data_currency_link_get_invalid_link (link_number))
 	invalid = GTK_STOCK_DIALOG_WARNING;
     else
 	invalid = NULL;
 
     tmpstr = gsb_real_get_string (gsb_data_currency_link_get_change_rate (link_number));
-    gtk_list_store_append ( GTK_LIST_STORE (model),
-			    iter_ptr );
-    gtk_list_store_set ( GTK_LIST_STORE (model),
+    gtk_list_store_append ( GTK_LIST_STORE ( model ), iter_ptr );
+    gtk_list_store_set ( GTK_LIST_STORE ( model ),
 			 iter_ptr,
 			 LINK_1_COLUMN, "1",
 			 LINK_CURRENCY1_COLUMN, gsb_data_currency_get_name (gsb_data_currency_link_get_first_currency(link_number)),
 			 LINK_EQUAL_COLUMN, "=",
 			 LINK_EXCHANGE_COLUMN, tmpstr,
 			 LINK_CURRENCY2_COLUMN, gsb_data_currency_get_name (gsb_data_currency_link_get_second_currency(link_number)),
+             LINK_DATE_COLUMN, strdate,
 			 LINK_INVALID_COLUMN, invalid,
 			 LINK_NUMBER_COLUMN, link_number,
 			 -1 );
     g_free ( tmpstr );
+    g_free ( strdate );
 }
 
 
@@ -472,10 +481,12 @@
     gchar *invalid;
     GtkWidget *label;
 	gchar* tmpstr;
+    gchar *strdate;
 
-    if ( !gtk_tree_selection_get_selected ( gtk_tree_view_get_selection ( GTK_TREE_VIEW (tree_view)),
+    if ( !gtk_tree_selection_get_selected ( gtk_tree_view_get_selection (
+                        GTK_TREE_VIEW ( tree_view ) ),
 					    &model,
-					    &iter ))
+					    &iter ) )
 	return FALSE;
 
     gtk_tree_model_get ( GTK_TREE_MODEL (model),
@@ -500,6 +511,9 @@
 						 gsb_currency_get_currency_from_combobox (combobox_2));
     gsb_data_currency_link_set_change_rate ( link_number,
 					     gsb_real_get_from_string (gtk_entry_get_text ( GTK_ENTRY (exchange_entry))));
+    gsb_data_currency_link_set_modified_date ( link_number, gdate_today ( ) );
+
+    strdate = gsb_format_gdate ( gsb_data_currency_link_get_modified_date ( link_number ) );
 
     if ( gsb_data_currency_link_get_invalid_link (link_number))
 	invalid = GTK_STOCK_DIALOG_WARNING;
@@ -512,9 +526,11 @@
 			 LINK_CURRENCY1_COLUMN, gsb_data_currency_get_name (gsb_data_currency_link_get_first_currency(link_number)),
 			 LINK_EXCHANGE_COLUMN, tmpstr,
 			 LINK_CURRENCY2_COLUMN, gsb_data_currency_get_name (gsb_data_currency_link_get_second_currency(link_number)),
+             LINK_DATE_COLUMN, strdate,
 			 LINK_INVALID_COLUMN, invalid,
 			 -1 );
     g_free ( tmpstr );
+    g_free ( strdate );
 
     /* set or hide the warning label */
     label = g_object_get_data (G_OBJECT (model),
@@ -591,7 +607,9 @@
 					   &model,
 					   &iter ))
     {
+    GtkWidget *label;
 	gint link_number;
+
 	gtk_tree_model_get ( GTK_TREE_MODEL (model),
 			     &iter,
 			     LINK_NUMBER_COLUMN, &link_number,
@@ -602,6 +620,13 @@
 	gtk_widget_set_sensitive ( GTK_WIDGET ( g_object_get_data ( G_OBJECT (model),
 								    "hbox_line")),
 				   FALSE );
+
+    /* hide the warning label */
+    label = g_object_get_data (G_OBJECT (model),
+			       "warning_label");
+    if ( GTK_WIDGET_VISIBLE ( label ) )
+        gtk_widget_hide (label);
+
 	if ( etat.modification_fichier == 0 )
         modification_fichier ( TRUE );
     }

Index: gsb_form_widget.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_form_widget.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- gsb_form_widget.c	7 Oct 2009 21:46:21 -0000	1.36
+++ gsb_form_widget.c	18 Oct 2009 17:46:21 -0000	1.37
@@ -250,6 +250,10 @@
 					  SPACIFY(_("Choose currency")));
 	    gsb_currency_set_combobox_history ( widget,
 						gsb_data_account_get_currency (account_number));
+        g_signal_connect ( G_OBJECT (  widget ),
+			       "changed",
+			       G_CALLBACK (gsb_form_transaction_currency_changed),
+			       NULL );
 	    break;
 
 	case TRANSACTION_FORM_CHANGE:

Index: gsb_form_transaction.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_form_transaction.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- gsb_form_transaction.c	28 Jun 2009 06:41:07 -0000	1.47
+++ gsb_form_transaction.c	18 Oct 2009 17:46:21 -0000	1.48
@@ -591,6 +591,24 @@
 }
 
 
+void gsb_form_transaction_currency_changed ( GtkWidget *widget, gpointer null )
+{
+    gint account_number;
+    gint currency_number;
+    gint account_currency_number;
+
+    devel_debug ("gsb_form_transaction_currency_changed");
+    account_number = gsb_form_get_account_number ();
+    gtk_widget_grab_focus ( gsb_form_widget_get_widget (TRANSACTION_FORM_DATE));
+
+    account_currency_number = gsb_data_account_get_currency (account_number);
+    currency_number = gsb_currency_get_currency_from_combobox ( widget );
+
+    if ( account_currency_number == currency_number )
+        gtk_widget_hide ( gsb_form_widget_get_widget (TRANSACTION_FORM_CHANGE));
+    else
+        gtk_widget_show ( gsb_form_widget_get_widget (TRANSACTION_FORM_CHANGE));
+}
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */

Index: gsb_file_save.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_file_save.c,v
retrieving revision 1.142
retrieving revision 1.143
diff -u -d -r1.142 -r1.143
--- gsb_file_save.c	2 Oct 2009 21:35:04 -0000	1.142
+++ gsb_file_save.c	18 Oct 2009 17:46:21 -0000	1.143
@@ -1594,36 +1594,45 @@
                         gchar **file_content )
 {
     GSList *list_tmp;
-	
+
     list_tmp = gsb_data_currency_link_get_currency_link_list ();
 
     while ( list_tmp )
     {
-	gchar *new_string;
-	gint link_number;
-	gchar *change_rate;
+    gchar *new_string;
+    gint link_number;
+    gchar *change_rate;
+    gchar *strdate;
 
-	link_number = gsb_data_currency_link_get_no_currency_link (list_tmp -> data);
+    link_number = gsb_data_currency_link_get_no_currency_link (list_tmp -> data);
 
-	/* set the number */
-	change_rate = gsb_file_save_real_to_string (gsb_data_currency_link_get_change_rate (link_number));
+    /* set the number */
+    change_rate = gsb_file_save_real_to_string (gsb_data_currency_link_get_change_rate (link_number));
 
-	/* now we can fill the file content */
-	new_string = g_markup_printf_escaped ( "\t<Currency_link Nb=\"%d\" Cu1=\"%d\" Cu2=\"%d\" Ex=\"%s\" />\n",
-					       link_number,
-					       gsb_data_currency_link_get_first_currency (link_number),
-					       gsb_data_currency_link_get_second_currency (link_number),
-					       my_safe_null_str(change_rate));
-        g_free ( change_rate );
+    /* set the date of modification */
+    strdate = gsb_format_gdate_safe ( gsb_data_currency_link_get_modified_date ( link_number ) );
 
-	/* append the new string to the file content
-	 * and take the new iterator */
+    /* now we can fill the file content */
+    new_string = g_markup_printf_escaped (
+                        "\t<Currency_link Nb=\"%d\" Cu1=\"%d\" Cu2=\"%d\" Ex=\"%s\" "
+                        "Modified_date=\"%s\"/>\n",
+                        link_number,
+                        gsb_data_currency_link_get_first_currency ( link_number ),
+                        gsb_data_currency_link_get_second_currency (link_number),
+                        my_safe_null_str ( change_rate ),
+                        strdate );
 
-	iterator = gsb_file_save_append_part ( iterator,
-					       length_calculated,
-					       file_content,
-					       new_string );
-	list_tmp = list_tmp -> next;
+    g_free ( change_rate );
+    g_free ( strdate );
+
+    /* append the new string to the file content
+     * and take the new iterator */
+
+    iterator = gsb_file_save_append_part ( iterator,
+                        length_calculated,
+                        file_content,
+                        new_string );
+    list_tmp = list_tmp -> next;
     }
     return iterator;
 }

Index: gsb_form_transaction.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_form_transaction.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- gsb_form_transaction.h	27 Jun 2009 19:17:53 -0000	1.11
+++ gsb_form_transaction.h	18 Oct 2009 17:46:21 -0000	1.12
@@ -12,6 +12,7 @@
 void gsb_form_transaction_check_change_button ( gint currency_number,
                         gint account_number );
 gboolean gsb_form_transaction_complete_form_by_payee ( const gchar *payee_name );
+void gsb_form_transaction_currency_changed ( GtkWidget *widget, gpointer null );
 GSList *gsb_form_transaction_get_parties_list_from_report ( void );
 gboolean gsb_form_transaction_recover_splits_of_transaction ( gint new_transaction_number,
                         gint no_last_split );

Index: gsb_data_currency_link.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_data_currency_link.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- gsb_data_currency_link.h	17 Dec 2007 10:44:39 -0000	1.7
+++ gsb_data_currency_link.h	18 Oct 2009 17:46:20 -0000	1.8
@@ -12,20 +12,23 @@
 gint gsb_data_currency_link_get_first_currency ( gint currency_link_number );
 gint gsb_data_currency_link_get_invalid_link ( gint currency_link_number );
 const gchar *gsb_data_currency_link_get_invalid_message ( gint currency_link_number );
+GDate *gsb_data_currency_link_get_modified_date ( gint currency_link_number );
 gint gsb_data_currency_link_get_no_currency_link ( gpointer currency_link_ptr );
 gint gsb_data_currency_link_get_second_currency ( gint currency_link_number );
 gboolean gsb_data_currency_link_init_variables ( void );
 gint gsb_data_currency_link_new ( gint currency_link_number );
 gboolean gsb_data_currency_link_remove ( gint currency_link_number );
 gint gsb_data_currency_link_search ( gint currency_1,
-				     gint currency_2 );
+                        gint currency_2 );
 gboolean gsb_data_currency_link_set_change_rate ( gint currency_link_number,
-						  gsb_real change_rate);
+                        gsb_real change_rate);
 gboolean gsb_data_currency_link_set_first_currency ( gint currency_link_number,
-						     gint first_currency );
+                        gint first_currency );
+gboolean gsb_data_currency_link_set_modified_date ( gint currency_link_number,
+                        GDate *date );
 gint gsb_data_currency_link_set_new_number ( gint currency_link_number,
-					     gint new_no_currency_link );
+                        gint new_no_currency_link );
 gboolean gsb_data_currency_link_set_second_currency ( gint currency_link_number,
-						      gint second_currency );
+                        gint second_currency );
 /* END_DECLARATION */
 #endif

Index: import.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/import.c,v
retrieving revision 1.297
retrieving revision 1.298
diff -u -d -r1.297 -r1.298
--- import.c	14 Oct 2009 20:09:13 -0000	1.297
+++ import.c	18 Oct 2009 17:46:21 -0000	1.298
@@ -119,7 +119,7 @@
                         GtkWidget *entry );
 static gboolean gsb_import_check_transaction_link ( gint transaction_number,
                         gint tested_transaction );
-static GSList *gsb_import_create_file_chooser (const char *enc);
+static GSList *gsb_import_create_file_chooser ( const char *enc, GtkWidget *parent );
 static gint gsb_import_create_imported_account ( struct struct_compte_importation *imported_account );
 static gint gsb_import_create_transaction ( struct struct_ope_importation *imported_transaction,
                         gint account_number, gchar * origine );
@@ -579,7 +579,7 @@
     GSList * filenames, * iterator;
     GtkTreeModel * model;
 
-    filenames = gsb_import_create_file_chooser (NULL);
+    filenames = gsb_import_create_file_chooser ( NULL, assistant );
     if (!filenames)
     return FALSE;
 
@@ -668,7 +668,7 @@
  *
  * \return a GtkFileChooser
  * */
-GSList *gsb_import_create_file_chooser (const char *enc)
+GSList *gsb_import_create_file_chooser ( const char *enc, GtkWidget *parent )
 {
     GtkWidget * dialog, * hbox, * go_charmap_sel;
     GtkFileFilter * filter, * default_filter;
@@ -680,7 +680,7 @@
 	gchar* tmpstr;
 
     dialog = gtk_file_chooser_dialog_new ( _("Choose files to import."),
-                        GTK_WINDOW ( window ),
+                        GTK_WINDOW ( parent ),
                         GTK_FILE_CHOOSER_ACTION_OPEN,
                         GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
                         GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
@@ -4291,7 +4291,7 @@
 
     rule = GPOINTER_TO_INT ( g_object_get_data (G_OBJECT (entry), "rule"));
     enc = gsb_data_import_rule_get_charmap ( rule );
-    filenames = gsb_import_create_file_chooser (enc);
+    filenames = gsb_import_create_file_chooser ( enc, window );
     if (!filenames)
     return FALSE;
 

Index: gsb_file_load.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_file_load.c,v
retrieving revision 1.191
retrieving revision 1.192
diff -u -d -r1.191 -r1.192
--- gsb_file_load.c	2 Oct 2009 21:35:04 -0000	1.191
+++ gsb_file_load.c	18 Oct 2009 17:46:21 -0000	1.192
@@ -2875,6 +2875,14 @@
         continue;
     }
 
+    if ( !strcmp ( attribute_names[i], "Modified_date" ) )
+    {
+        gsb_data_currency_link_set_modified_date ( link_number,
+                        gsb_parse_date_string_safe (attribute_values[i] ) );
+        i++;
+        continue;
+    }
+
     /* normally, shouldn't come here */
     i++;
     }
@@ -5237,6 +5245,7 @@
         gint contra_currency;
         gsb_real exchange;
         } tmp_currency_link;
+        GDate *modified_date = NULL;
         
         tmp_currency_link.one_c1_equal_x_c2 = 0;
         tmp_currency_link.contra_currency = 0;
@@ -5303,6 +5312,17 @@
         if ( !strcmp ( attribute_names[i],
                    "Change" ))
             tmp_currency_link.exchange = gsb_real_get_from_string (attribute_values[i]);
+        if ( !strcmp ( attribute_names[i], "Date_dernier_change" ) 
+         &&
+         strlen ( attribute_values[i] ) )
+        {
+            /* cannot use gsb_parse_date_string here because before, all date were dd/mm/yyyy */
+            pointeur_char = g_strsplit ( attribute_values[i], "/", 0 );
+            modified_date = g_date_new_dmy ( utils_str_atoi ( pointeur_char[0] ),
+                        utils_str_atoi ( pointeur_char[1] ),
+                        utils_str_atoi ( pointeur_char[2] ) );
+            g_strfreev ( pointeur_char );
+        }
         i++;
         }
         while ( attribute_names[i] );
@@ -5312,25 +5332,30 @@
          * else we will become very rich in grisbi !!! */
         if (tmp_currency_link.contra_currency && tmp_currency_link.exchange.mantissa != 0)
         {
-        gint  link_number;
+            gint  link_number;
 
-        link_number = gsb_data_currency_link_new (0);
-        if (tmp_currency_link.one_c1_equal_x_c2)
-        {
-            gsb_data_currency_link_set_first_currency ( link_number,
+            link_number = gsb_data_currency_link_new ( 0 );
+            if (tmp_currency_link.one_c1_equal_x_c2)
+            {
+                gsb_data_currency_link_set_first_currency ( link_number,
                                     currency_number );
-            gsb_data_currency_link_set_second_currency ( link_number,
+                gsb_data_currency_link_set_second_currency ( link_number,
                                      tmp_currency_link.contra_currency);
-        }
-        else
-        {
-            gsb_data_currency_link_set_first_currency ( link_number,
+            }
+            else
+            {
+                gsb_data_currency_link_set_first_currency ( link_number,
                                     tmp_currency_link.contra_currency );
-            gsb_data_currency_link_set_second_currency ( link_number,
+                gsb_data_currency_link_set_second_currency ( link_number,
                                      currency_number);
-        }
-        gsb_data_currency_link_set_change_rate ( link_number,
+            }
+            gsb_data_currency_link_set_change_rate ( link_number,
                                  tmp_currency_link.exchange );
+            if ( modified_date )
+            {
+                gsb_data_currency_link_set_modified_date ( link_number, modified_date );
+                g_date_free ( modified_date );
+            }
         }
     }
     }

Index: gsb_data_currency_link.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_data_currency_link.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- gsb_data_currency_link.c	3 Oct 2009 22:14:56 -0000	1.16
+++ gsb_data_currency_link.c	18 Oct 2009 17:46:20 -0000	1.17
@@ -1,7 +1,8 @@
 /* ************************************************************************** */
 /*                                                                            */
-/*     Copyright (C)	2000-2006 Cédric Auger (cedric at grisbi.org)	      */
-/* 			http://www.grisbi.org				      */
+/*     Copyright (C)    2000-2006 Cédric Auger (cedric at grisbi.org)            */
+/*          http://www.grisbi.org                                             */
+/*                      2009 Pierre Biava (grisbi at pierre.biava.name)          */
 /*                                                                            */
 /*  This program is free software; you can redistribute it and/or modify      */
 /*  it under the terms of the GNU General Public License as published by      */
@@ -29,6 +30,7 @@
 
 /*START_INCLUDE*/
 #include "gsb_data_currency_link.h"
+#include "./utils_dates.h"
 #include "./dialog.h"
 #include "./include.h"
 #include "./gsb_real.h"
@@ -46,6 +48,7 @@
     gint first_currency;
     gint second_currency;
     gsb_real change_rate;
+    GDate *modified_date;
 
     /* a link is invalid when :
      * - it's a comparison between 2 same currencies
@@ -223,6 +226,8 @@
     else
 	currency_link -> currency_link_number = gsb_data_currency_link_max_number () + 1;
 
+    currency_link -> modified_date = gdate_today ( );
+
     currency_link_list = g_slist_append ( currency_link_list, currency_link );
 
     return currency_link -> currency_link_number;
@@ -236,6 +241,8 @@
 {
     if ( ! currency_link )
         return ;
+    if ( currency_link -> modified_date )
+        g_date_free ( currency_link -> modified_date );
     g_free (currency_link);
     if ( currency_link_buffer == currency_link )
 	currency_link_buffer = NULL;
@@ -279,7 +286,7 @@
  * \return the new number or 0 if the currency_link doen't exist
  * */
 gint gsb_data_currency_link_set_new_number ( gint currency_link_number,
-					     gint new_no_currency_link )
+                        gint new_no_currency_link )
 {
     struct_currency_link *currency_link;
 
@@ -324,7 +331,7 @@
  * \return TRUE if ok or FALSE if problem
  * */
 gboolean gsb_data_currency_link_set_first_currency ( gint currency_link_number,
-						     gint first_currency )
+                        gint first_currency )
 {
     struct_currency_link *currency_link;
 
@@ -370,7 +377,7 @@
  * \return TRUE if ok or FALSE if problem
  * */
 gboolean gsb_data_currency_link_set_second_currency ( gint currency_link_number,
-						      gint second_currency )
+                        gint second_currency )
 {
     struct_currency_link *currency_link;
 
@@ -414,7 +421,7 @@
  * \return TRUE if ok or FALSE if problem
  * */
 gboolean gsb_data_currency_link_set_change_rate ( gint currency_link_number,
-						  gsb_real change_rate)
+                        gsb_real change_rate)
 {
     struct_currency_link *currency_link;
 
@@ -551,7 +558,7 @@
  * \return the number of the link, 0 if not found, -1 if they are the same currencies
  * */
 gint gsb_data_currency_link_search ( gint currency_1,
-				     gint currency_2 )
+                        gint currency_2 )
 {
     GSList *tmp_list;
 
@@ -588,4 +595,51 @@
 }
 
 
+/**
+ * get the GDate of the currency link 
+ * 
+ * \param currency_link_number
+ * 
+ * \return the GDate of the currency link
+ * */
+GDate *gsb_data_currency_link_get_modified_date ( gint currency_link_number )
+{
+    struct_currency_link *currency_link;
+
+    currency_link = gsb_data_currency_link_get_structure ( currency_link_number );
+
+    if (!currency_link)
+        return NULL;
+
+    return currency_link -> modified_date;
+}
+
+
+/**
+ * set the GDate of the currency link
+ * 
+ * \param currency_link_number
+ * \param date
+ * 
+ * \return TRUE if ok
+ * */
+gboolean gsb_data_currency_link_set_modified_date ( gint currency_link_number,
+                        GDate *date )
+{
+    struct_currency_link *currency_link;
+
+    currency_link = gsb_data_currency_link_get_structure ( currency_link_number );
+
+    if ( !currency_link )
+        return FALSE;
 
+    if ( !date )
+        return FALSE;
+
+    if ( currency_link -> modified_date )
+        g_date_free ( currency_link -> modified_date );
+
+    currency_link -> modified_date = gsb_date_copy ( date );
+
+    return TRUE;
+}



More information about the cvs mailing list