[grisbi-cvs] [SCM] grisbi branch, master, updated. upstream_version_0_7_3-67-gc3e34ca
Pierre Biava
nobody at users.sourceforge.net
Sun Oct 3 19:00:54 CEST 2010
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 c3e34ca527862fa6fa80a797ee85340b1dc9f771 (commit)
via 60bfc8ae6214e37227983eac6b279177b24ce7dd (commit)
from e0024b6b3523da3cd7da930c142b9de04993bd18 (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 c3e34ca527862fa6fa80a797ee85340b1dc9f771
Author: pbiava <pierre.biava at nerim.net>
Date: Sun Oct 3 17:33:48 2010 +0200
modification of toolbars for the simulator of credits
commit 60bfc8ae6214e37227983eac6b279177b24ce7dd
Author: pbiava <pierre.biava at nerim.net>
Date: Sun Oct 3 16:52:47 2010 +0200
fixed bug 1175 and minor changes
-----------------------------------------------------------------------
Changes:
diff --git a/src/accueil.c b/src/accueil.c
index 88688c0..90f259b 100644
--- a/src/accueil.c
+++ b/src/accueil.c
@@ -101,7 +101,6 @@ extern GtkWidget *form_transaction_part;
extern gsb_real null_real;
extern GSList *scheduled_transactions_taken;
extern GSList *scheduled_transactions_to_take;
-extern gchar *titre_fichier;
extern GtkWidget *window;
/*END_EXTERN*/
@@ -133,10 +132,17 @@ gint mise_a_jour_fin_comptes_passifs;
GtkSizeGroup * size_group_accueil;
gchar *chaine_espace = " ";
-/* ************************************************************************* */
+/**
+ * Create the home page of Grisbi
+ *
+ *
+ *
+ * */
GtkWidget *creation_onglet_accueil ( void )
{
GtkWidget *paddingbox, *base, *base_scroll;
+ GtkWidget * eb;
+ GtkStyle * style;
devel_debug ( NULL );
@@ -155,42 +161,29 @@ GtkWidget *creation_onglet_accueil ( void )
gtk_widget_show ( base_scroll );
gtk_widget_show ( base );
- /* en dessous, on met le titre du fichier s'il existe */
- if ( titre_fichier )
- {
- GtkWidget * eb;
- GtkStyle * style;
-
- hbox_title = gtk_hbox_new ( FALSE, 0 );
-
- eb = gtk_event_box_new ();
- style = gtk_widget_get_style ( eb );
- gtk_widget_modify_bg ( eb, 0, &(style -> bg[GTK_STATE_ACTIVE]) );
+ /* en dessous, on met le titre du fichier */
+ hbox_title = gtk_hbox_new ( FALSE, 0 );
- label_titre_fichier = gtk_label_new ( titre_fichier );
- gsb_main_page_update_homepage_title ( titre_fichier );
+ eb = gtk_event_box_new ();
+ style = gtk_widget_get_style ( eb );
+ gtk_widget_modify_bg ( eb, 0, &(style -> bg[GTK_STATE_ACTIVE]) );
- if ( etat.utilise_logo )
- {
- logo_accueil = gtk_image_new_from_pixbuf (
- gsb_select_icon_get_logo_pixbuf ( ) );
-
- gtk_box_pack_start ( GTK_BOX ( hbox_title ), logo_accueil, FALSE, FALSE, 20 );
- gtk_widget_set_size_request ( hbox_title, -1, LOGO_HEIGHT + 20 );
- }
+ label_titre_fichier = gtk_label_new ( NULL );
- gtk_box_pack_end ( GTK_BOX ( hbox_title ), label_titre_fichier, TRUE, TRUE, 20 );
- gtk_container_set_border_width ( GTK_CONTAINER ( hbox_title ), 6 );
- gtk_container_add ( GTK_CONTAINER(eb), hbox_title );
- gtk_box_pack_start ( GTK_BOX ( base ), eb, FALSE, FALSE, 0 );
- gtk_widget_show_all ( eb );
- }
- else
+ if ( etat.utilise_logo )
{
- label_titre_fichier = gtk_label_new ( NULL );
- gtk_box_pack_start ( GTK_BOX ( base ), label_titre_fichier, FALSE, FALSE, 0 );
+ logo_accueil = gtk_image_new_from_pixbuf ( gsb_select_icon_get_logo_pixbuf ( ) );
+
+ gtk_box_pack_start ( GTK_BOX ( hbox_title ), logo_accueil, FALSE, FALSE, 20 );
+ gtk_widget_set_size_request ( hbox_title, -1, LOGO_HEIGHT + 20 );
}
+ gtk_box_pack_end ( GTK_BOX ( hbox_title ), label_titre_fichier, TRUE, TRUE, 20 );
+ gtk_container_set_border_width ( GTK_CONTAINER ( hbox_title ), 6 );
+ gtk_container_add ( GTK_CONTAINER ( eb ), hbox_title );
+ gtk_box_pack_start ( GTK_BOX ( base ), eb, FALSE, FALSE, 0 );
+ gtk_widget_show_all ( eb );
+
/* on crée le size_group pour l'alignement des tableaux */
size_group_accueil = gtk_size_group_new ( GTK_SIZE_GROUP_HORIZONTAL );
@@ -280,7 +273,6 @@ GtkWidget *creation_onglet_accueil ( void )
return ( base_scroll );
}
-/* ************************************************************************* */
/**
@@ -1184,8 +1176,6 @@ gint affiche_soldes_additionnels ( GtkWidget *table, gint i, GSList *liste )
return nbre_lignes;
}
-/* ************************************************************************* */
-
/**
* called by a click on an account name or balance of accounts on the main page
@@ -1205,10 +1195,12 @@ gboolean gsb_main_page_click_on_account ( gint *account_number )
}
-
-
-
-/* ************************************************************************* */
+/**
+ *
+ *
+ *
+ *
+ * */
void update_liste_echeances_manuelles_accueil ( gboolean force )
{
devel_debug_int (force);
@@ -1345,9 +1337,8 @@ void update_liste_echeances_manuelles_accueil ( gboolean force )
hide_paddingbox ( frame_etat_echeances_manuelles_accueil );
}
}
-/* ************************************************************************* */
-/* ************************************************************************* */
+
void update_liste_echeances_auto_accueil ( gboolean force )
{
if ( !force
@@ -1470,14 +1461,16 @@ void update_liste_echeances_auto_accueil ( gboolean force )
hide_paddingbox ( frame_etat_echeances_auto_accueil );
}
}
-/* ************************************************************************* */
-/* ************************************************************************* */
-/* Fonction update_soldes_minimaux */
-/* vérifie les soldes de tous les comptes, affiche un message d'alerte si nécessaire */
-/* et ajoute dans l'accueil les comptes sous les soldes minimaux */
-/* ************************************************************************* */
+/**
+ * Fonction update_soldes_minimaux
+ * vérifie les soldes de tous les comptes, affiche un message d'alerte si nécessaire
+ *
+ *
+ *
+ *
+ * */
void update_soldes_minimaux ( gboolean force )
{
GtkWidget *vbox_1;
@@ -2135,24 +2128,26 @@ GtkWidget *onglet_accueil (void)
/**
* update the title of the main page
*
+ * \param title
+ *
+ *
* */
-void gsb_main_page_update_homepage_title ( gchar *title )
+void gsb_main_page_update_homepage_title ( const gchar *title )
{
- gchar * tmpstr;
+ gchar * tmp_str;
/* at the first use of grisbi,label_titre_fichier doesn't still exist */
if ( !label_titre_fichier || !GTK_IS_LABEL ( label_titre_fichier ) )
return;
- if ( title && strlen ( title ) > 0 )
- tmpstr = g_markup_printf_escaped ("<span size=\"x-large\">%s</span>", title );
- else
- tmpstr = g_strconcat ("<span size=\"x-large\">", _("My accounts"), "</span>", NULL );
+ tmp_str = g_markup_printf_escaped ("<span size=\"x-large\">%s</span>", title );
- gtk_label_set_markup ( GTK_LABEL ( label_titre_fichier ), tmpstr );
- g_free ( tmpstr );
+ gtk_label_set_markup ( GTK_LABEL ( label_titre_fichier ), tmp_str );
+ g_free ( tmp_str );
}
+
+
/* Local Variables: */
/* c-basic-offset: 4 */
/* End: */
diff --git a/src/accueil.h b/src/accueil.h
index 17c25cd..a7e52d3 100644
--- a/src/accueil.h
+++ b/src/accueil.h
@@ -19,7 +19,7 @@
void affiche_dialogue_soldes_minimaux ( void );
GtkWidget *creation_onglet_accueil ( void );
gboolean gsb_main_page_update_finished_scheduled_transactions ( gint scheduled_number );
-void gsb_main_page_update_homepage_title ( gchar *title );
+void gsb_main_page_update_homepage_title ( const gchar *title );
void mise_a_jour_accueil ( gboolean force );
GtkWidget *onglet_accueil (void);
/* END_DECLARATION */
diff --git a/src/affichage.c b/src/affichage.c
index ce5d265..f790ec4 100644
--- a/src/affichage.c
+++ b/src/affichage.c
@@ -103,11 +103,8 @@ extern GdkColor default_split_background;
extern GdkColor default_text_color[2];
extern GtkWidget *fenetre_preferences;
extern GtkWidget *hbox_title;
-extern gchar *initial_file_title;
-extern gchar *initial_holder_title;
extern GtkWidget *label_titre_fichier;
extern GtkWidget *logo_accueil;
-extern gchar *nom_fichier_comptes;
extern GdkColor split_background;
extern GdkColor text_color[2];
extern gchar *titre_fichier;
@@ -376,53 +373,46 @@ GtkWidget *onglet_display_addresses ( void )
paddingbox = new_paddingbox_with_title ( vbox_pref, FALSE, _("Titles") );
/* It first creates the entry of title */
- entry = gsb_automem_entry_new ( &initial_file_title,
+ entry = gsb_automem_entry_new ( &titre_fichier,
( GCallback ) update_homepage_title, NULL );
/* Choice of title type */
hbox = gtk_hbox_new ( FALSE, 6 );
gtk_box_pack_start ( GTK_BOX ( paddingbox ), hbox, FALSE, FALSE, 0);
- radiogroup = radio = gtk_radio_button_new_with_label ( NULL,
- _("Accounts file title") );
- g_object_set_data ( G_OBJECT(radio), "display",
- GINT_TO_POINTER ( GSB_ACCOUNTS_TITLE ) );
- gtk_box_pack_start ( GTK_BOX( hbox ), radio, FALSE, FALSE, 0 );
- if ( etat.display_grisbi_title == GSB_ACCOUNTS_TITLE )
- gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON (radio), TRUE );
- g_signal_connect ( G_OBJECT(radio),
+ radiogroup = gtk_radio_button_new_with_label ( NULL, _("Accounts file title") );
+ g_object_set_data ( G_OBJECT ( radiogroup ), "display", GINT_TO_POINTER ( GSB_ACCOUNTS_TITLE ) );
+ if ( conf.display_grisbi_title == GSB_ACCOUNTS_TITLE )
+ gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON ( radiogroup ), TRUE );
+ g_signal_connect ( G_OBJECT ( radiogroup ),
"toggled",
- G_CALLBACK(change_grisbi_title_type),
+ G_CALLBACK ( change_grisbi_title_type ),
entry );
+ gtk_box_pack_start ( GTK_BOX( hbox ), radiogroup, FALSE, FALSE, 0 );
- if ( initial_holder_title && strlen ( initial_holder_title ) )
- {
- radio = gtk_radio_button_new_with_label_from_widget (
- GTK_RADIO_BUTTON ( radiogroup ),
- _("Account owner name") );
- g_object_set_data ( G_OBJECT ( radio ), "display",
- GINT_TO_POINTER ( GSB_ACCOUNT_HOLDER ) );
- gtk_box_pack_start ( GTK_BOX( hbox ), radio, FALSE, FALSE, 0 );
- if ( etat.display_grisbi_title == GSB_ACCOUNT_HOLDER )
+ radio = gtk_radio_button_new_with_label_from_widget (
+ GTK_RADIO_BUTTON ( radiogroup ),
+ _("Account owner name") );
+ g_object_set_data ( G_OBJECT ( radio ), "display", GINT_TO_POINTER ( GSB_ACCOUNT_HOLDER ) );
+ if ( conf.display_grisbi_title == GSB_ACCOUNT_HOLDER )
gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON ( radio ), TRUE );
- g_signal_connect ( G_OBJECT ( radio ),
+ g_signal_connect ( G_OBJECT ( radio ),
"toggled",
G_CALLBACK ( change_grisbi_title_type ),
entry );
- }
+ gtk_box_pack_start ( GTK_BOX( hbox ), radio, FALSE, FALSE, 0 );
radio = gtk_radio_button_new_with_label_from_widget (
- GTK_RADIO_BUTTON(radiogroup),
+ GTK_RADIO_BUTTON ( radiogroup ),
_("Filename") );
- g_object_set_data ( G_OBJECT(radio), "display",
- GINT_TO_POINTER ( GSB_ACCOUNTS_FILE ) );
- gtk_box_pack_start ( GTK_BOX( hbox ), radio, FALSE, FALSE, 0 );
- if ( etat.display_grisbi_title == GSB_ACCOUNTS_FILE )
- gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON (radio), TRUE );
- g_signal_connect ( G_OBJECT(radio),
+ g_object_set_data ( G_OBJECT ( radio ), "display", GINT_TO_POINTER ( GSB_ACCOUNTS_FILE ) );
+ if ( conf.display_grisbi_title == GSB_ACCOUNTS_FILE )
+ gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON ( radio ), TRUE );
+ g_signal_connect ( G_OBJECT ( radio ),
"toggled",
- G_CALLBACK(change_grisbi_title_type),
+ G_CALLBACK ( change_grisbi_title_type ),
entry );
+ gtk_box_pack_start ( GTK_BOX( hbox ), radio, FALSE, FALSE, 0 );
hbox = gtk_hbox_new ( FALSE, 6 );
gtk_box_pack_start ( GTK_BOX ( paddingbox ), hbox,
@@ -432,7 +422,7 @@ GtkWidget *onglet_display_addresses ( void )
gtk_box_pack_start ( GTK_BOX ( hbox ), label,
FALSE, FALSE, 0);
- if ( etat.display_grisbi_title == GSB_ACCOUNTS_TITLE )
+ if ( conf.display_grisbi_title == GSB_ACCOUNTS_TITLE )
gtk_widget_set_sensitive ( entry, TRUE);
else
gtk_widget_set_sensitive ( entry, FALSE);
@@ -663,27 +653,13 @@ static gboolean preferences_view_update_preview_logo ( GtkFileChooser *file_choo
gboolean update_homepage_title (GtkEntry *entry, gchar *value,
gint length, gint * position)
{
- if ( initial_file_title && strlen ( initial_file_title ) )
- g_free ( initial_file_title );
+ if ( titre_fichier && strlen ( titre_fichier ) )
+ g_free ( titre_fichier );
- initial_file_title = my_strdup ( gtk_entry_get_text ( GTK_ENTRY ( entry ) ) );
-
- if ( initial_file_title && strlen ( initial_file_title ) > 0 )
- {
- gsb_main_page_update_homepage_title ( initial_file_title );
-
- if ( etat.display_grisbi_title == GSB_ACCOUNTS_TITLE )
- {
- if ( titre_fichier && strlen ( titre_fichier ) )
- g_free ( titre_fichier );
- titre_fichier = my_strdup ( initial_file_title );
- }
- }
- else if ( GTK_IS_LABEL ( label_titre_fichier ) )
- gtk_label_set_text ( GTK_LABEL ( label_titre_fichier ), "" );
+ titre_fichier = my_strdup ( gtk_entry_get_text ( GTK_ENTRY ( entry ) ) );
- /* Update window title */
- gsb_file_update_window_title ( );
+ /* set Grisbi title */
+ gsb_main_set_grisbi_title ( -1 );
/* Mark file as modified */
if ( etat.modification_fichier == 0 )
@@ -1000,57 +976,34 @@ static gboolean preferences_view_color_default ( GtkWidget *button,
*/
gboolean change_grisbi_title_type ( GtkRadioButton *button, GtkWidget *entry )
{
- gint account_number;
- gchar *tmpstr = NULL;
-
- if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(button)) )
+ if ( gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON ( button ) ) )
{
- etat.display_grisbi_title = GPOINTER_TO_INT (g_object_get_data
- ( G_OBJECT ( button ), "display" ));
+ conf.display_grisbi_title = GPOINTER_TO_INT ( g_object_get_data
+ ( G_OBJECT ( button ), "display" ) );
}
- if (titre_fichier && strlen (titre_fichier) )
- g_free (titre_fichier);
-
- switch ( etat.display_grisbi_title )
+ switch ( conf.display_grisbi_title )
{
case GSB_ACCOUNTS_TITLE:
- gtk_widget_set_sensitive ( entry, TRUE);
- if (initial_file_title && strlen (initial_file_title) )
- {
- gtk_entry_set_text ( GTK_ENTRY (entry), initial_file_title );
- titre_fichier = my_strdup ( initial_file_title );
- }
+ gtk_widget_set_sensitive ( entry, TRUE );
+ if ( titre_fichier && strlen ( titre_fichier ) )
+ gtk_entry_set_text ( GTK_ENTRY ( entry ), titre_fichier );
else
{
- gtk_entry_set_text ( GTK_ENTRY (entry), _("My accounts") );
- titre_fichier = g_strdup ( _("My accounts") );
+ gtk_entry_set_text ( GTK_ENTRY ( entry ), "" );
+ titre_fichier = NULL;
}
break;
case GSB_ACCOUNT_HOLDER:
gtk_widget_set_sensitive ( entry, FALSE);
- account_number = gsb_gui_navigation_get_current_account ( );
- if ( account_number == -1 )
- {
- account_number = gsb_gui_navigation_get_last_account ( );
- if ( account_number == -1 )
- account_number = 0;
- }
- tmpstr = my_strdup ( gsb_data_account_get_holder_name (account_number) );
- if (tmpstr && strlen (tmpstr) )
- {
- titre_fichier = my_strdup ( tmpstr );
- g_free ( tmpstr );
- }
break;
case GSB_ACCOUNTS_FILE:
- gtk_widget_set_sensitive ( entry, FALSE);
- titre_fichier = g_path_get_basename ( nom_fichier_comptes );
+ gtk_widget_set_sensitive ( entry, FALSE);
break;
}
- gsb_file_update_window_title ( );
- gsb_main_page_update_homepage_title ( titre_fichier );
+ /* set Grisbi title */
+ gsb_main_set_grisbi_title ( gsb_gui_navigation_get_current_account ( ) );
return FALSE;
}
diff --git a/src/bet_finance_ui.c b/src/bet_finance_ui.c
index fffd078..182b005 100644
--- a/src/bet_finance_ui.c
+++ b/src/bet_finance_ui.c
@@ -85,7 +85,10 @@ static GtkWidget *bet_finance_create_data_tree_view ( GtkWidget *container );
static GtkWidget *bet_finance_create_duration_widget ( GtkWidget *parent );
static GtkWidget *bet_finance_create_saisie_widget ( GtkWidget *parent );
static GtkWidget *bet_finance_create_simulator_page ( void );
-static GtkWidget *bet_finance_create_simulator_toolbar ( GtkWidget *parent, GtkWidget *tree_view );
+static GtkWidget *bet_finance_create_simulator_toolbar ( GtkWidget *parent,
+ GtkWidget *tree_view,
+ gboolean simulator,
+ gboolean amortization );
static gboolean bet_finance_data_list_button_press ( GtkWidget *tree_view,
GdkEventButton *ev,
GtkWidget *page );
@@ -297,7 +300,7 @@ GtkWidget *bet_finance_create_simulator_page ( void )
g_object_set_data ( G_OBJECT ( tree_view ), "label_title", label_title );
/* on y ajoute la barre d'outils */
- toolbar = bet_finance_create_simulator_toolbar ( page, tree_view );
+ toolbar = bet_finance_create_simulator_toolbar ( page, tree_view, TRUE, FALSE );
gtk_box_pack_start ( GTK_BOX ( page ), toolbar, FALSE, FALSE, 0 );
gtk_box_reorder_child ( GTK_BOX ( page ), toolbar, 0 );
@@ -1119,7 +1122,7 @@ GtkWidget *bet_finance_create_amortization_page ( void )
g_object_set_data ( G_OBJECT ( tree_view ), "label_title", label_title );
/* on y ajoute la barre d'outils */
- toolbar = bet_finance_create_amortization_toolbar ( page, tree_view );
+ toolbar = bet_finance_create_simulator_toolbar ( page, tree_view, FALSE, TRUE );
gtk_box_pack_start ( GTK_BOX ( page ), toolbar, FALSE, FALSE, 0 );
gtk_box_reorder_child ( GTK_BOX ( page ), toolbar, 0 );
@@ -1493,6 +1496,7 @@ GtkWidget *bet_finance_create_account_page ( void )
GtkWidget *tree_view;
GtkWidget *handlebox;
GtkWidget *button;
+ GtkWidget *toolbar;
devel_debug (NULL);
@@ -1552,39 +1556,10 @@ GtkWidget *bet_finance_create_account_page ( void )
g_object_set_data ( G_OBJECT ( account_page ), "bet_finance_tree_view", tree_view );
g_object_set_data ( G_OBJECT ( tree_view ), "label_title", label_title );
-
- /* Export button */
- handlebox = gtk_handle_box_new ( );
- hbox = gtk_hbox_new ( FALSE, 0 );
- gtk_container_add ( GTK_CONTAINER ( handlebox ), hbox );
-
- button = gsb_automem_stock_button_new ( etat.display_toolbar,
- GTK_STOCK_PRINT,
- _("Print"),
- NULL,
- NULL );
- gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ), _("Print the array") );
- g_signal_connect ( G_OBJECT ( button ),
- "clicked",
- G_CALLBACK ( print_tree_view_list ),
- tree_view );
- gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, FALSE, 5 );
-
- /* Export button */
- button = gsb_automem_stock_button_new ( etat.display_toolbar,
- GTK_STOCK_SAVE,
- _("Export"),
- NULL,
- NULL );
- gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ), SPACIFY ( _("Export the array") ) );
- g_signal_connect ( G_OBJECT ( button ),
- "clicked",
- G_CALLBACK ( bet_finance_ui_export_tab ),
- tree_view );
- gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, FALSE, 5 );
-
- gtk_box_pack_start ( GTK_BOX ( page ), handlebox, FALSE, FALSE, 0 );
- gtk_box_reorder_child ( GTK_BOX ( page ), handlebox, 0 );
+ /* on y ajoute la barre d'outils */
+ toolbar = bet_finance_create_simulator_toolbar ( page, tree_view, FALSE, FALSE );
+ gtk_box_pack_start ( GTK_BOX ( page ), toolbar, FALSE, FALSE, 0 );
+ gtk_box_reorder_child ( GTK_BOX ( page ), toolbar, 0 );
gtk_widget_show_all ( page );
@@ -1758,7 +1733,10 @@ void bet_finance_ui_struct_amortization_free ( struct_amortissement *s_amortisse
*
*
* */
-GtkWidget *bet_finance_create_simulator_toolbar ( GtkWidget *parent, GtkWidget *tree_view )
+GtkWidget *bet_finance_create_simulator_toolbar ( GtkWidget *parent,
+ GtkWidget *tree_view,
+ gboolean simulator,
+ gboolean amortization )
{
GtkWidget *handlebox;
GtkWidget *hbox;
@@ -1772,104 +1750,54 @@ GtkWidget *bet_finance_create_simulator_toolbar ( GtkWidget *parent, GtkWidget *
hbox = gtk_hbox_new ( FALSE, 0 );
gtk_container_add ( GTK_CONTAINER ( handlebox ), hbox );
+ if ( simulator )
+ {
/* création du bouton calculer */
- button = gsb_automem_stock_button_new ( etat.display_toolbar,
+ button = gsb_automem_stock_button_new ( etat.display_toolbar,
GTK_STOCK_EXECUTE,
_("Calculate"),
NULL,
NULL );
- gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ), _("Calculate") );
- g_signal_connect ( G_OBJECT ( button ),
+ gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ), _("Calculate") );
+ g_signal_connect ( G_OBJECT ( button ),
"clicked",
G_CALLBACK ( bet_finance_calculer_clicked ),
parent );
- g_object_set_data ( G_OBJECT ( parent ), "calculate_button", button );
- gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, FALSE, 5 );
+ g_object_set_data ( G_OBJECT ( parent ), "calculate_button", button );
+ gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, FALSE, 5 );
- /* création du bouton afficher le tableau d'amortissement */
- selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( tree_view ) );
- button = gsb_automem_imagefile_button_new ( etat.display_toolbar,
+ /* création du bouton afficher le tableau d'amortissement */
+ selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( tree_view ) );
+ button = gsb_automem_imagefile_button_new ( etat.display_toolbar,
_("Amortization"),
"ac_liability_16.png",
NULL,
NULL );
- gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ), _("View amortization table") );
- g_signal_connect ( G_OBJECT ( button ),
+ gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ), _("View amortization table") );
+ g_signal_connect ( G_OBJECT ( button ),
"clicked",
G_CALLBACK ( bet_finance_fill_amortization_array ),
selection );
- gtk_widget_set_sensitive ( button, FALSE );
- g_object_set_data ( G_OBJECT ( parent ), "amortization_button", button );
- gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, FALSE, 5 );
-
- /* création du bouton print */
- button = gsb_automem_stock_button_new ( etat.display_toolbar,
- GTK_STOCK_PRINT,
- _("Print"),
- NULL,
- NULL );
- gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ), _("Print the array") );
- g_signal_connect ( G_OBJECT ( button ),
- "clicked",
- G_CALLBACK ( print_tree_view_list ),
- tree_view );
- gtk_widget_set_sensitive ( button, FALSE );
- g_object_set_data ( G_OBJECT ( parent ), "print_button", button );
- gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, FALSE, 5 );
-
- /* Export button */
- button = gsb_automem_stock_button_new ( etat.display_toolbar,
- GTK_STOCK_SAVE,
- _("Export"),
- NULL,
- NULL );
- gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ), SPACIFY ( _("Export the array") ) );
- g_signal_connect ( G_OBJECT ( button ),
- "clicked",
- G_CALLBACK ( bet_finance_ui_export_tab ),
- tree_view );
- gtk_widget_set_sensitive ( button, FALSE );
- g_object_set_data ( G_OBJECT ( parent ), "export_button", button );
- gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, FALSE, 5 );
-
- gtk_widget_show_all ( handlebox );
-
- return ( handlebox );
-
-}
-
-
-/**
- *
- *
- *
- *
- * */
-GtkWidget *bet_finance_create_amortization_toolbar ( GtkWidget *parent, GtkWidget *tree_view )
-{
- GtkWidget *handlebox;
- GtkWidget *hbox;
- GtkWidget *button;
-
- /* HandleBox */
- handlebox = gtk_handle_box_new ( );
-
- /* Hbox */
- hbox = gtk_hbox_new ( FALSE, 0 );
- gtk_container_add ( GTK_CONTAINER ( handlebox ), hbox );
+ gtk_widget_set_sensitive ( button, FALSE );
+ g_object_set_data ( G_OBJECT ( parent ), "amortization_button", button );
+ gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, FALSE, 5 );
+ }
- /* création du bouton afficher le simulateur de crédits */
- button = gsb_automem_imagefile_button_new ( etat.display_toolbar,
+ if ( amortization )
+ {
+ /* création du bouton afficher le simulateur de crédits */
+ button = gsb_automem_imagefile_button_new ( etat.display_toolbar,
_("Credits"),
"ac_liability_16.png",
NULL,
NULL );
- gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ), _("View credits simulator") );
- g_signal_connect ( G_OBJECT ( button ),
+ gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ), _("View credits simulator") );
+ g_signal_connect ( G_OBJECT ( button ),
"clicked",
G_CALLBACK ( bet_finance_switch_simulator_page ),
NULL );
- gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, FALSE, 5 );
+ gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, FALSE, 5 );
+ }
/* création du bouton print */
button = gsb_automem_stock_button_new ( etat.display_toolbar,
@@ -1882,6 +1810,9 @@ GtkWidget *bet_finance_create_amortization_toolbar ( GtkWidget *parent, GtkWidge
"clicked",
G_CALLBACK ( print_tree_view_list ),
tree_view );
+ if ( simulator )
+ gtk_widget_set_sensitive ( button, FALSE );
+ g_object_set_data ( G_OBJECT ( parent ), "print_button", button );
gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, FALSE, 5 );
/* Export button */
@@ -1895,6 +1826,9 @@ GtkWidget *bet_finance_create_amortization_toolbar ( GtkWidget *parent, GtkWidge
"clicked",
G_CALLBACK ( bet_finance_ui_export_tab ),
tree_view );
+ if ( simulator )
+ gtk_widget_set_sensitive ( button, FALSE );
+ g_object_set_data ( G_OBJECT ( parent ), "export_button", button );
gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, FALSE, 5 );
gtk_widget_show_all ( handlebox );
diff --git a/src/gsb_account_property.c b/src/gsb_account_property.c
index dd0b238..45a6aee 100644
--- a/src/gsb_account_property.c
+++ b/src/gsb_account_property.c
@@ -179,7 +179,6 @@ extern gint mise_a_jour_liste_comptes_accueil;
extern gint mise_a_jour_liste_echeances_manuelles_accueil;
extern gint mise_a_jour_soldes_minimaux;
extern gsb_real null_real;
-extern gchar *titre_fichier;
/*END_EXTERN*/
@@ -1514,7 +1513,6 @@ gboolean gsb_account_property_focus_out ( GtkWidget *widget,
{
gint origin = GPOINTER_TO_INT (p_origin);
gint account_number;
- const gchar *tmpstr;
account_number = gsb_gui_navigation_get_current_account ();
if ( account_number == -1)
@@ -1540,10 +1538,7 @@ gboolean gsb_account_property_focus_out ( GtkWidget *widget,
payee_fill_tree ();
break;
case PROPERTY_HOLDER_NAME:
- tmpstr = gtk_entry_get_text ( GTK_ENTRY ( widget ) );
- titre_fichier = my_strdup ( tmpstr );
- gsb_main_page_update_homepage_title ( titre_fichier );
- gsb_file_update_window_title ( );
+ gsb_main_set_grisbi_title ( account_number );
break;
}
diff --git a/src/gsb_file.c b/src/gsb_file.c
index 2db3a56..c1fac86 100644
--- a/src/gsb_file.c
+++ b/src/gsb_file.c
@@ -89,8 +89,6 @@ gint id_timeout = 0;
/*START_EXTERN*/
extern gchar *copy_old_filename;
-extern gchar *initial_file_title;
-extern gchar *initial_holder_title;
extern GtkWidget *main_hpaned;
extern GtkWidget *main_vbox;
extern GtkWidget * navigation_tree_view;
@@ -202,33 +200,6 @@ void gsb_file_new_gui ( void )
/* Display accounts in menus */
gsb_menu_update_accounts_in_menus ();
- /* Initialisation du titre pour grisbi */
- if (titre_fichier && strlen (titre_fichier) )
- g_free (titre_fichier);
-
- switch ( etat.display_grisbi_title )
- {
- case GSB_ACCOUNTS_TITLE:
- titre_fichier = my_strdup ( initial_file_title );
- break;
- case GSB_ACCOUNT_HOLDER:
- if ( initial_holder_title && strlen ( initial_holder_title ) )
- titre_fichier = my_strdup ( initial_holder_title );
- else
- {
- etat.display_grisbi_title = GSB_ACCOUNTS_TITLE;
- titre_fichier = my_strdup ( initial_file_title );
- }
- break;
- case GSB_ACCOUNTS_FILE:
- titre_fichier = my_strdup ( nom_fichier_comptes );
- break;
- }
-
- /* Affiche le nom du fichier de comptes dans le titre de la fenetre */
- gsb_file_update_window_title();
- gsb_main_page_update_homepage_title ( titre_fichier );
-
gtk_notebook_set_current_page ( GTK_NOTEBOOK( notebook_general ), GSB_HOME_PAGE );
gtk_widget_show ( notebook_general );
@@ -495,6 +466,9 @@ gboolean gsb_file_open_file ( gchar *filename )
list_tmp = list_tmp -> next;
}
+ /* set Grisbi title */
+ gsb_main_set_grisbi_title ( -1 );
+
/* update the main page */
mise_a_jour_accueil (TRUE);
@@ -622,7 +596,7 @@ gboolean gsb_file_save_file ( gint origine )
/* update variables */
etat.fichier_deja_ouvert = 0;
modification_fichier ( FALSE );
- gsb_file_update_window_title ();
+ gsb_main_set_grisbi_title ( gsb_gui_navigation_get_current_account ( ) );
gsb_file_append_name_to_opened_list ( nom_fichier_comptes );
}
@@ -928,9 +902,11 @@ static gchar *gsb_file_dialog_ask_name ( void )
if ( ! nom_fichier_comptes )
{
- gchar* tmpstr = g_strconcat ( titre_fichier, ".gsb", NULL );
- gtk_file_chooser_set_current_name ( GTK_FILE_CHOOSER ( dialog ), tmpstr);
- g_free ( tmpstr );
+ gchar* tmp_str;
+
+ tmp_str = g_strconcat ( titre_fichier, ".gsb", NULL );
+ gtk_file_chooser_set_current_name ( GTK_FILE_CHOOSER ( dialog ), tmp_str);
+ g_free ( tmp_str );
}
else
gtk_file_chooser_select_filename ( GTK_FILE_CHOOSER (dialog), nom_fichier_comptes );
@@ -1005,7 +981,7 @@ gboolean gsb_file_close ( void )
init_variables ();
gsb_account_property_clear_config ( );
- gsb_file_update_window_title();
+ gsb_main_set_grisbi_title ( -1 );
menus_sensitifs ( FALSE );
@@ -1021,38 +997,6 @@ gboolean gsb_file_close ( void )
/**
- * set/update the name of the file on the title of the window
- *
- * \param
- *
- * \return
- * */
-void gsb_file_update_window_title ( void )
-{
- gchar *titre = NULL;
-
- devel_debug ( "gsb_file_update_window_title" );
-
- if ( titre_fichier && strlen ( titre_fichier ) )
- titre = g_strdup ( titre_fichier );
- else
- {
- if ( nom_fichier_comptes )
- titre = g_path_get_basename ( nom_fichier_comptes );
- else
- titre = g_strconcat ( "<", _("unnamed"), ">", NULL );
- }
-
- titre = g_strconcat ( titre, " - ", _("Grisbi"), NULL );
- gtk_window_set_title ( GTK_WINDOW ( window ), titre );
-
- if ( titre && strlen ( titre ) > 0 )
- g_free ( titre );
-}
-
-
-
-/**
* append a new name to the list of recently opened file
*
* \param path_fichier
diff --git a/src/gsb_file.h b/src/gsb_file.h
index 7db04d3..e200b4a 100644
--- a/src/gsb_file.h
+++ b/src/gsb_file.h
@@ -24,6 +24,5 @@ gboolean gsb_file_save ( void );
gboolean gsb_file_save_as ( void );
void gsb_file_set_backup_path ( const gchar *path );
void gsb_file_update_last_path ( const gchar *last_path );
-void gsb_file_update_window_title ( void );
/* END_DECLARATION */
#endif
diff --git a/src/gsb_file_config.c b/src/gsb_file_config.c
index 7dd673d..c8f58f7 100644
--- a/src/gsb_file_config.c
+++ b/src/gsb_file_config.c
@@ -442,7 +442,7 @@ devel_debug (NULL);
"Show closed accounts",
NULL );
- etat.display_grisbi_title = g_key_file_get_integer ( config,
+ conf.display_grisbi_title = g_key_file_get_integer ( config,
"Display",
"Display grisbi title",
NULL );
@@ -838,7 +838,7 @@ gboolean gsb_file_config_save_config ( void )
g_key_file_set_integer ( config,
"Display",
"Display grisbi title",
- etat.display_grisbi_title );
+ conf.display_grisbi_title );
/* save messages */
for ( i = 0; messages[i].name; i ++ )
@@ -1356,7 +1356,7 @@ void gsb_file_config_clean_config ( void )
etat.automatic_completion_payee = 1; /* by default automatic completion */
etat.limit_completion_to_current_account = 0; /* By default, do full search */
- etat.display_grisbi_title = GSB_ACCOUNTS_TITLE; /* show Accounts file title par défaut */
+ conf.display_grisbi_title = GSB_ACCOUNTS_TITLE; /* show Accounts file title par défaut */
etat.display_toolbar = GSB_BUTTON_BOTH; /* How to display toolbar icons. */
etat.show_toolbar = TRUE; /* Show toolbar or not. */
etat.show_headings_bar = TRUE; /* Show toolbar or not. */
diff --git a/src/gsb_file_load.c b/src/gsb_file_load.c
index 82028eb..dafdcec 100644
--- a/src/gsb_file_load.c
+++ b/src/gsb_file_load.c
@@ -225,10 +225,6 @@ static gint last_sub_budget_number = 0;
/* to import older file than 0.6, makes the link between report and comparison structures */
static gint last_report_number;
-/* initialization of titles for grisbi */
-gchar *initial_file_title = NULL;
-gchar *initial_holder_title = NULL;
-
/* filled only when loading a version before 0.6, contains the order of the accounts
* in the 0.6, the accounts are saved directly in the good order
* this is a list of the accounts number, in the good order */
@@ -771,7 +767,7 @@ void gsb_file_load_general_part ( const gchar **attribute_names,
else if ( !strcmp ( attribute_names[i],
"File_title" ) && strlen (attribute_values[i]))
{
- initial_file_title = my_strdup (attribute_values[i]);
+ titre_fichier = my_strdup (attribute_values[i]);
}
else if ( !strcmp ( attribute_names[i],
@@ -1519,10 +1515,6 @@ void gsb_file_load_account_part ( const gchar **attribute_names,
{
gsb_data_account_set_holder_name ( account_number,
attribute_values[i]);
-
- if ( initial_holder_title == NULL
- && attribute_values[i] && strlen ( attribute_values[i] ) )
- initial_holder_title = g_strdup ( attribute_values[i] );
i++;
continue;
}
@@ -6618,7 +6610,6 @@ void gsb_file_load_general_part_before_0_6 ( GMarkupParseContext *context,
if ( titre_fichier )
g_free ( titre_fichier );
titre_fichier = my_strdup (text);
- initial_file_title = my_strdup (text);
return;
}
diff --git a/src/gsb_file_save.c b/src/gsb_file_save.c
index 6e110be..f3231a3 100644
--- a/src/gsb_file_save.c
+++ b/src/gsb_file_save.c
@@ -158,7 +158,6 @@ extern GdkColor couleur_selection;
extern gint display_one_line;
extern gint display_three_lines;
extern gint display_two_lines;
-extern gchar *initial_file_title;
extern gint no_devise_totaux_categ;
extern gint no_devise_totaux_ib;
extern gint no_devise_totaux_tiers;
@@ -166,6 +165,7 @@ extern gint scheduler_col_width[SCHEDULER_COL_VISIBLE_COLUMNS];
extern GdkColor split_background;
extern gint tab_affichage_ope[TRANSACTION_LIST_ROWS_NB][CUSTOM_MODEL_VISIBLE_COLUMNS];
extern GdkColor text_color[2];
+extern gchar *titre_fichier;
extern gint transaction_col_width[CUSTOM_MODEL_N_VISIBLES_COLUMN];
extern gint valeur_echelle_recherche_date_import;
/*END_EXTERN*/
@@ -586,7 +586,6 @@ gulong gsb_file_save_general_part ( gulong iterator,
gchar *scheduler_column_width_write;
gchar *transaction_column_width_write;
gchar *new_string;
- gchar *tmpstr;
gchar *skipped_lines_string;
gchar *bet_array_column_width_write;
gboolean is_archive = FALSE;
@@ -677,12 +676,6 @@ gulong gsb_file_save_general_part ( gulong iterator,
etat.is_archive )
is_archive = TRUE;
- /* save the file_title or the initial_file_title */
- if ( initial_file_title && strlen (initial_file_title) )
- tmpstr = initial_file_title;
- else
- tmpstr = "";
-
/* save the general information */
new_string = g_markup_printf_escaped ( "\t<General\n"
"\t\tFile_version=\"%s\"\n"
@@ -729,7 +722,7 @@ gulong gsb_file_save_general_part ( gulong iterator,
my_safe_null_str(VERSION),
etat.crypt_file,
is_archive,
- my_safe_null_str(tmpstr),
+ my_safe_null_str ( titre_fichier ),
my_safe_null_str(adresse_commune),
my_safe_null_str(adresse_secondaire),
no_devise_totaux_tiers,
diff --git a/src/main.c b/src/main.c
index 1b390dd..388cf23 100644
--- a/src/main.c
+++ b/src/main.c
@@ -33,8 +33,10 @@
/*START_INCLUDE*/
#include "main.h"
+#include "accueil.h"
#include "dialog.h"
#include "gsb_assistant_first.h"
+#include "gsb_data_account.h"
#include "gsb_file.h"
#include "gsb_file_config.h"
#include "gsb_plugins.h"
@@ -103,6 +105,7 @@ G_MODULE_EXPORT GtkWidget *window = NULL;
/*START_EXTERN*/
extern FILE *debug_file;
extern gchar *nom_fichier_comptes;
+extern gchar *titre_fichier;
/*END_EXTERN*/
@@ -706,6 +709,87 @@ static void main_window_destroy_event ( GObject* obj, gpointer data)
gtk_main_quit();
}
+
+/**
+ * set Grisbi title
+ *
+ *
+ *
+ * */
+gboolean gsb_main_set_grisbi_title ( gint account_number )
+{
+ gchar *titre_grisbi = NULL;
+ gchar *titre = NULL;
+ gint tmp_number;
+ gboolean return_value;
+
+ devel_debug_int ( account_number );
+
+ if ( nom_fichier_comptes == NULL )
+ {
+ titre_grisbi = g_strdup ( _("Grisbi") );
+ return_value = TRUE;
+ }
+ else
+ {
+ switch ( conf.display_grisbi_title )
+ {
+ case GSB_ACCOUNTS_TITLE:
+ if ( titre_fichier && strlen ( titre_fichier ) )
+ titre = g_strdup ( titre_fichier );
+ break;
+ case GSB_ACCOUNT_HOLDER:
+ {
+ if ( account_number == -1 )
+ tmp_number = gsb_data_account_first_number ( );
+ else
+ tmp_number = account_number;
+
+ if ( tmp_number == -1 )
+ {
+ if ( titre_fichier && strlen ( titre_fichier ) )
+ titre = g_strdup ( titre_fichier );
+ }
+ else
+ {
+ titre = g_strdup ( gsb_data_account_get_holder_name ( tmp_number ) );
+
+ if ( titre == NULL )
+ titre = g_strdup ( gsb_data_account_get_name ( tmp_number ) );
+ }
+ break;
+ }
+ case GSB_ACCOUNTS_FILE:
+ if ( nom_fichier_comptes && strlen ( nom_fichier_comptes ) )
+ titre = g_path_get_basename ( nom_fichier_comptes );
+ break;
+ }
+
+ if ( titre && strlen ( titre ) > 0 )
+ {
+ titre_grisbi = g_strconcat ( titre, " - ", _("Grisbi"), NULL );
+ return_value = TRUE;
+ }
+ else
+ {
+ titre_grisbi = g_strconcat ( "<", _("unnamed"), ">", NULL );
+ return_value = FALSE;
+ }
+ }
+ gtk_window_set_title ( GTK_WINDOW ( window ), titre_grisbi );
+
+ gsb_main_page_update_homepage_title ( titre_grisbi );
+
+ if ( titre && strlen ( titre ) )
+ g_free ( titre );
+
+ if ( titre_grisbi && strlen ( titre_grisbi ) > 0 )
+ g_free ( titre_grisbi );
+
+ return return_value;
+}
+
+
/* Local Variables: */
/* c-basic-offset: 4 */
/* End: */
diff --git a/src/main.h b/src/main.h
index 1de5920..b6bcdd1 100644
--- a/src/main.h
+++ b/src/main.h
@@ -6,5 +6,6 @@
/* START_DECLARATION */
gboolean gsb_grisbi_close ( void );
int main (int argc, char **argv);
+gboolean gsb_main_set_grisbi_title ( gint account_number );
/* END_DECLARATION */
#endif
diff --git a/src/navigation.c b/src/navigation.c
index 8297851..4f08a5c 100644
--- a/src/navigation.c
+++ b/src/navigation.c
@@ -102,12 +102,10 @@ static gboolean navigation_tree_drag_data_get ( GtkTreeDragSource * drag_source,
/*START_EXTERN*/
extern GtkWidget *account_page;
-extern gchar *initial_holder_title;
extern GtkWidget *label_last_statement;
extern GtkWidget *menu_import_rules;
extern gint mise_a_jour_liste_comptes_accueil;
extern GtkWidget *notebook_general;
-extern gchar *titre_fichier;
/*END_EXTERN*/
@@ -971,40 +969,19 @@ gboolean navigation_change_account ( gint *no_account )
/* Sensitive menu items if something is selected. */
if ( gsb_data_account_get_current_transaction_number ( new_account ) == -1 )
- {
- gsb_menu_transaction_operations_set_sensitive ( FALSE );
- }
+ gsb_menu_transaction_operations_set_sensitive ( FALSE );
else
- {
- gsb_menu_transaction_operations_set_sensitive ( TRUE );
- }
+ gsb_menu_transaction_operations_set_sensitive ( TRUE );
/* show or hide the rules button in toolbar */
if ( gsb_data_import_rule_account_has_rule ( new_account ) )
- gtk_widget_show ( menu_import_rules );
+ gtk_widget_show ( menu_import_rules );
else
- gtk_widget_hide ( menu_import_rules );
+ gtk_widget_hide ( menu_import_rules );
/* Update the title of the file if needed */
- if ( etat.display_grisbi_title == GSB_ACCOUNT_HOLDER )
- {
- gchar * tmpstr;
-
- if (titre_fichier && strlen (titre_fichier) )
- g_free (titre_fichier);
-
- tmpstr = my_strdup ( gsb_data_account_get_holder_name ( new_account ) );
- if ( tmpstr && strlen (tmpstr) > 0 )
- {
- titre_fichier = g_strdup ( tmpstr );
- g_free ( tmpstr );
- }
- else
- titre_fichier = g_strdup ( initial_holder_title );
-
- gsb_main_page_update_homepage_title ( titre_fichier );
- gsb_file_update_window_title ( );
- }
+ if ( conf.display_grisbi_title == GSB_ACCOUNT_HOLDER )
+ gsb_main_set_grisbi_title ( new_account );
bet_data_select_bet_pages ( new_account );
@@ -1145,21 +1122,9 @@ gboolean gsb_gui_navigation_select_line ( GtkTreeSelection *selection,
case GSB_HOME_PAGE:
notice_debug ("Home page selected");
- /* set the title */
- if ( titre_fichier && strlen ( titre_fichier ) )
- {
- title = g_strconcat ( "Grisbi : " , titre_fichier, NULL );
- }
- else
- {
- title = g_strconcat ( "Grisbi : " , _("My accounts"), NULL );
- titre_fichier = g_strdup ( _("My accounts") );
- }
-
/* what to be done if switch to that page */
- mise_a_jour_accueil (FALSE);
- gsb_form_set_expander_visible (FALSE,
- FALSE );
+ mise_a_jour_accueil ( FALSE );
+ gsb_form_set_expander_visible ( FALSE, FALSE );
break;
case GSB_ACCOUNT_PAGE:
diff --git a/src/parametres.c b/src/parametres.c
index 5e5ccb9..45b2a17 100644
--- a/src/parametres.c
+++ b/src/parametres.c
@@ -101,9 +101,9 @@ extern gboolean balances_with_scheduled;
extern struct conditional_message delete_msg[];
extern gboolean execute_scheduled_of_month;
extern struct conditional_message messages[];
+extern gchar *nom_fichier_comptes;
extern gint nb_days_before_scheduled;
extern gint nb_max_derniers_fichiers_ouverts;
-extern gchar *titre_fichier;
extern GtkWidget *window;
/*END_EXTERN*/
@@ -658,7 +658,8 @@ GtkWidget *onglet_messages_and_warnings ( void )
GtkTreeIter iter;
if ( g_utf8_collate ( messages[i].name, "account-already-opened" ) == 0 )
- tmpstr = g_strdup_printf ( _(messages[i] . hint), titre_fichier );
+ tmpstr = g_strdup_printf ( _(messages[i] . hint),
+ g_path_get_basename ( nom_fichier_comptes ) );
else if ( g_utf8_collate ( messages[i].name, "development-version" ) == 0 )
tmpstr = g_strdup_printf ( _(messages[i] . hint), VERSION );
else if ( g_utf8_collate ( messages[i].name, "gtk_obsolete" ) == 0 )
diff --git a/src/structures.h b/src/structures.h
index ca90824..a82ba97 100644
--- a/src/structures.h
+++ b/src/structures.h
@@ -67,7 +67,6 @@ struct gsb_etat_t
gint utilise_logo;
gboolean is_pixmaps_dir; /* TRUE if path_icon == GRISBI_PIXMAPS_DIR */
gchar *name_logo;
- gint display_grisbi_title; /* selection du titre principal de grisbi */
gint display_toolbar; /** Display mode of toolbar. */
gboolean show_toolbar; /** Show toolbar or not. */
@@ -156,6 +155,8 @@ struct gsb_conf_t
gchar *dvips_command;
gint pluriel_final; /* 0 = finals 1 = finaux */
+ gint display_grisbi_title; /* selection du titre principal de grisbi */
+
/* files part */
gint sauvegarde_demarrage; /* utilisé pour enregistrer le fichier s'il s'est bien ouvert */
gint sauvegarde_auto; /* utilisé pour enregistrer le fichier automatiquementà la fermeture */
diff --git a/src/traitement_variables.c b/src/traitement_variables.c
index 0b146a6..174bdb5 100644
--- a/src/traitement_variables.c
+++ b/src/traitement_variables.c
@@ -163,8 +163,6 @@ extern gint display_one_line;
extern gint display_three_lines;
extern gint display_two_lines;
extern gint id_timeout;
-extern gchar *initial_file_title;
-extern gchar *initial_holder_title;
extern gint mise_a_jour_fin_comptes_passifs;
extern gint mise_a_jour_liste_comptes_accueil;
extern gint mise_a_jour_liste_echeances_auto_accueil;
@@ -306,14 +304,9 @@ void init_variables ( void )
no_devise_totaux_ib = 1;
/* initialization of titles and logo part */
+ if ( titre_fichier && strlen ( titre_fichier ) )
+ g_free ( titre_fichier );
titre_fichier = g_strdup( _("My accounts") );
- if ( initial_file_title && strlen ( initial_file_title ) )
- g_free ( initial_file_title );
- initial_file_title = NULL;
-
- if ( initial_holder_title && strlen ( initial_holder_title ) )
- g_free ( initial_holder_title );
- initial_holder_title = NULL;
etat.is_pixmaps_dir = TRUE;
if ( etat.name_logo && strlen ( etat.name_logo ) )
hooks/post-receive
--
grisbi
More information about the cvs
mailing list