Beispiel #1
0
/**
 * draw the title if asked
 *
 * \param context           the GtkPrintContext
 * \param line_position     the position to insert the title
 * \param page_width        the page width
 *
 * \return the new line_position to continue to fill the page
 * */
static gint print_tree_view_list_draw_title ( GtkPrintContext *context,
                        gint line_position )
{
    if ( title_string && strlen ( title_string ) )
    {
        PangoLayout *layout;
        devel_debug_int (line_position);

        cairo_move_to ( cr, 0, line_position );

        /* create the new layout */
        layout = gtk_print_context_create_pango_layout ( context );

        pango_layout_set_text ( layout, title_string, -1 );
        pango_layout_set_font_description ( layout, gsb_data_print_config_get_font_title () );
        pango_layout_set_width ( layout, page_width * PANGO_SCALE );
        pango_layout_set_alignment ( layout, PANGO_ALIGN_CENTER );
        pango_layout_set_ellipsize ( layout, PANGO_ELLIPSIZE_END );
        pango_cairo_show_layout ( cr, layout );
        g_object_unref ( layout );

        /* add title line and blank line */
        line_position = line_position + size_title;
    }

    return line_position;
}
/**
 * sensitive the buttons of the scheduler part of the form
 *
 * \param sensitive TRUE or FALSE
 *
 * \return FALSE
 * */
gboolean gsb_form_scheduler_sensitive_buttons ( gboolean sensitive )
{
    gint column;

    devel_debug_int (sensitive);

    /* clean the scheduled widget */
    for ( column = 0 ; column < SCHEDULED_FORM_MAX_WIDGETS ; column++ )
    {
	GtkWidget *widget;

	widget = gsb_form_scheduler_get_element_widget (column);

	if (widget)
	{
	    switch (column)
	    {
		case SCHEDULED_FORM_ACCOUNT:
		case SCHEDULED_FORM_AUTO:
		case SCHEDULED_FORM_FREQUENCY_BUTTON:
		case SCHEDULED_FORM_FREQUENCY_USER_BUTTON:
		    gtk_widget_set_sensitive ( widget,
					       sensitive );
		    break;
	    }
	}
    }
    return FALSE;
}
Beispiel #3
0
static gint print_tree_view_list_get_columns_title_size ( gint nbre_lines )
{
    gint size_tmp = 0;

    devel_debug_int(nbre_lines);

    size_tmp =  size_row * nbre_lines + gsb_data_print_config_get_draw_lines ( );

    return size_tmp;
}
Beispiel #4
0
/**
 * Update the view menu in the menu bar
 *
 * \param account_number	The account used to update the menu
 *
 * \return FALSE
 * */
gboolean gsb_menu_update_view_menu ( gint account_number )
{
    gchar * item_name = NULL;
    gchar *tmpstr;

    devel_debug_int (account_number);

    block_menu_cb = TRUE;

    /* update the showing of reconciled transactions */
    tmpstr = "/menubar/ViewMenu/ShowReconciled";
    gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (
                        gtk_ui_manager_get_action ( ui_manager, tmpstr) ),
				        gsb_data_account_get_r ( account_number ) );

    tmpstr = "/menubar/ViewMenu/ShowTransactionForm";
    gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (
                        gtk_ui_manager_get_action ( ui_manager, tmpstr) ),
				        gsb_form_is_visible ( ) );

    /* update the showing of archived transactions */
    tmpstr = "/menubar/ViewMenu/ShowArchived";
    gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (
                        gtk_ui_manager_get_action ( ui_manager, tmpstr) ),
				        gsb_data_account_get_l ( account_number ) );

    /* update the number of line showed */
    switch ( gsb_data_account_get_nb_rows (account_number))
    {
	default:
	case 1 :
	    item_name = "/menubar/ViewMenu/ShowOneLine";
	    break;
	case 2 :
	    item_name = "/menubar/ViewMenu/ShowTwoLines";
	    break;
	case 3 :
	    item_name = "/menubar/ViewMenu/ShowThreeLines";
	    break;
	case 4 :
	    item_name = "/menubar/ViewMenu/ShowFourLines";
	    break;
    }

    gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (
                        gtk_ui_manager_get_action ( ui_manager, item_name ) ),
				        TRUE );
    block_menu_cb = FALSE;

    return FALSE;
}
Beispiel #5
0
/**
 * Initialise la barre de menus en fonction de la présence ou non d'un fichier de comptes
 *
 * \param sensitif
 *
 * \return
 * */
