[grisbi-cvs] [SCM] grisbi branch, grisbi-gtk3, updated. grisbi_gtk3_1_3_0-185-gf2df58c

Pierre Biava nobody at users.sourceforge.net
Sun Mar 4 21:59:57 CET 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grisbi".

The branch, grisbi-gtk3 has been updated
       via  f2df58c78b6cb841ab9760b17e9b6b219acc565d (commit)
       via  4c0e226c35baf19f831dbb55fb9e11424089989d (commit)
       via  02d50143235d7d64ba7acbd439fd4ba0313db8fd (commit)
       via  a5e8ba3226e713b76bcec1232f888cd4bb9e65a7 (commit)
       via  a836b72924b9d12efa33ba5fd9ebd052596905dd (commit)
       via  c6ff88af94e4637565936b7f08520d763419832a (commit)
       via  c34bb9e4344d3240e9574a5ca98f0bd7e466a3e4 (commit)
      from  2c279fdc9a622417a3f80592a94ef3a56ebcc6df (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 f2df58c78b6cb841ab9760b17e9b6b219acc565d
Author: pbiava <pierre.biava at nerim.net>
Date:   Sun Mar 4 21:58:40 2012 +0100

    creation of the tab: "account files" in the preferences

commit 4c0e226c35baf19f831dbb55fb9e11424089989d
Author: pbiava <pierre.biava at nerim.net>
Date:   Sun Mar 4 21:50:51 2012 +0100

    replace run.new_crypted_file by run->new_crypted_file

commit 02d50143235d7d64ba7acbd439fd4ba0313db8fd
Author: pbiava <pierre.biava at nerim.net>
Date:   Sun Mar 4 21:47:39 2012 +0100

    bug fix management of recent files

commit a5e8ba3226e713b76bcec1232f888cd4bb9e65a7
Author: pbiava <pierre.biava at nerim.net>
Date:   Sun Mar 4 21:39:31 2012 +0100

    grisbi_ui.h: moving the menu "Preferences"

commit a836b72924b9d12efa33ba5fd9ebd052596905dd
Author: pbiava <pierre.biava at nerim.net>
Date:   Sun Mar 4 21:38:03 2012 +0100

    add struct GrisbiAppRun

commit c6ff88af94e4637565936b7f08520d763419832a
Author: pbiava <pierre.biava at nerim.net>
Date:   Sun Mar 4 08:48:13 2012 +0100

    minor changes

commit c34bb9e4344d3240e9574a5ca98f0bd7e466a3e4
Author: pbiava <pierre.biava at nerim.net>
Date:   Sun Feb 26 22:55:00 2012 +0100

    Moves the function: etats_config_ui_left_panel_tree_view_select_last_page () in utils.c

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

Changes:
diff --git a/src/etats_config_ui.c b/src/etats_config_ui.c
index fda2785..aa90b9b 100644
--- a/src/etats_config_ui.c
+++ b/src/etats_config_ui.c
@@ -536,46 +536,12 @@ gboolean etats_config_ui_left_panel_tree_view_update_style ( GtkWidget *button,
 gboolean etats_config_ui_left_panel_tree_view_select_last_page ( void )
 {
     GtkWidget *tree_view;
-    GtkTreeModel *model;
-    GtkTreeIter parent_iter;
+    GtkWidget *notebook;
 
     tree_view = GTK_WIDGET ( gtk_builder_get_object ( etats_config_builder, "treeview_left_panel" ) );
-    model = gtk_tree_view_get_model ( GTK_TREE_VIEW ( tree_view ) );
-
-    if ( !gtk_tree_model_get_iter_first ( GTK_TREE_MODEL ( model ), &parent_iter ) )
-        return FALSE;
-
-    do
-    {
-        GtkTreeIter iter;
-
-        if ( gtk_tree_model_iter_children ( GTK_TREE_MODEL ( model ), &iter, &parent_iter ) )
-        {
-            do
-            {
-                gint page;
+    notebook = GTK_WIDGET ( gtk_builder_get_object ( etats_config_builder, "notebook_config_etat" ) ),
 
-                gtk_tree_model_get (GTK_TREE_MODEL ( model ),
-                                &iter,
-                                LEFT_PANEL_TREE_PAGE_COLUMN, &page,
-                                -1 );
-
-                if ( page == last_page )
-                {
-                    GtkTreeSelection *sel;
-
-                    sel = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( tree_view ) );
-                    gtk_tree_selection_select_iter ( sel, &iter );
-                    gtk_notebook_set_current_page ( GTK_NOTEBOOK (
-                                gtk_builder_get_object ( etats_config_builder, "notebook_config_etat" ) ),
-                                page );
-                    break;
-                }
-            }
-            while ( gtk_tree_model_iter_next ( GTK_TREE_MODEL ( model ), &iter ) );
-        }
-    }
-    while ( gtk_tree_model_iter_next ( GTK_TREE_MODEL ( model ), &parent_iter ) );
+    utils_ui_left_panel_tree_view_select_page ( tree_view, notebook, last_page );
 
     /* return */
     return FALSE;
diff --git a/src/grisbi_app.c b/src/grisbi_app.c
index 4894e70..8c1b070 100644
--- a/src/grisbi_app.c
+++ b/src/grisbi_app.c
@@ -68,10 +68,11 @@ static gboolean grisbi_app_window_focus_in_event ( GrisbiWindow *window,
 static void grisbi_app_window_set_size_and_position ( GrisbiWindow *window );
 /*END_STATIC*/
 
+/* structure run */
+static GrisbiAppRun *app_run;
 
 #define GRISBI_APP_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), GRISBI_TYPE_APP, GrisbiAppPrivate))
 
-
 struct _GrisbiAppPrivate
 {
     GList               *windows;
@@ -101,13 +102,21 @@ static void grisbi_app_finalize ( GObject *object )
     /* libération mémoire de la liste des fenêtres */
     g_list_free ( app->priv->windows );
 
-    /* libération mémoire de la configuration de grisbi */
+    /* libération mémoire de la structure conf */
     conf = app->priv->conf;
+    g_free ( conf->account_files_path );
+    g_free ( conf->backup_path );
     g_free ( conf->font_string );
     g_free ( conf->browser_command );
     g_strfreev ( conf->tab_noms_derniers_fichiers_ouverts );
     g_free ( app->priv->conf );
 
+    /* libération mémoire de la structure run */
+    g_free ( app_run->reconcile_final_balance );
+    if ( app_run->reconcile_new_date )
+        g_date_free ( app_run->reconcile_new_date );
+    g_free ( app_run );
+
     /* libération de l'objet app */
     G_OBJECT_CLASS ( grisbi_app_parent_class )->finalize ( object );
 }
@@ -152,6 +161,9 @@ static void grisbi_app_init ( GrisbiApp *app )
         gtk_window_set_default_icon_from_file ( string, NULL );
     g_free (string);
 
+    /* creation de la structure run */
+    app_run = g_malloc0 ( sizeof ( GrisbiAppRun ) );
+
     /* initialisation des paramètres de l'application */
     grisbi_app_load_config_var ( app );
 
@@ -790,6 +802,19 @@ GtkUIManager *grisbi_app_get_active_ui_manager ( void )
 
 
 /**
+ * retourne la structure run
+ *
+ * \param
+ *
+ * \return
+ **/
+GrisbiAppRun *grisbi_app_get_run ( void )
+{
+    return app_run;
+}
+
+
+/**
  *
  *
  * \param
diff --git a/src/grisbi_app.h b/src/grisbi_app.h
index 9ff0ea1..eb260ae 100644
--- a/src/grisbi_app.h
+++ b/src/grisbi_app.h
@@ -57,6 +57,7 @@ GrisbiWindow *grisbi_app_get_active_window ( GrisbiApp *app );
 GrisbiAppConf *grisbi_app_get_conf ( void );
 GrisbiApp *grisbi_app_get_default ( void );
 gboolean grisbi_app_get_first_use ( GrisbiApp *app );
+GrisbiAppRun *grisbi_app_get_run ( void );
 const GList	*grisbi_app_get_windows ( GrisbiApp *app );
 gboolean grisbi_app_quit ( void );
 gboolean grisbi_app_set_active_filename ( const gchar *filename );
diff --git a/src/grisbi_prefs.c b/src/grisbi_prefs.c
index bb191bb..c9672d5 100644
--- a/src/grisbi_prefs.c
+++ b/src/grisbi_prefs.c
@@ -32,8 +32,11 @@
 #include <glib/gi18n.h>
 
 /*START_INCLUDE*/
-#include "grisbi_app.h"
 #include "grisbi_prefs.h"
+#include "dialog.h"
+#include "grisbi_app.h"
+#include "gsb_file.h"
+#include "menu.h"
 #include "utils.h"
 #include "utils_gtkbuilder.h"
 #include "erreur.h"
@@ -49,6 +52,8 @@
 static GtkBuilder *grisbi_prefs_builder = NULL;
 static GtkWidget *grisbi_prefs_dialog = NULL;
 
+/* last_page */
+/* static gint last_page;  */
 
 struct _GrisbiPrefsPrivate
 {
@@ -57,6 +62,20 @@ struct _GrisbiPrefsPrivate
     /* tree_store du panel de gauche */
     GtkWidget           *treeview_left_panel;
     GtkTreeStore        *prefs_tree_model;
+
+    /* notebook de droite */
+    GtkWidget           *notebook_prefs;
+
+    /* notebook_files */
+    GtkWidget           *notebook_files;
+    GtkWidget           *checkbutton_load_last_file;
+    GtkWidget           *checkbutton_sauvegarde_auto;
+    GtkWidget           *checkbutton_force_enregistrement;
+    GtkWidget           *checkbutton_crypt_file;
+    GtkWidget           *checkbutton_compress_file;
+    GtkWidget           *spinbutton_nb_max_derniers_fichiers_ouverts;
+    GtkWidget           *checkbutton_stable_config_file_model;
+    GtkWidget           *filechooserbutton_accounts;
 };
 
 
@@ -97,7 +116,7 @@ static void grisbi_prefs_class_init ( GrisbiPrefsClass *klass )
 }
 
 
-/* GTK_BUILDER */
+/* CALLBACKS - UTILS */
 /**
  * callback pour la fermeture des preferences
  *
@@ -106,7 +125,7 @@ static void grisbi_prefs_class_init ( GrisbiPrefsClass *klass )
  *
  * \return
  **/
-static void grisbi_prefs_dialog_response  (GtkDialog *prefs,
+static void grisbi_prefs_dialog_response  ( GtkDialog *prefs,
                         gint result_id )
 {
     if ( !prefs )
@@ -121,11 +140,36 @@ static void grisbi_prefs_dialog_response  (GtkDialog *prefs,
             break;
 
         default:
+        {
+            GrisbiAppConf *conf;
+
+            conf = grisbi_app_get_conf ( );
+
+            /* on récupère la dimension de la fenêtre */
+            gtk_window_get_size ( GTK_WINDOW ( prefs ), &conf->prefs_width, &conf->prefs_height );
+
             gtk_widget_destroy ( GTK_WIDGET ( prefs ) );
+        }
     }
 }
 
 
+/**
+ * sensitive a prefs
+ *
+ * \param object the object wich receive the signal, not used so can be NULL
+ * \param widget the widget to sensitive
+ *
+ * \return FALSE
+ * */
+static void grisbi_prefs_sensitive_etat_widgets ( GrisbiPrefs *prefs,
+                        gboolean sensitive )
+{
+    gtk_widget_set_sensitive ( prefs->priv->checkbutton_crypt_file, sensitive );
+
+
+}
+
 /* GTK_BUILDER */
 /**
  * Crée un builder et récupère les widgets du fichier grisbi.ui
@@ -134,7 +178,7 @@ static void grisbi_prefs_dialog_response  (GtkDialog *prefs,
  *
  * \rerurn
  * */
-static gboolean grisbi_prefs_initialise_builder ( void )
+static gboolean grisbi_prefs_initialise_builder ( GrisbiPrefs *prefs )
 {
     /* Creation d'un nouveau GtkBuilder */
     grisbi_prefs_builder = gtk_builder_new ( );
@@ -142,14 +186,274 @@ static gboolean grisbi_prefs_initialise_builder ( void )
         return FALSE;
 
     /* récupère les widgets */
-    if ( utils_gtkbuilder_merge_ui_data_in_builder ( grisbi_prefs_builder, "grisbi_prefs.ui" ) )
-        return TRUE;
-    else
+    if ( !utils_gtkbuilder_merge_ui_data_in_builder ( grisbi_prefs_builder, "grisbi_prefs.ui" ) )
         return FALSE;
+
+    prefs->priv->hpaned = GTK_WIDGET ( gtk_builder_get_object ( grisbi_prefs_builder, "dialog_hpaned" ) );
+    prefs->priv->treeview_left_panel = GTK_WIDGET ( gtk_builder_get_object (
+                        grisbi_prefs_builder, "treeview_left_panel" ) );
+
+    prefs->priv->notebook_prefs = GTK_WIDGET ( gtk_builder_get_object ( grisbi_prefs_builder, "notebook_prefs" ) );
+
+    /* notebook files - onglet files */
+    prefs->priv->notebook_files = GTK_WIDGET ( gtk_builder_get_object ( grisbi_prefs_builder, "notebook_files" ) );
+    prefs->priv->checkbutton_load_last_file = GTK_WIDGET ( gtk_builder_get_object (
+                        grisbi_prefs_builder, "checkbutton_load_last_file" ) );
+    prefs->priv->checkbutton_sauvegarde_auto = GTK_WIDGET ( gtk_builder_get_object (
+                        grisbi_prefs_builder, "checkbutton_sauvegarde_auto" ) );
+    prefs->priv->checkbutton_force_enregistrement = GTK_WIDGET ( gtk_builder_get_object (
+                        grisbi_prefs_builder, "checkbutton_force_enregistrement" ) );
+    prefs->priv->checkbutton_crypt_file = GTK_WIDGET ( gtk_builder_get_object (
+                        grisbi_prefs_builder, "checkbutton_crypt_file" ) );
+    prefs->priv->checkbutton_compress_file = GTK_WIDGET ( gtk_builder_get_object (
+                        grisbi_prefs_builder, "checkbutton_compress_file" ) );
+    prefs->priv->spinbutton_nb_max_derniers_fichiers_ouverts = GTK_WIDGET ( gtk_builder_get_object (
+                        grisbi_prefs_builder, "spinbutton_nb_max_derniers_fichiers_ouverts" ) );
+    prefs->priv->checkbutton_stable_config_file_model = GTK_WIDGET ( gtk_builder_get_object (
+                        grisbi_prefs_builder, "checkbutton_stable_config_file_model" ) );
+    prefs->priv->filechooserbutton_accounts = GTK_WIDGET ( gtk_builder_get_object (
+                        grisbi_prefs_builder, "filechooserbutton_accounts" ) );
+
+    /* notebook files - onglet backup */
+
+    return TRUE;
+}
+
+
+/* RIGHT_PANEL : CALLBACKS */
+/**
+ * Set a boolean integer to the value of a checkbutton.  Normally called
+ * via a GTK "toggled" signal handler.
+ * 
+ * \param checkbutton a pointer to a checkbutton widget.
+ * \param value to change
+ */
+static void grisbi_prefs_checkbutton_changed ( GtkToggleButton *checkbutton,
+                        gboolean *value )
+{
+
+    if ( value )
+    {
+        *value = gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON ( checkbutton ) );
+        gsb_file_set_modified ( TRUE );
+    }
+}
+
+
+/**
+ * Set a boolean integer to the value of a checkbutton.  Normally called
+ * via a GTK "toggled" signal handler.
+ *
+ * \param eventbox a pointer to a eventbox widget.
+ * \param value to change
+ */
+static gboolean grisbi_prefs_eventbox_clicked ( GObject *eventbox,
+                        GdkEvent *event,
+                        GtkToggleButton *checkbutton )
+{
+    gboolean state;
+
+    state = gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON ( checkbutton ) );
+    gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON ( checkbutton ), !state );
+
+    return FALSE;
+}
+
+
+/**
+ * Warns that there is no coming back if password is forgotten when
+ * encryption is activated.
+ *
+ * \param checkbox  Checkbox that triggered event.
+ * \param data      Unused.
+ *
+ * \return          FALSE
+ */
+static void grisbi_prefs_encryption_toggled ( GtkToggleButton *checkbutton,
+                        gboolean *value )
+{
+    gboolean state;
+
+    state = gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON ( checkbutton ) );
+    if ( value )
+    {
+        *value = state;
+        gsb_file_set_modified ( TRUE );
+    }
+
+    if ( state )
+    {
+        GrisbiAppRun *run;
+
+        run = grisbi_app_get_run ();
+        dialog_message ( "encryption-is-irreversible" );
+        run->new_crypted_file = TRUE;
+    }
+}
+
+
+/**
+ * set nb_max_derniers_fichiers_ouverts
+ *
+ * \param spinbutton a pointer to a spinbutton widget.
+ * \param value to change
+ */
+static void grisbi_prefs_spinbutton_changed ( GtkSpinButton *spinbutton,
+                        gboolean *value )
+{
+
+    if ( value )
+    {
+        *value = gtk_spin_button_get_value_as_int ( GTK_SPIN_BUTTON ( spinbutton ) );
+        affiche_derniers_fichiers_ouverts ();
+        gsb_file_set_modified ( TRUE );
+    }
 }
 
 
