[grisbi-cvs] [SCM] grisbi branch, grisbi-gtk3, updated. grisbi_gtk3_1_3_0-57-g7e89ad1

Pierre Biava nobody at users.sourceforge.net
Sun Jan 15 23:01:34 CET 2012


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, grisbi-gtk3 has been updated
       via  7e89ad18af4f8b0f2c2ab9b51119feb7663450ea (commit)
       via  817f3b196b3630fb80ecbacbcad1763ab24c146d (commit)
       via  bbab5378dccda35d39796058db2bb1b36a43ee2f (commit)
      from  8487daa7112caf63d6141183a1ad3da14aa137a5 (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 7e89ad18af4f8b0f2c2ab9b51119feb7663450ea
Author: pbiava <pierre.biava at nerim.net>
Date:   Sun Jan 15 23:00:51 2012 +0100

    Adding the option to remove orphaned transactions

commit 817f3b196b3630fb80ecbacbcad1763ab24c146d
Author: pbiava <pierre.biava at nerim.net>
Date:   Sun Jan 15 08:35:32 2012 +0100

    Use gtk_show_uri () for launching uri

commit bbab5378dccda35d39796058db2bb1b36a43ee2f
Author: pbiava <pierre.biava at nerim.net>
Date:   Sun Jan 15 07:56:23 2012 +0100

    Replace GDK_<keyname> with GDK_KEY_<keyname>

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

Changes:
diff --git a/src/bet_finance_ui.c b/src/bet_finance_ui.c
index 1fc9ef0..07e3a7b 100644
--- a/src/bet_finance_ui.c
+++ b/src/bet_finance_ui.c
@@ -2089,19 +2089,19 @@ gboolean bet_finance_capital_entry_key_press_event ( GtkWidget *widget,
 
     switch ( ev -> keyval )
     {
-        case GDK_1:
-        case GDK_2:
-        case GDK_3:
-        case GDK_4:
-        case GDK_5:
-        case GDK_6:
-        case GDK_7:
-        case GDK_8:
-        case GDK_9:
-        case GDK_0:
+        case GDK_KEY_1:
+        case GDK_KEY_2:
+        case GDK_KEY_3:
+        case GDK_KEY_4:
+        case GDK_KEY_5:
+        case GDK_KEY_6:
+        case GDK_KEY_7:
+        case GDK_KEY_8:
+        case GDK_KEY_9:
+        case GDK_KEY_0:
             break;
 
-        case GDK_Escape :
+        case GDK_KEY_Escape :
             str_capital = utils_real_get_string_with_currency ( gsb_real_double_to_real (
                                     etat.bet_capital ),
                                     etat.bet_currency,
@@ -2112,20 +2112,20 @@ gboolean bet_finance_capital_entry_key_press_event ( GtkWidget *widget,
             return TRUE;
             break;
 
-        case GDK_ISO_Left_Tab:
+        case GDK_KEY_ISO_Left_Tab:
             etat.bet_capital = bet_finance_get_number_from_string ( page, "capital" );
             bet_finance_calculer_clicked ( NULL, page );
             return TRUE;
             break;
 
-        case GDK_Tab :
+        case GDK_KEY_Tab :
             etat.bet_capital = bet_finance_get_number_from_string ( page, "capital" );
             bet_finance_calculer_clicked ( NULL, page );
             return TRUE;
             break;
 
-        case GDK_KP_Enter :
-        case GDK_Return :
+        case GDK_KEY_KP_Enter :
+        case GDK_KEY_Return :
             etat.bet_capital = bet_finance_get_number_from_string ( page, "capital" );
             bet_finance_calculer_clicked ( NULL, page );
             return TRUE;
diff --git a/src/bet_future.c b/src/bet_future.c
index 78144af..32c4de8 100644
--- a/src/bet_future.c
+++ b/src/bet_future.c
@@ -1201,24 +1201,24 @@ gboolean bet_form_key_press_event ( GtkWidget *widget,
 
     /* if conf.entree = 1, entry finish the transaction, else does as tab */
     if ( !conf.entree
-	 &&
-	 ( ev -> keyval == GDK_Return 
-	   ||
-	   ev -> keyval == GDK_KP_Enter ))
-	ev->keyval = GDK_Tab ;
+     &&
+     ( ev -> keyval == GDK_KEY_Return
+     ||
+     ev -> keyval == GDK_KEY_KP_Enter ) )
+        ev->keyval = GDK_KEY_Tab ;
 
     switch ( ev -> keyval )
     {
-    case GDK_1:
-    case GDK_2:
-    case GDK_3:
-    case GDK_4:
-    case GDK_5:
-    case GDK_6:
-    case GDK_7:
-    case GDK_8:
-    case GDK_9:
-    case GDK_0:
+    case GDK_KEY_1:
+    case GDK_KEY_2:
+    case GDK_KEY_3:
+    case GDK_KEY_4:
+    case GDK_KEY_5:
+    case GDK_KEY_6:
+    case GDK_KEY_7:
+    case GDK_KEY_8:
+    case GDK_KEY_9:
+    case GDK_KEY_0:
         switch ( element_number )
         {
         case TRANSACTION_FORM_DEBIT:
@@ -1241,18 +1241,18 @@ gboolean bet_form_key_press_event ( GtkWidget *widget,
             break;
         }
         break;
-	case GDK_Escape :
+	case GDK_KEY_Escape :
 	    gsb_form_escape_form ();
 	    break;
 
-	case GDK_KP_Enter :
-	case GDK_Return :
+	case GDK_KEY_KP_Enter :
+	case GDK_KEY_Return :
 
 	    break;
 
-	case GDK_KP_Add:
-	case GDK_plus:
-	case GDK_equal:		/* This should make all our US users happy */
+	case GDK_KEY_KP_Add:
+	case GDK_KEY_plus:
+	case GDK_KEY_equal:		/* This should make all our US users happy */
 
 	    /* increase the check of 1 */
 	    if (element_number == TRANSACTION_FORM_CHEQUE)
@@ -1263,8 +1263,8 @@ gboolean bet_form_key_press_event ( GtkWidget *widget,
 	    }
 	    break;
 
-	case GDK_KP_Subtract:
-	case GDK_minus:
+	case GDK_KEY_KP_Subtract:
+	case GDK_KEY_minus:
 
 	    /* decrease the check of 1 */
 	    if (element_number == TRANSACTION_FORM_CHEQUE)
diff --git a/src/bet_tab.c b/src/bet_tab.c
index 5f5f02f..c9ab4d7 100644
--- a/src/bet_tab.c
+++ b/src/bet_tab.c
@@ -1962,14 +1962,14 @@ gboolean bet_array_entry_key_press ( GtkWidget *entry,
 
     switch ( ev -> keyval )
     {
-    case GDK_Escape :
+    case GDK_KEY_Escape :
         account_nb = gsb_gui_navigation_get_current_account ( );
 	    date = gsb_data_account_get_bet_start_date ( account_nb );
         gtk_entry_set_text ( GTK_ENTRY ( entry ),
                         gsb_format_gdate ( date ) );
 	    break;
-    case GDK_KP_Enter :
-    case GDK_Return :
+    case GDK_KEY_KP_Enter :
+    case GDK_KEY_Return :
         bet_array_start_date_focus_out ( entry, NULL, data );
         break;
     }
diff --git a/src/gsb_account_property.c b/src/gsb_account_property.c
index e52cdac..434a972 100644
--- a/src/gsb_account_property.c
+++ b/src/gsb_account_property.c
@@ -1016,13 +1016,13 @@ gboolean gsb_account_property_iban_key_press_event ( GtkWidget *entry,
 
     switch ( ev -> keyval )
     {
-	case GDK_Escape :
+	case GDK_KEY_Escape :
 
         return TRUE;
 	    break;
 
-	case GDK_KP_Enter :
-	case GDK_Return :
+	case GDK_KEY_KP_Enter :
+	case GDK_KEY_Return :
         iban = gtk_editable_get_chars ( GTK_EDITABLE (entry), 0, -1 );
         if ( gsb_account_property_iban_control_iban (iban) == 0 )
         {
diff --git a/src/gsb_calendar_entry.c b/src/gsb_calendar_entry.c
index 01eb7d5..88e250b 100644
--- a/src/gsb_calendar_entry.c
+++ b/src/gsb_calendar_entry.c
@@ -238,41 +238,41 @@ gboolean gsb_calendar_entry_key_press ( GtkWidget *entry,
 {
     switch ( ev -> keyval )
     {
-	case GDK_KP_Enter :
-	case GDK_Return :
+	case GDK_KEY_KP_Enter :
+	case GDK_KEY_Return :
 
 	    /* CONTROL ENTER opens the calendar */
 	    if ( ( ev -> state & GDK_CONTROL_MASK ) == GDK_CONTROL_MASK)
 		gsb_calendar_entry_popup (entry);
 	    break;
 
-	case GDK_KP_Add:
-	case GDK_plus:
-	case GDK_equal:		/* This should make all our US users happy */
+	case GDK_KEY_KP_Add:
+	case GDK_KEY_plus:
+	case GDK_KEY_equal:		/* This should make all our US users happy */
 
 	    /* increase the date of 1 day/week */
 	    if ( ( ev -> state & GDK_CONTROL_MASK ) != GDK_CONTROL_MASK ||
-		 ev -> keyval != GDK_KP_Add )
+		 ev -> keyval != GDK_KEY_KP_Add )
 		gsb_calendar_entry_step_date ( entry, ONE_DAY );
 	    else
 		gsb_calendar_entry_step_date ( entry, ONE_WEEK );
 	    return TRUE;
 	    break;
 
-	case GDK_KP_Subtract:
-	case GDK_minus:
+	case GDK_KEY_KP_Subtract:
+	case GDK_KEY_minus:
 
 	    /* decrease the date of 1 day/week, or the check of 1 */
 	    if ( ( ev -> state & GDK_CONTROL_MASK ) != GDK_CONTROL_MASK ||
-		 ev -> keyval != GDK_KP_Subtract  )
+		 ev -> keyval != GDK_KEY_KP_Subtract  )
 		gsb_calendar_entry_step_date ( entry, -ONE_DAY );
 	    else
 		gsb_calendar_entry_step_date ( entry, -ONE_WEEK );
 	    return TRUE;
 	    break;
 
-	case GDK_Page_Up :
-	case GDK_KP_Page_Up :
+	case GDK_KEY_Page_Up :
+	case GDK_KEY_KP_Page_Up :
 
 	    /* increase the date of 1 month/year */
 	    if ( ( ev -> state & GDK_CONTROL_MASK ) != GDK_CONTROL_MASK )
@@ -285,8 +285,8 @@ gboolean gsb_calendar_entry_key_press ( GtkWidget *entry,
 	    return TRUE;
 	    break;
 
-	case GDK_Page_Down :
-	case GDK_KP_Page_Down :
+	case GDK_KEY_Page_Down :
+	case GDK_KEY_KP_Page_Down :
 
 	    /* decrease the date of 1 month/year */
 	    if ( ( ev -> state & GDK_CONTROL_MASK ) != GDK_CONTROL_MASK )
@@ -598,7 +598,7 @@ gboolean gsb_calendar_entry_calendar_key_press ( GtkCalendar *pCalendar,
 
     switch ( ev -> keyval )
     {
-	case GDK_Escape :
+	case GDK_KEY_Escape :
 	    /* just close the calendar if it's a popup */
 	    if ( gtk_widget_is_toplevel ( pTopLevelWidget ) )
 		gtk_widget_destroy ( pTopLevelWidget );
@@ -606,8 +606,8 @@ gboolean gsb_calendar_entry_calendar_key_press ( GtkCalendar *pCalendar,
 	    return TRUE;
 	    break ;
 
-	case GDK_Return :
-	case GDK_KP_Enter :
+	case GDK_KEY_Return :
+	case GDK_KEY_KP_Enter :
 	    /* get the date an close the calendar */
 	    gtk_entry_set_text ( GTK_ENTRY ( entry ),
 				 gsb_format_date ( day, month, year ));
@@ -620,55 +620,55 @@ gboolean gsb_calendar_entry_calendar_key_press ( GtkCalendar *pCalendar,
 	    /* from now, it will change date so just use date, modify it and fill day, month, year
 	     * we will set the calendar at the end of that function
 	     * so after now, only keys which change the date */
-	case GDK_Left :
-	case GDK_KP_Left:
-	case GDK_minus:
-	case GDK_KP_Subtract:
+	case GDK_KEY_Left :
+	case GDK_KEY_KP_Left:
+	case GDK_KEY_minus:
+	case GDK_KEY_KP_Subtract:
 	    /* day before */
 	    g_date_subtract_days (date, 1);
 	    break ;
 
-	case GDK_Right :
-	case GDK_KP_Right:
-	case GDK_plus:
-	case GDK_KP_Add:
+	case GDK_KEY_Right :
+	case GDK_KEY_KP_Right:
+	case GDK_KEY_plus:
+	case GDK_KEY_KP_Add:
 	    /* day after */
 	    g_date_add_days (date, 1);
 	    break ;
 
-	case GDK_Up :
-	case GDK_KP_Up :
+	case GDK_KEY_Up :
+	case GDK_KEY_KP_Up :
 	    /* prev week */
 	    g_date_subtract_days (date, 7);
 	    break ;
 
-	case GDK_Down :
-	case GDK_KP_Down :
+	case GDK_KEY_Down :
+	case GDK_KEY_KP_Down :
 	    /* next week */
 	    g_date_add_days (date, 7);
 	    break ;
 
-	case GDK_Home :
-	case GDK_KP_Home :
+	case GDK_KEY_Home :
+	case GDK_KEY_KP_Home :
 	    /* go to first day of the month */
 	    g_date_set_day (date, 1);
 	    break ;
 
-	case GDK_End :
-	case GDK_KP_End :
+	case GDK_KEY_End :
+	case GDK_KEY_KP_End :
 	    /* go to last day of the month */
 	    g_date_set_day (date,
 			    g_date_get_days_in_month (month, year));
 	    break ;
 
-	case GDK_Page_Up :
-	case GDK_KP_Page_Up :
+	case GDK_KEY_Page_Up :
+	case GDK_KEY_KP_Page_Up :
 	    /* prev month */
 	    g_date_subtract_months (date, 1);
 	    break ;
 
-	case GDK_Page_Down :
-	case GDK_KP_Page_Down :
+	case GDK_KEY_Page_Down :
+	case GDK_KEY_KP_Page_Down :
 	    /* next month */
 	    g_date_add_months (date, 1);
 	    break ;
diff --git a/src/gsb_currency_link_config.c b/src/gsb_currency_link_config.c
index a1f9990..7d9b3db 100644
--- a/src/gsb_currency_link_config.c
+++ b/src/gsb_currency_link_config.c
@@ -686,7 +686,7 @@ gboolean gsb_currency_link_config_key_press ( GtkWidget *tree_view, GdkEventKey
 {
     switch ( ev -> keyval )
     {
-    case GDK_Delete:    /*  del  */
+    case GDK_KEY_Delete:    /*  del  */
         gsb_currency_link_config_remove_link ( tree_view );
         return TRUE;
         break;
diff --git a/src/gsb_data_partial_balance.c b/src/gsb_data_partial_balance.c
index f04309e..072207e 100644
--- a/src/gsb_data_partial_balance.c
+++ b/src/gsb_data_partial_balance.c
@@ -585,14 +585,14 @@ gboolean gsb_partial_balance_key_press ( GtkWidget *tree_view, GdkEventKey *ev )
 {
     switch ( ev -> keyval )
     {
-    case GDK_Return :   /* entrée */
-    case GDK_KP_Enter :
-    case GDK_Tab :
+    case GDK_KEY_Return :   /* entrée */
+    case GDK_KEY_KP_Enter :
+    case GDK_KEY_Tab :
         g_object_set_data ( G_OBJECT ( tree_view ), "treeview", tree_view );
         gsb_partial_balance_edit ( NULL, tree_view );
         return TRUE;
         break;
-    case GDK_Delete:    /*  del  */
+    case GDK_KEY_Delete:    /*  del  */
         g_object_set_data ( G_OBJECT ( tree_view ), "treeview", tree_view );
         gsb_partial_balance_delete ( NULL, tree_view );
         return TRUE;
diff --git a/src/gsb_data_scheduled.c b/src/gsb_data_scheduled.c
index bd34126..8430974 100644
--- a/src/gsb_data_scheduled.c
+++ b/src/gsb_data_scheduled.c
@@ -39,6 +39,7 @@
 #include "gsb_currency.h"
 #include "gsb_data_currency.h"
 #include "gsb_data_currency_link.h"
+#include "gsb_file.h"
 #include "gsb_real.h"
 #include "utils_dates.h"
 #include "utils_str.h"
@@ -1615,34 +1616,35 @@ gboolean gsb_data_scheduled_remove_scheduled ( gint scheduled_number )
     scheduled = gsb_data_scheduled_get_scheduled_by_no ( scheduled_number);
 
     if ( !scheduled )
-	return FALSE;
+        return FALSE;
 
     if ( scheduled -> split_of_scheduled )
     {
-	GSList *list_tmp;
+        GSList *list_tmp;
 
-	list_tmp = gsb_data_scheduled_get_children (scheduled_number, FALSE);
+        list_tmp = gsb_data_scheduled_get_children ( scheduled_number, FALSE );
 
-	while ( list_tmp )
-	{
-	    struct_scheduled *scheduled_child;
+        while ( list_tmp )
+        {
+            struct_scheduled *scheduled_child;
 
-	    scheduled_child = list_tmp -> data;
+            scheduled_child = list_tmp -> data;
 
-	    if ( scheduled_child )
-	    {
-		scheduled_list = g_slist_remove ( scheduled_list,
-						  scheduled_child );
-		_gsb_data_scheduled_free ( scheduled_child );
-	    }
-	    list_tmp = list_tmp -> next;
-	}
+            if ( scheduled_child )
+            {
+                scheduled_list = g_slist_remove ( scheduled_list, scheduled_child );
+                _gsb_data_scheduled_free ( scheduled_child );
+            }
+            list_tmp = list_tmp -> next;
+        }
     }
 
-    scheduled_list = g_slist_remove ( scheduled_list,
-				      scheduled );
+    scheduled_list = g_slist_remove ( scheduled_list, scheduled );
 
     _gsb_data_scheduled_free ( scheduled );
+
+    gsb_file_set_modified ( TRUE );
+
     return TRUE;
 }
 
diff --git a/src/gsb_data_transaction.c b/src/gsb_data_transaction.c
index 7203dba..2d9e6e4 100644
--- a/src/gsb_data_transaction.c
+++ b/src/gsb_data_transaction.c
@@ -47,10 +47,11 @@
 #include "gsb_data_currency_link.h"
 #include "gsb_data_payee.h"
 #include "gsb_data_payment.h"
-#include "utils_dates.h"
+#include "gsb_file.h"
 #include "gsb_real.h"
-#include "utils_str.h"
 #include "structures.h"
+#include "utils_dates.h"
+#include "utils_str.h"
 #include "erreur.h"
 /*END_INCLUDE*/
 
@@ -2304,13 +2305,12 @@ gboolean gsb_data_transaction_remove_transaction ( gint transaction_number )
     gsb_data_budget_remove_transaction_from_budget (transaction_number);
 
     /* now can remove safely the transaction */
-    transactions_list = g_slist_remove ( transactions_list,
-					 transaction );
-    complete_transactions_list = g_slist_remove ( complete_transactions_list,
-						  transaction );
+    transactions_list = g_slist_remove ( transactions_list, transaction );
+    complete_transactions_list = g_slist_remove ( complete_transactions_list, transaction );
 
     /* force the update module budget */
     gsb_data_account_set_bet_maj ( transaction -> account_number, BET_MAJ_ALL );
+    gsb_file_set_modified ( TRUE );
 
     gsb_data_transaction_free (transaction);
 
diff --git a/src/gsb_form.c b/src/gsb_form.c
index c348bca..c937b94 100644
--- a/src/gsb_form.c
+++ b/src/gsb_form.c
@@ -2059,11 +2059,11 @@ gboolean gsb_form_key_press_event ( GtkWidget *widget,
 
     /* if conf.entree = 1, entry finish the transaction, else does as tab */
     if ( !conf.entree
-	 &&
-	 ( ev -> keyval == GDK_Return 
-	   ||
-	   ev -> keyval == GDK_KP_Enter ))
-	ev->keyval = GDK_Tab ;
+     &&
+     ( ev -> keyval == GDK_KEY_Return
+     ||
+     ev -> keyval == GDK_KEY_KP_Enter ))
+        ev->keyval = GDK_KEY_Tab ;
 
     if (!g_object_get_data (G_OBJECT (transaction_form), "transaction_number_in_form"))
 	/* set the new transaction number */
@@ -2073,16 +2073,16 @@ gboolean gsb_form_key_press_event ( GtkWidget *widget,
 
     switch ( ev -> keyval )
     {
-    case GDK_1:
-    case GDK_2:
-    case GDK_3:
-    case GDK_4:
-    case GDK_5:
-    case GDK_6:
-    case GDK_7:
-    case GDK_8:
-    case GDK_9:
-    case GDK_0:
+    case GDK_KEY_1:
+    case GDK_KEY_2:
+    case GDK_KEY_3:
+    case GDK_KEY_4:
+    case GDK_KEY_5:
+    case GDK_KEY_6:
+    case GDK_KEY_7:
+    case GDK_KEY_8:
+    case GDK_KEY_9:
+    case GDK_KEY_0:
         switch ( element_number )
         {
         case TRANSACTION_FORM_DEBIT:
@@ -2105,11 +2105,11 @@ gboolean gsb_form_key_press_event ( GtkWidget *widget,
             break;
         }
         break;
-	case GDK_Escape :
+	case GDK_KEY_Escape :
 	    gsb_form_escape_form ();
 	    break;
 
-	case GDK_Up:
+	case GDK_KEY_Up:
 	    element_suivant = gsb_form_widget_next_element ( account_number,
 							     element_number,
 							     GSB_UP );
@@ -2117,7 +2117,7 @@ gboolean gsb_form_key_press_event ( GtkWidget *widget,
 	    return TRUE;
 	    break;
 
-	case GDK_Down:
+	case GDK_KEY_Down:
 	    element_suivant = gsb_form_widget_next_element ( account_number,
 							     element_number,
 							     GSB_DOWN );
@@ -2125,7 +2125,7 @@ gboolean gsb_form_key_press_event ( GtkWidget *widget,
 	    return TRUE;
 	    break;
 
-	case GDK_ISO_Left_Tab:
+	case GDK_KEY_ISO_Left_Tab:
         if ( element_number == TRANSACTION_FORM_CREDIT
          || element_number == TRANSACTION_FORM_DEBIT )
         {
@@ -2154,7 +2154,7 @@ gboolean gsb_form_key_press_event ( GtkWidget *widget,
 	    return TRUE;
 	    break;
 
-	case GDK_Tab :
+	case GDK_KEY_Tab :
         if ( element_number == TRANSACTION_FORM_CREDIT
          || element_number == TRANSACTION_FORM_DEBIT )
         {
@@ -2187,8 +2187,8 @@ gboolean gsb_form_key_press_event ( GtkWidget *widget,
 	    return TRUE;
 	    break;
 
-	case GDK_KP_Enter :
-	case GDK_Return :
+	case GDK_KEY_KP_Enter :
+	case GDK_KEY_Return :
 
 	    /* need to check here if we are performing a scheduled transaction in home page
 	     * or another transaction, because if we are in home page, cannot finish like that,
@@ -2231,9 +2231,9 @@ gboolean gsb_form_key_press_event ( GtkWidget *widget,
 	    }
 	    break;
 
-	case GDK_KP_Add:
-	case GDK_plus:
-	case GDK_equal:		/* This should make all our US users happy */
+	case GDK_KEY_KP_Add:
+	case GDK_KEY_plus:
+	case GDK_KEY_equal:		/* This should make all our US users happy */
 	    /* increase the check of 1 */
 	    if (element_number == TRANSACTION_FORM_CHEQUE)
 	    {
@@ -2243,8 +2243,8 @@ gboolean gsb_form_key_press_event ( GtkWidget *widget,
 	    }
 	    break;
 
-	case GDK_KP_Subtract:
-	case GDK_minus:
+	case GDK_KEY_KP_Subtract:
+	case GDK_KEY_minus:
 	    /* decrease the check of 1 */
 	    if (element_number == TRANSACTION_FORM_CHEQUE)
 	    {
@@ -2261,8 +2261,8 @@ gboolean gsb_form_key_press_event ( GtkWidget *widget,
 
         switch ( ev -> keyval )
         {
-        case GDK_c:
-        case GDK_C:
+        case GDK_KEY_c:
+        case GDK_KEY_C:
             payment_number = gsb_data_payment_get_number_by_name ( _("Credit card"),
                         account_number );
             if ( payment_number )
@@ -2270,8 +2270,8 @@ gboolean gsb_form_key_press_event ( GtkWidget *widget,
 
             return TRUE;
             break;
-        case GDK_d:
-        case GDK_D:
+        case GDK_KEY_d:
+        case GDK_KEY_D:
             payment_number = gsb_data_payment_get_number_by_name ( _("Direct deposit"),
                         account_number );
             if ( payment_number )
@@ -2279,8 +2279,8 @@ gboolean gsb_form_key_press_event ( GtkWidget *widget,
 
             return TRUE;
             break;
-        case GDK_h:
-        case GDK_H:
+        case GDK_KEY_h:
+        case GDK_KEY_H:
             payment_number = gsb_data_payment_get_number_by_name ( _("Check"),
                         account_number );
             if ( payment_number )
@@ -2288,8 +2288,8 @@ gboolean gsb_form_key_press_event ( GtkWidget *widget,
 
             return TRUE;
             break;
-        case GDK_l:
-        case GDK_L:
+        case GDK_KEY_l:
+        case GDK_KEY_L:
             payment_number = gsb_data_payment_get_number_by_name ( _("Cash withdrawal"),
                         account_number );
             if ( payment_number )
@@ -2298,8 +2298,8 @@ gboolean gsb_form_key_press_event ( GtkWidget *widget,
             return TRUE;
             break;
 
-        case GDK_p:
-        case GDK_P:
+        case GDK_KEY_p:
+        case GDK_KEY_P:
             payment_number = gsb_data_payment_get_number_by_name ( _("Direct debit"),
                         account_number );
             if ( payment_number )
@@ -2307,10 +2307,10 @@ gboolean gsb_form_key_press_event ( GtkWidget *widget,
 
             return TRUE;
             break;
-        case GDK_t:
-        case GDK_T:
-        case GDK_v:
-        case GDK_V:
+        case GDK_KEY_t:
+        case GDK_KEY_T:
+        case GDK_KEY_v:
+        case GDK_KEY_V:
             payment_number = gsb_data_payment_get_number_by_name ( _("Transfer"),
                         account_number );
             if ( payment_number )
diff --git a/src/gsb_scheduler_list.c b/src/gsb_scheduler_list.c
index 6b177d6..e5f530b 100644
--- a/src/gsb_scheduler_list.c
+++ b/src/gsb_scheduler_list.c
@@ -92,6 +92,8 @@ static GtkTreeModel *gsb_scheduler_list_get_model ( void );
 static gboolean gsb_scheduler_list_key_press ( GtkWidget *tree_view,
                         GdkEventKey *ev );
 static gboolean gsb_scheduler_list_popup_custom_periodicity_dialog (void);
+static void gsb_scheduler_list_process_orphan_list ( GSList *orphan_scheduled,
+                        GDate *end_date );
 static gboolean gsb_scheduler_list_selection_changed ( GtkTreeSelection *selection,
                         gpointer null );
 static gboolean gsb_scheduler_list_set_color_of_mother ( gint mother_scheduled_number,
@@ -872,44 +874,8 @@ gboolean gsb_scheduler_list_fill_list ( GtkWidget *tree_view )
     /* if there are some orphan sheduler (children of breakdonw wich didn't find their mother */
     if ( orphan_scheduled )
     {
-        gchar *string = NULL;
-
-        tmp_list = orphan_scheduled;
-        while (tmp_list)
-        {
-            gint scheduled_number;
-
-            scheduled_number = gsb_data_scheduled_get_scheduled_number (tmp_list -> data);
-
-            if (!gsb_scheduler_list_append_new_scheduled ( scheduled_number,
-                                   end_date ))
-            {
-                if ( string == NULL )
-                    string = utils_str_itoa ( scheduled_number );
-                else
-                    string = g_strconcat ( string, " - ",
-                        utils_str_itoa ( scheduled_number ), NULL );
-            }
-
-            tmp_list = tmp_list -> next;
-        }
-
-        /* if string is not null, there is still some children
-         * wich didn't find their mother. show them now */
-        if ( string )
-        {
-            gchar *message;
-
-            message = _("Some scheduled children didn't find their mother in the list, "
-            "this shouldn't happen and there is probably a bug behind that. Please contact "
-            "the Grisbi team.\n\nThe concerned children number are :\n");
-
-            message = g_strconcat (message, string, NULL);
-            dialogue_warning ( message );
-            g_free ( message );
-            g_free ( string );
-        }
-        g_slist_free (orphan_scheduled);
+        gsb_scheduler_list_process_orphan_list ( orphan_scheduled, end_date );
+        g_slist_free ( orphan_scheduled );
     }
 
     /* create and append the white line */
@@ -1790,26 +1756,26 @@ gboolean gsb_scheduler_list_key_press ( GtkWidget *tree_view,
 
     switch ( ev->keyval )
     {
-	case GDK_Return :		/* touches entrée */
-	case GDK_KP_Enter :
+	case GDK_KEY_Return :		/* touches entrée */
+	case GDK_KEY_KP_Enter :
 
 	    if ( scheduled_number )
 		gsb_scheduler_list_edit_transaction (scheduled_number);
 	    break;
 
 
-	case GDK_Delete :               /*  del  */
+	case GDK_KEY_Delete :               /*  del  */
 
 	    if ( scheduled_number > 0 )
 		gsb_scheduler_list_delete_scheduled_transaction (scheduled_number, TRUE);
 	    break;
 
-	case GDK_Left:
+	case GDK_KEY_Left:
 	    /* if we press left, give back the focus to the tree at left */
 	    gtk_widget_grab_focus ( gsb_gui_navigation_get_tree_view ( ) );
 	    break;
 
-	case GDK_space:
+	case GDK_KEY_space:
 	    /* space open/close a split */
 	    gsb_scheduler_list_switch_expander (scheduled_number);
 	    break;
@@ -2814,6 +2780,73 @@ gboolean gsb_scheduler_list_set_color_of_mother ( gint mother_scheduled_number,
 }
 
 
+/**
+ * remove the orphan transactions
+ *
+ * \param orphan list
+ *
+ * \return void
+ */
+void gsb_scheduler_list_process_orphan_list ( GSList *orphan_scheduled,
+                        GDate *end_date )
+{
+    GSList *tmp_list;
+    gchar *string = NULL;
+    GArray *garray;
+
+    garray = g_array_new ( FALSE, FALSE, sizeof ( gint ) );
+    tmp_list = orphan_scheduled;
+    while (tmp_list)
+    {
+        gint scheduled_number;
+
+        scheduled_number = gsb_data_scheduled_get_scheduled_number ( tmp_list -> data );
+
+        if ( !gsb_scheduler_list_append_new_scheduled ( scheduled_number, end_date ) )
+        {
+            /* on sauvegarde le numéro de l'opération */
+            g_array_append_val ( garray, scheduled_number );
+            if ( string == NULL )
+                string = utils_str_itoa ( scheduled_number );
+            else
+                string = g_strconcat ( string, " - ",
+                    utils_str_itoa ( scheduled_number ), NULL );
+        }
+
+        tmp_list = tmp_list -> next;
+    }
+
+    /* if string is not null, there is still some children
+     * wich didn't find their mother. show them now */
+    if ( string )
+    {
+        gchar *message;
+        gint result;
+
+        message = g_strdup_printf ( _("Some scheduled children didn't find their mother in the list, "
+                        "this shouldn't happen and there is probably a bug behind that.\n\n"
+                        "The concerned children number are :\n %s\n\n"
+                        "Do you want to delete it"),
+                        string );
+
+        result = question_yes_no_hint (_("Remove orphan children"), message, GTK_RESPONSE_CANCEL );
+
+        if (result == TRUE)
+        {
+            gint i;
+
+            for ( i = 0; i < garray->len; i++ )
+                gsb_data_scheduled_remove_scheduled ( g_array_index ( garray, gint, i ) );
+
+        }
+
+        g_free ( message );
+        g_free ( string );
+        g_array_free ( garray, TRUE );
+    }
+}
+
+
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */
diff --git a/src/gsb_transactions_list.c b/src/gsb_transactions_list.c
index f0ce674..f020fd9 100644
--- a/src/gsb_transactions_list.c
+++ b/src/gsb_transactions_list.c
@@ -113,6 +113,7 @@ static gboolean gsb_transactions_list_key_press ( GtkWidget *widget,
                         GdkEventKey *ev );
 static gboolean gsb_transactions_list_move_transaction_to_account ( gint transaction_number,
                         gint target_account );
+static void gsb_transactions_list_process_orphan_list ( GSList *orphan_list );
 static void gsb_transactions_list_set_tree_view (GtkWidget *tree_view);
 static gboolean gsb_transactions_list_size_allocate ( GtkWidget *tree_view,
                         GtkAllocation *allocation,
@@ -828,56 +829,20 @@ gboolean gsb_transactions_list_fill_model ( void )
     tmp_list = gsb_data_transaction_get_transactions_list ();
     while (tmp_list)
     {
-	transaction_number = gsb_data_transaction_get_transaction_number (tmp_list -> data);
-	transaction_list_append_transaction (transaction_number);
-	tmp_list = tmp_list -> next;
+        transaction_number = gsb_data_transaction_get_transaction_number ( tmp_list -> data );
+        transaction_list_append_transaction ( transaction_number );
+
+        tmp_list = tmp_list -> next;
     }
 
     /* if orphan_child_transactions if filled, there are some children wich didn't fing their
      * mother, we try again now that all the mothers are in the model */
-    if (orphan_child_transactions)
+    if ( orphan_child_transactions )
     {
-	GSList *orphan_list_copy;
+        gsb_transactions_list_process_orphan_list ( orphan_child_transactions );
 
-	orphan_list_copy = g_slist_copy (orphan_child_transactions);
-	g_slist_free (orphan_child_transactions);
-	orphan_child_transactions = NULL;
-
-	tmp_list = orphan_list_copy;
-	while (tmp_list)
-	{
-	    transaction_number = GPOINTER_TO_INT (tmp_list -> data);
-	    transaction_list_append_transaction (transaction_number);
-	    tmp_list = tmp_list -> next;
-	}
-	g_slist_free (orphan_list_copy);
-
-	/* if orphan_child_transactions is not null, there is still some children
-	 * wich didn't find their mother. show them now */
-	if (orphan_child_transactions)
-	{
-	    gchar *message = _("Some children didn't find their mother in the list, this "
-                           "shouldn't happen and there is probably a bug behind that. "
-                           "Please contact the Grisbi team.\n\nThe concerned children "
-                           "number are :\n");
-	    gchar *string_1;
-	    gchar *string_2;
-
-	    string_1 = g_strconcat (message, NULL);
-	    tmp_list = orphan_child_transactions;
-	    while (tmp_list)
-	    {
-		string_2 = g_strconcat ( string_1,
-					 utils_str_itoa (GPOINTER_TO_INT (tmp_list -> data)),
-					 " - ",
-					 NULL);
-		g_free (string_1);
-		string_1 = string_2;
-		tmp_list = tmp_list -> next;
-	    }
-	    dialogue_warning (string_1);
-	    g_free (string_1);
-	}
+        g_slist_free ( orphan_child_transactions );
+        orphan_child_transactions = NULL;
     }
     return FALSE;
 }
@@ -1578,39 +1543,39 @@ gboolean gsb_transactions_list_key_press ( GtkWidget *widget,
 
     switch ( ev -> keyval )
     {
-    case GDK_Return :   /* entrée */
-    case GDK_KP_Enter :
-    case GDK_Tab :
+    case GDK_KEY_Return :   /* entrée */
+    case GDK_KEY_KP_Enter :
+    case GDK_KEY_Tab :
 
         gsb_transactions_list_edit_transaction (
                         gsb_data_account_get_current_transaction_number ( account_number ) );
         break;
 
-    case GDK_Up :       /* touches flèche haut */
-    case GDK_KP_Up :
+    case GDK_KEY_Up :       /* touches flèche haut */
+    case GDK_KEY_KP_Up :
 
         transaction_list_select_up (FALSE);
         break;
 
-    case GDK_Down :     /* touches flèche bas */
-    case GDK_KP_Down :
+    case GDK_KEY_Down :     /* touches flèche bas */
+    case GDK_KEY_KP_Down :
 
         transaction_list_select_down (FALSE);
         break;
 
-    case GDK_Delete:    /*  del  */
+    case GDK_KEY_Delete:    /*  del  */
         gsb_transactions_list_delete_transaction (
                         gsb_data_account_get_current_transaction_number ( account_number ),
                         TRUE );
         break;
 
-    case GDK_P:         /* touche P */
-    case GDK_p:         /* touche p */
-    case GDK_F12:       /* touche F12 pour pointer dépointer comme avec <ctrl>p*/ 
+    case GDK_KEY_P:         /* touche P */
+    case GDK_KEY_p:         /* touche p */
+    case GDK_KEY_F12:       /* touche F12 pour pointer dépointer comme avec <ctrl>p*/ 
 
         if ( ( ev -> state & GDK_CONTROL_MASK ) == GDK_CONTROL_MASK
             ||
-            ev -> keyval == GDK_F12 )
+            ev -> keyval == GDK_KEY_F12 )
         {
             gsb_transactions_list_switch_mark (
                         gsb_data_account_get_current_transaction_number ( account_number ) );
@@ -1618,8 +1583,8 @@ gboolean gsb_transactions_list_key_press ( GtkWidget *widget,
         }
         break;
 
-    case GDK_r:         /* touche r */
-    case GDK_R:         /* touche R */
+    case GDK_KEY_r:         /* touche r */
+    case GDK_KEY_R:         /* touche R */
 
         if ( ( ev -> state & GDK_CONTROL_MASK ) == GDK_CONTROL_MASK )
         {
@@ -1629,12 +1594,12 @@ gboolean gsb_transactions_list_key_press ( GtkWidget *widget,
         }
         break;
 
-    case GDK_t:         /* touche t */
-    case GDK_T:         /* touche T */
+    case GDK_KEY_t:         /* touche t */
+    case GDK_KEY_T:         /* touche T */
         transaction_list_select ( -1 );
         break;
 
-    case GDK_space:
+    case GDK_KEY_space:
         transaction_number = gsb_data_account_get_current_transaction_number ( account_number );
         if ( transaction_number > 0 )
         {
@@ -1650,18 +1615,18 @@ gboolean gsb_transactions_list_key_press ( GtkWidget *widget,
         }
         break;
 
-    case GDK_Left:
+    case GDK_KEY_Left:
         /* if we press left, give back the focus to the tree at left */
         gtk_widget_grab_focus ( gsb_gui_navigation_get_tree_view ( ) );
         break;
 
-    case GDK_Home:
-    case GDK_KP_Home:
+    case GDK_KEY_Home:
+    case GDK_KEY_KP_Home:
         gtk_tree_view_scroll_to_point ( GTK_TREE_VIEW ( gsb_transactions_list_get_tree_view ( ) ), 0, 0 );
         break;
 
-    case GDK_End:
-    case GDK_KP_End:
+    case GDK_KEY_End:
+    case GDK_KEY_KP_End:
         gtk_tree_view_scroll_to_point ( GTK_TREE_VIEW ( gsb_transactions_list_get_tree_view ( ) ), -1, 1024 );
         break;
 
@@ -4586,6 +4551,69 @@ gboolean gsb_transactions_list_delete_import_rule ( gint import_rule_number )
     return TRUE;
 }
 
+
+/**
+ * remove the orphan transactions
+ *
+ * \param orphan list
+ *
+ * \return void
+ */
+void gsb_transactions_list_process_orphan_list ( GSList *orphan_list )
+{
+    GSList *tmp_list;
+    gchar *string = NULL;
+    GArray *garray;
+
+    garray = g_array_new ( FALSE, FALSE, sizeof ( gint ) );
+    tmp_list = orphan_list;
+    while (tmp_list)
+    {
+        gint transaction_number;
+
+        transaction_number = GPOINTER_TO_INT ( tmp_list -> data );
+
+        /* on sauvegarde le numéro de l'opération */
+        g_array_append_val ( garray, transaction_number );
+        if ( string == NULL )
+            string = utils_str_itoa ( transaction_number );
+        else
+            string = g_strconcat ( string, " - ",
+                utils_str_itoa ( transaction_number ), NULL );
+
+        tmp_list = tmp_list -> next;
+    }
+
+    /* if string is not null, there is still some children
+     * wich didn't find their mother. show them now */
+    if ( string )
+    {
+        gchar *message;
+        gint result;
+
+        message = g_strdup_printf ( _("Some children didn't find their mother in the list, "
+                        "this shouldn't happen and there is probably a bug behind that.\n\n"
+                        "The concerned children number are :\n %s\n\n"
+                        "Do you want to delete it"),
+                        string );
+
+        result = question_yes_no_hint (_("Remove orphan children"), message, GTK_RESPONSE_CANCEL );
+
+        if (result == TRUE)
+        {
+            gint i;
+
+            for ( i = 0; i < garray->len; i++ )
+                gsb_data_transaction_remove_transaction ( g_array_index ( garray, gint, i ) );
+        }
+
+        g_free ( message );
+        g_free ( string );
+        g_array_free ( garray, TRUE );
+    }
+}
+
+
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */
diff --git a/src/gtk_combofix.c b/src/gtk_combofix.c
index 4efdae6..1935fd4 100644
--- a/src/gtk_combofix.c
+++ b/src/gtk_combofix.c
@@ -1486,10 +1486,10 @@ static gboolean gtk_combofix_key_press_event ( GtkWidget *entry,
 
     switch ( ev -> keyval )
     {
-    case GDK_ISO_Left_Tab:
-    case GDK_Tab :
-    case GDK_KP_Enter :
-    case GDK_Return :
+    case GDK_KEY_ISO_Left_Tab:
+    case GDK_KEY_Tab :
+    case GDK_KEY_KP_Enter :
+    case GDK_KEY_Return :
         /* we get the current selection */
         if ( gtk_widget_get_visible ( priv -> popup )
          &&
@@ -1507,7 +1507,7 @@ static gboolean gtk_combofix_key_press_event ( GtkWidget *entry,
         return FALSE;
         break;
 
-    case GDK_Escape:
+    case GDK_KEY_Escape:
         if ( gtk_widget_get_visible ( priv -> popup ))
         {
             gtk_combofix_hide_popup ( combofix );
@@ -1517,8 +1517,8 @@ static gboolean gtk_combofix_key_press_event ( GtkWidget *entry,
         }
         break;
 
-    case GDK_Down :
-    case GDK_KP_Down :
+    case GDK_KEY_Down :
+    case GDK_KEY_KP_Down :
         /* show the popup if necessary */
         if ( !gtk_widget_get_visible ( priv -> popup ) )
             gtk_combofix_show_popup ( combofix );
@@ -1528,8 +1528,8 @@ static gboolean gtk_combofix_key_press_event ( GtkWidget *entry,
         return TRUE;
         break;
 
-    case GDK_Up :
-    case GDK_KP_Up :
+    case GDK_KEY_Up :
+    case GDK_KEY_KP_Up :
         /* move the selection up in the combofix only if the popup is showed,
          * else let the program works with the upper key */
         if (gtk_widget_get_visible ( priv -> popup))
@@ -1540,8 +1540,8 @@ static gboolean gtk_combofix_key_press_event ( GtkWidget *entry,
         }
         break;
 
-    case GDK_Page_Up :
-    case GDK_KP_Page_Up :
+    case GDK_KEY_Page_Up :
+    case GDK_KEY_KP_Page_Up :
         /* show the popup if necessary */
         if ( !gtk_widget_get_visible ( priv -> popup ) )
             gtk_combofix_show_popup ( combofix );
@@ -1551,8 +1551,8 @@ static gboolean gtk_combofix_key_press_event ( GtkWidget *entry,
         return TRUE;
         break;
 
-    case GDK_Page_Down :
-    case GDK_KP_Page_Down :
+    case GDK_KEY_Page_Down :
+    case GDK_KEY_KP_Page_Down :
         /* show the popup if necessary */
         if ( !gtk_widget_get_visible ( priv -> popup ) )
             gtk_combofix_show_popup ( combofix );
diff --git a/src/help.c b/src/help.c
index 3da1db9..048bccf 100644
--- a/src/help.c
+++ b/src/help.c
@@ -43,8 +43,6 @@
 static gboolean url_clicked ( GtkAboutDialog *label,
                         gchar *uri,
                         gpointer user_data );
-
-static void launch_url (GtkAboutDialog *about, const gchar * link, gpointer data);
 /*END_STATIC*/
 
 
diff --git a/src/navigation.c b/src/navigation.c
index 53dd585..04affb7 100644
--- a/src/navigation.c
+++ b/src/navigation.c
@@ -1515,15 +1515,15 @@ gboolean gsb_gui_navigation_check_key_press ( GtkWidget *tree_view,
 	case GSB_HOME_PAGE:
 	case GSB_REPORTS_PAGE:
             /* expand or collapse subtree */
-	    if (ev -> keyval == GDK_Right)
+	    if (ev -> keyval == GDK_KEY_Right)
                 gtk_tree_view_expand_row ( GTK_TREE_VIEW ( tree_view ), path, FALSE );
-	    if (ev -> keyval == GDK_Left)
+	    if (ev -> keyval == GDK_KEY_Left)
                 gtk_tree_view_collapse_row ( GTK_TREE_VIEW ( tree_view ), path );
 	    break;
 
 	case GSB_ACCOUNT_PAGE:
 	    /* when come here, if we press the right key, give the focus to the list */
-	    if (ev -> keyval == GDK_Right)
+	    if (ev -> keyval == GDK_KEY_Right)
 		gtk_widget_grab_focus (gsb_transactions_list_get_tree_view ());
 	    break;
 
@@ -1541,7 +1541,7 @@ gboolean gsb_gui_navigation_check_key_press ( GtkWidget *tree_view,
 
 	case GSB_SCHEDULER_PAGE:
 	    /* when come here, if we press the right key, give the focus to the list */
-	    if (ev -> keyval == GDK_Right)
+	    if (ev -> keyval == GDK_KEY_Right)
 		gtk_widget_grab_focus (gsb_scheduler_list_get_tree_view ());
 	    break;
     }
diff --git a/src/utils.c b/src/utils.c
index 2e9577b..d607918 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -172,7 +172,7 @@ gboolean desensitive_widget ( gpointer object, GtkWidget *widget )
  * sous Windows si la commande est vide ou egale a la valeur par defaut
  * on lance le butineur par defaut (open)
  */
-gboolean lance_navigateur_web ( const gchar *url )
+gboolean lance_navigateur_web_old ( const gchar *url )
 {
     gchar **split;
     gchar *chaine = NULL;
@@ -247,6 +247,41 @@ gboolean lance_navigateur_web ( const gchar *url )
     return FALSE;
 }
 
+gboolean lance_navigateur_web ( const gchar *uri )
+{
+    GError *error = NULL;
+    gchar *str;
+
+    if ( g_str_has_prefix ( uri, "http://" ) )
+    {
+        str = g_strdup ( uri );
+    }
+    else
+    {
+        str = g_strconcat ( "file://", uri, NULL );
+    }
+
+    if ( gtk_show_uri ( NULL, str, GDK_CURRENT_TIME, &error ) == FALSE )
+    {
+        gchar *tmp_str;
+
+        tmp_str = g_strdup_printf ( _("Grisbi was unable to execute a web browser to "
+                        "browse url <tt>%s</tt>.\n"
+                        "The error was: %s."),
+                        uri, error -> message );
+        g_error_free ( error );
+        dialogue_error_hint ( tmp_str, _("Cannot execute web browser") );
+        g_free(tmp_str);
+    }
+
+    g_free ( str );
+
+    if ( error )
+        return FALSE;
+    else
+        return TRUE;
+}
+
 
 /**
  * Create a box with a nice bold title and content slightly indented.
diff --git a/src/utils.h b/src/utils.h
index ef540e2..a387750 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -14,7 +14,7 @@ gboolean desensitive_widget ( gpointer object,
                         GtkWidget *widget );
 gchar *get_gtk_run_version ( void );
 void lance_mailer ( const gchar *uri );
-gboolean lance_navigateur_web ( const gchar *url );
+gboolean lance_navigateur_web ( const gchar *uri );
 gboolean met_en_normal ( GtkWidget *event_box,
                         GdkEventMotion *event,
                         gpointer pointeur );


hooks/post-receive
-- 
grisbi


More information about the cvs mailing list