void gsb_menu_set_menus_with_file_sensitive ( gboolean sensitive )
{
    gchar * items[] = {
        "/menubar/FileMenu/Save",
        "/menubar/FileMenu/SaveAs",
        "/menubar/FileMenu/DebugFile",
        "/menubar/FileMenu/Obfuscate",
        "/menubar/FileMenu/DebugMode",
        "/menubar/FileMenu/ExportFile",
        "/menubar/FileMenu/CreateArchive",
        "/menubar/FileMenu/ExportArchive",
        "/menubar/FileMenu/Close",
        "/menubar/EditMenu/NewTransaction",
        "/menubar/EditMenu/RemoveTransaction",
        "/menubar/EditMenu/TemplateTransaction",
        "/menubar/EditMenu/CloneTransaction",
        "/menubar/EditMenu/EditTransaction",
        "/menubar/EditMenu/ConvertToScheduled",
        "/menubar/EditMenu/MoveToAnotherAccount",
        "/menubar/EditMenu/Preferences",
        "/menubar/EditMenu/RemoveAccount",
        "/menubar/EditMenu/NewAccount",
        "/menubar/ViewMenu/ShowTransactionForm",
        "/menubar/ViewMenu/ShowReconciled",
        "/menubar/ViewMenu/ShowArchived",
        "/menubar/ViewMenu/ShowClosed",
        "/menubar/ViewMenu/ShowOneLine",
        "/menubar/ViewMenu/ShowTwoLines",
        "/menubar/ViewMenu/ShowThreeLines",
        "/menubar/ViewMenu/ShowFourLines",
        "/menubar/ViewMenu/InitwidthCol",
        NULL
    };
    gchar ** tmp = items;

    devel_debug_int (sensitive);

    while ( *tmp )
    {
        gsb_gui_sensitive_menu_item ( *tmp, sensitive );
        tmp++;
    }

    /* As this function may only be called when a new account is
     * created and the like, it is unlikely that we want to sensitive
     * transaction-related menus. */
    gsb_gui_sensitive_menu_item ( "/menubar/EditMenu/NewTransaction", FALSE );
    gsb_menu_set_menus_select_transaction_sensitive ( FALSE );
}
/**
 * set the scheduler part of the form from the scheduled transaction given in param
 *
 * \param scheduled_number
 *
 * \return FALSE
 * */
gboolean gsb_form_scheduler_set ( gint scheduled_number )
{
    devel_debug_int (scheduled_number);

    gsb_form_scheduler_sensitive_buttons (TRUE);

    /* if we are on a white split line, set all as the mother */
    if (scheduled_number < -1)
	scheduled_number = gsb_data_scheduled_get_mother_scheduled_number (scheduled_number);

    gsb_form_scheduler_set_account ( gsb_data_scheduled_get_account_number (scheduled_number));
    gsb_form_scheduler_set_auto ( gsb_data_scheduled_get_automatic_scheduled (scheduled_number));
    gsb_form_scheduler_set_frequency ( gsb_data_scheduled_get_frequency (scheduled_number));
    gsb_form_scheduler_set_limit_date ( gsb_data_scheduled_get_limit_date (scheduled_number));
    gsb_form_scheduler_set_frequency_user ( gsb_data_scheduled_get_user_entry (scheduled_number));
    gsb_form_scheduler_set_frequency_user_button ( gsb_data_scheduled_get_user_interval (scheduled_number));
    return FALSE;
}
Beispiel #7
0
/**
 * called when the user change the interval of automatic backup
 *
 * \param spinbutton
 * \param null
 *
 * \return FALSE
 * */