-/*LEFT_PANEL*/
+/**
+ * called when choose a new directory for the account files or backup
+ *
+ * \param button the GtkFileChooserButton
+ * \param dirname
+ *
+ * \return FALSE
+ * */
+static void grisbi_prefs_dir_chosen ( GtkWidget *button,
+                        gchar *dirname )
+{
+    if ( dirname )
+        g_free ( dirname );
+
+    dirname = gtk_file_chooser_get_filename ( GTK_FILE_CHOOSER ( button ) );
+
+    gsb_file_set_modified ( TRUE );
+}
+
+
+/* RIGHT_PANEL : FILES - BACKUP */
+/**
+ * Création de la page de détermination de la période de requête
+ *
+ * \param
+ *
+ * \return la page
+ */
+static void grisbi_prefs_setup_files_page ( GrisbiPrefs *prefs,
+                        gint page )
+{
+    GrisbiAppConf *conf;
+    GrisbiWindowEtat *etat;
+
+    conf = grisbi_app_get_conf ();
+    etat = grisbi_window_get_window_etat ();
+
+    /* set the variables for account tab */
+    gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON ( prefs->priv->checkbutton_load_last_file ),
+                        conf->load_last_file );
+    gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON ( prefs->priv->checkbutton_sauvegarde_auto ),
+                        conf->sauvegarde_auto );
+    gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON ( prefs->priv->checkbutton_force_enregistrement ),
+                        conf->force_enregistrement );
+    gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON ( prefs->priv->checkbutton_crypt_file ),
+                        etat->crypt_file );
+    gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON ( prefs->priv->checkbutton_compress_file ),
+                        conf->compress_file );
+
+    /* set the max number of files */
+    gtk_spin_button_set_value ( GTK_SPIN_BUTTON ( prefs->priv->spinbutton_nb_max_derniers_fichiers_ouverts ),
+                        conf->nb_max_derniers_fichiers_ouverts );
+
+    /* set current folder for account files */
+    gtk_file_chooser_set_current_folder ( GTK_FILE_CHOOSER ( prefs->priv->filechooserbutton_accounts ),
+                        conf->account_files_path );
+
+    /* Connect signal */
+    g_signal_connect ( gtk_builder_get_object ( grisbi_prefs_builder, "eventbox_load_last_file" ),
+                        "button-press-event",
+                        G_CALLBACK ( grisbi_prefs_eventbox_clicked ),
+                        prefs->priv->checkbutton_load_last_file );
+
+    g_signal_connect ( prefs->priv->checkbutton_load_last_file,
+                        "toggled",
+                        G_CALLBACK ( grisbi_prefs_checkbutton_changed ),
+                        &conf->load_last_file );
+
+    g_signal_connect ( gtk_builder_get_object ( grisbi_prefs_builder, "eventbox_sauvegarde_auto" ),
+                        "button-press-event",
+                        G_CALLBACK ( grisbi_prefs_eventbox_clicked ),
+                        prefs->priv->checkbutton_sauvegarde_auto );
+
+    g_signal_connect ( prefs->priv->checkbutton_sauvegarde_auto,
+                        "toggled",
+                        G_CALLBACK ( grisbi_prefs_checkbutton_changed ),
+                        &conf->sauvegarde_auto );
+
+    g_signal_connect ( gtk_builder_get_object ( grisbi_prefs_builder, "eventbox_force_enregistrement" ),
+                        "button-press-event",
+                        G_CALLBACK ( grisbi_prefs_eventbox_clicked ),
+                        prefs->priv->checkbutton_force_enregistrement );
+
+    g_signal_connect ( prefs->priv->checkbutton_force_enregistrement,
+                        "toggled",
+                        G_CALLBACK ( grisbi_prefs_checkbutton_changed ),
+                        &conf->force_enregistrement );
+
+    g_signal_connect ( gtk_builder_get_object ( grisbi_prefs_builder, "eventbox_compress_file" ),
+                        "button-press-event",
+                        G_CALLBACK ( grisbi_prefs_eventbox_clicked ),
+                        prefs->priv->checkbutton_compress_file );
+
+    g_signal_connect ( prefs->priv->checkbutton_compress_file,
+                        "toggled",
+                        G_CALLBACK ( grisbi_prefs_checkbutton_changed ),
+                        &conf->compress_file );
+
+    if ( IS_DEVELOPMENT_VERSION )
+    {
+        gtk_widget_show ( GTK_WIDGET ( gtk_builder_get_object (
+                        grisbi_prefs_builder, "paddingbox_file_config" ) ) );
+        g_signal_connect ( gtk_builder_get_object ( grisbi_prefs_builder, "eventbox_stable_config_file_model" ),
+                        "button-press-event",
+                        G_CALLBACK ( grisbi_prefs_eventbox_clicked ),
+                        prefs->priv->checkbutton_stable_config_file_model );
+
+        g_signal_connect ( prefs->priv->checkbutton_stable_config_file_model,
+                        "toggled",
+                        G_CALLBACK ( grisbi_prefs_checkbutton_changed ),
+                        &conf->stable_config_file_model );
+    }
+    else
+        gtk_widget_hide ( GTK_WIDGET ( gtk_builder_get_object (
+                        grisbi_prefs_builder, "paddingbox_file_config" ) ) );
+
+    /* callback for encrypted files */
+    g_signal_connect ( prefs->priv->checkbutton_crypt_file,
+                        "toggled",
+                        G_CALLBACK ( grisbi_prefs_encryption_toggled ),
+                        NULL );
+
+    /* callback for spinbutton_nb_max_derniers_fichiers_ouverts */
+    g_signal_connect ( prefs->priv->spinbutton_nb_max_derniers_fichiers_ouverts,
+                        "value-changed",
+                        G_CALLBACK ( grisbi_prefs_spinbutton_changed ),
+                        &conf->nb_max_derniers_fichiers_ouverts );
+
+    /*  */
+    g_signal_connect ( G_OBJECT ( prefs->priv->filechooserbutton_accounts ),
+                        "selection-changed",
+                        G_CALLBACK ( grisbi_prefs_dir_chosen ),
+                        conf->account_files_path );
+
+
+    gtk_notebook_set_current_page ( GTK_NOTEBOOK ( prefs->priv->notebook_files ), 0 );
+
+
+    /* return */
+}
+
+
+/* LEFT_PANEL */
 /**
  * remplit le model pour la configuration des états
  *
@@ -159,48 +463,45 @@ static gboolean grisbi_prefs_initialise_builder ( void )
  * \return
  * */
 static void grisbi_prefs_left_panel_populate_tree_model ( GtkTreeStore *tree_model,
-                        GtkWidget *notebook )
+                        GrisbiPrefs *prefs )
 {
-    GtkWidget *widget;
     GtkTreeIter iter;
     gint page = 0;
 
     /* append group page "Main" */
     utils_ui_left_panel_add_line ( tree_model, &iter, NULL, NULL, _("Main"), -1 );
-page++;
+
+    /* append page Fichiers */
+    grisbi_prefs_setup_files_page ( prefs, page );
+    utils_ui_left_panel_add_line ( tree_model, &iter, NULL, NULL, _("Files"), page );
+    page++;
 
     /* append group page "Display" */
     utils_ui_left_panel_add_line ( tree_model, &iter, NULL, NULL, _("Display"), -1 );
-page++;
+    page++;
 
     /* append group page "Transactions" */
     utils_ui_left_panel_add_line ( tree_model, &iter, NULL, NULL, _("Transactions"), -1 );
-page++;
+    page++;
 
     /* append group page "Transaction form" */
-
     utils_ui_left_panel_add_line ( tree_model, &iter, NULL, NULL, _("Transaction form"), -1 );
-page++;
+    page++;
 
     /* append group page "Resources" */
     utils_ui_left_panel_add_line ( tree_model, &iter, NULL, NULL, _("Resources"), -1 );
-page++;
+    page++;
 
     /* append group page "Balance estimate" */
     utils_ui_left_panel_add_line ( tree_model, &iter, NULL, NULL, _("Balance estimate"), -1 );
-page++;
-
-
-
-
-    /* append page Generalities */
-/*     widget = etats_config_ui_onglet_affichage_generalites_create_page ( page );
- *     utils_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Generalities"), page );
- *     page++;
- */
+    page++;
 
+    if ( grisbi_app_get_active_filename () == NULL )
+        grisbi_prefs_sensitive_etat_widgets ( prefs, FALSE );
+    else
+        grisbi_prefs_sensitive_etat_widgets ( prefs, TRUE );
 
-    /* fin de fonction */
+    /* return */
 }
 
 
