[grisbi-cvs] [SCM] grisbi branch, master, updated. upstream_version_1_1_1-16-g190e8ed
Pierre Biava
nobody at users.sourceforge.net
Sat Jan 5 15:51:12 CET 2013
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grisbi".
The branch, master has been updated
via 190e8ed905e43b4017606d603e66ac23348b2a82 (commit)
via 005e00be2a9653aeb4ed81651e21c61f890c7e93 (commit)
via f713d4b1dd6277378e8c8161df4c807abc7bfa08 (commit)
via a22760d3559470292e0f7802b731575f131c72eb (commit)
via e6c7026401619528999af97f41aed4e53b1f499c (commit)
via 61dca875a7cd35740ea295a09cad85d4dec4a066 (commit)
via be6e0f64f65ad7e223e3c7fc6ffee04b4f8a8ab1 (commit)
via 2fb8734361735932410a9c0c5e2f8291caaebe58 (commit)
via c4dfc874c58c6d889710ee61f498e9d7705a352b (commit)
via 048bf0e26e04d04e529c0ae829017e88fafd3b1a (commit)
via 567788423cd5ed2a99f34296d38a395db2461fb0 (commit)
via 179250863e29067ea2f52bcc511968b1f2722ef8 (commit)
via b57d979679b423bfc840499fe245bea29bf47083 (commit)
via dc6568c9954b6f151f1a5d37f239793fbd137c37 (commit)
via 047970863cd0f37004513595ad9e27ac785c7154 (commit)
via 6d2e61df2d13be073f4fc31fbb0d19f09684dc04 (commit)
from 67a597d52efc0058b5fa62b09aeae0c837940bc8 (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 190e8ed905e43b4017606d603e66ac23348b2a82
Author: pbiava <pierre.biava at nerim.net>
Date: Sat Jan 5 15:35:06 2013 +0100
Replace GDK_<keyname> with GDK_KEY_<keyname>
commit 005e00be2a9653aeb4ed81651e21c61f890c7e93
Author: pbiava <pierre.biava at nerim.net>
Date: Sat Jan 5 15:12:48 2013 +0100
replaces direct access of structures by accessor functions except for gtk_table and tree_view widgets
commit f713d4b1dd6277378e8c8161df4c807abc7bfa08
Author: pbiava <pierre.biava at nerim.net>
Date: Thu Jan 3 22:24:38 2013 +0100
replaces accessor functions instead of direct access
commit a22760d3559470292e0f7802b731575f131c72eb
Author: pbiava <pierre.biava at nerim.net>
Date: Thu Jan 3 21:49:39 2013 +0100
replaced gtk_window_set_policy with gtk_window_set_resizable
commit e6c7026401619528999af97f41aed4e53b1f499c
Author: pbiava <pierre.biava at nerim.net>
Date: Thu Jan 3 21:36:20 2013 +0100
deleted deleted gtk_about_dialog_set_url_hook () and gtk_about_dialog_set_email_hook ()
commit 61dca875a7cd35740ea295a09cad85d4dec4a066
Author: pbiava <pierre.biava at nerim.net>
Date: Thu Jan 3 21:35:01 2013 +0100
replaced gtk_widget_hide_all () by gtk_widget_hide ()
commit be6e0f64f65ad7e223e3c7fc6ffee04b4f8a8ab1
Author: pbiava <pierre.biava at nerim.net>
Date: Thu Jan 3 21:32:28 2013 +0100
replaces the obsolete function "gtk_combo_box_new_text ()"
commit 2fb8734361735932410a9c0c5e2f8291caaebe58
Author: pbiava <pierre.biava at nerim.net>
Date: Thu Jan 3 20:45:12 2013 +0100
replaces the obsolete function "gtk_combo_box_entry_new_text ()"
commit c4dfc874c58c6d889710ee61f498e9d7705a352b
Author: pbiava <pierre.biava at nerim.net>
Date: Wed Jan 2 22:48:51 2013 +0100
replaces the obsolete symbol "GTK_OPTION_MENU"
commit 048bf0e26e04d04e529c0ae829017e88fafd3b1a
Author: pbiava <pierre.biava at nerim.net>
Date: Wed Jan 2 22:31:01 2013 +0100
replaces the obsolete symbol "GTK_WIDGET_REALIZED"
commit 567788423cd5ed2a99f34296d38a395db2461fb0
Author: pbiava <pierre.biava at nerim.net>
Date: Wed Jan 2 22:28:32 2013 +0100
replaces the obsolete symbol "GTK_WIDGET_TOPLEVEL"
commit 179250863e29067ea2f52bcc511968b1f2722ef8
Author: pbiava <pierre.biava at nerim.net>
Date: Wed Jan 2 22:24:11 2013 +0100
replaces the obsoletes symbols "gtk_signal_connect, GTK_OBJECT, GTK_SIGNAL_FUNC"
commit b57d979679b423bfc840499fe245bea29bf47083
Author: pbiava <pierre.biava at nerim.net>
Date: Wed Jan 2 22:17:46 2013 +0100
replaces the obsolete symbol "GtkComboBoxEntry"
commit dc6568c9954b6f151f1a5d37f239793fbd137c37
Author: pbiava <pierre.biava at nerim.net>
Date: Wed Jan 2 22:06:41 2013 +0100
replaces the obsolete symbol "GTK_WIDGET_SENSITIVE"
commit 047970863cd0f37004513595ad9e27ac785c7154
Author: pbiava <pierre.biava at nerim.net>
Date: Wed Jan 2 22:03:15 2013 +0100
replaces the obsolete symbol "GTK_WIDGET_IS_SENSITIVE"
commit 6d2e61df2d13be073f4fc31fbb0d19f09684dc04
Author: pbiava <pierre.biava at nerim.net>
Date: Wed Jan 2 21:01:56 2013 +0100
initialization of widget "treeview dates"
-----------------------------------------------------------------------
Changes:
diff --git a/src/accueil.c b/src/accueil.c
index 80b5521..5936e1d 100644
--- a/src/accueil.c
+++ b/src/accueil.c
@@ -111,7 +111,7 @@ static gchar *chaine_espace = " ";
#define show_paddingbox(child) gtk_widget_show_all (gtk_widget_get_parent(gtk_widget_get_parent(gtk_widget_get_parent(GTK_WIDGET(child)))))
-#define hide_paddingbox(child) gtk_widget_hide_all (gtk_widget_get_parent(gtk_widget_get_parent(gtk_widget_get_parent(GTK_WIDGET(child)))))
+#define hide_paddingbox(child) gtk_widget_hide (gtk_widget_get_parent(gtk_widget_get_parent(gtk_widget_get_parent(GTK_WIDGET(child)))))
/* structure définissant une association entre un compte et un solde partiel */
@@ -286,7 +286,7 @@ static gboolean saisie_echeance_accueil ( GtkWidget *event_box,
GtkWidget *button;
gint result;
- parent_save = form_transaction_part -> parent;
+ parent_save = gtk_widget_get_parent ( form_transaction_part );
/* Create the dialog */
dialog = gtk_dialog_new_with_buttons ( _("Enter a scheduled transaction"),
@@ -303,7 +303,7 @@ static gboolean saisie_echeance_accueil ( GtkWidget *event_box,
/* first we reparent the form in the dialog */
hbox = gtk_hbox_new ( FALSE, 0 );
- gtk_box_pack_start ( GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox, TRUE, TRUE, 0 );
+ gtk_box_pack_start ( GTK_BOX ( dialog_get_content_area ( dialog ) ), hbox, TRUE, TRUE, 0 );
gtk_container_set_border_width ( GTK_CONTAINER(hbox), 12 );
gtk_widget_reparent ( form_transaction_part, hbox );
gtk_widget_show_all ( hbox );
diff --git a/src/affichage_liste.c b/src/affichage_liste.c
index 5d86304..d5bbf12 100644
--- a/src/affichage_liste.c
+++ b/src/affichage_liste.c
@@ -189,7 +189,7 @@ GtkWidget *onglet_affichage_operations ( void )
break;
}
- button = gtk_combo_box_new_text ();
+ button = gtk_combo_box_text_new ();
g_signal_connect ( G_OBJECT (button), "changed",
G_CALLBACK (display_mode_button_changed),
GINT_TO_POINTER (i));
@@ -198,7 +198,7 @@ GtkWidget *onglet_affichage_operations ( void )
j=0;
while (text_line[j])
{
- gtk_combo_box_append_text (GTK_COMBO_BOX (button), text_line[j]);
+ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (button), text_line[j]);
j++;
}
gtk_combo_box_set_active ( GTK_COMBO_BOX (button), position);
@@ -231,7 +231,7 @@ GtkWidget *onglet_affichage_operations ( void )
hbox = gtk_hbox_new ( FALSE, 5);
gtk_box_pack_start ( GTK_BOX ( paddingbox ), hbox, FALSE, FALSE, 0 );
- button = gtk_combo_box_new_text ();
+ button = gtk_combo_box_text_new ();
g_signal_connect ( G_OBJECT ( button ),
"changed",
G_CALLBACK ( gsb_transactions_list_display_sort_changed ),
@@ -239,7 +239,7 @@ GtkWidget *onglet_affichage_operations ( void )
for ( i = 0 ; i < 2 ; i++ )
{
- gtk_combo_box_append_text ( GTK_COMBO_BOX ( button ), options_tri_primaire[i] );
+ gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( button ), options_tri_primaire[i] );
}
gtk_combo_box_set_active ( GTK_COMBO_BOX ( button ), conf.transactions_list_primary_sorting );
gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, FALSE, 0 );
@@ -251,7 +251,7 @@ GtkWidget *onglet_affichage_operations ( void )
hbox = gtk_hbox_new ( FALSE, 5);
gtk_box_pack_start ( GTK_BOX ( paddingbox ), hbox, FALSE, FALSE, 0 );
- button = gtk_combo_box_new_text ();
+ button = gtk_combo_box_text_new ();
g_signal_connect ( G_OBJECT ( button ),
"changed",
G_CALLBACK ( gsb_transactions_list_display_sort_changed ),
@@ -259,7 +259,7 @@ GtkWidget *onglet_affichage_operations ( void )
for ( i = 0 ; i < 4 ; i++ )
{
- gtk_combo_box_append_text ( GTK_COMBO_BOX ( button ), options_tri_secondaire[i] );
+ gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( button ), options_tri_secondaire[i] );
}
gtk_combo_box_set_active ( GTK_COMBO_BOX ( button ), conf.transactions_list_secondary_sorting );
gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, FALSE, 0 );
@@ -944,14 +944,16 @@ gboolean gsb_transaction_list_config_realized ( GtkWidget *tree_view,
for ( column = 0 ; column < CUSTOM_MODEL_VISIBLE_COLUMNS ; column++ )
{
gint width;
+ GtkAllocation allocation;
- width = ( transaction_col_width [column] * ( tree_view -> allocation.width ) ) / 100;
+ gtk_widget_get_allocation ( tree_view, &allocation );
+ width = ( transaction_col_width [column] * ( allocation.width ) ) / 100;
gtk_tree_view_column_set_fixed_width (
gtk_tree_view_get_column ( GTK_TREE_VIEW ( tree_view ), column ),
width );
}
- gdk_window_set_cursor ( tree_view -> window, gdk_cursor_new ( GDK_HAND2 ) );
+ gdk_window_set_cursor ( gtk_widget_get_window ( tree_view ), gdk_cursor_new ( GDK_HAND2 ) );
return FALSE;
}
diff --git a/src/bet_config.c b/src/bet_config.c
index 553250d..8d398ed 100644
--- a/src/bet_config.c
+++ b/src/bet_config.c
@@ -1154,25 +1154,25 @@ void bet_config_sensitive_account_parameters ( gint account_number, gboolean sen
widget = g_object_get_data ( G_OBJECT ( account_page ), "Data_for_historical" );
gtk_widget_show_all ( widget );
widget = g_object_get_data ( G_OBJECT ( account_page ), "Data_for_credit" );
- gtk_widget_hide_all ( widget );
+ gtk_widget_hide ( widget );
break;
case BET_ONGLETS_HIST:
widget = g_object_get_data ( G_OBJECT ( account_page ), "bet_credit_card_hbox" );
gtk_widget_show_all ( widget );
widget = g_object_get_data ( G_OBJECT ( account_page ), "Data_for_forecast" );
- gtk_widget_hide_all ( widget );
+ gtk_widget_hide ( widget );
widget = g_object_get_data ( G_OBJECT ( account_page ), "Data_for_historical" );
gtk_widget_show_all ( widget );
widget = g_object_get_data ( G_OBJECT ( account_page ), "Data_for_credit" );
- gtk_widget_hide_all ( widget );
+ gtk_widget_hide ( widget );
break;
case BET_ONGLETS_CAP:
widget = g_object_get_data ( G_OBJECT ( account_page ), "bet_credit_card_hbox" );
gtk_widget_show_all ( widget );
widget = g_object_get_data ( G_OBJECT ( account_page ), "Data_for_forecast" );
- gtk_widget_hide_all ( widget );
+ gtk_widget_hide ( widget );
widget = g_object_get_data ( G_OBJECT ( account_page ), "Data_for_historical" );
- gtk_widget_hide_all ( widget );
+ gtk_widget_hide ( widget );
widget = g_object_get_data ( G_OBJECT ( account_page ), "Data_for_credit" );
gtk_widget_show_all ( widget );
break;
@@ -1180,11 +1180,11 @@ void bet_config_sensitive_account_parameters ( gint account_number, gboolean sen
widget = g_object_get_data ( G_OBJECT ( account_page ), "bet_credit_card_hbox" );
gtk_widget_hide ( widget );
widget = g_object_get_data ( G_OBJECT ( account_page ), "Data_for_forecast" );
- gtk_widget_hide_all ( widget );
+ gtk_widget_hide ( widget );
widget = g_object_get_data ( G_OBJECT ( account_page ), "Data_for_historical" );
- gtk_widget_hide_all ( widget );
+ gtk_widget_hide ( widget );
widget = g_object_get_data ( G_OBJECT ( account_page ), "Data_for_credit" );
- gtk_widget_hide_all ( widget );
+ gtk_widget_hide ( widget );
break;
}
}
@@ -1193,11 +1193,11 @@ void bet_config_sensitive_account_parameters ( gint account_number, gboolean sen
widget = g_object_get_data ( G_OBJECT ( account_page ), "bet_credit_card_hbox" );
gtk_widget_hide ( widget );
widget = g_object_get_data ( G_OBJECT ( account_page ), "Data_for_forecast" );
- gtk_widget_hide_all ( widget );
+ gtk_widget_hide ( widget );
widget = g_object_get_data ( G_OBJECT ( account_page ), "Data_for_historical" );
- gtk_widget_hide_all ( widget );
+ gtk_widget_hide ( widget );
widget = g_object_get_data ( G_OBJECT ( account_page ), "Data_for_credit" );
- gtk_widget_hide_all ( widget );
+ gtk_widget_hide ( widget );
}
}
diff --git a/src/bet_finance_ui.c b/src/bet_finance_ui.c
index 5041ba8..1281cdf 100644
--- a/src/bet_finance_ui.c
+++ b/src/bet_finance_ui.c
@@ -2095,19 +2095,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,
@@ -2118,20 +2118,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 42f8f98..cf10510 100644
--- a/src/bet_future.c
+++ b/src/bet_future.c
@@ -295,7 +295,7 @@ GtkWidget *bet_future_create_dialog ( gint account_number )
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_box_pack_start ( GTK_BOX ( dialog_get_content_area ( dialog ) ), vbox, TRUE, TRUE, 0 );
gtk_container_set_border_width ( GTK_CONTAINER ( vbox ), 12 );
/* next we fill the bet_form */
@@ -896,7 +896,7 @@ gboolean bet_form_scheduler_frequency_button_changed ( GtkWidget *combo_box,
{
gchar *selected_item;
- selected_item = gtk_combo_box_get_active_text ( GTK_COMBO_BOX ( combo_box ) );
+ selected_item = gtk_combo_box_text_get_active_text ( GTK_COMBO_BOX_TEXT ( combo_box ) );
if ( !strcmp ( selected_item, _("Once") ) )
{
@@ -1045,7 +1045,7 @@ gboolean bet_form_entry_lose_focus ( GtkWidget *entry,
* (if grey, it's a child of split so do nothing) */
if ( widget
&&
- GTK_WIDGET_SENSITIVE ( widget ) )
+ gtk_widget_get_sensitive ( widget ) )
{
/* change the signe of the method of payment and the contra */
if ( gsb_payment_method_get_combo_sign ( widget ) == GSB_PAYMENT_CREDIT )
@@ -1073,7 +1073,7 @@ gboolean bet_form_entry_lose_focus ( GtkWidget *entry,
widget = bet_form_widget_get_widget ( TRANSACTION_FORM_TYPE );
if ( widget
&&
- GTK_WIDGET_SENSITIVE ( widget ) )
+ gtk_widget_get_sensitive ( widget ) )
{
/* change the signe of the method of payment and the contra */
if ( gsb_payment_method_get_combo_sign ( widget ) == GSB_PAYMENT_DEBIT )
@@ -1106,7 +1106,7 @@ gboolean bet_form_entry_lose_focus ( GtkWidget *entry,
* (if grey, it's a child of split so do nothing) */
if ( widget
&&
- GTK_WIDGET_SENSITIVE (widget))
+ gtk_widget_get_sensitive (widget))
{
/* change the signe of the method of payment and the contra */
if ( gsb_payment_method_get_combo_sign ( widget ) == GSB_PAYMENT_DEBIT )
@@ -1134,7 +1134,7 @@ gboolean bet_form_entry_lose_focus ( GtkWidget *entry,
widget = bet_form_widget_get_widget ( TRANSACTION_FORM_TYPE );
if ( widget
&&
- GTK_WIDGET_SENSITIVE ( widget ) )
+ gtk_widget_get_sensitive ( widget ) )
{
/* change the signe of the method of payment and the contra */
if ( gsb_payment_method_get_combo_sign ( widget ) == GSB_PAYMENT_CREDIT )
@@ -1249,10 +1249,10 @@ static gboolean bet_form_widget_can_focus ( gint element_number,
if ( !widget )
return FALSE;
- if ( !GTK_WIDGET_VISIBLE ( widget ) )
+ if ( !gtk_widget_get_visible ( widget ) )
return FALSE;
- if ( !GTK_WIDGET_SENSITIVE ( widget ) )
+ if ( !gtk_widget_get_sensitive ( widget ) )
return FALSE;
if ( !( GTK_IS_COMBOFIX ( widget )
@@ -1387,7 +1387,7 @@ gboolean bet_form_key_press_event ( GtkWidget *widget,
form_type = GPOINTER_TO_INT ( g_object_get_data ( G_OBJECT ( widget ), "form_type" ) );
/* on sort si on est sur la partie scheduler du formulaire sauf pour GDK_Tab */
- if ( form_type && ev -> keyval != GDK_Tab )
+ if ( form_type && ev -> keyval != GDK_KEY_Tab )
return FALSE;
element_number = GPOINTER_TO_INT (ptr_origin);
@@ -1396,23 +1396,23 @@ 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_KEY_Return
||
- ev -> keyval == GDK_KP_Enter ))
- ev->keyval = GDK_Tab ;
+ 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:
@@ -1435,18 +1435,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)
@@ -1457,8 +1457,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)
@@ -1469,7 +1469,7 @@ gboolean bet_form_key_press_event ( GtkWidget *widget,
}
break;
- case GDK_Tab :
+ case GDK_KEY_Tab :
widget_suivant = bet_form_widget_get_next_element ( element_number, form_type );
if ( widget_suivant )
@@ -2273,7 +2273,7 @@ static GtkWidget *bet_transfert_create_dialog ( gint account_number )
gtk_dialog_set_default_response ( GTK_DIALOG ( dialog ), GTK_RESPONSE_OK );
main_vbox = gtk_vbox_new ( FALSE, 0 );
- gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG ( dialog )->vbox ), main_vbox, TRUE, TRUE, 0 );
+ gtk_box_pack_start ( GTK_BOX ( dialog_get_content_area ( dialog ) ), main_vbox, TRUE, TRUE, 0 );
gtk_container_set_border_width ( GTK_CONTAINER ( main_vbox ), 12 );
/* list of accounts */
diff --git a/src/bet_graph.c b/src/bet_graph.c
index 388106d..3de8aaf 100644
--- a/src/bet_graph.c
+++ b/src/bet_graph.c
@@ -1,6 +1,6 @@
/* ************************************************************************** */
/* */
-/* Copyright (C) 2011-2012 Pierre Biava (grisbi at pierre.biava.name) */
+/* Copyright (C) 2011-2013 Pierre Biava (grisbi at pierre.biava.name) */
/* 2011 Guillaume Verger (guillaume.verger at laposte.net) */
/* http://www.grisbi.org */
/* */
@@ -470,9 +470,9 @@ static void bet_graph_affiche_sub_divisions ( struct_bet_graph_data *parent,
gtk_window_set_transient_for ( GTK_WINDOW ( dialog ), GTK_WINDOW ( parent_widget ) );
}
gtk_widget_set_size_request ( dialog, 600, 400 );
- gtk_signal_connect ( GTK_OBJECT ( dialog ),
+ g_signal_connect ( G_OBJECT ( dialog ),
"destroy",
- GTK_SIGNAL_FUNC ( gtk_widget_destroy ),
+ G_CALLBACK ( gtk_widget_destroy ),
NULL);
/* set the title */
@@ -724,7 +724,7 @@ static gboolean bet_graph_on_motion ( GtkWidget *event_box,
* Création de la page pour le graphique initialisée
*
* \param
- * \param add_page
+ * \param add_page
*
* \return GogPlot
* */
@@ -1895,7 +1895,7 @@ static gboolean bet_graph_populate_lines_by_historical_line ( struct_bet_graph_d
/* on met la division sous division comme titre */
self->title = g_strconcat ( bet_data_get_div_name ( div_number, sub_div_nb, NULL ), " = ", str_amount, NULL );
- g_date_free ( start_current_fyear );
+ g_date_free ( start_current_fyear );
/* return value */
return TRUE;
@@ -2151,9 +2151,9 @@ void bet_graph_line_graph_new ( GtkWidget *button,
dialog = GTK_WIDGET ( gtk_builder_get_object ( bet_graph_builder, "bet_graph_dialog" ) );
gtk_window_set_transient_for ( GTK_WINDOW ( dialog ), GTK_WINDOW ( run.window ) );
gtk_widget_set_size_request ( dialog, PAGE_WIDTH+30, PAGE_HEIGHT+70 );
- gtk_signal_connect ( GTK_OBJECT ( dialog ),
+ g_signal_connect ( G_OBJECT ( dialog ),
"destroy",
- GTK_SIGNAL_FUNC ( gtk_widget_destroy ),
+ G_CALLBACK ( gtk_widget_destroy ),
NULL);
/* initialise le bouton show_grid avec la préférence "Major_grid" */
@@ -2264,7 +2264,7 @@ void bet_graph_montly_graph_new ( GtkWidget *button,
self->title_Y,
self->title_Y2,
gsb_data_account_get_name ( self->account_number ) );
- g_date_free ( start_current_fyear );
+ g_date_free ( start_current_fyear );
}
else
{
@@ -2276,7 +2276,7 @@ void bet_graph_montly_graph_new ( GtkWidget *button,
title = g_strdup_printf ( _("Monthly amounts since %s for the account: '%s'"),
tmp_str,
gsb_data_account_get_name ( self->account_number ) );
- g_date_free ( date_debut_periode );
+ g_date_free ( date_debut_periode );
g_free ( tmp_str );
}
}
@@ -2287,9 +2287,9 @@ void bet_graph_montly_graph_new ( GtkWidget *button,
dialog = GTK_WIDGET ( gtk_builder_get_object ( bet_graph_builder, "bet_graph_dialog" ) );
gtk_window_set_transient_for ( GTK_WINDOW ( dialog ), GTK_WINDOW ( run.window ) );
gtk_widget_set_size_request ( dialog, PAGE_WIDTH+30, PAGE_HEIGHT+70 );
- gtk_signal_connect ( GTK_OBJECT ( dialog ),
+ g_signal_connect ( G_OBJECT ( dialog ),
"destroy",
- GTK_SIGNAL_FUNC ( gtk_widget_destroy ),
+ G_CALLBACK ( gtk_widget_destroy ),
NULL);
/* initialise le bouton show_grid avec la préférence "Major_grid" */
@@ -2380,9 +2380,9 @@ void bet_graph_sectors_graph_new ( GtkWidget *button,
dialog = GTK_WIDGET ( gtk_builder_get_object ( bet_graph_builder, "bet_graph_dialog" ) );
gtk_window_set_transient_for ( GTK_WINDOW ( dialog ), GTK_WINDOW ( run.window ) );
gtk_widget_set_size_request ( dialog, PAGE_WIDTH+30, PAGE_HEIGHT+70 );
- gtk_signal_connect ( GTK_OBJECT ( dialog ),
+ g_signal_connect ( G_OBJECT ( dialog ),
"destroy",
- GTK_SIGNAL_FUNC ( gtk_widget_destroy ),
+ G_CALLBACK ( gtk_widget_destroy ),
NULL);
/* set the title */
diff --git a/src/bet_tab.c b/src/bet_tab.c
index 9646493..c154773 100644
--- a/src/bet_tab.c
+++ b/src/bet_tab.c
@@ -2152,14 +2152,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/categories_onglet.c b/src/categories_onglet.c
index 906833e..f2d5507 100644
--- a/src/categories_onglet.c
+++ b/src/categories_onglet.c
@@ -735,7 +735,7 @@ gboolean edit_category ( GtkTreeView *tree_view )
/* Ugly dance to avoid side effects on dialog's vbox. */
hbox = gtk_hbox_new ( FALSE, 0 );
- gtk_box_pack_start ( GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox, FALSE, FALSE, 0 );
+ gtk_box_pack_start ( GTK_BOX ( dialog_get_content_area ( dialog ) ), hbox, FALSE, FALSE, 0 );
paddingbox = new_paddingbox_with_title ( hbox, TRUE, title );
gtk_container_set_border_width ( GTK_CONTAINER(hbox), 6 );
gtk_container_set_border_width ( GTK_CONTAINER(paddingbox), 6 );
diff --git a/src/dialog.c b/src/dialog.c
index f238451..08b595e 100644
--- a/src/dialog.c
+++ b/src/dialog.c
@@ -206,8 +206,8 @@ void dialogue_special ( GtkMessageType param, gchar *text )
dialog = gtk_message_dialog_new ( GTK_WINDOW ( run.window ),
GTK_DIALOG_DESTROY_WITH_PARENT,
param, GTK_BUTTONS_CLOSE,
- "%s", text );
- gtk_label_set_markup ( GTK_LABEL ( GTK_MESSAGE_DIALOG (dialog)->label ), text );
+ NULL );
+ gtk_message_dialog_set_markup ( GTK_MESSAGE_DIALOG ( dialog ), text );
gtk_window_set_modal ( GTK_WINDOW ( dialog ), TRUE );
gtk_dialog_run (GTK_DIALOG (dialog));
@@ -241,10 +241,9 @@ GtkWidget *dialogue_special_no_run ( GtkMessageType param,
dialog = gtk_message_dialog_new ( NULL,
0,
param, buttons,
- "%s", text );
+ NULL );
}
-
- gtk_label_set_markup ( GTK_LABEL ( GTK_MESSAGE_DIALOG(dialog)->label ), text );
+ gtk_message_dialog_set_markup ( GTK_MESSAGE_DIALOG ( dialog ), text );
return dialog;
}
@@ -326,11 +325,11 @@ GtkDialog *dialogue_conditional_new ( gchar *text,
dialog = gtk_message_dialog_new ( GTK_WINDOW ( run.window ),
GTK_DIALOG_DESTROY_WITH_PARENT,
type, buttons,
- "%s", text );
+ NULL );
gtk_dialog_set_default_response ( GTK_DIALOG( dialog ), GTK_RESPONSE_CLOSE );
- gtk_label_set_markup ( GTK_LABEL ( GTK_MESSAGE_DIALOG(dialog)->label ), text );
+ gtk_message_dialog_set_markup ( GTK_MESSAGE_DIALOG ( dialog ), text );
- vbox = GTK_DIALOG(dialog) -> vbox;
+ vbox = gtk_dialog_get_content_area ( GTK_DIALOG ( dialog ) );
checkbox = gtk_check_button_new_with_label ( _("Do not show this message again") );
g_signal_connect ( G_OBJECT ( checkbox ), "toggled",
@@ -440,8 +439,8 @@ gboolean question_yes_no ( gchar *text, gint default_answer )
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_QUESTION,
GTK_BUTTONS_YES_NO,
- "%s", text );
- gtk_label_set_markup ( GTK_LABEL ( GTK_MESSAGE_DIALOG(dialog)->label ), text );
+ NULL );
+ gtk_message_dialog_set_markup ( GTK_MESSAGE_DIALOG ( dialog ), text );
gtk_dialog_set_default_response (GTK_DIALOG (dialog), default_answer );
@@ -525,11 +524,11 @@ gboolean question_conditional_yes_no_with_struct ( struct conditional_message *m
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_YES_NO,
- "%s", text );
+ NULL );
gtk_dialog_set_default_response ( GTK_DIALOG( dialog ), GTK_RESPONSE_NO );
- gtk_label_set_markup ( GTK_LABEL ( GTK_MESSAGE_DIALOG ( dialog )->label ), text );
+ gtk_message_dialog_set_markup ( GTK_MESSAGE_DIALOG ( dialog ), text );
- vbox = GTK_DIALOG ( dialog ) -> vbox;
+ vbox = gtk_dialog_get_content_area ( GTK_DIALOG ( dialog ) );
checkbox = gtk_check_button_new_with_label ( _("Do not show this message again") );
g_signal_connect ( G_OBJECT ( checkbox ),
@@ -739,11 +738,11 @@ const gchar *dialogue_hint_with_entry ( gchar *text, gchar *hint, gchar *entry_d
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_INFO,
GTK_BUTTONS_CLOSE,
- "%s", format_text );
- gtk_label_set_markup ( GTK_LABEL ( GTK_MESSAGE_DIALOG(dialog)->label ), format_text );
+ NULL );
+ gtk_message_dialog_set_markup ( GTK_MESSAGE_DIALOG ( dialog ), format_text );
hbox = gtk_hbox_new (FALSE, 5);
- gtk_box_pack_start ( GTK_BOX (GTK_DIALOG (dialog) -> vbox),
+ gtk_box_pack_start ( GTK_BOX ( gtk_dialog_get_content_area ( GTK_DIALOG ( dialog ) ) ),
hbox,
FALSE, FALSE, 0);
@@ -762,6 +761,30 @@ const gchar *dialogue_hint_with_entry ( gchar *text, gchar *hint, gchar *entry_d
return string;
}
+/**
+ * return the content_area of dialog
+ *
+ * \param dialog
+ *
+ * \return the content_area
+ */
+GtkWidget *dialog_get_content_area ( GtkWidget *dialog )
+{
+ return gtk_dialog_get_content_area ( GTK_DIALOG ( dialog ) );
+}
+
+
+/**
+ * return the action_area of dialog
+ *
+ * \param dialog
+ *
+ * \return the action_area
+ */
+GtkWidget *dialog_get_action_area ( GtkWidget *dialog )
+{
+ return gtk_dialog_get_action_area ( GTK_DIALOG ( dialog ) );
+}
/* Local Variables: */
/* c-basic-offset: 4 */
/* End: */
diff --git a/src/dialog.h b/src/dialog.h
index 64b0e16..39b36ed 100644
--- a/src/dialog.h
+++ b/src/dialog.h
@@ -25,6 +25,8 @@ G_MODULE_EXPORT void dialogue_error ( gchar *text );
void dialogue_error_brain_damage ();
G_MODULE_EXPORT void dialogue_error_hint ( const gchar *text, gchar *hint );
void dialogue_error_memory ();
+GtkWidget *dialog_get_action_area ( GtkWidget *dialog );
+GtkWidget *dialog_get_content_area ( GtkWidget *dialog );
void dialogue_hint ( gchar *text, gchar *hint );
const gchar *dialogue_hint_with_entry ( gchar *text, gchar *hint, gchar *entry_description );
void dialogue_special ( GtkMessageType param, gchar *text );
diff --git a/src/erreur.c b/src/erreur.c
index eff8b19..7b27a81 100644
--- a/src/erreur.c
+++ b/src/erreur.c
@@ -165,7 +165,7 @@ void traitement_sigsegv ( gint signal_nb )
gtk_expander_set_use_markup ( GTK_EXPANDER ( expander ), TRUE );
gtk_container_add ( GTK_CONTAINER ( expander ), print_backtrace() );
- gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG(dialog)->vbox ), expander, FALSE, FALSE, 6 );
+ gtk_box_pack_start ( GTK_BOX ( dialog_get_content_area ( dialog ) ), expander, FALSE, FALSE, 6 );
gtk_widget_show_all ( dialog );
#endif
diff --git a/src/etats_config.c b/src/etats_config.c
index c8dd658..ce66416 100644
--- a/src/etats_config.c
+++ b/src/etats_config.c
@@ -210,6 +210,9 @@ static void etats_config_initialise_onglet_periode ( gint report_number )
gsb_data_report_get_financial_year_list ( report_number ),
"treeview_exer",
1 );
+
+ /* on initialise le tree_view des dates avec une valeur par défaut (mois en cours) */
+ etats_prefs_tree_view_select_single_row ( "treeview_dates", 3 );
}
else
{
diff --git a/src/etats_gtktable.c b/src/etats_gtktable.c
index 376c0a4..4f48aa1 100644
--- a/src/etats_gtktable.c
+++ b/src/etats_gtktable.c
@@ -247,8 +247,8 @@ gint gtktable_initialise ( GSList * opes_selectionnees, gchar * filename )
if ( table_etat && GTK_IS_TABLE(table_etat) )
gtk_widget_destroy (table_etat);
- if ( scrolled_window_etat && GTK_BIN ( scrolled_window_etat ) -> child )
- gtk_widget_hide ( GTK_BIN ( scrolled_window_etat ) -> child );
+ if ( scrolled_window_etat && gtk_bin_get_child ( GTK_BIN ( scrolled_window_etat ) ) )
+ gtk_widget_hide ( gtk_bin_get_child ( GTK_BIN ( scrolled_window_etat ) ) );
/* just update screen so that the user does not see the previous report anymore
* while we are processing the new report */
@@ -271,8 +271,8 @@ gint gtktable_finish ()
gtk_container_set_border_width ( GTK_CONTAINER ( table_etat ), 6 );
gtk_widget_show_all ( table_etat );
- if ( GTK_BIN ( scrolled_window_etat ) -> child )
- gtk_widget_show ( GTK_BIN ( scrolled_window_etat ) -> child );
+ if ( gtk_bin_get_child ( GTK_BIN ( scrolled_window_etat ) ) )
+ gtk_widget_show ( gtk_bin_get_child ( GTK_BIN ( scrolled_window_etat ) ) );
return 1;
}
diff --git a/src/etats_onglet.c b/src/etats_onglet.c
index 140225c..b55d519 100644
--- a/src/etats_onglet.c
+++ b/src/etats_onglet.c
@@ -265,15 +265,15 @@ gboolean ajout_etat ( void )
make_hint ( _("Choose template for new report"),
_("You are about to create a new report. For convenience, you can choose between the following templates. Reports may be customized later." ) ) );
- frame = new_paddingbox_with_title ( GTK_DIALOG(dialog)->vbox, FALSE,
+ frame = new_paddingbox_with_title ( dialog_get_content_area ( dialog ), FALSE,
_("Report type"));
/* combobox for predefined reports */
- combobox = gtk_combo_box_new_text ();
+ combobox = gtk_combo_box_text_new ();
gtk_box_pack_start ( GTK_BOX(frame), combobox, FALSE, FALSE, 0 );
/* on ajoute maintenant la frame */
- frame = new_paddingbox_with_title ( GTK_DIALOG(dialog)->vbox, TRUE,
+ frame = new_paddingbox_with_title ( dialog_get_content_area ( dialog ), TRUE,
_("Description"));
/* on met le label dans une scrolled window */
@@ -289,17 +289,17 @@ gboolean ajout_etat ( void )
gtk_scrolled_window_add_with_viewport ( GTK_SCROLLED_WINDOW ( scrolled_window ),
label_description );
- gtk_viewport_set_shadow_type ( GTK_VIEWPORT ( label_description -> parent ),
- GTK_SHADOW_NONE );
+ gtk_viewport_set_shadow_type ( GTK_VIEWPORT ( gtk_bin_get_child ( GTK_BIN ( scrolled_window ) ) ),
+ GTK_SHADOW_NONE );
/* fill combobox */
- gtk_combo_box_append_text ( GTK_COMBO_BOX ( combobox ), _("Last month incomes and outgoings") );
- gtk_combo_box_append_text ( GTK_COMBO_BOX ( combobox ), _("Current month incomes and outgoings") );
- gtk_combo_box_append_text ( GTK_COMBO_BOX ( combobox ), _("Annual budget") );
- gtk_combo_box_append_text ( GTK_COMBO_BOX ( combobox ), _("Blank report") );
- gtk_combo_box_append_text ( GTK_COMBO_BOX ( combobox ), _("Cheques deposit") );
- gtk_combo_box_append_text ( GTK_COMBO_BOX ( combobox ), _("Monthly outgoings by payee") );
- gtk_combo_box_append_text ( GTK_COMBO_BOX ( combobox ), _("Search") );
+ gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( combobox ), _("Last month incomes and outgoings") );
+ gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( combobox ), _("Current month incomes and outgoings") );
+ gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( combobox ), _("Annual budget") );
+ gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( combobox ), _("Blank report") );
+ gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( combobox ), _("Cheques deposit") );
+ gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( combobox ), _("Monthly outgoings by payee") );
+ gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( combobox ), _("Search") );
/* set first entry and description */
@@ -311,7 +311,7 @@ gboolean ajout_etat ( void )
G_CALLBACK ( change_choix_nouvel_etat ),
G_OBJECT ( label_description ));
- gtk_box_set_spacing ( GTK_BOX(GTK_DIALOG(dialog)->vbox), 6 );
+ gtk_box_set_spacing ( GTK_BOX( dialog_get_content_area ( dialog ) ), 6 );
gtk_widget_show_all ( dialog );
/* on attend le choix de l'utilisateur */
@@ -981,9 +981,12 @@ void efface_etat ( void )
*/
void gsb_gui_unsensitive_report_widgets ()
{
- if ( scrolled_window_etat && GTK_IS_WIDGET ( scrolled_window_etat ) &&
- GTK_BIN ( scrolled_window_etat ) -> child )
- gtk_widget_hide ( GTK_BIN ( scrolled_window_etat ) -> child );
+ if ( scrolled_window_etat
+ &&
+ GTK_IS_WIDGET ( scrolled_window_etat )
+ &&
+ gtk_bin_get_child ( GTK_BIN ( scrolled_window_etat ) ) )
+ gtk_widget_hide ( gtk_bin_get_child ( GTK_BIN ( scrolled_window_etat ) ) );
gtk_widget_set_sensitive ( bouton_personnaliser_etat, FALSE );
gtk_widget_set_sensitive ( bouton_imprimer_etat, FALSE );
@@ -1013,7 +1016,7 @@ void gsb_gui_update_gui_to_report ( gint report_number )
gsb_report_set_current (report_number);
}
else
- gtk_widget_show ( GTK_BIN ( scrolled_window_etat ) -> child );
+ gtk_widget_show ( gtk_bin_get_child ( GTK_BIN ( scrolled_window_etat ) ) );
}
@@ -1140,11 +1143,11 @@ void exporter_etat ( void )
gtk_box_pack_start ( GTK_BOX(hbox), gtk_label_new ( _("File format: ") ),
FALSE, FALSE, 0 );
- combo = gtk_combo_box_new_text();
+ combo = gtk_combo_box_text_new ();
gtk_box_pack_start ( GTK_BOX(hbox), combo, TRUE, TRUE, 0 );
- gtk_combo_box_append_text ( GTK_COMBO_BOX(combo), _("Grisbi report file (egsb file)" ) );
- gtk_combo_box_append_text ( GTK_COMBO_BOX(combo), _("HTML file" ) );
- gtk_combo_box_append_text ( GTK_COMBO_BOX(combo), _("CSV file" ) );
+ gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT (combo), _("Grisbi report file (egsb file)" ) );
+ gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT (combo), _("HTML file" ) );
+ gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT (combo), _("CSV file" ) );
/* Set initial format. */
gtk_combo_box_set_active ( GTK_COMBO_BOX(combo), REPORT_HTML );
@@ -1238,7 +1241,7 @@ void importer_etat ( void )
gsb_file_update_last_path (file_selection_get_last_directory (GTK_FILE_CHOOSER (fenetre_nom), TRUE));
gtk_widget_destroy ( GTK_WIDGET ( fenetre_nom ));
- /* la vérification que c'est possible a �t� faite par la boite de selection*/
+ /* la vérification que c'est possible a été faite par la boite de selection*/
if ( !gsb_file_others_load_report ( nom_etat ))
{
return;
diff --git a/src/export.c b/src/export.c
index bcb27de..3a0aef9 100644
--- a/src/export.c
+++ b/src/export.c
@@ -458,9 +458,9 @@ GtkWidget * create_export_account_resume_page ( struct exported_account * accoun
FALSE, FALSE, 0 );
/* Combo box */
- combo = gtk_combo_box_new_text();
- gtk_combo_box_append_text ( GTK_COMBO_BOX(combo), _("QIF format" ) );
- gtk_combo_box_append_text ( GTK_COMBO_BOX(combo), _("CSV format" ) );
+ combo = gtk_combo_box_text_new ();
+ gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT (combo), _("QIF format" ) );
+ gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT (combo), _("CSV format" ) );
gtk_box_pack_start ( GTK_BOX ( hbox ), combo, TRUE, TRUE, 0 );
g_signal_connect ( G_OBJECT(combo), "changed",
G_CALLBACK ( export_account_change_format ),
diff --git a/src/fenetre_principale.c b/src/fenetre_principale.c
index f4fc4b0..fefc1eb 100644
--- a/src/fenetre_principale.c
+++ b/src/fenetre_principale.c
@@ -441,7 +441,7 @@ gboolean gsb_gui_update_show_headings ( void )
}
else
{
- gtk_widget_hide_all ( headings_eb );
+ gtk_widget_hide ( headings_eb );
}
return FALSE;
}
diff --git a/src/gsb_account_property.c b/src/gsb_account_property.c
index 86d4757..f22f57d 100644
--- a/src/gsb_account_property.c
+++ b/src/gsb_account_property.c
@@ -225,7 +225,7 @@ GtkWidget *gsb_account_property_create_page ( void )
vbox = gtk_vbox_new ( FALSE, 5 );
gtk_scrolled_window_add_with_viewport ( GTK_SCROLLED_WINDOW ( scrolled_window ), vbox );
- gtk_viewport_set_shadow_type ( GTK_VIEWPORT ( GTK_BIN ( scrolled_window ) -> child ),
+ gtk_viewport_set_shadow_type ( GTK_VIEWPORT ( gtk_bin_get_child ( GTK_BIN ( scrolled_window ) ) ),
GTK_SHADOW_NONE );
/* création de la ligne des détails du compte */
@@ -930,7 +930,7 @@ void gsb_account_property_iban_insert_text ( GtkEditable *entry,
/* on autorise ou pas la saisie des données banquaires */
if ( g_utf8_strlen (iban, -1) == 0 )
gsb_account_property_iban_switch_bank_data ( TRUE );
- else if ( GTK_WIDGET_IS_SENSITIVE ( bank_list_combobox ) )
+ else if ( gtk_widget_is_sensitive ( bank_list_combobox ) )
gsb_account_property_iban_switch_bank_data ( FALSE );
/* on contrôle l'existence d'un modèle pour le numéro IBAN */
@@ -970,7 +970,7 @@ void gsb_account_property_iban_delete_text ( GtkEditable *entry,
/* on autorise ou pas la saisie des données banquaires */
if ( start_pos == 0 )
gsb_account_property_iban_switch_bank_data ( TRUE );
- else if ( GTK_WIDGET_IS_SENSITIVE ( bank_list_combobox ) )
+ else if ( gtk_widget_is_sensitive ( bank_list_combobox ) )
gsb_account_property_iban_switch_bank_data ( FALSE );
}
@@ -1014,13 +1014,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_assistant.c b/src/gsb_assistant.c
index 95badcd..f61a48e 100644
--- a/src/gsb_assistant.c
+++ b/src/gsb_assistant.c
@@ -35,10 +35,11 @@
/*START_INCLUDE*/
#include "gsb_assistant.h"
+#include "dialog.h"
+#include "gsb_dirs.h"
#include "structures.h"
#include "utils.h"
#include "utils_str.h"
-#include "gsb_dirs.h"
#include "erreur.h"
/*END_INCLUDE*/
@@ -122,7 +123,7 @@ GtkWidget * gsb_assistant_new ( const gchar * title, const gchar * explanation,
button_select = gtk_toggle_button_new_with_label ( _("Select all") );
gtk_widget_set_size_request ( button_select, width, -1 );
- gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG ( assistant )->action_area ),
+ gtk_box_pack_start ( GTK_BOX ( dialog_get_content_area ( assistant ) ),
button_select, FALSE, FALSE, 0 );
g_object_set_data ( G_OBJECT(assistant), "button_select", button_select );
@@ -165,12 +166,12 @@ GtkWidget * gsb_assistant_new ( const gchar * title, const gchar * explanation,
g_free ( tmpstr );
gtk_box_pack_start ( GTK_BOX(hbox), image, FALSE, FALSE, 0 );
- gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG(assistant) -> vbox ), eb, FALSE, FALSE, 0 );
+ gtk_box_pack_start ( GTK_BOX ( dialog_get_content_area ( assistant ) ), eb, FALSE, FALSE, 0 );
notebook = gtk_notebook_new ();
gtk_notebook_set_show_tabs ( GTK_NOTEBOOK(notebook), FALSE );
gtk_notebook_set_show_border ( GTK_NOTEBOOK(notebook), FALSE );
- gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG(assistant) -> vbox ), notebook, TRUE, TRUE, 0 );
+ gtk_box_pack_start ( GTK_BOX ( dialog_get_content_area ( assistant ) ), notebook, TRUE, TRUE, 0 );
view = gtk_text_view_new ();
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (view), GTK_WRAP_WORD);
diff --git a/src/gsb_assistant_archive.c b/src/gsb_assistant_archive.c
index ed31f27..801db0d 100644
--- a/src/gsb_assistant_archive.c
+++ b/src/gsb_assistant_archive.c
@@ -580,7 +580,7 @@ static gboolean gsb_assistant_archive_switch_to_archive_name ( GtkWidget *assist
gsb_assistant_change_button_next ( assistant,
GTK_STOCK_APPLY, GTK_RESPONSE_YES );
- if ( GTK_WIDGET_IS_SENSITIVE (initial_date) )
+ if ( gtk_widget_is_sensitive (initial_date) )
{
gchar * sdate, * fdate;
@@ -590,7 +590,7 @@ static gboolean gsb_assistant_archive_switch_to_archive_name ( GtkWidget *assist
g_free ( sdate );
g_free ( fdate );
}
- else if ( GTK_WIDGET_IS_SENSITIVE (financial_year_button) )
+ else if ( gtk_widget_is_sensitive (financial_year_button) )
{
gint fyear;
@@ -598,7 +598,7 @@ static gboolean gsb_assistant_archive_switch_to_archive_name ( GtkWidget *assist
string = g_strdup_printf ( _("Archive of financial year %s"),
gsb_data_fyear_get_name ( fyear ) );
}
- else if ( GTK_WIDGET_IS_SENSITIVE (report_button) )
+ else if ( gtk_widget_is_sensitive (report_button) )
{
gint report_number;
report_number = gsb_report_get_report_from_combobox (report_button);
@@ -666,7 +666,7 @@ static gboolean gsb_assistant_archive_switch_to_success ( GtkWidget *assistant,
GTK_STOCK_CLOSE, GTK_RESPONSE_APPLY );
/* fill the archive */
- if (GTK_WIDGET_IS_SENSITIVE (initial_date))
+ if (gtk_widget_is_sensitive (initial_date))
{
GDate *init_gdate;
GDate *final_gdate;
@@ -679,10 +679,10 @@ static gboolean gsb_assistant_archive_switch_to_success ( GtkWidget *assistant,
g_date_free (init_gdate);
g_date_free (final_gdate);
}
- else if (GTK_WIDGET_IS_SENSITIVE (financial_year_button))
+ else if (gtk_widget_is_sensitive (financial_year_button))
gsb_data_archive_set_fyear ( archive_number,
gsb_fyear_get_fyear_from_combobox ( financial_year_button,NULL ) );
- else if (GTK_WIDGET_IS_SENSITIVE (report_button) )
+ else if (gtk_widget_is_sensitive (report_button) )
{
gint report_number;
@@ -804,7 +804,7 @@ static gboolean gsb_assistant_archive_update_labels ( GtkWidget *assistant )
/* ok for now the choice is on initial/final date */
if ( gtk_notebook_get_current_page (GTK_NOTEBOOK(notebook)) == ARCHIVE_ASSISTANT_MENU )
{
- if ( GTK_WIDGET_IS_SENSITIVE (initial_date) )
+ if ( gtk_widget_is_sensitive (initial_date) )
{
GDate *init_gdate;
GDate *final_gdate;
@@ -878,7 +878,7 @@ static gboolean gsb_assistant_archive_update_labels ( GtkWidget *assistant )
}
/* ok for now the choice is on fyear */
- else if ( GTK_WIDGET_IS_SENSITIVE ( financial_year_button ) )
+ else if ( gtk_widget_is_sensitive ( financial_year_button ) )
{
gint fyear_number;
string = NULL;
@@ -919,7 +919,7 @@ static gboolean gsb_assistant_archive_update_labels ( GtkWidget *assistant )
}
}
/* ok for now the choice is on report */
- else if ( GTK_WIDGET_IS_SENSITIVE (report_button))
+ else if ( gtk_widget_is_sensitive (report_button))
{
gint report_number;
string = NULL;
diff --git a/src/gsb_assistant_archive_export.c b/src/gsb_assistant_archive_export.c
index a71b3ca..b8d67a4 100644
--- a/src/gsb_assistant_archive_export.c
+++ b/src/gsb_assistant_archive_export.c
@@ -301,10 +301,10 @@ static GtkWidget *gsb_assistant_archive_export_page_name ( GtkWidget *assistant
FALSE, FALSE, 0 );
/* Combo box */
- archive_export_combobox = gtk_combo_box_new_text();
- gtk_combo_box_append_text ( GTK_COMBO_BOX(archive_export_combobox), _("Grisbi (GSB) format" ) );
- gtk_combo_box_append_text ( GTK_COMBO_BOX(archive_export_combobox), _("QIF format" ) );
- gtk_combo_box_append_text ( GTK_COMBO_BOX(archive_export_combobox), _("CSV format" ) );
+ archive_export_combobox = gtk_combo_box_text_new ();
+ gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT (archive_export_combobox), _("Grisbi (GSB) format" ) );
+ gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT (archive_export_combobox), _("QIF format" ) );
+ gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT (archive_export_combobox), _("CSV format" ) );
gtk_box_pack_start ( GTK_BOX ( hbox ), archive_export_combobox, TRUE, TRUE, 0 );
archive_export_filechooser = gtk_file_chooser_widget_new ( GTK_FILE_CHOOSER_ACTION_SAVE );
diff --git a/src/gsb_assistant_reconcile_config.c b/src/gsb_assistant_reconcile_config.c
index 7296b1c..3277ca4 100644
--- a/src/gsb_assistant_reconcile_config.c
+++ b/src/gsb_assistant_reconcile_config.c
@@ -1196,7 +1196,7 @@ static gboolean gsb_assistant_reconcile_config_lauch_manu_asso ( GtkWidget *butt
label = gtk_label_new ( _("Select the reconciliation to associate to the selected transactions: ") );
gtk_misc_set_alignment ( GTK_MISC ( label ), 0.0, 0.0 );
- gtk_box_pack_start ( GTK_BOX (GTK_DIALOG (dialog) -> vbox),
+ gtk_box_pack_start ( GTK_BOX ( dialog_get_content_area ( dialog ) ),
label,
FALSE, FALSE,
10 );
@@ -1206,7 +1206,7 @@ static gboolean gsb_assistant_reconcile_config_lauch_manu_asso ( GtkWidget *butt
gtk_scrolled_window_set_policy ( GTK_SCROLLED_WINDOW (scrolled_window),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC );
- gtk_box_pack_start ( GTK_BOX (GTK_DIALOG (dialog) -> vbox),
+ gtk_box_pack_start ( GTK_BOX ( dialog_get_content_area ( dialog ) ),
scrolled_window,
TRUE, TRUE,
0 );
diff --git a/src/gsb_autofunc.c b/src/gsb_autofunc.c
index 0b8c8d4..2097dc3 100644
--- a/src/gsb_autofunc.c
+++ b/src/gsb_autofunc.c
@@ -1172,10 +1172,10 @@ static gboolean gsb_autofunc_real_changed ( GtkWidget *entry,
* gint index )
* ex : gsb_data_account_set_kind ( account_number, account_kind )
*
- * basically, that combobox is created with gsb_combo_box_new_with_index_by_list, so can use that functions to get the index
+ * basically, that combobox is created with gsb_combo_box_new_with_index_from_list, so can use that functions to get the index
* if necessary
*
- * \param list a g_slist to create the combobox (succession of text and number, see gsb_combo_box_new_with_index_by_list)
+ * \param list a g_slist to create the combobox (succession of text and number, see gsb_combo_box_new_with_index_from_list)
* \param index the index to place the combobox
* \param hook an optional function to execute as a handler if the
* combobox changed.
@@ -1200,7 +1200,7 @@ GtkWidget *gsb_autofunc_combobox_new ( GSList *list,
GtkWidget *combobox;
/* create and fill the combobox */
- combobox = gsb_combo_box_new_with_index_by_list ( list, NULL, NULL );
+ combobox = gsb_combo_box_new_with_index_from_list ( list, NULL, NULL );
gsb_combo_box_set_index (combobox, index);
diff --git a/src/gsb_bank.c b/src/gsb_bank.c
index 7eb3f2c..ca677ba 100644
--- a/src/gsb_bank.c
+++ b/src/gsb_bank.c
@@ -596,8 +596,8 @@ GtkWidget *gsb_bank_create_page ( gboolean default_sensitive )
vbox2 );
gtk_scrolled_window_set_shadow_type ( GTK_SCROLLED_WINDOW ( scrolled_window ),
GTK_SHADOW_NONE );
- gtk_viewport_set_shadow_type ( GTK_VIEWPORT ( GTK_BIN ( scrolled_window ) -> child ),
- GTK_SHADOW_NONE );
+ gtk_viewport_set_shadow_type ( GTK_VIEWPORT ( gtk_bin_get_child ( GTK_BIN ( scrolled_window ) ) ),
+ GTK_SHADOW_NONE );
gtk_widget_set_sensitive ( vbox2, FALSE );
gsb_bank_create_form ( vbox2, NULL );
@@ -1040,17 +1040,17 @@ static gboolean gsb_bank_edit_bank ( gint bank_number,
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC );
gtk_scrolled_window_set_shadow_type ( GTK_SCROLLED_WINDOW(scrolled_window),
GTK_SHADOW_NONE );
- gtk_container_add ( GTK_CONTAINER ( GTK_DIALOG(dialog)->vbox ), scrolled_window );
+ gtk_container_add ( GTK_CONTAINER ( dialog_get_content_area ( dialog ) ), scrolled_window );
gtk_widget_set_size_request ( scrolled_window, 600, 400 );
vbox = gtk_vbox_new ( FALSE, 6 );
gtk_container_set_border_width ( GTK_CONTAINER (vbox), 12 );
form = gsb_bank_create_form ( vbox, combobox );
gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled_window), vbox);
- gtk_viewport_set_shadow_type ( GTK_VIEWPORT (GTK_BIN(scrolled_window) -> child ),
+ gtk_viewport_set_shadow_type ( GTK_VIEWPORT ( gtk_bin_get_child ( GTK_BIN ( scrolled_window ) ) ),
GTK_SHADOW_NONE );
- gtk_widget_show_all ( GTK_DIALOG(dialog)->vbox );
+ gtk_widget_show_all ( dialog );
if ( bank_number == -2 )
{
@@ -1062,9 +1062,9 @@ static gboolean gsb_bank_edit_bank ( gint bank_number,
}
else
- gsb_bank_update_form ( bank_number, GTK_DIALOG(dialog)->vbox );
+ gsb_bank_update_form ( bank_number, dialog_get_content_area ( dialog ) );
- result = gtk_dialog_run ( GTK_DIALOG(dialog ) );
+ result = gtk_dialog_run ( GTK_DIALOG ( dialog ) );
if ( result == GTK_RESPONSE_APPLY )
{
diff --git a/src/gsb_calendar.c b/src/gsb_calendar.c
index 1e779bd..bb0d767 100644
--- a/src/gsb_calendar.c
+++ b/src/gsb_calendar.c
@@ -103,25 +103,28 @@ gboolean gsb_calendar_update ( void )
{
time_t temps;
GSList *tmp_list;
- gint calendar_month;
- gint calendar_year;
+ guint calendar_day;
+ guint calendar_month;
+ guint calendar_year;
- gtk_calendar_clear_marks ( GTK_CALENDAR ( scheduled_calendar ));
+ gtk_calendar_clear_marks ( GTK_CALENDAR ( scheduled_calendar ) );
+ gtk_calendar_get_date ( GTK_CALENDAR ( scheduled_calendar ),
+ &calendar_day,
+ &calendar_month,
+ &calendar_year );
/* select the current day */
time ( &temps );
- if ( ( localtime ( &temps ) -> tm_mon == GTK_CALENDAR ( scheduled_calendar ) -> month )
- &&
- ( ( localtime ( &temps ) -> tm_year + 1900 ) == GTK_CALENDAR ( scheduled_calendar ) -> year ) )
- gtk_calendar_select_day ( GTK_CALENDAR ( scheduled_calendar ),
- localtime ( &temps ) -> tm_mday );
+ if ( ( localtime ( &temps ) -> tm_mon == calendar_month )
+ &&
+ ( ( localtime ( &temps ) -> tm_year + 1900 ) == calendar_year ) )
+ gtk_calendar_select_day ( GTK_CALENDAR ( scheduled_calendar ), localtime ( &temps ) -> tm_mday );
else
- gtk_calendar_select_day ( GTK_CALENDAR ( scheduled_calendar ),
- FALSE );
+ gtk_calendar_select_day ( GTK_CALENDAR ( scheduled_calendar ), FALSE );
- calendar_month = GTK_CALENDAR ( scheduled_calendar ) -> month + 1;
- calendar_year = GTK_CALENDAR ( scheduled_calendar ) -> year + 25;
+ calendar_month = calendar_month + 1;
+ calendar_year = calendar_year + 25;
/* check the scheduled transactions and bold them in the calendar */
tmp_list = gsb_data_scheduled_get_scheduled_list ();
@@ -156,21 +159,26 @@ void click_sur_jour_calendrier_echeance ( GtkWidget *calendrier,
gpointer null )
{
time_t temps;
+ guint calendar_day;
+ guint calendar_month;
+ guint calendar_year;
time ( &temps );
+ gtk_calendar_get_date ( GTK_CALENDAR ( scheduled_calendar ),
+ &calendar_day,
+ &calendar_month,
+ &calendar_year );
g_signal_handlers_block_by_func ( G_OBJECT ( calendrier ),
G_CALLBACK ( click_sur_jour_calendrier_echeance ),
NULL );
- if ( ( localtime ( &temps ) -> tm_mon == GTK_CALENDAR ( scheduled_calendar ) -> month )
- &&
- ( ( localtime ( &temps ) -> tm_year + 1900 ) == GTK_CALENDAR ( scheduled_calendar ) -> year ) )
- gtk_calendar_select_day ( GTK_CALENDAR ( scheduled_calendar ),
- localtime ( &temps ) -> tm_mday );
+ if ( ( localtime ( &temps ) -> tm_mon == calendar_month )
+ &&
+ ( ( localtime ( &temps ) -> tm_year + 1900 ) == calendar_year ) )
+ gtk_calendar_select_day ( GTK_CALENDAR ( scheduled_calendar ), localtime ( &temps ) -> tm_mday );
else
- gtk_calendar_select_day ( GTK_CALENDAR ( scheduled_calendar ),
- FALSE );
+ gtk_calendar_select_day ( GTK_CALENDAR ( scheduled_calendar ), FALSE );
g_signal_handlers_unblock_by_func ( G_OBJECT ( calendrier ),
G_CALLBACK ( click_sur_jour_calendrier_echeance ),
diff --git a/src/gsb_calendar_entry.c b/src/gsb_calendar_entry.c
index 3a640ee..e5b9153 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 )
@@ -512,9 +512,7 @@ GtkWidget *gsb_calendar_entry_popup ( GtkWidget *entry )
gtk_widget_show ( button );
/* set the position */
- gdk_window_get_origin ( GTK_WIDGET ( entry ) -> window,
- &x,
- &y );
+ gdk_window_get_origin ( gtk_widget_get_window ( GTK_WIDGET ( entry ) ), &x, &y );
/* on récupère la taille de la popup */
popup_size = g_malloc0 ( sizeof ( GtkRequisition ));
@@ -565,7 +563,7 @@ gboolean gsb_calendar_entry_select_date ( GtkCalendar *pCalendar,
gtk_entry_set_text ( GTK_ENTRY ( entry ),
gsb_format_date ( day, month + 1, year ));
gsb_form_widget_set_empty ( entry, FALSE );
- if ( GTK_WIDGET_TOPLEVEL ( pTopLevelWidget ) )
+ if ( gtk_widget_is_toplevel ( pTopLevelWidget ) )
gtk_widget_destroy ( pTopLevelWidget );
return FALSE;
@@ -600,20 +598,20 @@ 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_TOPLEVEL ( pTopLevelWidget ) )
+ if ( gtk_widget_is_toplevel ( pTopLevelWidget ) )
gtk_widget_destroy ( pTopLevelWidget );
g_date_free (date);
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 ));
- if ( GTK_WIDGET_TOPLEVEL ( pTopLevelWidget ) )
+ if ( gtk_widget_is_toplevel ( pTopLevelWidget ) )
gtk_widget_destroy ( pTopLevelWidget );
g_date_free (date);
return TRUE;
@@ -622,54 +620,54 @@ 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_KEY_Page_Down :
case GDK_KP_Page_Down :
/* next month */
g_date_add_months (date, 1);
diff --git a/src/gsb_combo_box.c b/src/gsb_combo_box.c
index 5f39314..deee9bf 100644
--- a/src/gsb_combo_box.c
+++ b/src/gsb_combo_box.c
@@ -2,9 +2,10 @@
/* */
/* gsb_combo_box */
/* */
-/* Copyright (C) 2000-2006 Cédric Auger (cedric at grisbi.org) */
-/* 2003-2006 Benjamin Drieu (bdrieu at april.org) */
-/* http://www.grisbi.org */
+/* Copyright (C) 2000-2006 Cédric Auger (cedric at grisbi.org) */
+/* 2003-2006 Benjamin Drieu (bdrieu at april.org) */
+/* 2008-2013 Pierre Biava (grisbi at pierre.biava.name) */
+/* http://www.grisbi.org */
/* */
/* 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 */
@@ -33,6 +34,7 @@
#endif
#include "include.h"
+#include <glib/gi18n.h>
/*START_INCLUDE*/
#include "gsb_combo_box.h"
@@ -44,13 +46,109 @@
/*START_EXTERN*/
/*END_EXTERN*/
+
+/**
+ * Cette fonction retourne un GtkListStore à partir d'une liste
+ * TODO modifier le fonctionnement de cette liste
+ *
+ * \param le tableau de chaines à mettre dans le modèle
+ *
+ * \return un GtkListStore.
+ */
+static GtkListStore *gsb_combo_box_list_store_new_from_list ( GSList *list )
+{
+ GtkListStore *store = NULL;
+ GSList *tmp_list;
+
+ store = gtk_list_store_new ( 2, G_TYPE_STRING, G_TYPE_INT );
+
+ tmp_list = list;
+ while (tmp_list)
+ {
+ GtkTreeIter iter;
+ gchar *string;
+
+ string = tmp_list -> data;
+ tmp_list = tmp_list -> next;
+
+ /* should not append */
+ if ( !tmp_list )
+ break;
+
+ gtk_list_store_append ( GTK_LIST_STORE ( store ), &iter );
+ gtk_list_store_set ( store,
+ &iter,
+ 0, string,
+ 1, GPOINTER_TO_INT ( tmp_list -> data ),
+ -1 );
+
+ tmp_list = tmp_list -> next;
+ }
+
+ /* return */
+ return store;
+}
+
+
+/**
+ * Cette fonction retourne un GtkListStore à partir d'un tableau de chaine
+ *
+ * \param le tableau de chaines à mettre dans le modèle
+ *
+ * \return un GtkListStore.
+ */
+GtkListStore *gsb_combo_box_list_store_new_from_array ( gchar **array )
+{
+ GtkListStore *store = NULL;
+ gint i = 0;
+
+ store = gtk_list_store_new ( 2, G_TYPE_STRING, G_TYPE_INT );
+
+ while ( array[i] )
+ {
+ GtkTreeIter iter;
+ gchar *string;
+
+ string = gettext ( array[i] );
+ gtk_list_store_append ( store, &iter );
+ gtk_list_store_set ( store, &iter, 0, string, 1, i, -1 );
+
+ i++;
+ }
+
+ /* return */
+ return store;
+}
+
+
+/**
+ * Cette fonction crée la colonne visible d'un GtkComboBox
+ *
+ * \param le combo à initialiser
+ * \param le numéro de la colonne texte
+ *
+ * \return
+ */
+void gsb_combo_box_set_text_renderer ( GtkComboBox *combo,
+ gint num_col )
+{
+ GtkCellRenderer *renderer;
+
+ renderer = gtk_cell_renderer_text_new ( );
+ gtk_cell_layout_pack_start ( GTK_CELL_LAYOUT ( combo ), renderer, TRUE );
+ gtk_cell_layout_set_attributes ( GTK_CELL_LAYOUT ( combo ), renderer,
+ "text", num_col,
+ NULL );
+}
+
+
/**
* create a text only combo_box with an index
* column 0 will contain the text
* column 1 will have the index, in the order of the strings
*
* this function takes an array of string and attribute a number beginning by the first element of the array
- * to link some text with a special number, use gsb_combo_box_new_with_index_by_list
+ * to link some text with a special number, use gsb_combo_box_new_with_index_from_list
*
* \param string a pointer to an array of strings terminated by NULL, string will be appended in that order
* \param func an optional function to call when change the current item (gboolean func (GtkWidget *combox, gpointer data)
@@ -59,50 +157,26 @@
* \return a combo box widget
* */
GtkWidget *gsb_combo_box_new_with_index ( gchar **string,
- GCallback func,
- gpointer data )
+ GCallback func,
+ gpointer data )
{
- GtkWidget *combo_box;
- GtkListStore *store;
- GtkCellRenderer *renderer;
- gint i = 0;
+ GtkWidget *combo;
+ GtkTreeModel *model;
- combo_box = gtk_combo_box_new ();
+ combo = gtk_combo_box_new ( );
- store = gtk_list_store_new ( 2,
- G_TYPE_STRING,
- G_TYPE_INT );
- if (string)
- {
- while (string[i])
- {
- GtkTreeIter iter;
-
- gtk_list_store_append ( GTK_LIST_STORE (store),
- &iter );
- gtk_list_store_set ( store,
- &iter,
- 0, string[i],
- 1, i,
- -1 );
- i++;
- }
- }
- gtk_combo_box_set_model ( GTK_COMBO_BOX (combo_box),
- GTK_TREE_MODEL (store));
+ model = GTK_TREE_MODEL ( gsb_combo_box_list_store_new_from_array ( string ) );
+ gtk_combo_box_set_model ( GTK_COMBO_BOX ( combo ), model );
+
+ gsb_combo_box_set_text_renderer ( GTK_COMBO_BOX ( combo ), 0 );
+ gtk_combo_box_set_active ( GTK_COMBO_BOX ( combo ), 0 );
if ( func )
- g_signal_connect ( G_OBJECT (combo_box),
- "changed",
- G_CALLBACK(func),
- data );
-
- renderer = gtk_cell_renderer_text_new ();
- gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo_box), renderer, TRUE);
- gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo_box), renderer,
- "text", 0,
- NULL);
-
- return combo_box;
+ g_signal_connect ( G_OBJECT ( combo ),
+ "changed",
+ G_CALLBACK ( func ),
+ data );
+
+ return combo;
}
@@ -120,60 +194,28 @@ GtkWidget *gsb_combo_box_new_with_index ( gchar **string,
*
* \return a combo box widget
* */
-GtkWidget *gsb_combo_box_new_with_index_by_list ( GSList *list,
- GCallback func,
- gpointer data )
+GtkWidget *gsb_combo_box_new_with_index_from_list ( GSList *list,
+ GCallback func,
+ gpointer data )
{
- GSList *tmp_list;
- GtkWidget *combo_box;
- GtkListStore *store;
- GtkCellRenderer *renderer;
+ GtkWidget *combo;
+ GtkTreeModel *model;
- combo_box = gtk_combo_box_new ();
+ combo = gtk_combo_box_new ();
+
+ model = GTK_TREE_MODEL ( gsb_combo_box_list_store_new_from_list ( list ) );
+ gtk_combo_box_set_model ( GTK_COMBO_BOX ( combo ), model );
+
+ gsb_combo_box_set_text_renderer ( GTK_COMBO_BOX ( combo ), 0 );
+ gtk_combo_box_set_active ( GTK_COMBO_BOX ( combo ), 0 );
- store = gtk_list_store_new ( 2,
- G_TYPE_STRING,
- G_TYPE_INT );
- tmp_list = list;
- if (tmp_list)
- {
- while (tmp_list)
- {
- GtkTreeIter iter;
- gchar *string;
-
- string = tmp_list -> data;
- tmp_list = tmp_list -> next;
-
- /* should not append */
- if (!tmp_list)
- break;
-
- gtk_list_store_append ( GTK_LIST_STORE (store),
- &iter );
- gtk_list_store_set ( store,
- &iter,
- 0, string,
- 1, GPOINTER_TO_INT (tmp_list -> data),
- -1 );
- tmp_list = tmp_list -> next;
- }
- }
- gtk_combo_box_set_model ( GTK_COMBO_BOX (combo_box),
- GTK_TREE_MODEL (store));
if ( func )
- g_signal_connect ( G_OBJECT (combo_box),
- "changed",
- G_CALLBACK(func),
- data );
-
- renderer = gtk_cell_renderer_text_new ();
- gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo_box), renderer, TRUE);
- gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo_box), renderer,
- "text", 0,
- NULL);
-
- return combo_box;
+ g_signal_connect ( G_OBJECT ( combo ),
+ "changed",
+ G_CALLBACK ( func ),
+ data );
+
+ return combo;
}
/**
@@ -186,20 +228,19 @@ GtkWidget *gsb_combo_box_new_with_index_by_list ( GSList *list,
* */
gint gsb_combo_box_get_index ( GtkWidget *combo_box )
{
- gint index;
+ GtkTreeModel *model;
GtkTreeIter iter;
+ gint index;
if (!combo_box)
- return -1;
+ return -1;
- if ( !gtk_combo_box_get_active_iter ( GTK_COMBO_BOX (combo_box),
- &iter ))
- return -1;
+ if ( !gtk_combo_box_get_active_iter ( GTK_COMBO_BOX ( combo_box ), &iter ) )
+ return -1;
+
+ model = gtk_combo_box_get_model ( GTK_COMBO_BOX ( combo_box ) );
+ gtk_tree_model_get ( model, &iter, 1, &index, -1 );
- gtk_tree_model_get ( GTK_TREE_MODEL (gtk_combo_box_get_model (GTK_COMBO_BOX (combo_box))),
- &iter,
- 1, &index,
- -1 );
return index;
}
@@ -215,7 +256,7 @@ gint gsb_combo_box_get_index ( GtkWidget *combo_box )
* \return TRUE ok, FALSE problem
* */
gint gsb_combo_box_set_index ( GtkWidget *combo_box,
- gint index )
+ gint index )
{
GtkTreeIter iter;
GtkTreeModel *model;
@@ -246,4 +287,31 @@ gint gsb_combo_box_set_index ( GtkWidget *combo_box,
}
return FALSE;
}
+/**
+ * get the text of the current item in the combo_box given in param
+ * the combo_box must have been created with gsb_combo_box_new_with_index
+ *
+ * \param combo_box
+ *
+ * \return a newly allocated string or NULL if nothing selected
+ * */
+gchar *gsb_combo_box_get_active_text ( GtkComboBox *combo_box )
+{
+ GtkTreeIter iter;
+ gchar *string;
+
+ if ( !combo_box )
+ return NULL;
+
+ if ( !gtk_combo_box_get_active_iter ( GTK_COMBO_BOX ( combo_box ), &iter ) )
+ return NULL;
+
+ gtk_tree_model_get ( GTK_TREE_MODEL ( gtk_combo_box_get_model ( GTK_COMBO_BOX ( combo_box ) ) ),
+ &iter,
+ 0, &string,
+ -1 );
+
+ return string;
+}
+
diff --git a/src/gsb_combo_box.h b/src/gsb_combo_box.h
index 6ce5eb3..6483108 100644
--- a/src/gsb_combo_box.h
+++ b/src/gsb_combo_box.h
@@ -7,14 +7,18 @@
/* END_INCLUDE_H */
/* START_DECLARATION */
+gchar *gsb_combo_box_get_active_text ( GtkComboBox *combo_box );
gint gsb_combo_box_get_index ( GtkWidget *combo_box );
+GtkListStore *gsb_combo_box_list_store_new_from_array ( gchar **array );
GtkWidget *gsb_combo_box_new_with_index ( gchar **string,
- GCallback func,
- gpointer data );
-GtkWidget *gsb_combo_box_new_with_index_by_list ( GSList *list,
- GCallback func,
- gpointer data );
+ GCallback func,
+ gpointer data );
+GtkWidget *gsb_combo_box_new_with_index_from_list ( GSList *list,
+ GCallback func,
+ gpointer data );
gint gsb_combo_box_set_index ( GtkWidget *combo_box,
- gint index );
+ gint index );
+void gsb_combo_box_set_text_renderer ( GtkComboBox *combo,
+ gint num_col );
/* END_DECLARATION */
#endif
diff --git a/src/gsb_currency.c b/src/gsb_currency.c
index 52469fb..f9f577d 100644
--- a/src/gsb_currency.c
+++ b/src/gsb_currency.c
@@ -145,6 +145,8 @@ GtkWidget *gsb_currency_make_combobox ( gboolean set_name )
{
GtkCellRenderer *text_renderer, *flag_renderer;
GtkWidget *combo_box;
+ gint xpad;
+ gint ypad;
if ( !combobox_currency_store )
gsb_currency_create_combobox_store ();
@@ -158,7 +160,8 @@ GtkWidget *gsb_currency_make_combobox ( gboolean set_name )
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo_box), flag_renderer,
"pixbuf", CURRENCY_COL_FLAG, NULL );
- GTK_CELL_RENDERER(flag_renderer) -> xpad = 3; /* Ugly but how to set it otherwise ?*/
+ gtk_cell_renderer_get_padding ( GTK_CELL_RENDERER ( flag_renderer ), &xpad, &ypad );
+ gtk_cell_renderer_set_padding ( GTK_CELL_RENDERER ( flag_renderer ), 3, ypad );
text_renderer = gtk_cell_renderer_text_new ();
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo_box), text_renderer, FALSE);
@@ -535,7 +538,7 @@ void gsb_currency_exchange_dialog ( gint account_currency_number,
/* Ugly dance to avoid side effects on dialog's vbox. */
hbox = gtk_hbox_new ( FALSE, 0 );
- gtk_box_pack_start ( GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox, FALSE, FALSE, 0 );
+ gtk_box_pack_start ( GTK_BOX ( dialog_get_content_area ( dialog ) ), hbox, FALSE, FALSE, 0 );
paddingbox = new_paddingbox_with_title ( hbox, TRUE, tmpstr );
gtk_container_set_border_width ( GTK_CONTAINER(hbox), 6 );
gtk_container_set_border_width ( GTK_CONTAINER(paddingbox), 6 );
@@ -1047,17 +1050,19 @@ GtkWidget *gsb_currency_make_combobox_exchange_dialog ( gint transaction_currenc
GtkTreeIter iter;
GdkPixbuf *pixbuf;
gchar *string;
+ gchar *tmp_dir;
+ gint xpad;
+ gint ypad;
combobox_store = gtk_list_store_new ( 3, G_TYPE_INT, GDK_TYPE_PIXBUF,
G_TYPE_STRING);
- string = g_strconcat( gsb_dirs_get_pixmaps_dir ( ), G_DIR_SEPARATOR_S,
- "flags", G_DIR_SEPARATOR_S,
- gsb_data_currency_get_code_iso4217 (
- transaction_currency_number ),
- ".png", NULL );
- pixbuf = gdk_pixbuf_new_from_file ( string, NULL );
- g_free (string);
+ string = g_strconcat ( gsb_data_currency_get_code_iso4217 ( transaction_currency_number ), ".png", NULL );
+
+ tmp_dir = g_build_filename ( gsb_dirs_get_pixmaps_dir ( ), "flags", string, NULL );
+ pixbuf = gdk_pixbuf_new_from_file ( tmp_dir, NULL );
+ g_free ( string );
+ g_free ( tmp_dir );
gtk_list_store_append ( GTK_LIST_STORE ( combobox_store ), &iter );
gtk_list_store_set ( combobox_store, &iter,
@@ -1066,13 +1071,12 @@ GtkWidget *gsb_currency_make_combobox_exchange_dialog ( gint transaction_currenc
2, gsb_data_currency_get_name ( transaction_currency_number ),
-1 );
- string = g_strconcat( gsb_dirs_get_pixmaps_dir ( ), G_DIR_SEPARATOR_S,
- "flags", G_DIR_SEPARATOR_S,
- gsb_data_currency_get_code_iso4217 (
- account_currency_number ),
- ".png", NULL );
- pixbuf = gdk_pixbuf_new_from_file ( string, NULL );
- g_free (string);
+ string = g_strconcat( gsb_data_currency_get_code_iso4217 ( account_currency_number ), ".png", NULL );
+
+ tmp_dir = g_build_filename ( gsb_dirs_get_pixmaps_dir ( ), "flags", string, NULL );
+ pixbuf = gdk_pixbuf_new_from_file ( tmp_dir, NULL );
+ g_free ( string );
+ g_free ( tmp_dir );
gtk_list_store_append ( GTK_LIST_STORE ( combobox_store ), &iter );
gtk_list_store_set ( combobox_store, &iter,
@@ -1090,7 +1094,8 @@ GtkWidget *gsb_currency_make_combobox_exchange_dialog ( gint transaction_currenc
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo_box), flag_renderer,
"pixbuf", 1, NULL );
- GTK_CELL_RENDERER(flag_renderer) -> xpad = 3; /* Ugly but how to set it otherwise ?*/
+ gtk_cell_renderer_get_padding ( GTK_CELL_RENDERER ( flag_renderer ), &xpad, &ypad );
+ gtk_cell_renderer_set_padding ( GTK_CELL_RENDERER ( flag_renderer ), 3, ypad );
text_renderer = gtk_cell_renderer_text_new ();
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo_box), text_renderer, FALSE);
diff --git a/src/gsb_currency_config.c b/src/gsb_currency_config.c
index c634a47..ab11582 100644
--- a/src/gsb_currency_config.c
+++ b/src/gsb_currency_config.c
@@ -951,7 +951,7 @@ gboolean gsb_currency_config_add_currency ( GtkWidget *button,
main_vbox = new_vbox_with_title_and_icon ( _("Select base currency for your account"),
"currencies.png" );
- gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG ( dialog ) -> vbox ), main_vbox, TRUE, TRUE, 0 );
+ gtk_box_pack_start ( GTK_BOX ( dialog_get_content_area ( dialog ) ), main_vbox, TRUE, TRUE, 0 );
vbox = gtk_vbox_new ( FALSE, 12 );
gtk_box_pack_start ( GTK_BOX ( main_vbox ), vbox, TRUE, TRUE, 0 );
diff --git a/src/gsb_currency_link_config.c b/src/gsb_currency_link_config.c
index 7d2c7bf..627d81a 100644
--- a/src/gsb_currency_link_config.c
+++ b/src/gsb_currency_link_config.c
@@ -669,7 +669,7 @@ gboolean gsb_currency_link_config_remove_link ( GtkWidget *tree_view )
/* hide the warning label */
label = g_object_get_data (G_OBJECT (model),
"warning_label");
- if ( GTK_WIDGET_VISIBLE ( label ) )
+ if ( gtk_widget_get_visible ( label ) )
gtk_widget_hide (label);
gsb_file_set_modified ( TRUE );
@@ -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 86048b9..c7acd83 100644
--- a/src/gsb_data_partial_balance.c
+++ b/src/gsb_data_partial_balance.c
@@ -586,14 +586,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;
@@ -1695,7 +1695,7 @@ GtkWidget *gsb_partial_balance_create_dialog ( gint action, gint spin_value )
gtk_window_set_position ( GTK_WINDOW ( dialog ), GTK_WIN_POS_CENTER_ON_PARENT );
main_vbox = new_vbox_with_title_and_icon ( _("Partial balance details"), "payment.png" );
- gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG ( dialog ) -> vbox ), main_vbox, TRUE, TRUE, 0 );
+ gtk_box_pack_start ( GTK_BOX ( dialog_get_content_area ( dialog ) ), main_vbox, TRUE, TRUE, 0 );
vbox = gtk_vbox_new ( FALSE, 12 );
gtk_box_pack_start ( GTK_BOX ( main_vbox ), vbox, TRUE, TRUE, 0 );
@@ -1782,7 +1782,7 @@ gint gsb_partial_balance_request_currency ( GtkWidget *parent )
gtk_window_set_position ( GTK_WINDOW ( dialog ), GTK_WIN_POS_CENTER_ON_PARENT );
hbox = gtk_hbox_new ( FALSE, 5 );
- gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG ( dialog ) -> vbox ), hbox, TRUE, FALSE, 0 );
+ gtk_box_pack_start ( GTK_BOX ( dialog_get_content_area( dialog ) ), hbox, TRUE, FALSE, 0 );
label = gtk_label_new ( _("Select the currency of the partial balance: ") );
gtk_misc_set_alignment ( GTK_MISC ( label ), 0, 1 );
diff --git a/src/gsb_file.c b/src/gsb_file.c
index 6abe99c..f5aadde 100644
--- a/src/gsb_file.c
+++ b/src/gsb_file.c
@@ -857,8 +857,7 @@ static gint gsb_file_dialog_save ( void )
g_free ( tmpstr2 );
g_free ( time_elapsed );
- gtk_label_set_markup ( GTK_LABEL ( GTK_MESSAGE_DIALOG(dialog)->label ),
- make_hint ( hint, message ) );
+ gtk_label_set_markup ( GTK_LABEL ( GTK_MESSAGE_DIALOG ( dialog ) ), make_hint ( hint, message ) );
g_free ( message );
g_free ( hint );
@@ -1131,7 +1130,6 @@ void gsb_file_remove_name_from_opened_list ( gchar *filename )
void gsb_file_save_remove_old_file ( gchar *filename )
{
GtkWidget *dialog;
- GtkWidget *content_area;
GtkWidget *hbox;
GtkWidget *image;
GtkWidget *label;
@@ -1149,10 +1147,9 @@ void gsb_file_save_remove_old_file ( gchar *filename )
gtk_window_set_position ( GTK_WINDOW ( dialog ), GTK_WIN_POS_CENTER_ON_PARENT );
gtk_window_set_resizable ( GTK_WINDOW ( dialog ), FALSE );
- content_area = GTK_DIALOG(dialog) -> vbox;
hbox = gtk_hbox_new ( FALSE, 5);
gtk_container_set_border_width ( GTK_CONTAINER( hbox ), 6 );
- gtk_box_pack_start ( GTK_BOX ( content_area ), hbox, FALSE, FALSE, 5 );
+ gtk_box_pack_start ( GTK_BOX ( dialog_get_content_area ( dialog ) ), hbox, FALSE, FALSE, 5 );
image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING,
GTK_ICON_SIZE_DIALOG );
diff --git a/src/gsb_form.c b/src/gsb_form.c
index 6508d5a..d084a67 100644
--- a/src/gsb_form.c
+++ b/src/gsb_form.c
@@ -338,8 +338,8 @@ void gsb_form_create_widgets ( void )
/* Kludge : otherwise, GtkExpander won't give us as many space
as we need. */
- gtk_widget_set_size_request ( hbox, 2048, -1 );
-
+/* gtk_widget_set_size_request ( hbox, 2048, -1 );
+*/
gtk_widget_show_all ( hbox );
gtk_widget_show_all ( transaction_form );
gtk_widget_hide ( form_scheduled_part );
@@ -830,7 +830,7 @@ void gsb_form_fill_element ( gint element_number,
/* don't show the cheque entry for a child of split */
tmp_widget = gsb_form_widget_get_widget ( TRANSACTION_FORM_CHEQUE );
- if ( GTK_WIDGET_VISIBLE ( widget ) )
+ if ( gtk_widget_get_visible ( widget ) )
{
gboolean check_entry = FALSE;
@@ -911,7 +911,7 @@ void gsb_form_fill_element ( gint element_number,
GSB_PAYMENT_DEBIT,
number, 0, TRUE );
- if (GTK_WIDGET_VISIBLE (widget))
+ if (gtk_widget_get_visible (widget))
{
gint method;
@@ -1125,7 +1125,7 @@ gint gsb_form_get_account_number ( void )
case ORIGIN_VALUE_HOME:
/* we are on the home page, we need to check if the form is showed,
* if yes, we get the account number of the scheduled showed in that form */
- if ( transaction_form && GTK_WIDGET_VISIBLE (transaction_form))
+ if ( transaction_form && gtk_widget_get_visible (transaction_form))
{
gint scheduled_number;
@@ -1554,7 +1554,7 @@ gboolean gsb_form_entry_lose_focus ( GtkWidget *entry,
* (if grey, it's a child of split so do nothing) */
if ( widget
&&
- GTK_WIDGET_SENSITIVE (widget))
+ gtk_widget_get_sensitive (widget))
{
/* change the signe of the method of payment and the contra */
if ( gsb_payment_method_get_combo_sign ( widget ) == GSB_PAYMENT_CREDIT)
@@ -1564,11 +1564,11 @@ gboolean gsb_form_entry_lose_focus ( GtkWidget *entry,
account_number, 0, FALSE );
/* if there is no payment method, the last function hide it, but we have
* to hide the cheque element too */
- if ( !GTK_WIDGET_VISIBLE ( widget ) )
+ if ( !gtk_widget_get_visible ( widget ) )
gtk_widget_hide ( gsb_form_widget_get_widget ( TRANSACTION_FORM_CHEQUE ) );
widget = gsb_form_widget_get_widget ( TRANSACTION_FORM_CONTRA );
- if ( widget && GTK_WIDGET_VISIBLE ( widget ) )
+ if ( widget && gtk_widget_get_visible ( widget ) )
gsb_payment_method_create_combo_list ( gsb_form_widget_get_widget (
TRANSACTION_FORM_CONTRA ),
GSB_PAYMENT_CREDIT,
@@ -1591,7 +1591,7 @@ gboolean gsb_form_entry_lose_focus ( GtkWidget *entry,
widget = gsb_form_widget_get_widget ( TRANSACTION_FORM_TYPE );
if ( widget
&&
- GTK_WIDGET_SENSITIVE ( widget ) )
+ gtk_widget_get_sensitive ( widget ) )
{
/* change the signe of the method of payment and the contra */
if ( gsb_payment_method_get_combo_sign ( widget ) == GSB_PAYMENT_DEBIT )
@@ -1608,7 +1608,7 @@ gboolean gsb_form_entry_lose_focus ( GtkWidget *entry,
gsb_payment_method_set_payment_position ( widget, payment_number );
widget = gsb_form_widget_get_widget ( TRANSACTION_FORM_CHEQUE );
- if ( widget && GTK_WIDGET_VISIBLE ( widget ) )
+ if ( widget && gtk_widget_get_visible ( widget ) )
{
if ( gsb_form_widget_get_old_credit_payment_content ( ) )
{
@@ -1619,7 +1619,7 @@ gboolean gsb_form_entry_lose_focus ( GtkWidget *entry,
}
widget = gsb_form_widget_get_widget (TRANSACTION_FORM_CONTRA);
- if ( widget && GTK_WIDGET_VISIBLE ( widget ) )
+ if ( widget && gtk_widget_get_visible ( widget ) )
gsb_payment_method_create_combo_list ( gsb_form_widget_get_widget (
TRANSACTION_FORM_CONTRA ),
GSB_PAYMENT_DEBIT,
@@ -1651,7 +1651,7 @@ gboolean gsb_form_entry_lose_focus ( GtkWidget *entry,
* (if grey, it's a child of split so do nothing) */
if ( widget
&&
- GTK_WIDGET_SENSITIVE (widget))
+ gtk_widget_get_sensitive (widget))
{
/* change the signe of the method of payment and the contra */
if ( gsb_payment_method_get_combo_sign (widget) == GSB_PAYMENT_DEBIT)
@@ -1661,11 +1661,11 @@ gboolean gsb_form_entry_lose_focus ( GtkWidget *entry,
account_number, 0, FALSE );
/* if there is no payment method, the last function hide it, but we have
* to hide the cheque element too */
- if ( !GTK_WIDGET_VISIBLE (widget))
+ if ( !gtk_widget_get_visible (widget))
gtk_widget_hide (gsb_form_widget_get_widget (TRANSACTION_FORM_CHEQUE));
widget = gsb_form_widget_get_widget ( TRANSACTION_FORM_CONTRA);
- if ( widget && GTK_WIDGET_VISIBLE ( widget ) )
+ if ( widget && gtk_widget_get_visible ( widget ) )
gsb_payment_method_create_combo_list ( widget,
GSB_PAYMENT_DEBIT,
account_number, 0, TRUE );
@@ -1687,7 +1687,7 @@ gboolean gsb_form_entry_lose_focus ( GtkWidget *entry,
widget = gsb_form_widget_get_widget ( TRANSACTION_FORM_TYPE );
if ( widget
&&
- GTK_WIDGET_SENSITIVE ( widget ) )
+ gtk_widget_get_sensitive ( widget ) )
{
/* change the signe of the method of payment and the contra */
if ( gsb_payment_method_get_combo_sign ( widget ) == GSB_PAYMENT_CREDIT )
@@ -1704,7 +1704,7 @@ gboolean gsb_form_entry_lose_focus ( GtkWidget *entry,
gsb_payment_method_set_payment_position ( widget, payment_number );
widget = gsb_form_widget_get_widget ( TRANSACTION_FORM_CHEQUE );
- if ( widget && GTK_WIDGET_VISIBLE ( widget ) )
+ if ( widget && gtk_widget_get_visible ( widget ) )
{
if ( gsb_form_widget_get_old_debit_payment_content ( ) )
{
@@ -1715,7 +1715,7 @@ gboolean gsb_form_entry_lose_focus ( GtkWidget *entry,
}
widget = gsb_form_widget_get_widget (TRANSACTION_FORM_CONTRA);
- if ( widget && GTK_WIDGET_VISIBLE ( widget ) )
+ if ( widget && gtk_widget_get_visible ( widget ) )
gsb_payment_method_create_combo_list ( gsb_form_widget_get_widget (
TRANSACTION_FORM_CONTRA ),
GSB_PAYMENT_CREDIT,
@@ -1977,7 +1977,7 @@ gboolean gsb_form_button_press_event ( GtkWidget *entry,
if ( widget
&&
- GTK_WIDGET_VISIBLE (widget))
+ gtk_widget_get_visible (widget))
{
gint payment_number;
gint account_number;
@@ -2058,10 +2058,10 @@ 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_KEY_Return
||
- ev -> keyval == GDK_KP_Enter ))
- ev->keyval = GDK_Tab ;
+ 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 */
@@ -2071,16 +2071,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:
@@ -2103,11 +2103,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 );
@@ -2115,7 +2115,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 );
@@ -2123,7 +2123,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 )
{
@@ -2152,7 +2152,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 )
{
@@ -2185,8 +2185,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,
@@ -2229,9 +2229,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)
{
@@ -2242,7 +2242,7 @@ gboolean gsb_form_key_press_event ( GtkWidget *widget,
break;
case GDK_KP_Subtract:
- case GDK_minus:
+ case GDK_KEY_minus:
/* decrease the check of 1 */
if (element_number == TRANSACTION_FORM_CHEQUE)
{
@@ -2259,8 +2259,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 )
@@ -2268,8 +2268,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 )
@@ -2277,8 +2277,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 )
@@ -2286,8 +2286,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 )
@@ -2296,8 +2296,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 )
@@ -2305,10 +2305,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 )
@@ -2993,7 +2993,7 @@ gboolean gsb_form_validate_form_transaction ( gint transaction_number,
if ( widget
&&
- GTK_WIDGET_VISIBLE (widget))
+ gtk_widget_get_visible (widget))
{
GtkWidget *combo_box;
gint payment;
@@ -3215,7 +3215,7 @@ void gsb_form_take_datas_from_form ( gint transaction_number,
case TRANSACTION_FORM_TYPE:
/* set the type only if visible */
- if ( GTK_WIDGET_VISIBLE (element -> element_widget))
+ if ( gtk_widget_get_visible (element -> element_widget))
{
GtkWidget *widget_tmp;
gint payment_number;
@@ -3226,7 +3226,7 @@ void gsb_form_take_datas_from_form ( gint transaction_number,
/* set the number of cheque only if visible */
widget_tmp = gsb_form_widget_get_widget (TRANSACTION_FORM_CHEQUE);
- if ( GTK_WIDGET_VISIBLE (widget_tmp)
+ if ( gtk_widget_get_visible (widget_tmp)
&&
!gsb_form_widget_check_empty (widget_tmp))
{
@@ -3251,7 +3251,7 @@ void gsb_form_take_datas_from_form ( gint transaction_number,
case TRANSACTION_FORM_CONTRA:
/* here only for scheduled transaction */
- if (!is_transaction && GTK_WIDGET_VISIBLE (element -> element_widget))
+ if (!is_transaction && gtk_widget_get_visible (element -> element_widget))
gsb_data_scheduled_set_contra_method_of_payment_number ( transaction_number,
gsb_payment_method_get_selected_number (element -> element_widget));
break;
diff --git a/src/gsb_form_config.c b/src/gsb_form_config.c
index 9d6fdce..a6b5b8a 100644
--- a/src/gsb_form_config.c
+++ b/src/gsb_form_config.c
@@ -784,27 +784,25 @@ gboolean gsb_form_config_realized ( GtkWidget *tree_view,
{
gint column;
gint account_number;
- gint width;
+ GtkAllocation allocation;
if ( !assert_account_loaded())
return FALSE;
account_number = gsb_account_get_combo_account_number ( accounts_combobox );
- width = tree_view -> allocation.width;
+ gtk_widget_get_allocation ( tree_view, &allocation );
/* fill and update the form list and buttons */
gsb_form_config_update_form_config(account_number);
for ( column=0 ; column < gsb_data_form_get_nb_columns (account_number) ; column++ )
{
- gtk_tree_view_column_set_fixed_width ( gtk_tree_view_get_column ( GTK_TREE_VIEW ( tree_view ),
- column ),
- gsb_data_form_get_width_column ( account_number,
- column ) * width / 100 );
+ gtk_tree_view_column_set_fixed_width (
+ gtk_tree_view_get_column ( GTK_TREE_VIEW ( tree_view ), column ),
+ gsb_data_form_get_width_column ( account_number, column ) * allocation.width / 100 );
}
- gdk_window_set_cursor ( tree_view -> window,
- gdk_cursor_new ( GDK_FLEUR ) );
+ gdk_window_set_cursor ( gtk_widget_get_window ( tree_view ), gdk_cursor_new ( GDK_FLEUR ) );
return FALSE;
}
@@ -827,8 +825,9 @@ gboolean gsb_form_config_change_column_size ( GtkWidget *tree_view,
gint column;
gint account_number;
gint i;
+ GtkAllocation tmp_allocation;
- if ( !GTK_WIDGET_REALIZED (tree_view))
+ if ( !gtk_widget_get_realized (tree_view))
return FALSE;
account_number = gsb_account_get_combo_account_number ( accounts_combobox );
@@ -850,8 +849,9 @@ gboolean gsb_form_config_change_column_size ( GtkWidget *tree_view,
gsb_file_set_modified ( TRUE );
/* update the form if needed */
- saved_allocation_size = 0;
- gsb_form_allocate_size ( NULL, &(form_transaction_part -> allocation), NULL );
+ saved_allocation_size = 0;
+ gtk_widget_get_allocation ( form_transaction_part, &tmp_allocation );
+ gsb_form_allocate_size ( NULL, &tmp_allocation, NULL );
gsb_form_create_widgets ();
return FALSE;
diff --git a/src/gsb_form_scheduler.c b/src/gsb_form_scheduler.c
index 7599cd5..a6708f8 100644
--- a/src/gsb_form_scheduler.c
+++ b/src/gsb_form_scheduler.c
@@ -381,7 +381,7 @@ GSList *gsb_form_scheduler_get_content_list ( void )
element = tmp_list -> data;
- if (GTK_WIDGET_VISIBLE (element -> element_widget))
+ if (gtk_widget_get_visible (element -> element_widget))
{
content_element *element_save;
@@ -496,7 +496,7 @@ void gsb_form_scheduler_set_content_list ( GSList *content_list )
form_element = form_list -> data;
- if (!GTK_WIDGET_VISIBLE (form_element -> element_widget)
+ if (!gtk_widget_get_visible (form_element -> element_widget)
||
form_element -> element_number != element -> element_number)
{
@@ -871,7 +871,7 @@ gboolean gsb_form_scheduler_frequency_button_changed ( GtkWidget *combo_box,
{
gchar *selected_item;
- selected_item = gtk_combo_box_get_active_text ( GTK_COMBO_BOX (combo_box));
+ selected_item = gsb_combo_box_get_active_text ( GTK_COMBO_BOX ( combo_box ) );
if ( !strcmp ( selected_item,
_("Once")))
@@ -1067,7 +1067,7 @@ GDate *gsb_form_scheduler_get_limit_date ( void )
||
gsb_form_widget_check_empty (entry)
||
- !GTK_WIDGET_VISIBLE (entry))
+ !gtk_widget_get_visible (entry))
return NULL;
date = gsb_calendar_entry_get_date (entry);
@@ -1089,7 +1089,7 @@ gboolean gsb_form_scheduler_set_limit_date ( GDate *date )
entry = gsb_form_scheduler_get_element_widget ( SCHEDULED_FORM_LIMIT_DATE );
/* if no entry, go away... */
- if (!entry || !GTK_WIDGET_VISIBLE ( entry ) )
+ if (!entry || !gtk_widget_get_visible ( entry ) )
return FALSE;
if ( !date )
@@ -1145,7 +1145,7 @@ gboolean gsb_form_scheduler_set_frequency_user ( gint user_freq )
/* if no entry, go away... */
if (!entry
||
- !GTK_WIDGET_VISIBLE (entry))
+ !gtk_widget_get_visible (entry))
return FALSE;
string = utils_str_itoa (user_freq);
@@ -1195,7 +1195,7 @@ gboolean gsb_form_scheduler_set_frequency_user_button ( gboolean automatic )
/* if no automatic button, go away... */
if (!button
||
- !GTK_WIDGET_VISIBLE (button))
+ !gtk_widget_get_visible (button))
return FALSE;
return gsb_combo_box_set_index ( button,
diff --git a/src/gsb_form_transaction.c b/src/gsb_form_transaction.c
index 42fed6d..a268ce1 100644
--- a/src/gsb_form_transaction.c
+++ b/src/gsb_form_transaction.c
@@ -208,7 +208,7 @@ gboolean gsb_form_transaction_complete_form_by_payee ( const gchar *payee_name )
gsb_payment_method_create_combo_list ( widget, GSB_PAYMENT_CREDIT,
account_number, 0, FALSE );
- if ( GTK_WIDGET_VISIBLE (widget))
+ if ( gtk_widget_get_visible (widget))
{
gint tmp_account;
@@ -572,7 +572,7 @@ gint gsb_form_transaction_validate_transfer ( gint transaction_number,
contra_payment_button = gsb_form_widget_get_widget ( TRANSACTION_FORM_CONTRA );
if ( contra_payment_button
&&
- GTK_WIDGET_VISIBLE ( contra_payment_button ) )
+ gtk_widget_get_visible ( contra_payment_button ) )
gsb_data_transaction_set_method_of_payment_number ( contra_transaction_number,
gsb_payment_method_get_selected_number ( contra_payment_button ) );
}
diff --git a/src/gsb_form_widget.c b/src/gsb_form_widget.c
index c23b69a..d7b4ebf 100644
--- a/src/gsb_form_widget.c
+++ b/src/gsb_form_widget.c
@@ -626,10 +626,10 @@ gboolean gsb_form_widget_can_focus ( gint element_number )
if ( !widget )
return FALSE;
- if ( !GTK_WIDGET_VISIBLE (widget))
+ if ( !gtk_widget_get_visible (widget))
return FALSE;
- if ( !GTK_WIDGET_SENSITIVE (widget))
+ if ( !gtk_widget_get_sensitive (widget))
return FALSE;
if ( !(GTK_IS_COMBOFIX (widget)
@@ -796,7 +796,7 @@ gboolean gsb_form_widget_entry_get_focus ( GtkWidget *entry,
* (if grey, it's a child of split so do nothing) */
if ( widget
&&
- GTK_WIDGET_SENSITIVE ( widget ) )
+ gtk_widget_get_sensitive ( widget ) )
{
/* change the signe of the method of payment and the contra */
if ( gsb_payment_method_get_combo_sign ( widget ) == GSB_PAYMENT_CREDIT )
@@ -804,7 +804,7 @@ gboolean gsb_form_widget_entry_get_focus ( GtkWidget *entry,
old_credit_payment_number = gsb_payment_method_get_selected_number ( widget );
tmp_widget = gsb_form_widget_get_widget ( TRANSACTION_FORM_CHEQUE );
- if ( tmp_widget && GTK_WIDGET_VISIBLE ( tmp_widget ) )
+ if ( tmp_widget && gtk_widget_get_visible ( tmp_widget ) )
{
if ( old_credit_payment_content )
g_free ( old_credit_payment_content );
@@ -820,7 +820,7 @@ gboolean gsb_form_widget_entry_get_focus ( GtkWidget *entry,
account_number, 0, FALSE );
widget = gsb_form_widget_get_widget ( TRANSACTION_FORM_CONTRA );
- if ( widget && GTK_WIDGET_VISIBLE ( widget ) )
+ if ( widget && gtk_widget_get_visible ( widget ) )
gsb_payment_method_create_combo_list ( gsb_form_widget_get_widget (
TRANSACTION_FORM_CONTRA ),
GSB_PAYMENT_CREDIT,
@@ -846,7 +846,7 @@ gboolean gsb_form_widget_entry_get_focus ( GtkWidget *entry,
* (if grey, it's a child of split so do nothing) */
if ( widget
&&
- GTK_WIDGET_SENSITIVE (widget))
+ gtk_widget_get_sensitive (widget))
{
/* change the signe of the method of payment and the contra */
if ( gsb_payment_method_get_combo_sign (widget) == GSB_PAYMENT_DEBIT)
@@ -854,7 +854,7 @@ gboolean gsb_form_widget_entry_get_focus ( GtkWidget *entry,
old_debit_payment_number = gsb_payment_method_get_selected_number ( widget );
tmp_widget = gsb_form_widget_get_widget ( TRANSACTION_FORM_CHEQUE );
- if ( tmp_widget && GTK_WIDGET_VISIBLE ( tmp_widget ) )
+ if ( tmp_widget && gtk_widget_get_visible ( tmp_widget ) )
{
if ( old_debit_payment_content )
g_free ( old_debit_payment_content );
@@ -870,7 +870,7 @@ gboolean gsb_form_widget_entry_get_focus ( GtkWidget *entry,
account_number, 0, FALSE );
widget = gsb_form_widget_get_widget ( TRANSACTION_FORM_CONTRA);
- if ( widget && GTK_WIDGET_VISIBLE ( widget ) )
+ if ( widget && gtk_widget_get_visible ( widget ) )
gsb_payment_method_create_combo_list ( widget,
GSB_PAYMENT_DEBIT,
account_number, 0, TRUE );
@@ -1094,7 +1094,7 @@ gboolean gsb_form_combo_selection_changed ( GtkTreeSelection *tree_selection,
widget = gsb_form_widget_get_widget ( TRANSACTION_FORM_DEVISE );
if ( widget != NULL
&&
- GTK_WIDGET_VISIBLE (
+ gtk_widget_get_visible (
gsb_form_widget_get_widget ( TRANSACTION_FORM_DEVISE) ) )
{
if ( g_str_has_prefix ( tmp_str, _("Transfer : ") ) )
diff --git a/src/gsb_payment_method.c b/src/gsb_payment_method.c
index b718b99..811c2a2 100644
--- a/src/gsb_payment_method.c
+++ b/src/gsb_payment_method.c
@@ -207,7 +207,7 @@ gint gsb_payment_method_get_selected_number ( GtkWidget *combo_box )
if ( !combo_box
||
- !GTK_WIDGET_VISIBLE (combo_box))
+ !gtk_widget_get_visible (combo_box))
return 0;
model = gtk_combo_box_get_model (GTK_COMBO_BOX (combo_box));
diff --git a/src/gsb_payment_method_config.c b/src/gsb_payment_method_config.c
index 2920979..859361e 100644
--- a/src/gsb_payment_method_config.c
+++ b/src/gsb_payment_method_config.c
@@ -1,8 +1,9 @@
/* ************************************************************************** */
/* */
-/* copyright (c) 2000-2007 Cédric Auger (cedric at grisbi.org) */
-/* 2004-2007 Benjamin Drieu (bdrieu at april.org) */
-/* http://www.grisbi.org */
+/* copyright (c) 2000-2007 Cédric Auger (cedric at grisbi.org) */
+/* 2004-2007 Benjamin Drieu (bdrieu at april.org) */
+/* 2008-2013 Pierre Biava (grisbi at pierre.biava.name) */
+/* http://www.grisbi.org */
/* */
/* 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 */
@@ -35,6 +36,7 @@
#include "gsb_payment_method_config.h"
#include "dialog.h"
#include "gsb_autofunc.h"
+#include "gsb_combo_box.h"
#include "gsb_data_account.h"
#include "gsb_data_form.h"
#include "gsb_data_payment.h"
@@ -73,8 +75,8 @@ static gboolean gsb_payment_method_config_select ( GtkTreeSelection *selection,
GtkWidget *tree_view );
static gboolean gsb_payment_method_config_show_entry_changed ( GtkWidget *button,
GtkWidget *tree_view );
-static gboolean gsb_payment_method_config_sign_changed ( GtkWidget *menu_item,
- gint *sign );
+static gboolean gsb_payment_method_config_sign_changed ( GtkWidget *combo,
+ gpointer data );
static gboolean gsb_payment_method_config_switch_payment ( gint payment_number );
static gboolean gsb_payment_method_config_toggled ( GtkCellRendererToggle *cell,
gchar *path_str,
@@ -97,6 +99,13 @@ static GtkWidget *button_show_entry;
/** Global to handle sensitiveness */
static GtkWidget *details_paddingbox;
+static gchar *payment_sign_list[] =
+{
+ N_("Neutral"),
+ N_("Debit"),
+ N_("Credit"),
+ NULL
+};
/**
@@ -109,7 +118,7 @@ static GtkWidget *details_paddingbox;
GtkWidget *gsb_payment_method_config_create ( void )
{
GtkWidget *vbox_pref, *hbox, *scrolled_window, *paddingbox;
- GtkWidget *vbox, *table, *menu, *item, *label;
+ GtkWidget *vbox, *table, *label;
GtkTreeViewColumn *column;
GtkCellRenderer *cell;
GtkWidget *bouton_ajouter_type;
@@ -306,31 +315,9 @@ GtkWidget *gsb_payment_method_config_create ( void )
0, 0 );
/* Create menu */
- payment_sign_button = gtk_option_menu_new ();
- menu = gtk_menu_new();
- /* Neutral method_ptr */
- item = gtk_menu_item_new_with_label ( _("Neutral") );
- g_signal_connect ( G_OBJECT ( item ),
- "activate",
- G_CALLBACK ( gsb_payment_method_config_sign_changed ),
- GINT_TO_POINTER (GSB_PAYMENT_NEUTRAL));
- gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), item );
- /* Debit method_ptr */
- item = gtk_menu_item_new_with_label ( _("Debit") );
- g_signal_connect ( G_OBJECT ( item ),
- "activate",
- G_CALLBACK ( gsb_payment_method_config_sign_changed ),
- GINT_TO_POINTER (GSB_PAYMENT_DEBIT));
- gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), item );
- /* Credit method_ptr */
- item = gtk_menu_item_new_with_label ( _("Credit") );
- g_signal_connect ( G_OBJECT ( item ),
- "activate",
- G_CALLBACK ( gsb_payment_method_config_sign_changed ),
- GINT_TO_POINTER (GSB_PAYMENT_CREDIT));
- gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), item );
- /* Set menu */
- gtk_option_menu_set_menu ( GTK_OPTION_MENU ( payment_sign_button ), menu );
+ payment_sign_button = gsb_combo_box_new_with_index ( payment_sign_list,
+ G_CALLBACK ( gsb_payment_method_config_sign_changed ),
+ NULL );
gtk_table_attach ( GTK_TABLE ( table ),
payment_sign_button, 1, 3, 2, 3,
GTK_EXPAND | GTK_FILL, 0,
@@ -523,8 +510,8 @@ gboolean gsb_payment_method_config_select ( GtkTreeSelection *selection,
gsb_autofunc_checkbutton_set_value ( button_auto_numbering,
gsb_data_payment_get_automatic_numbering (payment_number),
payment_number );
- gtk_option_menu_set_history ( GTK_OPTION_MENU ( payment_sign_button ),
- gsb_data_payment_get_sign (payment_number));
+ gsb_combo_box_set_index ( payment_sign_button,
+ gsb_data_payment_get_sign ( payment_number ) );
/* Activating widgets */
gtk_widget_set_sensitive ( button_auto_numbering,
gsb_data_payment_get_show_entry (payment_number));
@@ -544,7 +531,7 @@ gboolean gsb_payment_method_config_select ( GtkTreeSelection *selection,
gtk_widget_set_sensitive ( button_auto_numbering, FALSE );
gtk_widget_set_sensitive ( payment_last_number_entry, FALSE );
/* We set menu to "Neutral" as a default*/
- gtk_option_menu_set_history ( GTK_OPTION_MENU ( payment_sign_button ), 0);
+ gsb_combo_box_set_index ( payment_sign_button, 0);
/* Nothing to remove */
gtk_widget_set_sensitive ( payment_remove_button, TRUE );
@@ -562,7 +549,7 @@ gboolean gsb_payment_method_config_select ( GtkTreeSelection *selection,
gtk_widget_set_sensitive ( button_auto_numbering, FALSE );
gtk_widget_set_sensitive ( payment_last_number_entry, FALSE );
/* We set menu to "Neutral" as a default*/
- gtk_option_menu_set_history ( GTK_OPTION_MENU ( payment_sign_button ), 0);
+ gsb_combo_box_set_index ( payment_sign_button, 0);
/* Nothing to remove */
gtk_widget_set_sensitive ( payment_remove_button, TRUE );
@@ -733,7 +720,7 @@ gboolean gsb_payment_method_config_name_changed ( GtkWidget *entry,
GSB_PAYMENT_DEBIT,
account_number, 0, FALSE );
- if (GTK_WIDGET_VISIBLE (widget))
+ if (gtk_widget_get_visible (widget))
{
gsb_payment_method_set_combobox_history ( widget,
gsb_data_account_get_default_debit (account_number), TRUE );
@@ -946,82 +933,94 @@ gint gsb_payment_method_config_get_transaction_by_sign ( gint account_number,
*
* \return FALSE
*/
-gboolean gsb_payment_method_config_sign_changed ( GtkWidget *menu_item,
- gint *sign )
+gboolean gsb_payment_method_config_sign_changed ( GtkWidget *combo,
+ gpointer data )
{
+ GtkTreeModel *model;
GtkTreeSelection *selection;
GtkTreeIter iter;
gboolean good;
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (payment_method_treeview));
- good = gtk_tree_selection_get_selected (selection, NULL, &iter);
+ selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( payment_method_treeview ) );
+ good = gtk_tree_selection_get_selected ( selection, &model, &iter );
- if (good)
+ if ( good )
{
- GtkTreeModel *model;
- gint payment_number;
-
- model = gtk_tree_view_get_model ( GTK_TREE_VIEW (payment_method_treeview));
- gtk_tree_model_get ( GTK_TREE_MODEL(model), &iter,
- PAYMENT_METHODS_NUMBER_COLUMN, &payment_number,
- -1 );
-
- if (payment_number)
- {
- gint account_number;
-
- /* Call this callback so that we "unselect" things */
- gsb_payment_method_config_select ( selection, payment_method_treeview);
-
- account_number = gsb_data_payment_get_account_number (payment_number);
-
- /* as we have changed the sign of the method of payment, check if it was the default
- * for the account, and if yes, change the default for that account */
- switch (gsb_data_payment_get_sign (payment_number))
- {
- case GSB_PAYMENT_DEBIT:
- if ( gsb_data_account_get_default_debit (account_number) == payment_number)
- {
- /* the current method of payment was a debit and was the default debit for its account,
- * so change the default to another debit */
- gsb_data_account_set_default_debit ( account_number,
- gsb_payment_method_config_get_transaction_by_sign (account_number,
- GSB_PAYMENT_DEBIT,
- payment_number));
- }
- break;
-
- case GSB_PAYMENT_CREDIT:
- if ( gsb_data_account_get_default_credit (account_number) == payment_number)
- {
- /* the current method of payment was a credit and was the default credit for its account,
- * so change the default to another credit */
- gsb_data_account_set_default_credit ( account_number,
- gsb_payment_method_config_get_transaction_by_sign (account_number,
- GSB_PAYMENT_CREDIT,
- payment_number));
- }
- break;
- }
- gsb_data_payment_set_sign ( payment_number,
- GPOINTER_TO_INT (sign));
-
- /* Update tree */
- g_signal_handlers_block_by_func ( selection,
- G_CALLBACK (gsb_payment_method_config_select),
- model );
- gsb_payment_method_config_fill_list (model);
- gtk_tree_view_expand_all ( GTK_TREE_VIEW(payment_method_treeview) );
- g_signal_handlers_unblock_by_func ( selection,
- G_CALLBACK (gsb_payment_method_config_select),
- model );
- gtk_tree_model_foreach ( GTK_TREE_MODEL (model),
- (GtkTreeModelForeachFunc) gsb_payment_method_config_foreach_select,
- GINT_TO_POINTER (payment_number));
- /* need to clear and fill the reconciliation tree becaus if it was a neutral changing to credit/debit
- * and neutral was split... */
- gsb_reconcile_sort_config_fill ();
- }
+ gint payment_number;
+ gint index;
+
+ /* on bloque l'appel à la fonction gsb_payment_method_config_sign_changed */
+ g_signal_handlers_block_by_func ( payment_sign_button,
+ G_CALLBACK ( gsb_payment_method_config_sign_changed ),
+ NULL );
+
+ index = gtk_combo_box_get_active ( GTK_COMBO_BOX ( combo ) );
+
+ gtk_tree_model_get ( GTK_TREE_MODEL ( model ),
+ &iter,
+ PAYMENT_METHODS_NUMBER_COLUMN, &payment_number,
+ -1 );
+
+ if ( payment_number )
+ {
+ gint account_number;
+
+ /* Call this callback so that we "unselect" things */
+ gsb_payment_method_config_select ( selection, payment_method_treeview );
+
+ account_number = gsb_data_payment_get_account_number ( payment_number );
+
+ /* as we have changed the sign of the method of payment, check if it was the default
+ * for the account, and if yes, change the default for that account */
+ switch (gsb_data_payment_get_sign ( payment_number ) )
+ {
+ case GSB_PAYMENT_DEBIT:
+ if ( gsb_data_account_get_default_debit ( account_number ) == payment_number)
+ {
+ /* the current method of payment was a debit and was the default debit for its account,
+ * so change the default to another debit */
+ gsb_data_account_set_default_debit ( account_number,
+ gsb_payment_method_config_get_transaction_by_sign ( account_number,
+ GSB_PAYMENT_DEBIT,
+ payment_number ) );
+ }
+ break;
+
+ case GSB_PAYMENT_CREDIT:
+ if ( gsb_data_account_get_default_credit ( account_number ) == payment_number)
+ {
+ /* the current method of payment was a credit and was the default credit for its account,
+ * so change the default to another credit */
+ gsb_data_account_set_default_credit ( account_number,
+ gsb_payment_method_config_get_transaction_by_sign ( account_number,
+ GSB_PAYMENT_CREDIT,
+ payment_number ) );
+ }
+ break;
+ }
+ gsb_data_payment_set_sign ( payment_number, index );
+
+ /* Update tree */
+ g_signal_handlers_block_by_func ( selection,
+ G_CALLBACK ( gsb_payment_method_config_select ),
+ model );
+ gsb_payment_method_config_fill_list (model);
+ gtk_tree_view_expand_all ( GTK_TREE_VIEW(payment_method_treeview ) );
+ g_signal_handlers_unblock_by_func ( selection,
+ G_CALLBACK ( gsb_payment_method_config_select ),
+ model );
+ gtk_tree_model_foreach ( GTK_TREE_MODEL (model),
+ (GtkTreeModelForeachFunc) gsb_payment_method_config_foreach_select,
+ GINT_TO_POINTER (payment_number));
+
+ /* need to clear and fill the reconciliation tree becaus if it was a neutral changing to credit/debit
+ * and neutral was split... */
+ gsb_reconcile_sort_config_fill ();
+ }
+ /* on débloque l'appel à la fonction gsb_payment_method_config_sign_changed */
+ g_signal_handlers_unblock_by_func ( payment_sign_button,
+ G_CALLBACK ( gsb_payment_method_config_sign_changed ),
+ NULL );
}
return FALSE;
}
@@ -1038,71 +1037,72 @@ gboolean gsb_payment_method_config_sign_changed ( GtkWidget *menu_item,
gboolean gsb_payment_method_config_add ( GtkWidget *button,
GtkWidget *tree_view )
{
- GtkTreeSelection * selection;
+ GtkTreeSelection *selection;
GtkTreeIter iter, parent, root, child, *final;
- GtkTreePath * treepath;
+ GtkTreePath *tree_path;
+ GtkTreePath *final_path;
gint account_number, type_final;
gboolean good;
gint payment_number;
GtkTreeModel *model;
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view));
- good = gtk_tree_selection_get_selected (selection, NULL, &iter);
- model = gtk_tree_view_get_model (GTK_TREE_VIEW (tree_view));
+ selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( tree_view ) );
+ good = gtk_tree_selection_get_selected ( selection, &model, &iter );
if ( good )
{
- /* there is a selection, get corrent iters */
- gtk_tree_model_get ( GTK_TREE_MODEL(model), &iter,
- PAYMENT_METHODS_NUMBER_COLUMN, &payment_number,
- -1 );
- if (payment_number)
- {
- /* Select parent */
- gtk_tree_model_iter_parent ( GTK_TREE_MODEL(model),
- &parent, &iter );
- final = &parent;
- type_final = gsb_data_payment_get_sign (payment_number);
- gtk_tree_model_iter_parent (GTK_TREE_MODEL(model), &root, &parent);
- }
- else
- {
- gchar *name;
-
- gtk_tree_model_get ( GTK_TREE_MODEL(model), &iter,
- PAYMENT_METHODS_NAME_COLUMN, &name,
- -1 );
-
- if (gtk_tree_model_iter_parent (GTK_TREE_MODEL(model), &root, &iter))
- {
- /* We are on "Credit" or "Debit" or "Neutral" */
- final = &iter;
- if ( !strcmp(name, _("Credit")) )
- {
- type_final = GSB_PAYMENT_CREDIT;
- }
- else if ( !strcmp(name, _("Debit")) )
- {
- type_final = GSB_PAYMENT_DEBIT;
- }
- else /* Neutral */
- {
- type_final = GSB_PAYMENT_NEUTRAL;
- }
- }
- else
- {
- /* We are on an account, method_ptr will be the same as the
- first node */
- if (!gtk_tree_model_iter_children( GTK_TREE_MODEL(model),
- &child, &iter ))
- /* Should not happen! */
- dialogue_error_brain_damage ();
-
- final = &child;
- type_final = GSB_PAYMENT_DEBIT;
- }
- }
+ /* there is a selection, get current iters */
+ gtk_tree_model_get ( GTK_TREE_MODEL( model ),
+ &iter,
+ PAYMENT_METHODS_NUMBER_COLUMN, &payment_number,
+ -1 );
+ if ( payment_number )
+ {
+ /* Select parent */
+ gtk_tree_model_iter_parent ( GTK_TREE_MODEL ( model ), &parent, &iter );
+ final = &parent;
+ type_final = gsb_data_payment_get_sign ( payment_number );
+ gtk_tree_model_iter_parent ( GTK_TREE_MODEL ( model ), &root, &parent );
+ /* ici root = compte, parent = type, iter = moyen de payement sélectionné */
+ }
+ else
+ {
+ gchar *name;
+
+ gtk_tree_model_get ( GTK_TREE_MODEL ( model ),
+ &iter,
+ PAYMENT_METHODS_NAME_COLUMN, &name,
+ -1 );
+
+ if ( gtk_tree_model_iter_parent ( GTK_TREE_MODEL ( model ), &root, &iter ) )
+ {
+ /* We are on "Credit" or "Debit" or "Neutral" */
+ final = &iter;
+ if ( !strcmp ( name, _("Credit") ) )
+ {
+ type_final = GSB_PAYMENT_CREDIT;
+ }
+ else if ( !strcmp ( name, _("Debit") ) )
+ {
+ type_final = GSB_PAYMENT_DEBIT;
+ }
+ else /* Neutral */
+ {
+ type_final = GSB_PAYMENT_NEUTRAL;
+ }
+ }
+ else
+ {
+ /* We are on an account, method_ptr will be the same as the
+ first node */
+ if ( !gtk_tree_model_iter_children ( GTK_TREE_MODEL ( model ), &child, &iter ) )
+ /* Should not happen! */
+ dialogue_error_brain_damage ();
+
+ final = &child;
+ type_final = GSB_PAYMENT_DEBIT;
+ }
+ }
}
else
{
@@ -1139,16 +1139,20 @@ gboolean gsb_payment_method_config_add ( GtkWidget *button,
PAYMENT_METHODS_NUMBER_COLUMN, payment_number,
-1 );
+ tree_path = gtk_tree_model_get_path ( GTK_TREE_MODEL ( model ), &iter );
+ gtk_tree_model_row_inserted ( GTK_TREE_MODEL ( model ), tree_path, &iter );
+
/* Select and view new position */
+ final_path = gtk_tree_model_get_path ( GTK_TREE_MODEL ( model ), final );
+ if ( !gtk_tree_view_row_expanded ( GTK_TREE_VIEW ( tree_view ), final_path ) )
+ gtk_tree_view_expand_to_path ( GTK_TREE_VIEW ( tree_view ), final_path );
+ gtk_tree_path_free ( final_path );
gtk_tree_selection_select_iter ( selection, &iter );
- treepath = gtk_tree_model_get_path ( GTK_TREE_MODEL(model), &iter );
- gtk_tree_view_scroll_to_cell ( GTK_TREE_VIEW(tree_view), treepath, NULL,
- TRUE, 0.5, 0);
- gtk_tree_path_free ( treepath );
+ gtk_tree_view_scroll_to_cell ( GTK_TREE_VIEW ( tree_view ), tree_path, NULL, TRUE, 0.5, 0);
+ gtk_tree_path_free ( tree_path );
/* add to the sorted list */
- gsb_data_account_sort_list_add ( account_number,
- payment_number );
+ gsb_data_account_sort_list_add ( account_number, payment_number );
gsb_reconcile_sort_config_fill ();
/* Mark file as modified */
@@ -1279,7 +1283,7 @@ gboolean gsb_payment_method_config_switch_payment ( gint payment_number )
/* Ugly dance to avoid side effects on dialog's vbox. */
hbox = gtk_hbox_new ( FALSE, 0 );
- gtk_box_pack_start ( GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox, FALSE, FALSE, 0 );
+ gtk_box_pack_start ( GTK_BOX ( dialog_get_content_area ( dialog ) ), hbox, FALSE, FALSE, 0 );
paddingbox = new_paddingbox_with_title ( hbox, TRUE, _("Payment method is used by transactions") );
gtk_container_set_border_width ( GTK_CONTAINER(hbox), 6 );
gtk_container_set_border_width ( GTK_CONTAINER(paddingbox), 6 );
@@ -1298,7 +1302,7 @@ gboolean gsb_payment_method_config_switch_payment ( gint payment_number )
return FALSE;
}
- if (GTK_WIDGET_VISIBLE (combo_box))
+ if (gtk_widget_get_visible (combo_box))
label = gtk_label_new ( _("Some transactions still use that payment method. As deletion of this method is irreversible, these transactions are to be associated with another payment method."));
else
label = gtk_label_new (_("No target method of payment to switch the transactions to another method of payment. If you continue, the transactions with this method of payment will have no new one."));
@@ -1318,7 +1322,7 @@ gboolean gsb_payment_method_config_switch_payment ( gint payment_number )
/* the combo_box was created before */
gtk_box_pack_start ( GTK_BOX ( hbox ), combo_box, TRUE, TRUE, 0 );
- if (GTK_WIDGET_VISIBLE (combo_box))
+ if (gtk_widget_get_visible (combo_box))
gtk_widget_show_all ( hbox );
resultat = gtk_dialog_run ( GTK_DIALOG ( dialog ));
diff --git a/src/gsb_scheduler_list.c b/src/gsb_scheduler_list.c
index 9c9da9c..0207e4f 100644
--- a/src/gsb_scheduler_list.c
+++ b/src/gsb_scheduler_list.c
@@ -1792,26 +1792,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;
@@ -2056,7 +2056,7 @@ gboolean gsb_scheduler_list_delete_scheduled_transaction ( gint scheduled_number
_("Only this one"), 0,
NULL );
- vbox = GTK_DIALOG(dialog) -> vbox;
+ vbox = gtk_dialog_get_content_area ( GTK_DIALOG ( dialog ) );
checkbox = gtk_check_button_new_with_label ( _("Do not show this message again") );
g_signal_connect ( G_OBJECT ( checkbox ),
@@ -2166,7 +2166,7 @@ gboolean gsb_scheduler_list_popup_custom_periodicity_dialog (void)
/* Ugly dance to avoid side effects on dialog's vbox. */
hbox = gtk_hbox_new ( FALSE, 0 );
- gtk_box_pack_start ( GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox, FALSE, FALSE, 0 );
+ gtk_box_pack_start ( GTK_BOX ( dialog_get_content_area ( dialog ) ), hbox, FALSE, FALSE, 0 );
paddingbox = new_paddingbox_with_title ( hbox, TRUE, _("Scheduler frequency") );
gtk_container_set_border_width ( GTK_CONTAINER(hbox), 6 );
gtk_container_set_border_width ( GTK_CONTAINER(paddingbox), 6 );
@@ -2181,12 +2181,12 @@ gboolean gsb_scheduler_list_popup_custom_periodicity_dialog (void)
gtk_box_pack_start ( GTK_BOX(hbox2), entry, FALSE, FALSE, 6 );
/* combobox for userdefined frequency */
- combobox = gtk_combo_box_new_text ();
+ combobox = gtk_combo_box_text_new ();
gtk_box_pack_start ( GTK_BOX(hbox2), combobox, FALSE, FALSE, 0 );
for ( i = 0; names[i]; i++ )
{
- gtk_combo_box_append_text ( GTK_COMBO_BOX ( combobox ), names[i] );
+ gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( combobox ), names[i] );
}
gtk_combo_box_set_active ( GTK_COMBO_BOX ( combobox ), affichage_echeances_perso_j_m_a );
diff --git a/src/gsb_select_icon.c b/src/gsb_select_icon.c
index 509e88d..eafdeee 100644
--- a/src/gsb_select_icon.c
+++ b/src/gsb_select_icon.c
@@ -45,7 +45,7 @@ static GtkWidget * gsb_select_icon_create_entry_text ( gchar * name_icon );
static void gsb_select_icon_create_file_chooser ( GtkWidget * button,
gpointer user_data );
static GtkWidget * gsb_select_icon_create_icon_view ( gchar * name_icon );
-static void gsb_select_icon_entry_text_changed ( GtkComboBoxEntry *entry,
+static void gsb_select_icon_entry_text_changed ( GtkComboBox *entry,
gpointer user_data );
static GtkTreePath * gsb_select_icon_fill_icon_view ( gchar * name_icon );
static GdkPixbuf *gsb_select_icon_resize_logo_pixbuf ( GdkPixbuf *pixbuf );
@@ -173,7 +173,7 @@ gchar * gsb_select_icon_create_window ( gchar *name_icon )
GTK_STOCK_OK,
GTK_RESPONSE_ACCEPT);
gtk_widget_set_size_request ( dialog, 400, 450 );
- content_area = GTK_DIALOG ( dialog ) -> vbox;
+ content_area = gtk_dialog_get_content_area ( GTK_DIALOG ( dialog ) );
/* création hbox pour GtkEntry répertoire et bouton sélection des répertoires */
hbox = gtk_hbox_new ( FALSE, 5);
@@ -242,18 +242,13 @@ gchar * gsb_select_icon_create_window ( gchar *name_icon )
*
* \return le GtkComboBox
* */
-GtkWidget * gsb_select_icon_create_entry_text ( gchar * name_icon )
+GtkWidget *gsb_select_icon_create_entry_text ( gchar *name_icon )
{
GtkWidget *combo;
GtkTreeIter iter;
- if ( store )
+ if ( !store )
{
- devel_debug ( "combo existe" );
- }
- else
- {
- devel_debug ( "combo n'existe pas" );
store = gtk_list_store_new ( 2, G_TYPE_STRING, G_TYPE_INT );
gtk_list_store_append (store, &iter);
if ( g_strcmp0 ( gsb_dirs_get_pixmaps_dir ( ), path_icon ) != 0 )
@@ -264,8 +259,10 @@ GtkWidget * gsb_select_icon_create_entry_text ( gchar * name_icon )
gtk_list_store_set (store, &iter, 0, path_icon, -1);
}
- combo = gtk_combo_box_entry_new_with_model ( GTK_TREE_MODEL ( store ), 0 );
- gtk_entry_set_text ( GTK_ENTRY (GTK_BIN (combo)->child), name_icon );
+ combo = gtk_combo_box_new_with_model_and_entry ( GTK_TREE_MODEL ( store ) );
+ gtk_combo_box_set_entry_text_column ( GTK_COMBO_BOX ( combo ), 0 );
+
+ gtk_entry_set_text ( GTK_ENTRY ( gtk_bin_get_child ( GTK_BIN ( combo ) ) ), name_icon );
return combo;
}
@@ -421,7 +418,7 @@ void gsb_select_icon_create_file_chooser ( GtkWidget * button,
gtk_icon_view_scroll_to_path (GTK_ICON_VIEW ( icon_view ),
path, TRUE, 0.5, 0 );
gsb_select_icon_add_path ( );
- gtk_entry_set_text ( GTK_ENTRY (GTK_BIN (entry_text)->child ),
+ gtk_entry_set_text ( GTK_ENTRY ( gtk_bin_get_child ( GTK_BIN ( entry_text ) ) ),
path_icon );
gtk_widget_set_sensitive (bouton_OK, FALSE );
}
@@ -439,25 +436,26 @@ void gsb_select_icon_create_file_chooser ( GtkWidget * button,
* \return void
*
* */
-void gsb_select_icon_entry_text_changed ( GtkComboBoxEntry *entry,
+void gsb_select_icon_entry_text_changed ( GtkComboBox *entry,
gpointer user_data )
{
GtkTreePath *path;
- const gchar *tmpstr;
+ const gchar *tmp_str;
gchar *ptr;
- tmpstr = gtk_entry_get_text ( GTK_ENTRY (GTK_BIN (entry_text)->child ) );
- devel_debug ( tmpstr );
- ptr = g_strstr_len ( tmpstr, -1, path_icon );
+ tmp_str = gtk_entry_get_text ( GTK_ENTRY ( gtk_bin_get_child ( GTK_BIN ( entry ) ) ) );
+ devel_debug ( tmp_str );
+
+ ptr = g_strstr_len ( tmp_str, -1, path_icon );
if ( ptr == NULL )
{
- if ( g_file_test ( tmpstr, G_FILE_TEST_IS_DIR ) )
+ if ( g_file_test ( tmp_str, G_FILE_TEST_IS_DIR ) )
{
- path_icon = g_strdup ( tmpstr );
+ path_icon = g_strdup ( tmp_str );
path = gsb_select_icon_fill_icon_view ( NULL );
- gtk_icon_view_scroll_to_path (GTK_ICON_VIEW ( icon_view ),
- path, TRUE, 0.5, 0 );
- gtk_widget_set_sensitive (bouton_OK, FALSE );
+ gtk_icon_view_scroll_to_path (GTK_ICON_VIEW ( icon_view ), path, TRUE, 0.5, 0 );
+
+ gtk_widget_set_sensitive ( bouton_OK, FALSE );
}
}
}
@@ -495,11 +493,10 @@ void gsb_select_icon_selection_changed ( GtkIconView *icon_view,
devel_debug ( name_icon );
if ( name_icon && strlen ( name_icon ) > 0 )
{
- new_icon = g_strconcat ( path_icon, G_DIR_SEPARATOR_S,
- name_icon, NULL );
- gtk_entry_set_text ( GTK_ENTRY (GTK_BIN (entry_text)->child ),
- new_icon );
+ new_icon = g_build_filename ( path_icon, name_icon, NULL );
+ gtk_entry_set_text ( GTK_ENTRY ( gtk_bin_get_child ( GTK_BIN ( entry_text ) ) ), new_icon );
gtk_widget_set_sensitive (bouton_OK, TRUE );
+ g_free ( name_icon );
}
}
diff --git a/src/gsb_status.c b/src/gsb_status.c
index 628b9c7..44ec697 100644
--- a/src/gsb_status.c
+++ b/src/gsb_status.c
@@ -135,18 +135,20 @@ void gsb_status_clear ( )
*/
void gsb_status_wait ( gboolean force_update )
{
- GdkWindow * current_window;
+ GdkWindow *current_window;
+ GdkWindow *run_window;
- gdk_window_set_cursor ( run.window -> window,
- gdk_cursor_new_for_display ( gdk_display_get_default ( ),
- GDK_WATCH ) );
+ run_window = gtk_widget_get_window ( GTK_WIDGET ( run.window ) );
- current_window = gdk_display_get_window_at_pointer ( gdk_display_get_default ( ),
- NULL, NULL );
+ gdk_window_set_cursor ( run_window,
+ gdk_cursor_new_for_display ( gdk_display_get_default ( ),
+ GDK_WATCH ) );
+
+ current_window = gdk_display_get_window_at_pointer ( gdk_display_get_default ( ), NULL, NULL );
if ( current_window && GDK_IS_WINDOW ( current_window )
&&
- current_window != run.window -> window )
+ current_window != run_window )
{
GdkWindow * parent = gdk_window_get_toplevel ( current_window );
@@ -179,7 +181,7 @@ void gsb_status_stop_wait ( gboolean force_update )
if ( ! run.window )
return;
- gdk_window_set_cursor ( run.window -> window, NULL );
+ gdk_window_set_cursor ( gtk_widget_get_window ( GTK_WIDGET ( run.window ) ), NULL );
if ( tracked_window && gdk_window_is_visible ( tracked_window ) )
{
diff --git a/src/gsb_transactions_list.c b/src/gsb_transactions_list.c
index 36fab02..d80cc9b 100644
--- a/src/gsb_transactions_list.c
+++ b/src/gsb_transactions_list.c
@@ -757,15 +757,19 @@ void update_titres_tree_view ( void )
for ( i = 0 ; i < CUSTOM_MODEL_VISIBLE_COLUMNS ; i++ )
{
- gtk_tree_view_column_set_title ( GTK_TREE_VIEW_COLUMN (
- transactions_tree_view_columns[i] ),
- _(titres_colonnes_liste_operations[i] ) );
+ GtkTreeViewColumn *col;
+ GtkWidget *button;
- if ( GTK_TREE_VIEW_COLUMN ( transactions_tree_view_columns[i] )->button )
+ col = GTK_TREE_VIEW_COLUMN ( transactions_tree_view_columns[i] );
+ gtk_tree_view_column_set_title ( col, ( titres_colonnes_liste_operations[i] ) );
+
+/* for gtk3
+ * button = gtk_tree_view_column_get_button ( col );
+ */
+ button = col->button;
+ if ( button )
{
- gtk_widget_set_tooltip_text ( GTK_WIDGET ( GTK_TREE_VIEW_COLUMN (
- transactions_tree_view_columns[i] )->button ),
- tips_col_liste_operations[i] );
+ gtk_widget_set_tooltip_text ( button, tips_col_liste_operations[i] );
}
}
}
@@ -815,30 +819,36 @@ GtkWidget *gsb_transactions_list_create_tree_view ( GtkTreeModel *model )
for ( i = 0 ; i < CUSTOM_MODEL_VISIBLE_COLUMNS ; i++ )
{
- gtk_tree_view_append_column ( GTK_TREE_VIEW ( tree_view ),
- transactions_tree_view_columns[i] );
-
- gtk_tree_view_column_set_clickable ( transactions_tree_view_columns[i],
- TRUE );
+ GtkWidget *button;
+ GtkTreeViewColumn *col;
- /* set the tooltips */
- gtk_widget_set_tooltip_text ( GTK_WIDGET (transactions_tree_view_columns[i] -> button),
- tips_col_liste_operations[i] );
+ col = GTK_TREE_VIEW_COLUMN ( transactions_tree_view_columns[i] );
+ gtk_tree_view_append_column ( GTK_TREE_VIEW ( tree_view ), col );
- g_signal_connect ( G_OBJECT ( transactions_tree_view_columns[i] -> button),
- "button-press-event",
- G_CALLBACK ( gsb_transactions_list_title_column_button_press ),
- GINT_TO_POINTER ( i ) );
+ gtk_tree_view_column_set_clickable ( col, TRUE );
- /* use the click to sort the list */
- g_signal_connect ( G_OBJECT ( transactions_tree_view_columns[i] ),
- "clicked",
- G_CALLBACK ( gsb_transactions_list_change_sort_column ),
- GINT_TO_POINTER ( i ) );
+ /* set the tooltips */
+/* for gtk3
+ * button = gtk_tree_view_column_get_button ( col );
+ */
+ button = col->button;
+ gtk_widget_set_tooltip_text ( button, tips_col_liste_operations[i] );
+
+ g_signal_connect ( G_OBJECT ( button ),
+ "button-press-event",
+ G_CALLBACK ( gsb_transactions_list_title_column_button_press ),
+ GINT_TO_POINTER ( i ) );
+
+ /* use the click to sort the list */
+ g_signal_connect ( G_OBJECT ( col ),
+ "clicked",
+ G_CALLBACK ( gsb_transactions_list_change_sort_column ),
+ GINT_TO_POINTER ( i ) );
}
- gtk_tree_view_set_model ( GTK_TREE_VIEW ( tree_view ),
- GTK_TREE_MODEL ( model ) );
+ gtk_tree_view_set_model ( GTK_TREE_VIEW ( tree_view ), GTK_TREE_MODEL ( model ) );
+
+ /* return */
return tree_view;
}
@@ -1581,34 +1591,34 @@ 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_KEY_P: /* touche P */
+ case GDK_KEY_p: /* touche p */
case GDK_F12: /* touche F12 pour pointer dépointer comme avec <ctrl>p*/
if ( ( ev -> state & GDK_CONTROL_MASK ) == GDK_CONTROL_MASK
@@ -1621,8 +1631,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 )
{
@@ -1632,12 +1642,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 )
{
@@ -1653,18 +1663,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;
@@ -2055,7 +2065,7 @@ gint gsb_transactions_list_choose_reconcile ( gint account_number,
label = gtk_label_new ( _("Select the reconciliation to associate to the selected transaction: ") );
gtk_misc_set_alignment ( GTK_MISC ( label ), 0.0, 0.0 );
- gtk_box_pack_start ( GTK_BOX (GTK_DIALOG (dialog) -> vbox),
+ gtk_box_pack_start ( GTK_BOX ( gtk_dialog_get_content_area GTK_DIALOG ( dialog ) ),
label,
FALSE, FALSE, 10 );
gtk_widget_show (label);
@@ -2064,7 +2074,7 @@ gint gsb_transactions_list_choose_reconcile ( gint account_number,
gtk_scrolled_window_set_policy ( GTK_SCROLLED_WINDOW (scrolled_window),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC );
- gtk_box_pack_start ( GTK_BOX (GTK_DIALOG (dialog) -> vbox),
+ gtk_box_pack_start ( GTK_BOX ( gtk_dialog_get_content_area GTK_DIALOG ( dialog ) ),
scrolled_window,
TRUE, TRUE, 0 );
gtk_widget_show (scrolled_window);
diff --git a/src/gtk_combofix.c b/src/gtk_combofix.c
index cda0c5b..6468570 100644
--- a/src/gtk_combofix.c
+++ b/src/gtk_combofix.c
@@ -297,7 +297,7 @@ gboolean gtk_combofix_hide_popup ( GtkComboFix *combofix )
g_return_val_if_fail ( combofix != NULL, FALSE );
g_return_val_if_fail ( GTK_IS_COMBOFIX ( combofix ), FALSE );
- if ( GTK_WIDGET_VISIBLE ( priv -> popup ))
+ if ( gtk_widget_get_visible ( priv -> popup ))
{
gtk_grab_remove ( priv -> popup );
gdk_pointer_ungrab ( GDK_CURRENT_TIME );
@@ -318,7 +318,7 @@ gboolean gtk_combofix_show_popup ( GtkComboFix *combofix )
{
GtkComboFixPrivate *priv = combofix -> priv;
- if ( GTK_WIDGET_VISIBLE ( priv -> popup ) )
+ if ( gtk_widget_get_visible ( priv -> popup ) )
return FALSE;
g_signal_handlers_block_by_func ( G_OBJECT ( combofix -> entry ),
@@ -609,9 +609,10 @@ static void gtk_combofix_init ( GtkComboFix *combofix )
GtkCellRenderer *cell_renderer;
GtkTreeViewColumn *tree_view_column;
GtkWidget *scrolled_window;
- GtkComboFixPrivate *priv = GTK_COMBOFIX_GET_PRIVATE ( combofix );
+ GtkComboFixPrivate *priv;
- combofix -> priv = priv;
+ combofix -> priv = GTK_COMBOFIX_GET_PRIVATE ( combofix );
+ priv = combofix -> priv;
/* set the fields of the combofix */
priv -> force = FALSE;
@@ -1299,6 +1300,7 @@ static gboolean gtk_combofix_set_popup_position ( GtkComboFix *combofix )
gint x, y;
gint height;
GdkRectangle rectangle;
+ GtkAllocation allocation;
gint horizontal_separator;
GtkComboFixPrivate *priv;
@@ -1307,13 +1309,13 @@ static gboolean gtk_combofix_set_popup_position ( GtkComboFix *combofix )
priv = combofix -> priv;
/* get the position of the combofix */
- gdk_window_get_origin ( GTK_WIDGET ( combofix->entry ) -> window, &x, &y );
+ gdk_window_get_origin ( gtk_widget_get_window ( combofix->entry ), &x, &y );
gtk_widget_style_get(GTK_WIDGET ( priv -> tree_view ),
"horizontal-separator", &horizontal_separator,
NULL );
- if ( GTK_WIDGET_REALIZED ( priv -> tree_view ) )
+ if ( gtk_widget_get_realized ( priv -> tree_view ) )
{
gtk_tree_view_get_cell_area ( GTK_TREE_VIEW ( priv -> tree_view),
gtk_tree_path_new_first ( ),
@@ -1323,14 +1325,20 @@ static gboolean gtk_combofix_set_popup_position ( GtkComboFix *combofix )
height = ( priv -> visible_items ) * ( rectangle.height + horizontal_separator ) + 4;
}
else
- height = ( priv -> visible_items ) * ( GTK_WIDGET (
- combofix -> entry ) -> allocation.height + horizontal_separator) + 4;
+ {
+ gtk_widget_get_allocation ( combofix -> entry, &allocation );
+
+ height = ( priv -> visible_items ) * ( allocation.height + horizontal_separator ) + 4;
+
+ }
/* if the popup is too small to contain all, we check to set it on the bottom or on the top
* if the place on the top is more than 2 times bigger than the bottom, we set it on the top */
- if ( ( ( gdk_screen_height ( ) - y - GTK_WIDGET ( combofix ) -> allocation.height ) < height )
- &&
- ( ( ( gdk_screen_height () - y ) * 3 ) < y ) )
+ gtk_widget_get_allocation ( GTK_WIDGET ( combofix ), &allocation );
+
+ if ( ( ( gdk_screen_height ( ) - y - allocation.height ) < height )
+ &&
+ ( ( ( gdk_screen_height () - y ) * 3 ) < y ) )
{
/* popup on the top */
if ( y > height )
@@ -1344,16 +1352,14 @@ static gboolean gtk_combofix_set_popup_position ( GtkComboFix *combofix )
else
{
/* popup on the bottom */
- y += GTK_WIDGET ( combofix ) -> allocation.height;
+ y += allocation.height;
if ( ( gdk_screen_height ( ) - y ) < height )
height = gdk_screen_height ( ) - y;
}
gtk_window_move ( GTK_WINDOW ( priv -> popup ), x, y );
- gtk_widget_set_size_request ( GTK_WIDGET ( priv -> popup ),
- GTK_WIDGET ( combofix ) -> allocation.width,
- height );
+ gtk_widget_set_size_request ( GTK_WIDGET ( priv -> popup ), allocation.width, height );
return FALSE;
}
@@ -1374,14 +1380,18 @@ static gboolean gtk_combofix_button_press ( GtkWidget *popup,
GdkEventButton *ev,
GtkComboFix *combofix )
{
- if ( ( ev -> x_root > ( GTK_WIDGET (popup) -> allocation.x ))
- &&
- ( ev -> x_root < ( GTK_WIDGET (popup) -> allocation.x + GTK_WIDGET (popup) -> allocation. width ))
- &&
- ( ev -> y_root > ( GTK_WIDGET (popup) -> allocation.y ))
- &&
- ( ev -> x_root < ( GTK_WIDGET (popup) -> allocation.y + GTK_WIDGET (popup) -> allocation. height)))
- return TRUE;
+ GtkAllocation allocation;
+
+ gtk_widget_get_allocation ( popup, &allocation );
+
+ if ( ( ev -> x_root > allocation.x )
+ &&
+ ( ev -> x_root < ( allocation.x + allocation. width ) )
+ &&
+ ( ev -> y_root > allocation.y )
+ &&
+ ( ev -> x_root < ( allocation.y +allocation. height ) ) )
+ return TRUE;
gdk_pointer_ungrab ( GDK_CURRENT_TIME );
gtk_widget_hide (popup);
@@ -1486,12 +1496,12 @@ 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_VISIBLE ( priv -> popup )
+ if ( gtk_widget_get_visible ( priv -> popup )
&&
strlen ( gtk_entry_get_text ( GTK_ENTRY ( combofix -> entry ) ) ) == 0 )
{
@@ -1507,8 +1517,8 @@ static gboolean gtk_combofix_key_press_event ( GtkWidget *entry,
return FALSE;
break;
- case GDK_Escape:
- if ( GTK_WIDGET_VISIBLE ( priv -> popup ))
+ case GDK_KEY_Escape:
+ if ( gtk_widget_get_visible ( priv -> popup ))
{
gtk_combofix_hide_popup ( combofix );
gtk_combofix_set_text ( combofix, priv -> old_entry );
@@ -1517,10 +1527,10 @@ 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_VISIBLE ( priv -> popup ) )
+ if ( !gtk_widget_get_visible ( priv -> popup ) )
gtk_combofix_show_popup ( combofix );
gtk_combofix_move_selection ( combofix, COMBOFIX_DOWN );
@@ -1528,11 +1538,11 @@ 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_VISIBLE ( priv -> popup))
+ if (gtk_widget_get_visible ( priv -> popup))
{
gtk_combofix_move_selection ( combofix, COMBOFIX_UP );
gtk_combofix_choose_selection ( combofix );
@@ -1540,10 +1550,10 @@ 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_VISIBLE ( priv -> popup ) )
+ if ( !gtk_widget_get_visible ( priv -> popup ) )
gtk_combofix_show_popup ( combofix );
gtk_combofix_move_selection ( combofix, COMBOFIX_PAGE_UP );
@@ -1551,10 +1561,10 @@ 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_VISIBLE ( priv -> popup ) )
+ if ( !gtk_widget_get_visible ( priv -> popup ) )
gtk_combofix_show_popup ( combofix );
gtk_combofix_move_selection ( combofix, COMBOFIX_PAGE_DOWN );
@@ -1838,7 +1848,11 @@ static gint gtk_combofix_get_rows_number_by_page ( GtkComboFix *combofix )
priv = combofix -> priv;
adjustment = gtk_tree_view_get_vadjustment ( GTK_TREE_VIEW ( priv -> tree_view ) );
- return_value = priv -> visible_items * adjustment -> page_size / adjustment -> upper;
+ return_value = priv -> visible_items
+ *
+ gtk_adjustment_get_page_size ( adjustment)
+ /
+ gtk_adjustment_get_upper ( adjustment );
return return_value;
}
@@ -2087,8 +2101,8 @@ void gtk_combofix_dialog ( gchar *text, gchar *hint )
dialog = gtk_message_dialog_new ( NULL,
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_WARNING, GTK_BUTTONS_CLOSE,
- "%s", tmp_str );
- gtk_label_set_markup ( GTK_LABEL ( GTK_MESSAGE_DIALOG (dialog)->label ), tmp_str );
+ NULL );
+ gtk_message_dialog_set_markup ( GTK_MESSAGE_DIALOG ( dialog ), tmp_str );
g_free ( tmp_str );
diff --git a/src/gtk_combofix.h b/src/gtk_combofix.h
index 75bf5f6..7473394 100644
--- a/src/gtk_combofix.h
+++ b/src/gtk_combofix.h
@@ -44,7 +44,7 @@ struct _GtkComboFix
GtkWidget *entry;
/* *** private entries *** */
- GtkComboFixPrivate *GSEAL (priv);
+ GtkComboFixPrivate *priv;
};
struct _GtkComboFixClass
diff --git a/src/help.c b/src/help.c
index 5991020..f7fba78 100644
--- a/src/help.c
+++ b/src/help.c
@@ -40,7 +40,6 @@
/*END_INCLUDE*/
/*START_STATIC*/
-static void launch_url (GtkAboutDialog *about, const gchar * link, gpointer data);
/*END_STATIC*/
@@ -49,30 +48,29 @@ static void launch_url (GtkAboutDialog *about, const gchar * link, gpointer data
/**
- * Handler used to pop up a web browser when user clicked on a link in
+ * Handler used to lauch a mailer or browser when user clicked on a link in
* the GtkAboutDialog.
*
- * \param about Dialog that triggered the event.
- * \param link URL to display.
- * \param data Not used.
+ * \param label link that triggered the event.
+ * \param uri URL to display.
+ * \param data Not used.
*/
-void launch_url (GtkAboutDialog *about, const gchar * link, gpointer data)
+static gboolean url_clicked ( GtkAboutDialog *label,
+ gchar *uri,
+ gpointer user_data )
{
- lance_navigateur_web ( link );
-}
+ if ( g_str_has_prefix ( uri, "mailto:" ) )
+ {
+ gchar *str;
+ str = gsb_string_remplace_string ( uri, "%40", "@" );
+ lance_mailer ( str );
+ g_free ( str );
+ }
+ else
+ lance_navigateur_web ( uri );
-/**
- * Handler used to pop up a mailer when user clicked on a link in
- * the GtkAboutDialog.
- *
- * \param about Dialog that triggered the event.
- * \param link URL to display.
- * \param data Not used.
- */
-void launch_mailto (GtkAboutDialog *about, const gchar * link, gpointer data)
-{
- lance_mailer ( link );
+ return TRUE;
}
@@ -203,8 +201,6 @@ NULL};
}
about = gtk_about_dialog_new ( );
- gtk_about_dialog_set_url_hook (launch_url, NULL, NULL);
- gtk_about_dialog_set_email_hook (launch_mailto, NULL, NULL);
gtk_about_dialog_set_program_name ( GTK_ABOUT_DIALOG (about), "Grisbi" );
gtk_about_dialog_set_logo ( GTK_ABOUT_DIALOG (about), logo );
gtk_about_dialog_set_comments ( GTK_ABOUT_DIALOG (about), comments );
@@ -225,6 +221,10 @@ NULL};
g_free ( plugins );
g_free ( version_to_string );
g_free ( comments );
+ g_signal_connect ( G_OBJECT ( about ),
+ "activate-link",
+ G_CALLBACK ( url_clicked ),
+ NULL );
gtk_dialog_run ( GTK_DIALOG (about)) ;
diff --git a/src/import.c b/src/import.c
index f1a3dc4..3502d1a 100644
--- a/src/import.c
+++ b/src/import.c
@@ -1236,7 +1236,7 @@ GtkWidget *cree_ligne_recapitulatif ( struct struct_compte_importation * compte
gtk_container_add ( GTK_CONTAINER ( alignement ), label );
gtk_box_pack_start ( GTK_BOX ( compte -> hbox1 ), alignement, FALSE, FALSE, 0 );
- compte -> bouton_type_compte = gsb_combo_box_new_with_index_by_list (
+ compte -> bouton_type_compte = gsb_combo_box_new_with_index_from_list (
gsb_account_property_create_combobox_list (),
NULL, NULL );
gtk_box_pack_start ( GTK_BOX ( compte -> hbox1 ), compte -> bouton_type_compte,
@@ -1271,7 +1271,7 @@ GtkWidget *cree_ligne_recapitulatif ( struct struct_compte_importation * compte
radio_add_account = gtk_radio_button_new_with_label_from_widget ( GTK_RADIO_BUTTON ( radiogroup ),
_("Add transactions to an account") );
gtk_box_pack_start ( GTK_BOX ( vbox ), radio_add_account, FALSE, FALSE, 0 );
- if (radio_add_account && GTK_WIDGET_VISIBLE (radio_add_account))
+ if (radio_add_account && gtk_widget_get_visible (radio_add_account))
gtk_widget_set_sensitive ( radio_add_account, assert_account_loaded ( ) );
compte -> hbox2 = gtk_hbox_new ( FALSE, 6 );
@@ -1420,10 +1420,10 @@ gint gsb_import_add_currency ( struct struct_compte_importation * compte )
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_QUESTION,
GTK_BUTTONS_YES_NO,
- "%s", text );
- gtk_label_set_markup ( GTK_LABEL ( GTK_MESSAGE_DIALOG ( dialog ) ->label ), text );
+ NULL );
+ gtk_message_dialog_set_markup ( GTK_MESSAGE_DIALOG ( dialog ), text );
- vbox = GTK_DIALOG(dialog) -> vbox;
+ vbox = dialog_get_content_area ( dialog );
checkbox = gtk_check_button_new_with_label (
_("Use this currency for totals for the payees categories\n"
@@ -1464,17 +1464,17 @@ gboolean import_account_action_activated ( GtkWidget * radio, gint action )
account = g_object_get_data ( G_OBJECT ( radio ), "account" );
- if (account -> hbox1 && GTK_WIDGET_VISIBLE (account -> hbox1))
+ if (account -> hbox1 && gtk_widget_get_visible (account -> hbox1))
gtk_widget_set_sensitive ( account -> hbox1, FALSE );
- if (account -> hbox2 && GTK_WIDGET_VISIBLE (account -> hbox2))
+ if (account -> hbox2 && gtk_widget_get_visible (account -> hbox2))
gtk_widget_set_sensitive ( account -> hbox2, FALSE );
- if (account -> hbox3 && GTK_WIDGET_VISIBLE (account -> hbox3))
+ if (account -> hbox3 && gtk_widget_get_visible (account -> hbox3))
gtk_widget_set_sensitive ( account -> hbox3, FALSE );
gtk_widget_set_sensitive ( g_object_get_data ( G_OBJECT ( radio ), "associated" ), TRUE );
account -> action = action;
- if ( account -> hbox_rule && GTK_WIDGET_VISIBLE (account -> hbox_rule) )
+ if ( account -> hbox_rule && gtk_widget_get_visible (account -> hbox_rule) )
gtk_widget_set_sensitive ( account -> hbox_rule, action != IMPORT_CREATE_ACCOUNT );
return FALSE;
}
@@ -2288,7 +2288,7 @@ void confirmation_enregistrement_ope_import ( struct struct_compte_importation *
}
label = gtk_label_new ( tmpstr );
gtk_misc_set_alignment ( GTK_MISC ( label ), 0.0, 0.0 );
- gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG ( dialog )-> vbox ),
+ gtk_box_pack_start ( GTK_BOX ( dialog_get_content_area ( dialog ) ),
label,
FALSE,
FALSE,
@@ -2298,7 +2298,7 @@ void confirmation_enregistrement_ope_import ( struct struct_compte_importation *
/* set the decoration */
frame = gtk_frame_new (NULL);
- gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG ( dialog )-> vbox ), frame, TRUE, TRUE, 0 );
+ gtk_box_pack_start ( GTK_BOX ( dialog_get_content_area ( dialog ) ), frame, TRUE, TRUE, 0 );
gtk_widget_show ( frame );
vbox = gtk_vbox_new ( FALSE, 0 );
@@ -3252,7 +3252,7 @@ void gsb_import_show_orphan_transactions ( GSList *orphan_list,
label = gtk_label_new ( _("Mark transactions you want to add to the list and click the "
"OK button"));
gtk_misc_set_alignment ( GTK_MISC ( label ), 0.0, 0.0 );
- gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG ( dialog ) -> vbox ),
+ gtk_box_pack_start ( GTK_BOX ( dialog_get_content_area ( dialog ) ),
label,
FALSE,
FALSE,
@@ -3296,7 +3296,7 @@ void gsb_import_show_orphan_transactions ( GSList *orphan_list,
scrolled_window = gtk_scrolled_window_new ( FALSE, FALSE );
gtk_widget_set_size_request ( scrolled_window, -1, 300 );
- gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG ( dialog ) -> vbox ),
+ gtk_box_pack_start ( GTK_BOX ( dialog_get_content_area ( dialog ) ),
scrolled_window,
TRUE,
TRUE,
@@ -4570,7 +4570,7 @@ gchar **gsb_import_by_rule_ask_filename ( gint rule )
/* Ugly dance to avoid side effects on dialog's vbox. */
hbox = gtk_hbox_new ( FALSE, 0 );
- gtk_box_pack_start ( GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox, FALSE, FALSE, 0 );
+ gtk_box_pack_start ( GTK_BOX ( dialog_get_content_area ( dialog ) ), hbox, FALSE, FALSE, 0 );
paddingbox = new_paddingbox_with_title ( hbox, TRUE, tmpstr );
gtk_container_set_border_width ( GTK_CONTAINER(hbox), 6 );
gtk_container_set_border_width ( GTK_CONTAINER(paddingbox), 6 );
diff --git a/src/import_csv.c b/src/import_csv.c
index 1236759..37891a8 100644
--- a/src/import_csv.c
+++ b/src/import_csv.c
@@ -133,14 +133,14 @@ GtkWidget * import_create_csv_preview_page ( GtkWidget * assistant )
hbox = gtk_hbox_new ( FALSE, 12 );
gtk_box_pack_start ( GTK_BOX(paddingbox), hbox, FALSE, FALSE, 0 );
- combobox = gtk_combo_box_new_text ();
+ combobox = gtk_combo_box_text_new ();
do
{
gchar * complete_name = g_strdup_printf ( "%s : \"%s\"",
_(csv_separators [ i ] . name),
( csv_separators [ i ] . value ?
csv_separators [ i ] . value : "" ) );
- gtk_combo_box_append_text ( GTK_COMBO_BOX ( combobox ), complete_name );
+ gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( combobox ), complete_name );
g_free ( complete_name );
}
diff --git a/src/imputation_budgetaire.c b/src/imputation_budgetaire.c
index fc44341..1d28fb7 100644
--- a/src/imputation_budgetaire.c
+++ b/src/imputation_budgetaire.c
@@ -771,7 +771,7 @@ gboolean edit_budgetary_line ( GtkTreeView * view )
/* Ugly dance to avoid side effects on dialog's vbox. */
hbox = gtk_hbox_new ( FALSE, 0 );
- gtk_box_pack_start ( GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox, FALSE, FALSE, 0 );
+ gtk_box_pack_start ( GTK_BOX ( dialog_get_content_area ( dialog ) ), hbox, FALSE, FALSE, 0 );
paddingbox = new_paddingbox_with_title ( hbox, TRUE, title );
gtk_container_set_border_width ( GTK_CONTAINER(hbox), 6 );
gtk_container_set_border_width ( GTK_CONTAINER(paddingbox), 6 );
diff --git a/src/main.c b/src/main.c
index 82f6c70..03712e9 100644
--- a/src/main.c
+++ b/src/main.c
@@ -575,7 +575,7 @@ GtkWidget *gsb_main_create_main_window ( void )
G_CALLBACK ( main_window_key_press_event ),
NULL );
- gtk_window_set_policy ( GTK_WINDOW ( run.window ), TRUE, TRUE, FALSE );
+ gtk_window_set_resizable ( GTK_WINDOW ( run.window ), TRUE );
/* create the main window : a vbox */
vbox = gtk_vbox_new ( FALSE, 0 );
diff --git a/src/metatree.c b/src/metatree.c
index cb921ae..a883d8f 100644
--- a/src/metatree.c
+++ b/src/metatree.c
@@ -1762,7 +1762,7 @@ gboolean find_destination_blob ( MetatreeInterface * iface,
g_free ( tmpstr2 );
hbox = gtk_hbox_new ( FALSE, 6 );
- gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG ( dialog ) -> vbox ), hbox,
+ gtk_box_pack_start ( GTK_BOX ( dialog_get_content_area ( dialog ) ), hbox,
FALSE, FALSE, 0 );
if ( iface -> content == 0 )
@@ -1862,7 +1862,7 @@ gboolean find_destination_blob ( MetatreeInterface * iface,
/* other choice, just remove the division */
hbox = gtk_hbox_new ( FALSE, 6 );
- gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG ( dialog ) -> vbox ), hbox,
+ gtk_box_pack_start ( GTK_BOX ( dialog_get_content_area ( dialog ) ), hbox,
FALSE, FALSE, 0 );
if ( iface -> content == 0 )
@@ -2874,11 +2874,11 @@ gboolean metatree_find_destination_blob ( MetatreeInterface *iface,
g_free ( tmp_str_2 );
g_free ( tmp_str_3 );
- gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG ( dialog ) -> vbox ), button, FALSE, FALSE, 0 );
+ gtk_box_pack_start ( GTK_BOX ( dialog_get_content_area ( dialog ) ), button, FALSE, FALSE, 0 );
/* create the list containing division and sub-division without the current division */
hbox = gtk_hbox_new ( FALSE, 6 );
- gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG ( dialog ) -> vbox ), hbox, FALSE, FALSE, 0 );
+ gtk_box_pack_start ( GTK_BOX ( dialog_get_content_area ( dialog ) ), hbox, FALSE, FALSE, 0 );
label = gtk_label_new ( _("Select the destination: ") );
gtk_misc_set_alignment ( GTK_MISC ( label ), 0, 0 );
@@ -2899,7 +2899,7 @@ gboolean metatree_find_destination_blob ( MetatreeInterface *iface,
button_action_selected = 0;
hbox = gtk_hbox_new ( FALSE, 6 );
- gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG ( dialog ) -> vbox ), hbox, FALSE, FALSE, 0 );
+ gtk_box_pack_start ( GTK_BOX ( dialog_get_content_area ( dialog ) ), hbox, FALSE, FALSE, 0 );
label = gtk_label_new ( _("Select the destination: ") );
gtk_misc_set_alignment ( GTK_MISC ( label ), 0, 0 );
@@ -3730,7 +3730,7 @@ static gboolean metatree_select_transactions_destination ( MetatreeInterface *if
NULL );
g_free ( tmp_str_1 );
- gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG ( dialog ) -> vbox ), button_1, FALSE, FALSE, 0 );
+ gtk_box_pack_start ( GTK_BOX ( dialog_get_content_area ( dialog ) ), button_1, FALSE, FALSE, 0 );
tmp_str_2 = g_strdup ( gsb_data_transaction_get_notes ( transaction_number ) );
if ( tmp_str_2 )
@@ -3743,12 +3743,12 @@ static gboolean metatree_select_transactions_destination ( MetatreeInterface *if
g_free ( tmp_str_1 );
g_free ( tmp_str_2 );
- gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG ( dialog ) -> vbox ), button_2, FALSE, FALSE, 0 );
+ gtk_box_pack_start ( GTK_BOX ( dialog_get_content_area ( dialog ) ), button_2, FALSE, FALSE, 0 );
}
/* create the list containing division and sub-division without the current division */
hbox = gtk_hbox_new ( FALSE, 6 );
- gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG ( dialog ) -> vbox ), hbox, FALSE, FALSE, 0 );
+ gtk_box_pack_start ( GTK_BOX ( dialog_get_content_area ( dialog ) ), hbox, FALSE, FALSE, 0 );
label = gtk_label_new ( _("Select the destination: ") );
gtk_misc_set_alignment ( GTK_MISC ( label ), 0, 0 );
diff --git a/src/navigation.c b/src/navigation.c
index 32706a1..30579fc 100644
--- a/src/navigation.c
+++ b/src/navigation.c
@@ -203,11 +203,13 @@ GtkWidget *gsb_gui_navigation_create_navigation_pane ( void )
{
GtkWidget * sw, *vbox;
GQueue *tmp_queue;
- GtkCellRenderer * renderer;
- GtkTreeDragDestIface * navigation_dst_iface;
- GtkTreeDragSourceIface * navigation_src_iface;
- GtkTreeViewColumn * column;
- gint i;
+ GtkCellRenderer *renderer;
+ GtkTreeDragDestIface *navigation_dst_iface;
+ GtkTreeDragSourceIface *navigation_src_iface;
+ GtkTreeViewColumn *column;
+ gint i;
+ gint xpad;
+ gint ypad;
vbox = gtk_vbox_new ( FALSE, 6 );
@@ -305,8 +307,10 @@ GtkWidget *gsb_gui_navigation_create_navigation_pane ( void )
gtk_tree_view_column_set_expand ( column, FALSE );
/* Text renderer. */
- renderer = gtk_cell_renderer_text_new();
- renderer -> xpad = 6;
+ renderer = gtk_cell_renderer_text_new ();
+
+ gtk_cell_renderer_get_padding ( GTK_CELL_RENDERER ( renderer ), &xpad, &ypad );
+ gtk_cell_renderer_set_padding ( GTK_CELL_RENDERER ( renderer ), 6, ypad );
gtk_tree_view_column_pack_start(GTK_TREE_VIEW_COLUMN(column), renderer, TRUE);
gtk_tree_view_column_add_attribute(GTK_TREE_VIEW_COLUMN(column), renderer,
"text", NAVIGATION_TEXT);
@@ -356,8 +360,8 @@ GtkWidget *gsb_gui_navigation_create_navigation_pane ( void )
GINT_TO_POINTER ( 1 ) );
gtk_widget_show_all ( vbox );
- gtk_widget_hide_all ( scheduler_calendar );
- gtk_widget_hide_all ( reconcile_panel );
+ gtk_widget_hide ( scheduler_calendar );
+ gtk_widget_hide ( reconcile_panel );
return vbox;
}
@@ -1121,7 +1125,7 @@ gboolean gsb_gui_navigation_select_line ( GtkTreeSelection *selection,
if ( page_number != GSB_SCHEDULER_PAGE )
{
- gtk_widget_hide_all ( scheduler_calendar );
+ gtk_widget_hide ( scheduler_calendar );
}
switch ( page_number )
@@ -1509,15 +1513,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;
@@ -1535,7 +1539,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/parametres.c b/src/parametres.c
index 897a375..da18de0 100644
--- a/src/parametres.c
+++ b/src/parametres.c
@@ -2,7 +2,7 @@
/* */
/* Copyright (C) 2000-2008 Cédric Auger (cedric at grisbi.org) */
/* 2003-2009 Benjamin Drieu (bdrieu at april.org) */
-/* 2008-2012 Pierre Biava (grisbi at pierre.biava.name) */
+/* 2008-2013 Pierre Biava (grisbi at pierre.biava.name) */
/* http://www.grisbi.org */
/* */
/* This program is free software; you can redistribute it and/or modify */
@@ -91,11 +91,11 @@ static gboolean gsb_gui_delete_msg_toggled ( GtkCellRendererToggle *cell, gchar
GtkTreeModel * model );
static gboolean gsb_gui_messages_toggled ( GtkCellRendererToggle *cell, gchar *path_str,
GtkTreeModel * model );
-static void gsb_localisation_decimal_point_changed ( GtkComboBox *widget, gpointer user_data );
+static void gsb_localisation_decimal_point_changed ( GtkComboBoxText *widget, gpointer user_data );
static gboolean gsb_localisation_format_date_toggle ( GtkToggleButton *togglebutton,
GdkEventButton *event,
gpointer user_data);
-static void gsb_localisation_thousands_sep_changed ( GtkComboBox *widget, gpointer user_data );
+static void gsb_localisation_thousands_sep_changed ( GtkComboBoxText *widget, gpointer user_data );
static void gsb_localisation_update_affichage ( gint type_maj );
static GtkWidget *onglet_delete_messages ( void );
static GtkWidget *onglet_fichier ( void );
@@ -852,7 +852,7 @@ gboolean preferences ( gint page )
gtk_widget_show_all ( hpaned );
gtk_container_set_border_width ( GTK_CONTAINER(hpaned), 6 );
- gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG(fenetre_preferences) -> vbox ),
+ gtk_box_pack_start ( GTK_BOX ( dialog_get_content_area ( fenetre_preferences ) ),
hpaned, TRUE, TRUE, 0);
/* balance estimate subtree */
@@ -1709,11 +1709,11 @@ GtkWidget *gsb_config_number_format_chosen ( GtkWidget *parent, gint sens )
gtk_size_group_add_widget ( GTK_SIZE_GROUP ( size_group ), label );
gtk_box_pack_start ( GTK_BOX ( dec_hbox ), label, FALSE, FALSE, 0 );
- dec_sep = gtk_combo_box_entry_new_text ( );
- gtk_editable_set_editable ( GTK_EDITABLE ( GTK_BIN ( dec_sep ) -> child ), FALSE );
- gtk_entry_set_width_chars ( GTK_ENTRY ( GTK_BIN ( dec_sep ) -> child ), 5 );
- gtk_combo_box_append_text ( GTK_COMBO_BOX ( dec_sep ), "." );
- gtk_combo_box_append_text ( GTK_COMBO_BOX ( dec_sep ), "," );
+ dec_sep = gtk_combo_box_text_new_with_entry ( );
+ gtk_editable_set_editable ( GTK_EDITABLE ( gtk_bin_get_child ( GTK_BIN ( dec_sep ) ) ), FALSE );
+ gtk_entry_set_width_chars ( GTK_ENTRY ( gtk_bin_get_child ( GTK_BIN ( dec_sep ) ) ), 5 );
+ gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( dec_sep ), "." );
+ gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( dec_sep ), "," );
gtk_box_pack_start ( GTK_BOX ( dec_hbox ), dec_sep, FALSE, FALSE, 0 );
thou_hbox = gtk_hbox_new ( FALSE, 0 );
@@ -1722,13 +1722,13 @@ GtkWidget *gsb_config_number_format_chosen ( GtkWidget *parent, gint sens )
gtk_size_group_add_widget ( GTK_SIZE_GROUP ( size_group ), label );
gtk_box_pack_start ( GTK_BOX ( thou_hbox ), label, FALSE, FALSE, 0 );
- thou_sep = gtk_combo_box_entry_new_text ( );
- gtk_editable_set_editable ( GTK_EDITABLE ( GTK_BIN ( thou_sep ) -> child ), FALSE );
- gtk_entry_set_width_chars ( GTK_ENTRY ( GTK_BIN ( thou_sep ) -> child ), 5 );
- gtk_combo_box_append_text ( GTK_COMBO_BOX ( thou_sep ), "' '" );
- gtk_combo_box_append_text ( GTK_COMBO_BOX ( thou_sep ), "." );
- gtk_combo_box_append_text ( GTK_COMBO_BOX ( thou_sep ), "," );
- gtk_combo_box_append_text ( GTK_COMBO_BOX ( thou_sep ), "''" );
+ thou_sep = gtk_combo_box_text_new_with_entry ( );
+ gtk_editable_set_editable ( GTK_EDITABLE ( gtk_bin_get_child ( GTK_BIN ( thou_sep ) ) ), FALSE );
+ gtk_entry_set_width_chars ( GTK_ENTRY ( gtk_bin_get_child ( GTK_BIN ( thou_sep ) ) ), 5 );
+ gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( thou_sep ), "' '" );
+ gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( thou_sep ), "." );
+ gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( thou_sep ), "," );
+ gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( thou_sep ), "''" );
gtk_box_pack_start ( GTK_BOX ( thou_hbox ), thou_sep, FALSE, FALSE, 0 );
@@ -1789,21 +1789,21 @@ GtkWidget *gsb_config_number_format_chosen ( GtkWidget *parent, gint sens )
*
*
* */
-void gsb_localisation_decimal_point_changed ( GtkComboBox *widget, gpointer user_data )
+void gsb_localisation_decimal_point_changed ( GtkComboBoxText *widget, gpointer user_data )
{
GtkWidget *combo_box;
GtkWidget *entry;
gchar *str_capital;
const gchar *text;
- text = gtk_combo_box_get_active_text ( widget );
+ text = gtk_combo_box_text_get_active_text ( widget );
combo_box = g_object_get_data ( G_OBJECT ( widget ), "separator" );
if ( g_strcmp0 ( text, "," ) == 0 )
{
gsb_locale_set_mon_decimal_point ( "," );
- if ( g_strcmp0 ( gtk_combo_box_get_active_text ( GTK_COMBO_BOX ( combo_box ) ), "," ) == 0 )
+ if ( g_strcmp0 ( gtk_combo_box_text_get_active_text ( GTK_COMBO_BOX_TEXT ( combo_box ) ), "," ) == 0 )
{
gsb_locale_set_mon_thousands_sep ( " " );
gtk_combo_box_set_active ( GTK_COMBO_BOX ( combo_box ), 0 );
@@ -1812,7 +1812,7 @@ void gsb_localisation_decimal_point_changed ( GtkComboBox *widget, gpointer user
else
{
gsb_locale_set_mon_decimal_point ( "." );
- if ( g_strcmp0 ( gtk_combo_box_get_active_text ( GTK_COMBO_BOX ( combo_box ) ), "." ) == 0 )
+ if ( g_strcmp0 ( gtk_combo_box_text_get_active_text ( GTK_COMBO_BOX_TEXT ( combo_box ) ), "." ) == 0 )
{
gsb_locale_set_mon_thousands_sep ( "," );
gtk_combo_box_set_active ( GTK_COMBO_BOX ( combo_box ), 2 );
@@ -1842,14 +1842,14 @@ void gsb_localisation_decimal_point_changed ( GtkComboBox *widget, gpointer user
*
*
* */
-void gsb_localisation_thousands_sep_changed ( GtkComboBox *widget, gpointer user_data )
+void gsb_localisation_thousands_sep_changed ( GtkComboBoxText *widget, gpointer user_data )
{
GtkWidget *combo_box;
GtkWidget *entry;
gchar *str_capital;
const gchar *text;
- text = gtk_combo_box_get_active_text ( widget );
+ text = gtk_combo_box_text_get_active_text ( widget );
combo_box = g_object_get_data ( G_OBJECT ( widget ), "separator" );
if ( g_strcmp0 ( text, "' '" ) == 0 )
@@ -1860,7 +1860,7 @@ void gsb_localisation_thousands_sep_changed ( GtkComboBox *widget, gpointer user
{
gsb_locale_set_mon_thousands_sep ( "." );
- if ( g_strcmp0 ( gtk_combo_box_get_active_text ( GTK_COMBO_BOX ( combo_box ) ), "." ) == 0 )
+ if ( g_strcmp0 ( gtk_combo_box_text_get_active_text ( GTK_COMBO_BOX_TEXT ( combo_box ) ), "." ) == 0 )
{
gsb_locale_set_mon_decimal_point ( "," );
gtk_combo_box_set_active ( GTK_COMBO_BOX ( combo_box ), 1 );
@@ -1870,7 +1870,7 @@ void gsb_localisation_thousands_sep_changed ( GtkComboBox *widget, gpointer user
{
gsb_locale_set_mon_thousands_sep ( "," );
- if ( g_strcmp0 ( gtk_combo_box_get_active_text ( GTK_COMBO_BOX ( combo_box ) ), "," ) == 0 )
+ if ( g_strcmp0 ( gtk_combo_box_text_get_active_text ( GTK_COMBO_BOX_TEXT ( combo_box ) ), "," ) == 0 )
{
gsb_locale_set_mon_decimal_point ( "." );
gtk_combo_box_set_active ( GTK_COMBO_BOX ( combo_box ), 0 );
diff --git a/src/plugins/openssl/openssl.c b/src/plugins/openssl/openssl.c
index b05e84a..7018c55 100644
--- a/src/plugins/openssl/openssl.c
+++ b/src/plugins/openssl/openssl.c
@@ -328,7 +328,7 @@ gchar *gsb_file_util_ask_for_crypt_key ( gchar * file_name, gchar * additional_m
gtk_dialog_set_default_response ( GTK_DIALOG ( dialog ), GTK_RESPONSE_OK );
hbox = gtk_hbox_new ( FALSE, 6 );
- gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG ( dialog ) -> vbox), hbox, TRUE, TRUE, 6 );
+ gtk_box_pack_start ( GTK_BOX ( gtk_dialog_get_content_area ( GTK_DIALOG ( dialog ) ) ), hbox, TRUE, TRUE, 6 );
/* Ugly dance to force alignement. */
vbox = gtk_vbox_new ( FALSE, 6 );
diff --git a/src/print_report.c b/src/print_report.c
index d0f8453..819f4aa 100644
--- a/src/print_report.c
+++ b/src/print_report.c
@@ -130,10 +130,13 @@ gboolean print_report_begin ( GtkPrintOperation *operation,
gint nb_pages;
gint i;
gint table_size = 0;
+ guint nrows;
+ guint ncols;
devel_debug (NULL);
/* initialize globals variables */
+ gtk_table_get_size ( GTK_TABLE ( table_etat ), &nrows, &ncols );
cr = gtk_print_context_get_cairo_context (context);
size_row = pango_font_description_get_size (gsb_data_print_config_get_report_font_transactions ())/PANGO_SCALE;
size_title = pango_font_description_get_size (gsb_data_print_config_get_report_font_title ())/PANGO_SCALE;
@@ -144,15 +147,17 @@ gboolean print_report_begin ( GtkPrintOperation *operation,
page_width = gtk_print_context_get_width (context);
/* get the width of each columns */
- if (columns_width)
- g_free (columns_width);
- columns_width = g_malloc0 (GTK_TABLE (table_etat) -> ncols * sizeof (gdouble));
+ if ( columns_width )
+ g_free ( columns_width );
+
+ columns_width = g_malloc0 ( ncols * sizeof ( gdouble ) );
/* get first the size of the table */
- for (i=0 ; i<GTK_TABLE (table_etat) -> ncols ; i++)
- table_size = table_size + (GTK_TABLE (table_etat) -> cols)[i].allocation;
- for (i=0 ; i<GTK_TABLE (table_etat) -> ncols ; i++)
- columns_width[i] = (page_width * (GTK_TABLE (table_etat) -> cols)[i].allocation) / table_size;
+ for ( i = 0; i < ncols ; i++ )
+ table_size = table_size + ( GTK_TABLE ( table_etat ) -> cols)[i].allocation;
+
+ for ( i = 0; i < ncols ; i++ )
+ columns_width[i] = ( page_width * ( GTK_TABLE ( table_etat ) -> cols)[i].allocation ) / table_size;
/* calculate the nb of rows in 1 page and in the first page */
nb_rows_per_page = page_height / size_row;
@@ -161,10 +166,9 @@ gboolean print_report_begin ( GtkPrintOperation *operation,
/* calculate the number of pages,
* it's not too difficult because each line has the same size
* except the title */
- nb_pages = ceil (((GTK_TABLE (table_etat) -> nrows - 1)*size_row + size_title) / page_height);
+ nb_pages = ceil ( ( ( nrows - 1 ) * size_row + size_title ) / page_height );
- gtk_print_operation_set_n_pages ( GTK_PRINT_OPERATION (operation),
- nb_pages );
+ gtk_print_operation_set_n_pages ( GTK_PRINT_OPERATION ( operation ), nb_pages );
current_child_table = NULL;
current_child_line = 0;
@@ -192,16 +196,15 @@ gboolean print_report_draw_page ( GtkPrintOperation *operation,
gpointer null )
{
GList *children;
- gint nb_columns;
- gint nb_lines;
+ guint nb_columns;
+ guint nb_lines;
gint rows_drawed = 0;
gint previous_line = -1;
gboolean is_title = FALSE;
devel_debug_int (page);
- nb_columns = GTK_TABLE (table_etat) -> ncols;
- nb_lines = GTK_TABLE (table_etat) -> nrows;
+ gtk_table_get_size ( GTK_TABLE ( table_etat ), &nb_lines, &nb_columns );
/* children begins with the last GtkTableChild added, so we need to inverse */
if (page)
diff --git a/src/tiers_onglet.c b/src/tiers_onglet.c
index 8fbf23b..571a2b4 100644
--- a/src/tiers_onglet.c
+++ b/src/tiers_onglet.c
@@ -670,7 +670,7 @@ gboolean edit_payee ( GtkTreeView * view )
/* Ugly dance to avoid side effects on dialog's vbox. */
hbox = gtk_hbox_new ( FALSE, 0 );
- gtk_box_pack_start ( GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox, FALSE, FALSE, 0 );
+ gtk_box_pack_start ( GTK_BOX ( dialog_get_content_area ( dialog ) ), hbox, FALSE, FALSE, 0 );
paddingbox = new_paddingbox_with_title ( hbox, TRUE, title );
gtk_container_set_border_width ( GTK_CONTAINER(hbox), 6 );
gtk_container_set_border_width ( GTK_CONTAINER(paddingbox), 6 );
diff --git a/src/tip.c b/src/tip.c
index 9349eb6..b97f012 100644
--- a/src/tip.c
+++ b/src/tip.c
@@ -139,7 +139,7 @@ void display_tip ( gboolean force )
checkbox = gsb_automem_checkbutton_new ( _("Display tips at next start"),
&(conf.show_tip), NULL, NULL );
- gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG(dialog) -> vbox ), checkbox, FALSE, FALSE, 6 );
+ gtk_box_pack_start ( GTK_BOX ( dialog_get_content_area ( dialog ) ), checkbox, FALSE, FALSE, 6 );
gtk_widget_show ( checkbox );
btn_back = gtk_dialog_add_button (GTK_DIALOG(dialog), GTK_STOCK_GO_BACK, 1);
@@ -167,8 +167,7 @@ void display_tip ( gboolean force )
g_dgettext (NULL, tips[conf.last_tip] ),
NULL );
- gtk_label_set_markup ( GTK_LABEL ( GTK_MESSAGE_DIALOG(dialog) -> label ),
- tmpstr );
+ gtk_message_dialog_set_markup ( GTK_MESSAGE_DIALOG ( dialog ), tmpstr );
g_free ( tmpstr );
break;
@@ -181,8 +180,7 @@ void display_tip ( gboolean force )
g_dgettext (NULL, tips[conf.last_tip] ),
NULL );
- gtk_label_set_markup ( GTK_LABEL ( GTK_MESSAGE_DIALOG(dialog) -> label ),
- tmpstr );
+ gtk_message_dialog_set_markup ( GTK_MESSAGE_DIALOG ( dialog ), tmpstr );
g_free ( tmpstr );
gtk_widget_set_sensitive (btn_back, TRUE);
break;
diff --git a/src/utils.c b/src/utils.c
index a11a3bf..899520d 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -63,7 +63,7 @@ gboolean met_en_prelight ( GtkWidget *event_box,
gpointer pointeur )
{
if ( pointeur == NULL )
- gtk_widget_set_state ( GTK_WIDGET ( GTK_BIN (event_box)->child ), GTK_STATE_PRELIGHT );
+ gtk_widget_set_state ( gtk_bin_get_child ( GTK_BIN ( event_box ) ), GTK_STATE_PRELIGHT );
else
{
GSList *list = ( GSList* ) pointeur;
@@ -73,7 +73,7 @@ gboolean met_en_prelight ( GtkWidget *event_box,
GtkWidget *widget;
widget = list -> data;
- gtk_widget_set_state ( GTK_WIDGET ( GTK_BIN ( widget )->child ), GTK_STATE_PRELIGHT );
+ gtk_widget_set_state ( gtk_bin_get_child ( GTK_BIN ( widget ) ), GTK_STATE_PRELIGHT );
list = list -> next;
}
@@ -92,7 +92,7 @@ gboolean met_en_normal ( GtkWidget *event_box,
gpointer pointeur )
{
if ( pointeur == NULL )
- gtk_widget_set_state ( GTK_WIDGET ( GTK_BIN (event_box)->child ), GTK_STATE_NORMAL );
+ gtk_widget_set_state ( gtk_bin_get_child ( GTK_BIN ( event_box ) ), GTK_STATE_NORMAL );
else
{
GSList *list = ( GSList* ) pointeur;
@@ -103,7 +103,7 @@ gboolean met_en_normal ( GtkWidget *event_box,
widget = list -> data;
- gtk_widget_set_state ( GTK_WIDGET ( GTK_BIN ( widget )->child ), GTK_STATE_NORMAL );
+ gtk_widget_set_state ( gtk_bin_get_child ( GTK_BIN ( widget ) ), GTK_STATE_NORMAL );
list = list -> next;
}
@@ -171,7 +171,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;
@@ -246,6 +246,40 @@ 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.
@@ -456,12 +490,9 @@ gchar *get_gtk_run_version ( void )
* */
void lance_mailer ( const gchar *uri )
{
- gchar *chaine;
GError *error = NULL;
- chaine = g_strconcat ( "mailto:", uri, NULL );
-
- if ( gtk_show_uri ( NULL, chaine, GDK_CURRENT_TIME, &error ) == FALSE )
+ if ( gtk_show_uri ( NULL, uri, GDK_CURRENT_TIME, &error ) == FALSE )
{
gchar *tmp_str;
@@ -472,7 +503,6 @@ void lance_mailer ( const gchar *uri )
dialogue_error_hint ( tmp_str, _("Cannot execute mailer") );
g_free(tmp_str);
}
- g_free ( chaine );
}
diff --git a/src/utils_buttons.c b/src/utils_buttons.c
index 80551bf..10d787a 100644
--- a/src/utils_buttons.c
+++ b/src/utils_buttons.c
@@ -157,6 +157,7 @@ void set_popup_position (GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpo
{
GtkWidget *widget;
GtkRequisition requisition;
+ GtkAllocation allocation;
gint screen_width, menu_xpos, menu_ypos, menu_width;
widget = GTK_WIDGET (user_data);
@@ -164,13 +165,14 @@ void set_popup_position (GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpo
gtk_widget_get_child_requisition (GTK_WIDGET (menu), &requisition);
menu_width = requisition.width;
- gdk_window_get_origin (widget->window, &menu_xpos, &menu_ypos);
+ gdk_window_get_origin ( gtk_widget_get_window ( widget ), &menu_xpos, &menu_ypos );
- menu_xpos += widget->allocation.x;
- menu_ypos += widget->allocation.y + widget->allocation.height - 2;
+ gtk_widget_get_allocation ( widget, &allocation );
+ menu_xpos += allocation.x;
+ menu_ypos += allocation.y + allocation.height - 2;
- if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
- menu_xpos = menu_xpos + widget->allocation.width - menu_width;
+ if ( gtk_widget_get_direction ( widget) == GTK_TEXT_DIR_RTL )
+ menu_xpos = menu_xpos + allocation.width - menu_width;
/* Clamp the position on screen */
screen_width = gdk_screen_get_width (gtk_widget_get_screen (widget));
diff --git a/src/utils_files.c b/src/utils_files.c
index 042f90d..f6b344e 100644
--- a/src/utils_files.c
+++ b/src/utils_files.c
@@ -530,7 +530,7 @@ gchar *utils_files_create_sel_charset ( GtkWidget *assistant,
vbox = gtk_vbox_new ( FALSE, 6 );
gtk_container_set_border_width ( GTK_CONTAINER(vbox), 12 );
- gtk_container_add ( GTK_CONTAINER ( GTK_DIALOG ( dialog ) -> vbox ), vbox );
+ gtk_container_add ( GTK_CONTAINER ( dialog_get_content_area ( dialog ) ), vbox );
/* Warning label */
hbox = gtk_hbox_new ( FALSE, 6 );
hooks/post-receive
--
grisbi
More information about the cvs
mailing list