gboolean gsb_file_automatic_backup_change_time ( GtkWidget *spinbutton,
                        gpointer null )
{
    devel_debug_int (conf.make_backup_nb_minutes);

    /* if there is already a timeout, we stop it */
    if (id_timeout)
    {
	g_source_remove (id_timeout);
	id_timeout = 0;
    }

    /* set a new timeout only if there is an interval */
    if (conf.make_backup_nb_minutes)
	id_timeout = g_timeout_add_seconds ( conf.make_backup_nb_minutes * 60,
					     (GSourceFunc) (gsb_file_automatic_backup),
					     NULL );

    return FALSE;
}
Beispiel #8
0
/**
 * called when the user select the backup every x minutes
 *
 * \param checkbutton
 * \param null
 *
 * \return FALSE
 * */
gboolean gsb_file_automatic_backup_start ( GtkWidget *checkbutton,
                        gpointer null )
{
    devel_debug_int (conf.make_backup_every_minutes);

    /* if there is already a timeout, we remove it */
    if (id_timeout)
    {
	g_source_remove (id_timeout);
	id_timeout = 0;
    }

    /* launch the timeout only if active and if there is some minutes */
    if (conf.make_backup_every_minutes
	&&
	conf.make_backup_nb_minutes )
	id_timeout = g_timeout_add_seconds ( conf.make_backup_nb_minutes * 60,
					     (GSourceFunc) (gsb_file_automatic_backup),
					     NULL );
    return FALSE;
}
Beispiel #9
0
/**
 * remove the filename from the list of recently opened file
 *
 * \param filename
 *
 * \return
 * */
void gsb_file_remove_name_from_opened_list ( gchar *filename )
{
    gint i, j;

    devel_debug ( filename );
    efface_derniers_fichiers_ouverts();
    devel_debug_int ( conf.nb_derniers_fichiers_ouverts );

    for ( i = 0 ; i < conf.nb_derniers_fichiers_ouverts; i++ )
    {
        if ( strcmp (filename, tab_noms_derniers_fichiers_ouverts[i]) == 0 )
        {
            for ( j = i; ( j + 1 ) < conf.nb_derniers_fichiers_ouverts; j++ )
            {
                tab_noms_derniers_fichiers_ouverts[j] = tab_noms_derniers_fichiers_ouverts[j+1];
            }
            conf.nb_derniers_fichiers_ouverts--;
        }
    }
    affiche_derniers_fichiers_ouverts();
}
Beispiel #10
0
static gint print_tree_view_list_draw_rows_data ( GtkPrintContext *context,
                        gint line_position,
                        GtkTreeView *tree_view,
                        gint page )
{
    gint lines_to_draw;
    devel_debug_int (line_position);

    /* calcul du nombre de lignes à éditer */
    if (page)
        lines_to_draw = lines_per_page;
    else
        lines_to_draw = lines_in_first_page;
    if ( lines_to_draw > ( total_lines_to_print - total_lines_printed ) )
        lines_to_draw = total_lines_to_print - total_lines_printed;

    while ( lines_to_draw )
    {
        nbre_lines_col_data = print_tree_view_list_get_columns_data_nbre_lines ( tree_view );
        print_tree_view_list_draw_background ( context, tree_view, line_position );
        /* begin a row : fill the line before the row */
        line_position = print_tree_view_list_draw_line ( line_position );

        /* draw the last column */
        print_tree_view_list_draw_column ( page_width, line_position );

        /* draw the row */
        line_position = print_tree_view_list_draw_row ( context, tree_view, line_position );

        gtk_tree_path_next ( tree_path_to_print );
        lines_to_draw--;
        total_lines_printed++;
    }

    /* draw the last line */
    print_tree_view_list_draw_line ( line_position );

    return line_position;
}
Beispiel #11
0
/**
 * print the page
 *
 * \param operation GtkPrintOperation
 * \param context   GtkPrintContext
 * \param page      page to print
 * \param null
 *
 * \return FALSE
 * */
 gboolean print_tree_view_list_draw_page ( GtkPrintOperation *operation,
                        GtkPrintContext *context,
                        gint page,
                        gpointer data )
{
    GtkTreeView *tree_view = ( GtkTreeView * ) data;
    gint line_position = 0;

    devel_debug_int (page);

    /* draw the title */
    if ( !page && title_string && strlen ( title_string ) )
        line_position = print_tree_view_list_draw_title ( context, line_position );

    /* draw the columns titles */
    if ( gsb_data_print_config_get_draw_columns_name () )
        line_position = print_tree_view_list_draw_columns_title ( context, line_position, tree_view );

    /* draw the lines */
    line_position = print_tree_view_list_draw_rows_data ( context, line_position, tree_view, page );

    return FALSE;
}
Beispiel #12
0
/**
 * Initialise la barre de menus si un compte est sélectionné
 *
 * \param sensitif
 *
 * \return
 * */