@@ -210,10 +511,9 @@ page++;
  *
  *\return tree_view or NULL;
  * */
-static GtkWidget *grisbi_prefs_left_panel_create_tree_view ( void )
+static void grisbi_prefs_left_panel_setup_tree_view ( GrisbiPrefs *prefs )
 {
     GtkWidget *tree_view = NULL;
-    GtkWidget *notebook;
     GtkTreeStore *model = NULL;
     GtkTreeViewColumn *column;
     GtkCellRenderer *cell;
@@ -230,11 +530,12 @@ static GtkWidget *grisbi_prefs_left_panel_create_tree_view ( void )
 
     /* Create container + TreeView */
     tree_view = GTK_WIDGET ( gtk_builder_get_object ( grisbi_prefs_builder, "treeview_left_panel" ) );
+    prefs->priv->treeview_left_panel = GTK_WIDGET ( gtk_builder_get_object ( grisbi_prefs_builder, "treeview_left_panel" ) );
     gtk_tree_view_set_model ( GTK_TREE_VIEW ( tree_view ), GTK_TREE_MODEL ( model ) );
     g_object_unref ( G_OBJECT ( model ) );
 
     /* set the color of selected row */
-    utils_set_tree_view_selection_and_text_color ( tree_view );
+/*     utils_set_tree_view_selection_and_text_color ( tree_view );  */
 
     /* make column */
     cell = gtk_cell_renderer_text_new ( );
@@ -247,18 +548,12 @@ static GtkWidget *grisbi_prefs_left_panel_create_tree_view ( void )
     gtk_tree_view_column_set_sizing ( GTK_TREE_VIEW_COLUMN ( column ), GTK_TREE_VIEW_COLUMN_FIXED );
     gtk_tree_view_append_column ( GTK_TREE_VIEW ( tree_view ), GTK_TREE_VIEW_COLUMN ( column ) );
 
-    /* initialisation du notebook pour les pages de la configuration */
-    notebook = GTK_WIDGET ( gtk_builder_get_object ( grisbi_prefs_builder, "notebook_prefs" ) );
-    gtk_notebook_set_show_tabs ( GTK_NOTEBOOK ( notebook ), FALSE );
-    gtk_notebook_set_show_border ( GTK_NOTEBOOK ( notebook ), FALSE );
-    gtk_container_set_border_width ( GTK_CONTAINER ( notebook ), 0 );
-
     /* Handle select */
     selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( tree_view ) );
     g_signal_connect ( selection,
                         "changed",
                         G_CALLBACK ( utils_ui_left_panel_tree_view_selection_changed ),
-                        NULL );
+                        prefs->priv->notebook_prefs );
 
     /* Choose which entries will be selectable */
     gtk_tree_selection_set_select_function ( selection,
@@ -271,16 +566,14 @@ static GtkWidget *grisbi_prefs_left_panel_create_tree_view ( void )
                         "0:0" );
 
     /* remplissage du paned gauche */
-    grisbi_prefs_left_panel_populate_tree_model ( model, notebook );
+    grisbi_prefs_left_panel_populate_tree_model ( model, prefs );
 
     /* show all widgets */
     gtk_widget_show_all ( tree_view );
-
-    return tree_view;
 }
 
 
-/*CREATE OBJECT */
+/* CREATE OBJECT */
 /**
  * Initialise GrisbiPrefs
  *
@@ -297,7 +590,7 @@ static void grisbi_prefs_init ( GrisbiPrefs *prefs )
 
     prefs->priv = GRISBI_PREFS_GET_PRIVATE ( prefs );
 
-    if ( !grisbi_prefs_initialise_builder ( ) )
+    if ( !grisbi_prefs_initialise_builder ( prefs ) )
         exit ( 1 );
 
     gtk_dialog_add_buttons ( GTK_DIALOG ( prefs ),
@@ -319,10 +612,10 @@ static void grisbi_prefs_init ( GrisbiPrefs *prefs )
     /* set the default size */
     if ( conf->prefs_width )
         gtk_window_set_default_size ( GTK_WINDOW ( prefs ),
-                        conf->prefs_width, -1 );
+                        conf->prefs_width, conf->prefs_height );
 
     /* create the tree_view */
-    prefs->priv->treeview_left_panel = grisbi_prefs_left_panel_create_tree_view ( );
+    grisbi_prefs_left_panel_setup_tree_view ( prefs );
 
     /* connect the signals */
     g_signal_connect ( prefs,
@@ -330,11 +623,12 @@ static void grisbi_prefs_init ( GrisbiPrefs *prefs )
                         G_CALLBACK ( grisbi_prefs_dialog_response ),
                         NULL);
 
-    prefs->priv->hpaned = GTK_WIDGET ( gtk_builder_get_object ( grisbi_prefs_builder, "dialog_hpaned" ) );
     gtk_box_pack_start ( GTK_BOX ( gtk_dialog_get_content_area ( GTK_DIALOG ( prefs ) ) ),
                         prefs->priv->hpaned, TRUE, TRUE, 0 );
     g_object_unref ( prefs->priv->hpaned );
 
+    gtk_widget_show_all ( prefs->priv->hpaned );
+
     /* return */
 }
 
@@ -346,7 +640,7 @@ static void grisbi_prefs_init ( GrisbiPrefs *prefs )
  *
  * \return
  **/
-void grisb_show_prefs_dialog ( GrisbiWindow *parent )
+void grisb_prefs_show_dialog ( GrisbiWindow *parent )
 {
     if ( !GRISBI_IS_WINDOW ( parent ) )
         return;
@@ -371,6 +665,19 @@ void grisb_show_prefs_dialog ( GrisbiWindow *parent )
 
 
 /**
+ * retourne le widget demandé
+ *
+ * \param
+ *
+ * \return
+ */
+GtkWidget *grisbi_prefs_widget_get_widget_by_name ( const gchar *name )
+{
+    return utils_gtkbuilder_get_widget_by_name ( grisbi_prefs_builder, name, NULL);
+}
+
+
+/**
  *
  *
  * \param parent
diff --git a/src/grisbi_prefs.h b/src/grisbi_prefs.h
index a2457bb..35562fc 100644
--- a/src/grisbi_prefs.h
+++ b/src/grisbi_prefs.h
@@ -47,7 +47,8 @@ struct _GrisbiPrefsClass
 
 /* START_DECLARATION */
 GType grisbi_prefs_get_type ( void ) G_GNUC_CONST;
-void grisb_show_prefs_dialog ( GrisbiWindow *parent );
+void grisb_prefs_show_dialog ( GrisbiWindow *parent );
+GtkWidget *grisbi_prefs_widget_get_widget_by_name ( const gchar *name );
 /* END_DECLARATION */
 
 G_END_DECLS
diff --git a/src/grisbi_ui.h b/src/grisbi_ui.h
index 61e5627..75f11ee 100644
--- a/src/grisbi_ui.h
+++ b/src/grisbi_ui.h
@@ -57,6 +57,8 @@ static const GtkActionEntry always_sensitive_entries[] =
 
     /* Edit menu */
     {"EditMenuAction", NULL, N_("_Edit"), NULL, NULL, NULL },
+    {"PrefsAction", GTK_STOCK_PREFERENCES, N_("_Preferences"), NULL, NULL,
+     G_CALLBACK ( gsb_menu_preferences ) },
 
     /* View menu */
     {"ViewMenuAction", NULL, N_("_View"), NULL, NULL, NULL },
@@ -117,8 +119,6 @@ static const GtkActionEntry division_sensitive_entries[] =
 #endif
     {"NewAccountAction", GTK_STOCK_NEW, N_("_New account"), "", NULL,
      G_CALLBACK ( gsb_assistant_account_run ) },
-    {"PrefsAction", GTK_STOCK_PREFERENCES, N_("_Preferences"), NULL, NULL,
-     G_CALLBACK ( gsb_menu_preferences ) },
 };
 
 static const GtkActionEntry file_save_entries[] =
diff --git a/src/grisbi_window.c b/src/grisbi_window.c
index 7dc702e..c8d017d 100644
--- a/src/grisbi_window.c
+++ b/src/grisbi_window.c
@@ -49,15 +49,6 @@
 
 
 /*START_STATIC*/
-static GtkActionGroup *grisbi_window_add_recents_action_group ( GtkUIManager *ui_manager,
-                        GrisbiAppConf *conf );
-static void grisbi_window_add_recents_sub_menu ( GtkUIManager *ui_manager,
-                        gint nb_derniers_fichiers_ouverts );
-static void grisbi_window_init_menus ( GrisbiWindow *window );
-static gboolean grisbi_window_initialise_builder ( void );
-static GtkWidget *grisbi_window_new_accueil_page ( GrisbiWindow *window );
-static GtkWidget *grisbi_window_new_headings_eb ( GrisbiWindow *window );
-static GtkWidget *grisbi_window_new_statusbar ( GrisbiWindow *window );
 /*END_STATIC*/
 
 #define GSB_NBRE_CHAR 15
@@ -95,6 +86,8 @@ struct _GrisbiWindowPrivate
     GtkActionGroup      *edit_sensitive_action_group;
     GtkActionGroup      *edit_transactions_action_group;
     GtkActionGroup      *view_sensitive_action_group;
+    guint                recent_files_merge_id;             /* utile pour la mise à jour du menu recent file */
+    guint                move_to_account_merge_id;          /* utile pour la mise à jour du menu move_to_account */
 
     /* statusbar */
     GtkWidget           *statusbar;
@@ -112,6 +105,13 @@ struct _GrisbiWindowPrivate
 G_DEFINE_TYPE(GrisbiWindow, grisbi_window, GTK_TYPE_WINDOW)
 
 