void gsb_menu_set_menus_view_account_sensitive ( gboolean sensitive )
{
    gchar * items[] = {
        "/menubar/ViewMenu/ShowTransactionForm",
        "/menubar/ViewMenu/ShowReconciled",
        "/menubar/ViewMenu/ShowArchived",
        "/menubar/ViewMenu/ShowOneLine",
        "/menubar/ViewMenu/ShowTwoLines",
        "/menubar/ViewMenu/ShowThreeLines",
        "/menubar/ViewMenu/ShowFourLines",
        "/menubar/ViewMenu/InitwidthCol",
        NULL
    };
    gchar **tmp = items;

    devel_debug_int (sensitive);

    while ( *tmp )
    {
        gsb_gui_sensitive_menu_item ( *tmp, sensitive );
        tmp++;
    }
}
Beispiel #13
0
/**
 * save the file
 *
 * \param origine 0 from gsb_file_save (menu), -1 from gsb_file_close, -2 from gsb_file_save_as
 *
 * \return TRUE if ok, FALSE if problem
 * */
gboolean gsb_file_save_file ( gint origine )
{
    gint etat_force, result;
    gchar *nouveau_nom_enregistrement;

    devel_debug_int (origine);

    etat_force = 0;

    if ( ( !gsb_file_get_modified ( ) && origine != -2 ) ||
	 !gsb_data_account_get_accounts_amount () )
    {
	notice_debug ( "nothing done in gsb_file_save_file" );
	return ( TRUE );
    }

    /* si le fichier de comptes n'a pas de nom ou si on enregistre sous un nouveau nom */
    /*     c'est ici */

    if ( !nom_fichier_comptes || origine == -2 )
	nouveau_nom_enregistrement = gsb_file_dialog_ask_name ();
    else
	nouveau_nom_enregistrement = nom_fichier_comptes;

    if ( !nouveau_nom_enregistrement )
	return FALSE;

    /*     on vérifie que le fichier n'est pas locké */
    if ( etat.fichier_deja_ouvert
	 &&
	 !conf.force_enregistrement
	 &&
	 origine != -2 )
    {
        gchar* tmpstr1 = g_strdup_printf( _("Grisbi was unable to save this file because it is locked.  Please save it with another name or activate the \"%s\" option in preferences."),
					       _("Force saving of locked files" ) );
	gchar* tmpstr2 = g_strdup_printf( _("Can not save file \"%s\""),
					       nom_fichier_comptes );
	dialogue_error_hint ( tmpstr1,
			      tmpstr2 );
	g_free ( tmpstr1 );
	g_free ( tmpstr2 );
	return ( FALSE );
    }

        /* Si le fichier est un d'une version précédente de grisbi on demande si on l'efface */
    if ( copy_old_filename && strlen ( copy_old_filename ) > 0 )
    {
        gsb_file_save_remove_old_file ( copy_old_filename );
        g_free ( copy_old_filename );
        copy_old_filename = NULL;
    }

    /* make backup before saving if asked */
    if (conf.make_backup)
	gsb_file_save_backup();

    /*   on a maintenant un nom de fichier */
    /*     et on sait qu'on peut sauvegarder */
    gsb_status_message ( _("Saving file") );

    result = gsb_file_save_save_file ( nouveau_nom_enregistrement,
				       conf.compress_file,
				       FALSE );

    if ( result )
    {
	/* saving was right, so unlock the last name */
	gsb_file_util_modify_lock ( FALSE );

	nom_fichier_comptes = nouveau_nom_enregistrement;

	/* and lock the new name */
	gsb_file_util_modify_lock ( TRUE );

	/* update variables */
	etat.fichier_deja_ouvert = 0;
        gsb_file_set_modified ( FALSE );
	gsb_main_set_grisbi_title ( gsb_gui_navigation_get_current_account ( ) );
	gsb_file_append_name_to_opened_list ( nom_fichier_comptes );
    }

    gsb_status_message ( _("Done") );

    return ( result );
}
/**
 * print the page
 *
 * \param operation	GtkPrintOperation
 * \param context	GtkPrintContext
 * \param page		page to print
 * \param null
 *
 * \return FALSE
 * */
gboolean print_transactions_list_draw_page ( GtkPrintOperation *operation,
					     GtkPrintContext *context,
					     gint page,
					     gpointer null )
{
    CustomList *custom_list;
    gboolean color_bg = TRUE;
    gint line_position = 0;
    gint transactions_to_draw;

    devel_debug_int (page);

    /* draw the title */
    if (!page)
	line_position = print_transactions_list_draw_title (context, line_position);

    /* draw the columns titles */
    if (gsb_data_print_config_get_draw_columns_name ())
	line_position = print_transactions_list_draw_columns_title (context, line_position);

    /* draw the transactions lines */
    custom_list = transaction_model_get_model ();

    if (page)
	transactions_to_draw = transactions_per_page;
    else
	transactions_to_draw = transactions_in_first_page;
    if (transactions_to_draw > (total_transactions_to_print - total_transactions_printed))
	transactions_to_draw = total_transactions_to_print - total_transactions_printed;

    while (transactions_to_draw)
    {
	gint i;
	CustomRecord *record = NULL;

	/* begin a transaction : fill the line before the transaction */
	line_position = print_transactions_list_draw_line (line_position);

	/* print the transaction */
	for (i=0 ; i<custom_list -> nb_rows_by_transaction ; i++)
	{
	    record = custom_list -> visibles_rows[current_row_to_print];

	    /* if it's an archive, check we want it */
	    if (record -> what_is_line == IS_ARCHIVE && !gsb_data_print_config_get_draw_archives ())
	    {
		/* go to the next row but come back to the first line of transaction */
		current_row_to_print++;
		i--;
		continue;
	    }

	    /* if we use the dates, it's here */
	    if (gsb_data_print_config_get_draw_interval_dates () && draw_initial_date && draw_final_date
		&& record -> what_is_line == IS_TRANSACTION)
	    {
		/* we want an interval, so check the transaction */
		gint transaction_number;
		const GDate *date = NULL;

		transaction_number = gsb_data_transaction_get_transaction_number (record -> transaction_pointer);
		if (gsb_data_print_config_get_draw_dates_are_value_dates ())
		    date = gsb_data_transaction_get_value_date (transaction_number);

		/* if no value date, get the date */
		if (!date)
		    date = gsb_data_transaction_get_date (transaction_number);

		if (g_date_compare (date,
				    draw_initial_date) < 0
		    ||
		    g_date_compare (date,
				    draw_final_date) > 0)
		{
		    /* the transaction is not into the dates, go to the next transaction */
		    current_row_to_print = current_row_to_print + custom_list -> nb_rows_by_transaction;
		    i--;
		    continue;
		}
	    }

	    /* begin the transaction, fill the background */
	    if (!i)
		print_transactions_list_draw_background (record, color_bg, line_position );

	    /* draw the last column */
	    print_transactions_list_draw_column (page_width, line_position);

	    line_position = print_transactions_list_draw_row (context, record, line_position);

	    current_row_to_print++;

	    /* an archive is 1 line */
	    if (record -> what_is_line == IS_ARCHIVE)
		break;
	}

	/* we are on the last record of the transaction or archive,
	 * decrease the number of transactions to draw */
	if (record -> what_is_line == IS_TRANSACTION)
	{
	    transactions_to_draw--;
	    total_transactions_printed++;
	}

	/* add a space between 2 transactions */
	line_position++;

	color_bg = !color_bg;
    }

    /* draw the last line */
    print_transactions_list_draw_line (line_position);
    return FALSE;
}
Beispiel #15
0
/**
 * draw the title of the columns
 *
 * \param context           the GtkPrintContext
 * \param line_position     the position to insert the titles
 *
 * \return the new line_position to continue to fill the page
 * */