+/**
+ *
+ *
+ * \param
+ *
+ * \return
+ **/
 static void grisbi_window_realized ( GtkWidget *window,
                         gpointer  *data )
 {
@@ -120,6 +120,13 @@ static void grisbi_window_realized ( GtkWidget *window,
 }
 
 
+/**
+ *
+ *
+ * \param
+ *
+ * \return
+ **/
 static void grisbi_window_finalize ( GObject *object )
 {
     GrisbiWindow *window;
@@ -136,6 +143,13 @@ static void grisbi_window_finalize ( GObject *object )
 }
 
 
+/**
+ *
+ *
+ * \param
+ *
+ * \return
+ **/
 static gboolean grisbi_window_key_press_event ( GtkWidget *widget,
                         GdkEventKey *event,
                         gpointer data )
@@ -157,6 +171,13 @@ static gboolean grisbi_window_key_press_event ( GtkWidget *widget,
 }
 
 
+/**
+ *
+ *
+ * \param
+ *
+ * \return
+ **/
 static gboolean grisbi_window_state_event ( GtkWidget *widget,
                         GdkEventWindowState *event )
 {
@@ -185,6 +206,13 @@ static gboolean grisbi_window_state_event ( GtkWidget *widget,
 }
 
 
+/**
+ *
+ *
+ * \param
+ *
+ * \return
+ **/
 static void grisbi_window_class_init ( GrisbiWindowClass *klass )
 {
     GObjectClass *object_class = G_OBJECT_CLASS ( klass );
@@ -197,65 +225,97 @@ static void grisbi_window_class_init ( GrisbiWindowClass *klass )
 }
 
 
-static void grisbi_window_init ( GrisbiWindow *window )
+/* MENUS */
+/**
+ * Add menu items to the action_group "FileRecentFilesGroupAction"
+ *
+ * \param
+ *
+ * \return
+ **/
+static GtkActionGroup *grisbi_window_add_recents_action_group ( GtkUIManager *ui_manager,
+                        GrisbiAppConf *conf )
 {
-    GtkWidget *main_box;
-    GtkWidget *statusbar;
-    GtkWidget *headings_eb;
-    GrisbiAppConf *conf;
+    GtkActionGroup *actions;
+    gint i;
 
-    window->priv = GRISBI_WINDOW_GET_PRIVATE ( window );
+    devel_debug (NULL);
 
-    if ( !grisbi_window_initialise_builder ( ) )
-        exit ( 1 );
+    actions = gtk_action_group_new ( "FileRecentFilesGroupAction" );
+    for ( i = 0 ; i < conf->nb_derniers_fichiers_ouverts ; i++ )
+    {
+        gchar *tmp_name;
+        GtkAction *action;
 
-    /* Création de la fenêtre principale de Grisbi */
-    main_box = GTK_WIDGET ( gtk_builder_get_object ( grisbi_window_builder, "main_vbox" ) );
+        tmp_name = g_strdup_printf ( "LastFile%d", i );
 
-    window->priv->main_box = main_box;
+        action = gtk_action_new ( tmp_name,
+                        conf->tab_noms_derniers_fichiers_ouverts[i],
+                        "",
+                        "gtk-open" );
+        g_free ( tmp_name );
+        g_signal_connect ( action,
+                        "activate",
+                        G_CALLBACK ( gsb_file_open_direct_menu ),
+                        GINT_TO_POINTER ( i ) );
+        gtk_action_group_add_action ( actions, action );
+    }
 
-    gtk_container_add ( GTK_CONTAINER ( window ), main_box );
-    gtk_widget_show ( main_box );
+    gtk_ui_manager_insert_action_group ( ui_manager, actions, 1 );
+    g_object_unref ( actions );
 
-    /* create the menus */
-    grisbi_window_init_menus ( window );
+    return actions;
+}
 
-    /* create the headings eb */
-    headings_eb = grisbi_window_new_headings_eb ( window );
-    gtk_box_pack_start ( GTK_BOX ( main_box ), headings_eb, FALSE, FALSE, 0 );
 
-    /* create the statusbar */
-    statusbar = grisbi_window_new_statusbar ( window );
-    gtk_box_pack_end ( GTK_BOX ( main_box ), statusbar, FALSE, FALSE, 0 );
+/**
+ * Add menu items to the action_group "FileRecentFilesGroupAction".
+ *
+ * \param
+ *
+ * \return
+ **/
+static void grisbi_window_add_recents_sub_menu ( GrisbiWindow *window,
+                        gint nb_derniers_fichiers_ouverts )
+{
+    GtkUIManager *ui_manager;
+    gint i;
 
-    /* on initialise une page d'accueil si on ne charge pas de fichier */
-    conf = grisbi_app_get_conf ();
+    devel_debug (NULL);
 
-    window->priv->accueil_page = grisbi_window_new_accueil_page ( window );
-    gtk_box_pack_start ( GTK_BOX ( main_box ), window->priv->accueil_page, FALSE, FALSE, 0 );
+    ui_manager = window->priv->ui_manager;
 
-    if ( conf->load_last_file && conf->nb_derniers_fichiers_ouverts > 0 )
-        gtk_widget_hide ( window->priv->accueil_page );
+    window->priv->recent_files_merge_id = gtk_ui_manager_new_merge_id ( ui_manager );
 
-    /* initialisation de la variable etat */
-    window->priv->etat = g_malloc0 ( sizeof ( GrisbiWindowEtat ) );
+    for ( i=0 ; i < nb_derniers_fichiers_ouverts ; i++ )
+    {
+        gchar *tmp_name;
+        gchar *tmp_label;
 
-    /* initialisation des variables de la fenêtre */
-/*     init_variables ();  */
+        tmp_name = g_strdup_printf ( "LastFile%d", i );
+        tmp_label = g_strdup_printf ( "_%d LastFile%d", i, i );
 
-    /* set the signals */
-    g_signal_connect ( G_OBJECT ( window ),
-                        "realize",
-                        G_CALLBACK ( grisbi_window_realized ),
-                        NULL );
+        gtk_ui_manager_add_ui ( ui_manager,
+                    window->priv->recent_files_merge_id,
+                    "/menubar/FileMenu/RecentFiles/FileRecentsPlaceholder",
+                    tmp_label,
+                    tmp_name,
+                    GTK_UI_MANAGER_MENUITEM,
+                    FALSE );
 
-    g_signal_connect ( G_OBJECT ( window ),
-                        "key-press-event",
-                        G_CALLBACK ( grisbi_window_key_press_event ),
-                        NULL );
+        g_free ( tmp_name );
+        g_free ( tmp_label );
+    }
 }
 
-/* MENUS */
+
+/**
+ *
+ *
+ * \param
+ *
+ * \return
+ **/
 static void grisbi_window_init_menus ( GrisbiWindow *window )
 {
     GrisbiAppConf *conf;
@@ -266,6 +326,7 @@ static void grisbi_window_init_menus ( GrisbiWindow *window )
 
     ui_manager = gtk_ui_manager_new ( );
     window->priv->ui_manager = ui_manager;
+    window->priv->recent_files_merge_id = -1;
 
     conf = grisbi_app_get_conf ( );
 
@@ -403,7 +464,7 @@ static void grisbi_window_init_menus ( GrisbiWindow *window )
     if ( conf->nb_derniers_fichiers_ouverts && conf->nb_max_derniers_fichiers_ouverts )
     {
         actions = grisbi_window_add_recents_action_group ( ui_manager, conf );
-        grisbi_window_add_recents_sub_menu ( ui_manager, conf->nb_derniers_fichiers_ouverts );
+        grisbi_window_add_recents_sub_menu ( window, conf->nb_derniers_fichiers_ouverts );
         window->priv->file_recent_files_action_group = actions;
     }
 
@@ -432,6 +493,13 @@ GtkUIManager *grisbi_window_get_ui_manager ( GrisbiWindow *window )
 }
 
 
+/**
+ *
+ *
+ * \param
+ *
+ * \return
+ **/
 GtkActionGroup *grisbi_window_get_action_group ( GrisbiWindow *window,
                         const gchar *action_group_name )
 {
@@ -453,85 +521,45 @@ GtkActionGroup *grisbi_window_get_action_group ( GrisbiWindow *window,
         return NULL;
 }
 
-
 /**
- * Add menu items to the action_group "FileRecentFilesGroupAction"
+ * retourne merge_id utile pour efface_derniers_fichiers_ouverts ()
  *
- * \param
+ * \param window
+ * \param nom du sous menu concerné
  *
- * \return
+ * \return recent_files_merge_id
  **/
-static GtkActionGroup *grisbi_window_add_recents_action_group ( GtkUIManager *ui_manager,
-                        GrisbiAppConf *conf )
+guint grisbi_window_get_sub_menu_merge_id ( GrisbiWindow *window,
+                        const gchar *sub_menu )
 {
-    GtkActionGroup *actions;
-    gint i;
-
-    devel_debug (NULL);
-
-    actions = gtk_action_group_new ( "FileRecentFilesGroupAction" );
-    for ( i = 0 ; i < conf->nb_derniers_fichiers_ouverts ; i++ )
-    {
-        gchar *tmp_name;
-        GtkAction *action;
-
-        tmp_name = g_strdup_printf ( "LastFile%d", i );
-
-        action = gtk_action_new ( tmp_name, 
-                        conf->tab_noms_derniers_fichiers_ouverts[i],
-                        "",
-                        "" );
-        g_free ( tmp_name );
-        g_signal_connect ( action,
-                        "activate",
-                        G_CALLBACK ( gsb_file_open_direct_menu ), 
-                        GINT_TO_POINTER ( i ) );
-        gtk_action_group_add_action ( actions, action );
-    }
-
-    gtk_ui_manager_insert_action_group ( ui_manager, actions, 1 );
-    g_object_unref ( actions );
-
-    return actions;
+    if ( strcmp ( sub_menu, "recent_file" ) == 0 )
+        return window->priv->recent_files_merge_id;
+    else if ( strcmp ( sub_menu, "move_to_account" ) == 0 )
+        return window->priv->move_to_account_merge_id;
+    else
+        return 0;
 }
 
 
 /**
- * Add menu items to the action_group "FileRecentFilesGroupAction".
+ * set the merge_id for the submenu given in parameter
  *
- * \param
+ * \param window
+ * \param merge_id
+ * \param name of the submenu
  *
- * \return
+ * \return recent_files_merge_id
  **/
-static void grisbi_window_add_recents_sub_menu ( GtkUIManager *ui_manager,
-                        gint nb_derniers_fichiers_ouverts )
+void grisbi_window_set_sub_menu_merge_id ( GrisbiWindow *window,
+                        guint merge_id,
+                        const gchar *sub_menu )
 {
-    gint recent_files_merge_id = -1;
-    gint i;
-
-    devel_debug (NULL);
-
-    recent_files_merge_id = gtk_ui_manager_new_merge_id ( ui_manager );
-
-    for ( i=0 ; i < nb_derniers_fichiers_ouverts ; i++ )
-    {
-        gchar *tmp_name;
-        gchar *tmp_label;
-
-        tmp_name = g_strdup_printf ( "LastFile%d", i );
-        tmp_label = g_strdup_printf ( "_%d LastFile%d", i, i );
-
-        gtk_ui_manager_add_ui ( ui_manager,
-                    recent_files_merge_id, 
-                    "/menubar/FileMenu/RecentFiles/FileRecentsPlaceholder",
-                    tmp_label,
-                    tmp_name,
-                    GTK_UI_MANAGER_MENUITEM,
-                    FALSE );
-
-        g_free ( tmp_name );
-        g_free ( tmp_label );
-    }
+    if ( strcmp ( sub_menu, "recent_file" ) == 0 )
+        window->priv->recent_files_merge_id = merge_id;
+    else if ( strcmp ( sub_menu, "move_to_account" ) == 0 )
+        window->priv->move_to_account_merge_id = merge_id;
+    else
+        window->priv->recent_files_merge_id = 0;
 }
 
 
@@ -559,6 +587,13 @@ gboolean grisbi_window_initialise_builder ( void )
 
 
 /* BLANK_PAGE */
+/**
+ * page d'accueil si on ne charge pas un fichier automatiquement
+ *
+ * \param
+ *
+ * \return
+ **/
 static GtkWidget *grisbi_window_new_accueil_page ( GrisbiWindow *window )
 {
     GtkWidget *accueil_page;
@@ -987,6 +1022,72 @@ GtkWidget *grisbi_window_new_hpaned ( GrisbiWindow *window )
 }
 
 
+/* CREATE OBJECT */
+/**
+ * Initialise GrisbiWindow
+ *
+ * \param window
+ *
+ * \return
+ */
+static void grisbi_window_init ( GrisbiWindow *window )
+{
+    GtkWidget *main_box;
+    GtkWidget *statusbar;
+    GtkWidget *headings_eb;
+    GrisbiAppConf *conf;
+
+    window->priv = GRISBI_WINDOW_GET_PRIVATE ( window );
+
+    if ( !grisbi_window_initialise_builder ( ) )
+        exit ( 1 );
+
+    /* Création de la fenêtre principale de Grisbi */
+    main_box = GTK_WIDGET ( gtk_builder_get_object ( grisbi_window_builder, "main_vbox" ) );
+
+    window->priv->main_box = main_box;
+
+    gtk_container_add ( GTK_CONTAINER ( window ), main_box );
+    gtk_widget_show ( main_box );
+
+    /* create the menus */
+    grisbi_window_init_menus ( window );
+
+    /* create the headings eb */
+    headings_eb = grisbi_window_new_headings_eb ( window );
+    gtk_box_pack_start ( GTK_BOX ( main_box ), headings_eb, FALSE, FALSE, 0 );
+
+    /* create the statusbar */
+    statusbar = grisbi_window_new_statusbar ( window );
+    gtk_box_pack_end ( GTK_BOX ( main_box ), statusbar, FALSE, FALSE, 0 );
+
+    /* on initialise une page d'accueil si on ne charge pas de fichier */
+    conf = grisbi_app_get_conf ();
+
+    window->priv->accueil_page = grisbi_window_new_accueil_page ( window );
+    gtk_box_pack_start ( GTK_BOX ( main_box ), window->priv->accueil_page, FALSE, FALSE, 0 );
+
+    if ( conf->load_last_file && conf->nb_derniers_fichiers_ouverts > 0 )
+        gtk_widget_hide ( window->priv->accueil_page );
+
+    /* initialisation de la variable etat */
+    window->priv->etat = g_malloc0 ( sizeof ( GrisbiWindowEtat ) );
+
+    /* initialisation des variables de la fenêtre */
+/*     init_variables ();  */
+
+    /* set the signals */
+    g_signal_connect ( G_OBJECT ( window ),
+                        "realize",
+                        G_CALLBACK ( grisbi_window_realized ),
+                        NULL );
+
+    g_signal_connect ( G_OBJECT ( window ),
+                        "key-press-event",
+                        G_CALLBACK ( grisbi_window_key_press_event ),
+                        NULL );
+}
+
 /* FONCTIONS UTILITAIRES */
 /**
  * retourne le widget nommé
@@ -1017,7 +1118,7 @@ GrisbiWindowEtat *grisbi_window_get_window_etat ( void )
     GrisbiApp *app;
     GrisbiWindow *window;
 
-    app = grisbi_app_get_default ( );
+    app = grisbi_app_get_default ();
     window = grisbi_app_get_active_window ( app );
 
     return window->priv->etat;
diff --git a/src/grisbi_window.h b/src/grisbi_window.h
index 8d8a57b..002ab1b 100644
--- a/src/grisbi_window.h
+++ b/src/grisbi_window.h
@@ -54,6 +54,8 @@ GrisbiWindowEtat *grisbi_window_get_window_etat ( void );
 const gchar *grisbi_window_get_filename ( GrisbiWindow *window );
 const gchar *grisbi_window_get_file_title ( GrisbiWindow *window );
 GtkWidget *grisbi_window_get_headings_eb ( GrisbiWindow *window );
+guint grisbi_window_get_sub_menu_merge_id ( GrisbiWindow *window,
+                        const gchar *sub_menu );
 GtkWidget *grisbi_window_get_widget_by_name (  const gchar *name );
 GtkUIManager *grisbi_window_get_ui_manager ( GrisbiWindow *window );
 GtkWidget *grisbi_window_new_general_widget ( void );
@@ -65,6 +67,9 @@ gboolean grisbi_window_set_filename ( GrisbiWindow *window,
                         const gchar *filename );
 gboolean grisbi_window_set_file_title ( GrisbiWindow *window,
                         const gchar *file_title );
+void grisbi_window_set_sub_menu_merge_id ( GrisbiWindow *window,
+                        guint merge_id,
+                        const gchar *sub_menu );
 void grisbi_window_set_window_title ( GrisbiWindow *window,
                         const gchar *title );
 void grisbi_window_statusbar_remove ( GrisbiWindow *window );
diff --git a/src/gsb_assistant_file.c b/src/gsb_assistant_file.c
index e762afd..e745db2 100644
--- a/src/gsb_assistant_file.c
+++ b/src/gsb_assistant_file.c
@@ -263,6 +263,9 @@ static GtkWidget *gsb_assistant_file_page_2 ( GtkWidget *assistant )
     GtkWidget *filename_entry;
     gchar *nom_fichier_comptes;
     gchar *titre_fichier;
+    GrisbiAppRun *run;
+
+    run = grisbi_app_get_run ();
 
     page = gtk_hbox_new (FALSE, 15);
     gtk_container_set_border_width ( GTK_CONTAINER (page), 10 );
@@ -333,11 +336,11 @@ static GtkWidget *gsb_assistant_file_page_2 ( GtkWidget *assistant )
         gtk_box_pack_start ( GTK_BOX ( paddingbox ), button, FALSE, FALSE, 0 );
 
         if ( etat.crypt_file )
-            run.new_crypted_file = TRUE;
+            run->new_crypted_file = TRUE;
     }
     else
     {
-        run.new_crypted_file = FALSE;
+        run->new_crypted_file = FALSE;
     }
 
     /* date format */
diff --git a/src/gsb_assistant_first.c b/src/gsb_assistant_first.c
index 285d2d3..01f30e5 100644
--- a/src/gsb_assistant_first.c
+++ b/src/gsb_assistant_first.c
@@ -199,8 +199,10 @@ static GtkWidget *gsb_assistant_first_page_2 ( GtkWidget *assistant )
     GtkWidget *hbox;
     GtkWidget *dialog;
     GrisbiAppConf *conf;
+    GrisbiAppRun *run;
 
     conf = grisbi_app_get_conf ( );
+    run = grisbi_app_get_run ();
 
     page = gtk_hbox_new (FALSE, 15);
     gtk_container_set_border_width ( GTK_CONTAINER (page), 10 );
@@ -257,11 +259,11 @@ static GtkWidget *gsb_assistant_first_page_2 ( GtkWidget *assistant )
         gtk_box_pack_start ( GTK_BOX ( paddingbox ), button, FALSE, FALSE, 0 );
 
         if ( etat.crypt_file )
-            run.new_crypted_file = TRUE;
+            run->new_crypted_file = TRUE;
     }
     else
     {
-        run.new_crypted_file = FALSE;
+        run->new_crypted_file = FALSE;
     }
 
     /* Automatic backup ? */
diff --git a/src/gsb_file.c b/src/gsb_file.c
index 1294c7b..79a90eb 100644
--- a/src/gsb_file.c
+++ b/src/gsb_file.c
@@ -38,7 +38,6 @@
 #include "affichage_liste.h"
 #include "dialog.h"
 #include "fenetre_principale.h"
-#include "grisbi_app.h"
 #include "grisbi_window.h"
 #include "gsb_account_property.h"
 #include "gsb_assistant_account.h"
@@ -80,8 +79,6 @@ static void gsb_file_save_remove_old_file ( gchar *filename );
  * keep the last path used in grisbi, save in the configuration at the end */
 static gchar *last_path_used;
 
-static gchar *backup_path;
-
 /** the timeout used to save a backup every x minutes */
 gint id_timeout = 0;
 
@@ -249,9 +246,14 @@ const gchar *gsb_file_get_last_path ( void )
  * */
 const gchar *gsb_file_get_backup_path ( void )
 {
-    return backup_path;
+    GrisbiAppRun *run;
+
+    run = grisbi_app_get_run ();
+
+    return run->backup_path;
 }
 
+
 /**
  * set the backup path
  *
@@ -261,10 +263,14 @@ const gchar *gsb_file_get_backup_path ( void )
  * */
 void gsb_file_set_backup_path ( const gchar *path )
 {
+    GrisbiAppRun *run;
+
+    run = grisbi_app_get_run ();
+
     if ( path == NULL || strlen ( path ) == 0 )
-        backup_path = my_strdup ( gsb_dirs_get_user_config_dir ( ) );
+        run->backup_path = my_strdup ( gsb_dirs_get_user_config_dir ( ) );
     else
-        backup_path = my_strdup ( path );
+        run->backup_path = my_strdup ( path );
 
     if ( !g_file_test ( path, G_FILE_TEST_EXISTS ) )
     {
@@ -1250,6 +1256,52 @@ gboolean gsb_file_open_from_commandline ( GSList *file_list )
     return FALSE;
 }
 
+
+/**
+ * get the account files path
+ *
+ * \param
+ *
+ * \return a const gchar with the backup path
+ * */
+const gchar *gsb_file_get_account_files_path ( void )
+{
+    GrisbiAppConf *conf;
+
+    conf = grisbi_app_get_conf ();
+    return conf->account_files_path;
+}
+
+
+/**
+ * set the account files path
+ *
+ * \param le nom du répertoire ou NULL
+ *
+ * \return a const gchar with the backup path
+ * */
+void gsb_file_set_account_files_path ( const gchar *path,
+                        GrisbiAppConf *conf )
+{
+devel_debug ( path );
+    if ( path == NULL || strlen ( path ) == 0 )
+        conf->account_files_path = my_strdup ( gsb_dirs_get_home_dir ( ) );
+    else
+        conf->account_files_path = my_strdup ( path );
+
+    if ( !g_file_test ( conf->account_files_path, G_FILE_TEST_EXISTS ) )
+    {
+#ifdef _MSC_VER
+        int mode = 0;
+#else
+        int mode = S_IRUSR | S_IWUSR | S_IXUSR;
+#endif /*_MSC_VER */
+
+        g_mkdir_with_parents ( conf->account_files_path, mode );
+    }
+}
+
+
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */
diff --git a/src/gsb_file.h b/src/gsb_file.h
index 9a99fa3..7a04b79 100644
--- a/src/gsb_file.h
+++ b/src/gsb_file.h
@@ -4,6 +4,7 @@
 #include <gtk/gtk.h>
 
 /* START_INCLUDE_H */
+#include "grisbi_app.h"
 /* END_INCLUDE_H */
 
 
@@ -13,6 +14,7 @@ gboolean gsb_file_automatic_backup_change_time ( GtkWidget *spinbutton,
 gboolean gsb_file_automatic_backup_start ( GtkWidget *checkbutton,
                         gpointer null );
 gboolean gsb_file_close ( void );
+const gchar *gsb_file_get_account_files_path ( void );
 const gchar *gsb_file_get_backup_path ( void );
 const gchar *gsb_file_get_last_path ( void );
 gboolean gsb_file_new ( void );
@@ -26,6 +28,8 @@ gboolean gsb_file_open_menu ( void );
 void gsb_file_remove_name_from_opened_list ( gchar *filename );
 gboolean gsb_file_save ( void );
 gboolean gsb_file_save_as ( void );
+void gsb_file_set_account_files_path ( const gchar *path,
+                        GrisbiAppConf *conf );
 void gsb_file_set_backup_path ( const gchar *path );
 void gsb_file_update_last_path ( const gchar *last_path );
 void gsb_file_set_modified ( gboolean modified );
diff --git a/src/gsb_file_config.c b/src/gsb_file_config.c
index 647fe6d..71bd670 100644
--- a/src/gsb_file_config.c
+++ b/src/gsb_file_config.c
@@ -82,8 +82,6 @@ gboolean gsb_file_config_load_config ( GrisbiAppConf *conf )
     gint int_ret;
     GError* err = NULL;
 
-    devel_debug ( conf_filename );
-
     gsb_file_config_clean_config ( conf );
 
     if ( !g_file_test ( conf_filename, G_FILE_TEST_EXISTS ) )
@@ -174,10 +172,23 @@ gboolean gsb_file_config_load_config ( GrisbiAppConf *conf )
         err = NULL;
     }
 
-    conf->prefs_width = g_key_file_get_integer ( config,
+    int_ret = g_key_file_get_integer ( config,
                         "Geometry",
-                        "Prefs width",
-                        NULL );
+                        "Prefs_width",
+                        &err );
+    if ( err == NULL )
+        conf->prefs_width = int_ret;
+    else
+        err = NULL;
+
+    int_ret = g_key_file_get_integer ( config,
+                        "Geometry",
+                        "Prefs_height",
+                        &err );
+    if ( err == NULL )
+        conf->prefs_height = int_ret;
+    else
+        err = NULL;
 
     /* get general */
     conf->r_modifiable = g_key_file_get_integer ( config,
@@ -259,10 +270,11 @@ gboolean gsb_file_config_load_config ( GrisbiAppConf *conf )
                         "Compress backup",
                         NULL );
 
-    gsb_file_set_backup_path ( g_key_file_get_string ( config,
-                        "Backup",
-                        "Backup path",
-                        NULL ));
+/*     gsb_file_set_backup_path ( g_key_file_get_string ( config,
+ *                         "Backup",
+ *                         "Backup path",
+ *                         NULL ));
+ */
 
     /* get input/output */
     conf->load_last_file = g_key_file_get_integer ( config,
@@ -282,7 +294,7 @@ gboolean gsb_file_config_load_config ( GrisbiAppConf *conf )
 
     conf->nb_max_derniers_fichiers_ouverts = g_key_file_get_integer ( config,
                         "IO",
-                        "Nb last opened files",
+                        "Nb_max_derniers_fichiers_ouverts",
                         NULL );
 
     conf->compress_file = g_key_file_get_integer ( config,
@@ -298,15 +310,21 @@ gboolean gsb_file_config_load_config ( GrisbiAppConf *conf )
     conf->tab_noms_derniers_fichiers_ouverts = g_key_file_get_string_list ( config,
                         "IO",
                         "Names last files",
-                        &conf->nb_derniers_fichiers_ouverts,
+                        ( gsize *) &conf->nb_derniers_fichiers_ouverts,
                         NULL );
 
-    conf->check_for_archival = g_key_file_get_integer ( config, 
+    gsb_file_set_account_files_path ( g_key_file_get_string ( config,
+                        "IO",
+                        "Account_files_path",
+                        NULL ), conf );
+
+    /* archival part */
+    conf->check_for_archival = g_key_file_get_integer ( config,
                         "IO",
                         "Check_archival_at_opening",
                         NULL );
 
-    conf->max_non_archived_transactions_for_check = g_key_file_get_integer ( config, 
+    conf->max_non_archived_transactions_for_check = g_key_file_get_integer ( config,
                         "IO",
                         "Max_transactions_before_warn_archival",
                         NULL );
@@ -511,9 +529,14 @@ gboolean gsb_file_config_save_config ( GrisbiAppConf *conf )
 
     g_key_file_set_integer ( config,
                         "Geometry",
-                        "Prefs width",
+                        "Prefs_width",
                         conf->prefs_width );
 
+    g_key_file_set_integer ( config,
+                        "Geometry",
+                        "Prefs_height",
+                        conf->prefs_height );
+
     /* Remember size of main panel */
     g_key_file_set_integer ( config,
                         "Geometry",
@@ -630,7 +653,7 @@ gboolean gsb_file_config_save_config ( GrisbiAppConf *conf )
 
     g_key_file_set_integer ( config,
                         "IO",
-                        "Nb last opened files",
+                        "Nb_max_derniers_fichiers_ouverts",
                         conf->nb_max_derniers_fichiers_ouverts );
 
     g_key_file_set_integer ( config,
@@ -652,12 +675,18 @@ gboolean gsb_file_config_save_config ( GrisbiAppConf *conf )
                         (const gchar **) conf->tab_noms_derniers_fichiers_ouverts,
                         conf->nb_derniers_fichiers_ouverts);
 
-    g_key_file_set_integer ( config, 
+    g_key_file_set_string ( config,
+                        "IO",
+                        "Account_files_path",
+                        gsb_file_get_account_files_path () );
+
+    /* archival part */
+    g_key_file_set_integer ( config,
                         "IO",
                         "Check_archival_at_opening",
                         conf->check_for_archival );
 
-    g_key_file_set_integer ( config, 
+    g_key_file_set_integer ( config,
                         "IO",
                         "Max_transactions_before_warn_archival",
                         conf->max_non_archived_transactions_for_check );
@@ -832,7 +861,8 @@ void gsb_file_config_clean_config ( GrisbiAppConf *conf )
     conf->main_width = 800;
     conf->main_height = 600;
     conf->panel_width = 250;
-    conf->prefs_width = 600;
+    conf->prefs_width = 720;
+    conf->main_height = 450;
 
     conf->force_enregistrement = 1;
 
@@ -845,7 +875,7 @@ void gsb_file_config_clean_config ( GrisbiAppConf *conf )
     conf->balances_with_scheduled = TRUE;
     conf->formulaire_toujours_affiche = 0;           /* le formulaire ne s'affiche que lors de l'edition d'1 opé */
     conf->affichage_exercice_automatique = 0;        /* l'exercice est choisi en fonction de la date */
-    conf->automatic_completion_payee = 0;            /* by default automatic completion */
+    conf->automatic_completion_payee = 1;            /* by default automatic completion */
     conf->limit_completion_to_current_account = 0;   /* By default, do full search */
     conf->automatic_recover_splits = 1;
     conf->automatic_erase_credit_debit = 0;
@@ -865,10 +895,11 @@ void gsb_file_config_clean_config ( GrisbiAppConf *conf )
         g_free ( conf->font_string );
         conf->font_string = NULL;
     }
-    
+
     conf->force_enregistrement = 1;                     /* par défaut, on force l'enregistrement */
-    gsb_file_update_last_path ( g_get_home_dir ( ) );
-    gsb_file_set_backup_path ( gsb_dirs_get_user_data_dir ( ) );
+    gsb_file_update_last_path ( g_get_home_dir () );
+    gsb_file_set_account_files_path ( g_get_home_dir (), conf );
+/*     gsb_file_set_backup_path ( gsb_dirs_get_user_data_dir () );  */
     conf->make_backup = 1;
     conf->make_backup_every_minutes = FALSE;
     conf->make_backup_nb_minutes = 0;
diff --git a/src/main.c b/src/main.c
index b9c3c6a..dafc4bf 100644
--- a/src/main.c
+++ b/src/main.c
@@ -241,7 +241,7 @@ void gsb_main_load_file_if_necessary ( GrisbiCommandLine *command_line )
     else
     {
         /* open the last file if needed */
-        if ( conf->load_last_file && 
+        if ( conf->load_last_file &&
              conf->nb_derniers_fichiers_ouverts > 0 &&
              conf->tab_noms_derniers_fichiers_ouverts[0] )
         {
diff --git a/src/menu.c b/src/menu.c
index 078ef70..02bf515 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -50,23 +50,24 @@
 /*END_STATIC*/
 
 
-
 /*START_EXTERN*/
 /*END_EXTERN*/
 
 /* variables globales */
 static gboolean block_menu_cb = FALSE;
-static gint recent_files_merge_id = -1;
-static gint move_to_account_merge_id = -1;
 
 /**
  * Blank the "Recent files submenu".
  */
 void efface_derniers_fichiers_ouverts ( void )
 {
+    GrisbiWindow *window;
     GtkUIManager *ui_manager;
+    guint recent_files_merge_id;
 
-    ui_manager = grisbi_window_get_ui_manager ( grisbi_app_get_active_window ( NULL ) );
+    window = grisbi_app_get_active_window ( NULL );
+    ui_manager = grisbi_window_get_ui_manager ( window );
+    recent_files_merge_id = grisbi_window_get_sub_menu_merge_id  ( window, "recent_file" );
 
     gtk_ui_manager_remove_ui ( ui_manager, recent_files_merge_id );
 }
@@ -77,25 +78,28 @@ void efface_derniers_fichiers_ouverts ( void )
  */
 gboolean affiche_derniers_fichiers_ouverts ( void )
 {
+    GrisbiWindow *window;
     GtkActionGroup *action_group;
     GrisbiAppConf *conf;
     GtkUIManager *ui_manager;
-    gint recent_files_merge_id = -1;
+    guint recent_files_merge_id;
     gint i;
 
-    devel_debug (NULL);
+    window = grisbi_app_get_active_window ( NULL );
+    ui_manager = grisbi_window_get_ui_manager ( window );
+
     conf = grisbi_app_get_conf ( );
 
     efface_derniers_fichiers_ouverts ();
 
-    if ( conf->nb_derniers_fichiers_ouverts > conf->nb_max_derniers_fichiers_ouverts )
+    if ( !conf->nb_derniers_fichiers_ouverts || !conf->nb_max_derniers_fichiers_ouverts )
     {
-        conf->nb_derniers_fichiers_ouverts = conf->nb_max_derniers_fichiers_ouverts;
+        return FALSE;
     }
 
-    if ( !conf->nb_derniers_fichiers_ouverts || !conf->nb_max_derniers_fichiers_ouverts )
+    if ( conf->nb_derniers_fichiers_ouverts > conf->nb_max_derniers_fichiers_ouverts )
     {
-        return FALSE;
+        conf->nb_derniers_fichiers_ouverts = conf->nb_max_derniers_fichiers_ouverts;
     }
 
     ui_manager = grisbi_window_get_ui_manager ( grisbi_app_get_active_window ( NULL ) );
@@ -145,6 +149,7 @@ gboolean affiche_derniers_fichiers_ouverts ( void )
         g_free ( tmp_label );
     }
 
+    grisbi_window_set_sub_menu_merge_id ( window, recent_files_merge_id, "recent_file" );
     gtk_ui_manager_ensure_update ( ui_manager );
 
 #ifdef GTKOSXAPPLICATION
@@ -477,11 +482,15 @@ gboolean gsb_menu_update_view_menu ( gint account_number )
  * */
 gboolean gsb_menu_update_accounts_in_menus ( void )
 {
+    GrisbiWindow *window;
     GSList *list_tmp;
     GtkActionGroup *action_group;
     GtkUIManager *ui_manager;
+    guint move_to_account_merge_id;
 
-    ui_manager = grisbi_window_get_ui_manager ( grisbi_app_get_active_window ( NULL ) );
+    window = grisbi_app_get_active_window ( NULL );
+    ui_manager = grisbi_window_get_ui_manager ( window );
+    move_to_account_merge_id = grisbi_window_get_sub_menu_merge_id ( window, "move_to_account" );
 
     if ( move_to_account_merge_id != -1 )
         gtk_ui_manager_remove_ui ( ui_manager, move_to_account_merge_id );
@@ -520,7 +529,7 @@ gboolean gsb_menu_update_accounts_in_menus ( void )
                         G_CALLBACK ( move_selected_operation_to_account_nb ),
                         GINT_TO_POINTER ( i ) );
 
-            gtk_ui_manager_add_ui ( ui_manager, recent_files_merge_id,
+            gtk_ui_manager_add_ui ( ui_manager, move_to_account_merge_id,
                         "/menubar/EditMenu/MoveToAnotherAccount/",
                         tmp_name, tmp_name,
                         GTK_UI_MANAGER_MENUITEM, FALSE );
@@ -531,8 +540,10 @@ gboolean gsb_menu_update_accounts_in_menus ( void )
     }
 
     gtk_ui_manager_insert_action_group ( ui_manager, action_group, 2 );
+    grisbi_window_set_sub_menu_merge_id ( window, move_to_account_merge_id, "move_to_account" );
     gtk_ui_manager_ensure_update ( ui_manager );
 
+    /* return */
     return FALSE;
 }
 
@@ -660,7 +671,7 @@ void gsb_menu_full_screen_mode ( void )
 void gsb_menu_preferences ( GtkAction *action,
                         GrisbiWindow *window )
 {
-    grisb_show_prefs_dialog ( window );
+    grisb_prefs_show_dialog ( window );
 }
 
 
diff --git a/src/parametres.c b/src/parametres.c
index 9e1f4ef..9bdcf18 100644
--- a/src/parametres.c
+++ b/src/parametres.c
@@ -1026,8 +1026,12 @@ gboolean gsb_gui_encryption_toggled ( GtkWidget * checkbox, gpointer data )
 {
     if ( gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON (checkbox)))
     {
+        GrisbiAppRun *run;
+
+        run = grisbi_app_get_run ();
+
         dialog_message ( "encryption-is-irreversible" );
-        run.new_crypted_file = TRUE;
+        run->new_crypted_file = TRUE;
     }
 
     return FALSE;
@@ -1048,7 +1052,7 @@ gboolean gsb_config_backup_dir_chosen ( GtkWidget *button,
 
     path = gtk_file_chooser_get_filename ( GTK_FILE_CHOOSER ( button ) );
     devel_debug ( path );
-    gsb_file_set_backup_path ( path );
+/*     gsb_file_set_backup_path ( path );  */
     if ( path && strlen ( path ) > 0 )
         g_free ( path );
 
diff --git a/src/plugins/openssl/openssl.c b/src/plugins/openssl/openssl.c
index c4d6b13..a728d0a 100644
--- a/src/plugins/openssl/openssl.c
+++ b/src/plugins/openssl/openssl.c
@@ -227,12 +227,15 @@ gulong gsb_file_util_crypt_file ( gchar * file_name, gchar **file_content,
 {
 #ifdef HAVE_SSL
     gchar * key, * message = "";
+    GrisbiAppRun *run;
 
-    if ( run.new_crypted_file )
+    run = grisbi_app_get_run ();
+
+    if ( run->new_crypted_file )
     {
         if ( saved_crypt_key )
             g_free ( saved_crypt_key );
-	    saved_crypt_key = NULL;
+        saved_crypt_key = NULL;
     }
 
     if ( crypt )
@@ -292,7 +295,7 @@ return_bad_password:
     dialogue_error_hint ( _("This build of Grisbi does not support encryption.\n"
                         "Please recompile Grisbi with OpenSSL encryption enabled."),
                         g_strdup_printf ( _("Cannot open encrypted file '%s'"),
-					    file_name ) );
+                        file_name ) );
 #endif
 
     return 0;
@@ -315,6 +318,9 @@ gchar *gsb_file_util_ask_for_crypt_key ( gchar * file_name, gchar * additional_m
     gchar *key = NULL;
     GtkWidget *dialog, *button, *label, *entry, *hbox, *hbox2, *vbox, *icon;
     gint result;
+    GrisbiAppRun *run;
+
+    run = grisbi_app_get_run ();
 
     dialog = gtk_dialog_new_with_buttons ( _("Grisbi password"),
                         GTK_WINDOW ( grisbi_app_get_active_window ( NULL ) ),
@@ -370,7 +376,7 @@ gchar *gsb_file_util_ask_for_crypt_key ( gchar * file_name, gchar * additional_m
     gtk_entry_set_visibility ( GTK_ENTRY ( entry ), FALSE );
     gtk_box_pack_start ( GTK_BOX ( hbox2 ), entry, TRUE, TRUE, 0 );
 
-    if ( run.new_crypted_file )
+    if ( run->new_crypted_file )
     {
         button = gtk_check_button_new_with_label ( _("View password") );
         gtk_box_pack_start ( GTK_BOX ( vbox ), button, FALSE, FALSE, 5 );
@@ -417,7 +423,7 @@ return_bad_password:
         else
             saved_crypt_key = NULL;
 
-        run.new_crypted_file = FALSE;
+        run->new_crypted_file = FALSE;
 
         break;
 
diff --git a/src/structures.h b/src/structures.h
index a5392a7..4f8bf48 100644
--- a/src/structures.h
+++ b/src/structures.h
@@ -17,7 +17,7 @@
 #define VERSION_FICHIER_CATEG "0.6.0"
 #define VERSION_FICHIER_IB "0.6.0"
 
-#define CSV_MAX_TOP_LINES 10	/** How many lines to show in CSV preview.  */
+#define CSV_MAX_TOP_LINES 10    /** How many lines to show in CSV preview.  */
 
 typedef struct gsb_conf_t GrisbiAppConf;
 typedef struct gsb_etat_t GrisbiWindowEtat;
@@ -133,6 +133,7 @@ struct gsb_conf_t
 
     /* preferences */
     gint prefs_width;                               /* preferences width */
+    gint prefs_height;                              /* preferences height */
 
     /* left_panel */
     gint panel_width;                               /* left hpanel width */
@@ -162,8 +163,9 @@ struct gsb_conf_t
     gint alerte_permission;                         /* à un si le message d'alerte s'affiche */
     gint force_enregistrement;                      /* à un si on force l'enregistrement */
     gint nb_max_derniers_fichiers_ouverts;          /* contient le nb max que peut contenir nb_derniers_fichiers_ouverts */
-    gsize nb_derniers_fichiers_ouverts;             /* contient le nb de derniers fichiers ouverts */
+    gint nb_derniers_fichiers_ouverts;              /* contient le nb de derniers fichiers ouverts */
     gchar **tab_noms_derniers_fichiers_ouverts;     /* RecentFiles */
+    gchar *account_files_path;                      /* localisation des fichiers de compte */
 
     /* backup part */
     gint make_backup;                               /* TRUE for create a backup when save file */
@@ -171,6 +173,7 @@ struct gsb_conf_t
     gint make_backup_nb_minutes;                    /* the number of minutes we want to make a backup */
     gint make_bakup_single_file;                    /* TRUE if a single backup file */
     gint compress_backup;                           /* TRUE if we want to compress the backup */
+    gchar *backup_path;                             /* localisation des fichiers de sauvegarde */
 
     /* formulaire */
     gint formulaire_toujours_affiche;
@@ -214,7 +217,10 @@ struct gsb_conf_t
 
 struct gsb_run_t
 {
-    /* initialisation variables */
+    /* répertoire des fichiers de comptes etde backup */
+    gchar *backup_path;                             /* localisation des fichiers de sauvegarde */
+
+    /* crypted files */
     gboolean n files */                             /* localisation des fichiers de sauvegarde */  up */  chiers_ouverts */    TÆÓÿ         ðTÆÓÿ  uÚÒÂã*  €úÓÂã*  õóÂã*                          ’èïÃã*  ðTÆÓÿ  € Äã*          àIÆÓÿ         °HÆÓÿ  kðÒÂã*  6                    è     è!     è!     €TÆÓÿ  ðTÆÓÿ  x¤ïÃã*          àJÆÓÿ          ’ÒÒÂã*          †ðÒÂã*  €TÆÓÿ  `ÒÒÂã*  ¿TÆÓÿ         ÀŸSÄã*  uÚÒÂã*   SÄã*  ؔSÄã*  ¨™SÄã*  €úÓÂã*          x¤ïÃã*          àJÆÓÿ          °IÆÓÿ  kðÒÂã*  à!     à!     €TÆÓÿ  ðTÆÓÿ  HnÏÃã*          ÀKÆÓÿ         ’ÒÒÂã*          †ðÒÂã*  €TÆÓÿ  `ÒÒÂã*  ¿TÆÓÿ  °TÆÓÿ  ¨TÆÓÿ  8ûóÂã*  Œp˜        ðTÆÓÿ  uÚÒÂã*  €úÓÂã*                  ÀKÆÓÿ         JÆÓÿ  kðÒÂã*          G       H   I       J   K           M   N   O       P   €TÆÓÿ  ðTÆÓÿ  H%¦Ãã*          `MÆÓÿ         ’ÒÒÂã*          †ðÒÂã*  €TÆÓÿ         0ŸSÄã*  uÚÒÂã*   °ïÃã*   YƒÃã*   SÄã*  ؔSÄã*  ¨™SÄã*  €úÓÂã*          H%¦Ãã*          `MÆÓÿ        
   KÆÓÿ  kðÒÂã*  8%¦Ãã*          `MÆÓÿ         ÐKÆÓÿ  kðÒÂã*  (%¦Ãã*          `MÆÓÿ          LÆÓÿ  kðÒÂã*  %¦Ãã*          `MÆÓÿ         0LÆÓÿ  kðÒÂã*  	       ¨žSÄã*  uÚÒÂã*         ¨™SÄã*  °FÆÓÿ          Š¨ƒÃã*  eÙÒÂã*         ؔSÄã*  ÐLÆÓÿ          y¨ƒÃã*  eÙÒÂã*          SÄã*   MÆÓÿ          Z¨ƒÃã*  eÙÒÂã*  ØTƒÃã*   °ïÃã*   YƒÃã*   SÄã*  Ø´ïÃã*  ؔSÄã*  ¨™SÄã*  €úÓÂã*          8ûóÂã*                        OÃã*  ðTÆÓÿ  pë‚Ãã*          °NÆÓÿ          €MÆÓÿ  kðÒÂã*      5   6   7   8   :   <   =   >       ?       @   B   D       €TÆÓÿ  ðTÆÓÿ  àLÃã*                 ðTÆÓÿ  uÚÒÂã*         õóÂã*  0MÆÓÿ          OÃã*  eÙÒÂã*  õóÂã*          Õ_ at fÆS         Qöl±íÁ3Ãã*  ðTÆÓÿ  àLÃã*          ÀOÆÓÿ         NÆÓÿ  kðÒÂã*  u]ÞÓ	4Q ÷U^Qʉ§ ¶uª¹ñìò*ēv€TÆÓÿ  ðTÆÓÿ  HnÃã*          ´TÃã*          0VÆÓÿ  ¦À¶Äã*  ¦À¶Äã*         RÃã*  ¿TÆÓÿ  ðUÆÓÿ  ¨TÆÓÿ  QÆÓÿ  ¿ïÃã*  uÚÒÂã*  Ø´ïÃã*  pWÆÓÿ  ¢À¶Äã*  @VÆÓÿ          ÐQÆÓÿ             
     ÿÿÿÿÿÿÿÿ¢À¶Äã*          øTÆÓÿ                 ew_crypted_file;      /* 0 à l'exécution de init_variables () 1 si new crypted file*/
 
     /* file stuff */
diff --git a/src/traitement_variables.c b/src/traitement_variables.c
index 605813e..6c870d9 100644
--- a/src/traitement_variables.c
+++ b/src/traitement_variables.c
@@ -146,9 +146,6 @@ void init_variables ( void )
  * et les variables liées à grisbi (ex sauvegarde auto...) qui doivent rester */
     devel_debug (NULL);
 
-    /* init the new crypted file */
-    run.new_crypted_file = FALSE;
-
     /* init the format date */
     initialise_format_date ( );
 
diff --git a/src/ui/grisbi_prefs.ui b/src/ui/grisbi_prefs.ui
index dbd98ea..378a99e 100644
--- a/src/ui/grisbi_prefs.ui
+++ b/src/ui/grisbi_prefs.ui
@@ -2,6 +2,12 @@
 <interface>
   <requires lib="gtk+" version="2.24"/>
   <!-- interface-naming-policy project-wide -->
+  <object class="GtkAdjustment" id="adjustment1">
+    <property name="upper">5</property>
+    <property name="value">3</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">1</property>
+  </object>
   <object class="GtkHPaned" id="dialog_hpaned">
     <property name="visible">True</property>
     <property name="can_focus">True</property>
@@ -59,8 +65,664 @@
           <object class="GtkNotebook" id="notebook_prefs">
             <property name="visible">True</property>
             <property name="can_focus">True</property>
-            <property name="tab_hborder">0</property>
-            <property name="tab_vborder">0</property>
+            <property name="show_tabs">False</property>
+            <property name="show_border">False</property>
+            <child>
+              <object class="GtkVBox" id="vbox_files">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <child>
+                  <object class="GtkNotebook" id="notebook_files">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="show_border">False</property>
+                    <child>
+                      <object class="GtkVBox" id="vbox2">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="spacing">5</property>
+                        <child>
+                          <object class="GtkVBox" id="vbox_paddingbox2">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="spacing">6</property>
+                            <child>
+                              <object class="GtkLabel" id="title2">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="xalign">0</property>
+                                <property name="yalign">1</property>
+                                <property name="label" translatable="yes">Account files handling</property>
+                                <attributes>
+                                  <attribute name="weight" value="bold"/>
+                                </attributes>
+                              </object>
+                              <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
+                                <property name="padding">2</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkHBox" id="hbox2">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <child>
+                                  <object class="GtkLabel" id="label8">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="label">    </property>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkVBox" id="paddingbox_comptes">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="spacing">6</property>
+                                    <child>
+                                      <object class="GtkHBox" id="hbox3">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <child>
+                                          <object class="GtkCheckButton" id="checkbutton_load_last_file">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="receives_default">False</property>
+                                            <property name="use_action_appearance">False</property>
+                                            <property name="draw_indicator">True</property>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">False</property>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkEventBox" id="eventbox_load_last_file">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="has_focus">True</property>
+                                            <child>
+                                              <object class="GtkLabel" id="label10">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">True</property>
+                                                <property name="label" translatable="yes">Automatically load last file on startup</property>
+                                                <attributes>
+                                                  <attribute name="foreground" value="#00000000ffff"/>
+                                                </attributes>
+                                              </object>
+                                            </child>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">False</property>
+                                            <property name="position">1</property>
+                                          </packing>
+                                        </child>
+                                      </object>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="fill">False</property>
+                                        <property name="position">0</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkHBox" id="hbox8">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <child>
+                                          <object class="GtkCheckButton" id="checkbutton_sauvegarde_auto">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="receives_default">False</property>
+                                            <property name="use_action_appearance">False</property>
+                                            <property name="draw_indicator">True</property>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">False</property>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkEventBox" id="eventbox_sauvegarde_auto">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <child>
+                                              <object class="GtkLabel" id="label11">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">False</property>
+                                                <property name="label" translatable="yes">Automatically save on exit</property>
+                                                <attributes>
+                                                  <attribute name="foreground" value="#00000000ffff"/>
+                                                </attributes>
+                                              </object>
+                                            </child>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">False</property>
+                                            <property name="position">1</property>
+                                          </packing>
+                                        </child>
+                                      </object>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="fill">False</property>
+                                        <property name="position">1</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkHBox" id="hbox9">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <child>
+                                          <object class="GtkCheckButton" id="checkbutton_force_enregistrement">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="receives_default">False</property>
+                                            <property name="use_action_appearance">False</property>
+                                            <property name="draw_indicator">True</property>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">False</property>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkEventBox" id="eventbox_force_enregistrement">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <child>
+                                              <object class="GtkLabel" id="label12">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">False</property>
+                                                <property name="label" translatable="yes">Force saving of locked files</property>
+                                                <attributes>
+                                                  <attribute name="foreground" value="#00000000ffff"/>
+                                                </attributes>
+                                              </object>
+                                            </child>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">False</property>
+                                            <property name="position">1</property>
+                                          </packing>
+                                        </child>
+                                      </object>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="fill">False</property>
+                                        <property name="position">2</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkCheckButton" id="checkbutton_crypt_file">
+                                        <property name="label" translatable="yes">Encrypt Grisbi file</property>
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">False</property>
+                                        <property name="use_action_appearance">False</property>
+                                        <property name="draw_indicator">True</property>
+                                      </object>
+                                      <packing>
+                                        <property name="expand">True</property>
+                                        <property name="fill">True</property>
+                                        <property name="position">3</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkHBox" id="hbox10">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <child>
+                                          <object class="GtkCheckButton" id="checkbutton_compress_file">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="receives_default">False</property>
+                                            <property name="use_action_appearance">False</property>
+                                            <property name="draw_indicator">True</property>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">False</property>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkEventBox" id="eventbox_compress_file">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <child>
+                                              <object class="GtkLabel" id="label13">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">False</property>
+                                                <property name="label" translatable="yes">Compress Grisbi file</property>
+                                                <attributes>
+                                                  <attribute name="foreground" value="#00000000ffff"/>
+                                                </attributes>
+                                              </object>
+                                            </child>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">False</property>
+                                            <property name="position">1</property>
+                                          </packing>
+                                        </child>
+                                      </object>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="fill">False</property>
+                                        <property name="position">4</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkHBox" id="hbox6">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="spacing">4</property>
+                                        <child>
+                                          <object class="GtkLabel" id="label7">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="xalign">0</property>
+                                            <property name="label" translatable="yes">Memorise last opened files: </property>
+                                            <attributes>
+                                              <attribute name="foreground" value="#00000000ffff"/>
+                                            </attributes>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">True</property>
+                                            <property name="fill">True</property>
+                                            <property name="padding">4</property>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkSpinButton" id="spinbutton_nb_max_derniers_fichiers_ouverts">
+                                            <property name="width_request">50</property>
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="invisible_char">●</property>
+                                            <property name="primary_icon_activatable">False</property>
+                                            <property name="secondary_icon_activatable">False</property>
+                                            <property name="primary_icon_sensitive">True</property>
+                                            <property name="secondary_icon_sensitive">True</property>
+                                            <property name="adjustment">adjustment1</property>
+                                            <property name="snap_to_ticks">True</property>
+                                            <property name="numeric">True</property>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">True</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">1</property>
+                                          </packing>
+                                        </child>
+                                      </object>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="fill">False</property>
+                                        <property name="position">5</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkHBox" id="hbox12">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="spacing">6</property>
+                                        <child>
+                                          <object class="GtkLabel" id="label15">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="xalign">0</property>
+                                            <property name="label" translatable="yes">Default directory:</property>
+                                            <attributes>
+                                              <attribute name="foreground" value="#00000000ffff"/>
+                                            </attributes>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">True</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkFileChooserButton" id="filechooserbutton_accounts">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="action">select-folder</property>
+                                            <property name="preview_widget_active">False</property>
+                                            <property name="use_preview_label">False</property>
+                                            <property name="title" translatable="yes">Sélectionner un répertoire</property>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">False</property>
+                                            <property name="position">1</property>
+                                          </packing>
+                                        </child>
+                                      </object>
+                                      <packing>
+                                        <property name="expand">True</property>
+                                        <property name="fill">True</property>
+                                        <property name="position">6</property>
+                                      </packing>
+                                    </child>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkVBox" id="vbox_paddingbox3">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="no_show_all">True</property>
+                            <property name="spacing">6</property>
+                            <child>
+                              <object class="GtkLabel" id="title3">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="xalign">0</property>
+                                <property name="yalign">1</property>
+                                <property name="label" translatable="yes">Config file</property>
+                                <attributes>
+                                  <attribute name="weight" value="bold"/>
+                                </attributes>
+                              </object>
+                              <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
+                                <property name="padding">2</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkHBox" id="hbox7">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <child>
+                                  <object class="GtkLabel" id="label9">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="label">    </property>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkVBox" id="paddingbox_file_config">
+                                    <property name="can_focus">False</property>
+                                    <property name="spacing">6</property>
+                                    <child>
+                                      <object class="GtkHBox" id="hbox11">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <child>
+                                          <object class="GtkCheckButton" id="checkbutton_stable_config_file_model">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="receives_default">False</property>
+                                            <property name="no_show_all">True</property>
+                                            <property name="use_action_appearance">False</property>
+                                            <property name="draw_indicator">True</property>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">False</property>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkEventBox" id="eventbox_stable_config_file_model">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <child>
+                                              <object class="GtkLabel" id="label14">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">False</property>
+                                                <property name="label" translatable="yes">Use the config file of stable version as model</property>
+                                                <attributes>
+                                                  <attribute name="foreground" value="#00000000ffff"/>
+                                                </attributes>
+                                              </object>
+                                            </child>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">False</property>
+                                            <property name="position">1</property>
+                                          </packing>
+                                        </child>
+                                      </object>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="fill">False</property>
+                                        <property name="position">0</property>
+                                      </packing>
+                                    </child>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="tab_fill">False</property>
+                      </packing>
+                    </child>
+                    <child type="tab">
+                      <object class="GtkHBox" id="hbox4">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="spacing">5</property>
+                        <child>
+                          <object class="GtkImage" id="image_file">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="stock">gtk-open</property>
+                          </object>
+                          <packing>
+                            <property name="expand">True</property>
+                            <property name="fill">True</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="label5">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes">Account files</property>
+                          </object>
+                          <packing>
+                            <property name="expand">True</property>
+                            <property name="fill">True</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="tab_fill">False</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkVBox" id="vbox5">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <child>
+                          <placeholder/>
+                        </child>
+                        <child>
+                          <placeholder/>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                    <child type="tab">
+                      <object class="GtkHBox" id="hbox5">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="spacing">5</property>
+                        <child>
+                          <object class="GtkImage" id="image_backup">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="stock">gtk-save</property>
+                          </object>
+                          <packing>
+                            <property name="expand">True</property>
+                            <property name="fill">True</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="label6">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes">Backup files</property>
+                          </object>
+                          <packing>
+                            <property name="expand">True</property>
+                            <property name="fill">True</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="position">1</property>
+                        <property name="tab_fill">False</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <placeholder/>
+                    </child>
+                    <child type="tab">
+                      <placeholder/>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">True</property>
+                    <property name="fill">True</property>
+                    <property name="padding">5</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+              </object>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="label2">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">page 1</property>
+              </object>
+              <packing>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkVBox" id="vbox3">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+              </object>
+              <packing>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="label3">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">page 2</property>
+              </object>
+              <packing>
+                <property name="position">1</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkVBox" id="vbox4">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+              </object>
+              <packing>
+                <property name="position">2</property>
+              </packing>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="label4">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">page 3</property>
+              </object>
+              <packing>
+                <property name="position">2</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
           </object>
         </child>
       </object>
diff --git a/src/utils.c b/src/utils.c
index 619cb51..f487fe4 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -774,7 +774,8 @@ void utils_ui_left_panel_add_line ( GtkTreeStore *tree_model,
     else
     {
         /* append page onglet*/
-        gtk_notebook_append_page ( GTK_NOTEBOOK ( notebook ),
+        if ( child )
+            gtk_notebook_append_page ( GTK_NOTEBOOK ( notebook ),
                         child,
                         gtk_label_new ( title ) );
 
@@ -841,6 +842,60 @@ gboolean utils_ui_left_panel_tree_view_selection_changed ( GtkTreeSelection *sel
 }
 
 
+/**
+ * selectionne une page
+ *
+ * \param
+ *
+ * \return
+ */
+gboolean utils_ui_left_panel_tree_view_select_page ( GtkWidget *tree_view,
+                        GtkWidget *notebook,
+                        gint page )
+{
+    GtkTreeModel *model;
+    GtkTreeIter parent_iter;
+
+    model = gtk_tree_view_get_model ( GTK_TREE_VIEW ( tree_view ) );
+
+    if ( !gtk_tree_model_get_iter_first ( GTK_TREE_MODEL ( model ), &parent_iter ) )
+        return FALSE;
+
+    do
+    {
+        GtkTreeIter iter;
+
+        if ( gtk_tree_model_iter_children ( GTK_TREE_MODEL ( model ), &iter, &parent_iter ) )
+        {
+            do
+            {
+                gint tmp_page;
+
+                gtk_tree_model_get (GTK_TREE_MODEL ( model ),
+                                &iter,
+                                LEFT_PANEL_TREE_PAGE_COLUMN, &tmp_page,
+                                -1 );
+
+                if ( tmp_page == page )
+                {
+                    GtkTreeSelection *sel;
+
+                    sel = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( tree_view ) );
+                    gtk_tree_selection_select_iter ( sel, &iter );
+                    gtk_notebook_set_current_page ( GTK_NOTEBOOK ( notebook ), page );
+                    break;
+                }
+            }
+            while ( gtk_tree_model_iter_next ( GTK_TREE_MODEL ( model ), &iter ) );
+        }
+    }
+    while ( gtk_tree_model_iter_next ( GTK_TREE_MODEL ( model ), &parent_iter ) );
+
+    /* return */
+    return FALSE;
+}
+
+
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */
diff --git a/src/utils.h b/src/utils.h
index 89a9b41..e049a4e 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -49,6 +49,9 @@ void utils_ui_left_panel_add_line ( GtkTreeStore *tree_model,
                         GtkWidget *child,
                         const gchar *title,
                         gint page );
+gboolean utils_ui_left_panel_tree_view_select_page ( GtkWidget *tree_view,
+                        GtkWidget *notebook,
+                        gint page );
 gboolean utils_ui_left_panel_tree_view_selectable_func (GtkTreeSelection *selection,
                         GtkTreeModel *model,
                         GtkTreePath *path,


hooks/post-receive
-- 
grisbi


More information about the cvs mailing list