static gint print_tree_view_list_draw_columns_title ( GtkPrintContext *context,
                        gint line_position,
                        GtkTreeView *tree_view )
{
    GList *list;
    GList *list_tmp;
    gint column = 0;
    gint column_position;

    devel_debug_int ( line_position );

    if ( !gsb_data_print_config_get_draw_columns_name () )
        return line_position;

    /* begin a row : fill the line before the row */
    line_position = print_tree_view_list_draw_line ( line_position );

    list = gtk_tree_view_get_columns ( tree_view );

    if ( nbre_lines_col_title == 1 )
    {
        /* draw the last column */
        print_tree_view_list_draw_column ( page_width, line_position );
        list_tmp = list;

        while ( list_tmp )
        {
            GtkTreeViewColumn *col;
            const gchar *text;

            col = ( GtkTreeViewColumn * ) list_tmp -> data;
            column_position = columns_position[column];

            /* get the text */
            text = gtk_tree_view_column_get_title ( col );
            if (!text)
            {
                list_tmp  = list_tmp -> next;
                column++;
                continue;
            }

            print_tree_view_list_draw_cell ( context, line_position, column_position, column, text );

            list_tmp  = list_tmp -> next;
            column++;
        }
        line_position = line_position + size_columns_title;
    }
    else
    {
        gchar **tab;
        gchar *str_tmp;
        gint i = 0;

        for ( i = 0; i < nbre_lines_col_title; i ++ )
        {
            /* draw the last column */
            print_tree_view_list_draw_column ( page_width, line_position );
            list_tmp = list;

            while ( list_tmp )
            {
                GtkTreeViewColumn *col;
                const gchar *text;

                col = ( GtkTreeViewColumn * ) list_tmp -> data;
                column_position = columns_position[column];

                /* get the text */
                text = gtk_tree_view_column_get_title ( col );

                if ( text == NULL || strlen ( text ) == 0 )
                {
                    print_tree_view_list_draw_column ( column_position, line_position );
                    list_tmp  = list_tmp -> next;
                    column++;
                    continue;
                }

                str_tmp = gsb_string_uniform_new_line ( text, strlen ( text ) );
                if ( str_tmp == NULL )
                {
                    if ( i == 0 )
                        print_tree_view_list_draw_cell ( context, line_position, column_position, column, text );
                    else
                        print_tree_view_list_draw_column ( column_position, line_position );
                    list_tmp  = list_tmp -> next;
                    column++;
                    continue;
                }

                tab = g_strsplit ( str_tmp, "\n", 0 );

                if ( tab[i] && strlen ( tab[i] ) )
                    print_tree_view_list_draw_cell ( context, line_position, column_position, column, tab[i] );
                else
                    print_tree_view_list_draw_column ( column_position, line_position );

                list_tmp  = list_tmp -> next;
                column++;
                g_strfreev ( tab );
                g_free ( str_tmp );
            }
            line_position = line_position + size_row + gsb_data_print_config_get_draw_lines ( );
            column = 0;
        }
    }

    return line_position;
}
Beispiel #16
0
/**
 * 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 );
            g_free ( titre );

            return_value = TRUE;
        }
        else
        {
            titre_grisbi = g_strconcat ( "<", _("unnamed"), ">", NULL );
            return_value = FALSE;
        }
    }
    gtk_window_set_title ( GTK_WINDOW ( run.window ), titre_grisbi );

    gsb_main_page_update_homepage_title ( titre_grisbi );

    if ( titre_grisbi && strlen ( titre_grisbi ) > 0 )
        g_free ( titre_grisbi );

    return return_value;
}