[grisbi-cvs] [SCM] grisbi branch, grisbi-gtk3, updated. grisbi_gtk3_1_3_0-178-g2c279fd

Pierre Biava nobody at users.sourceforge.net
Sun Feb 26 16:30:41 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  2c279fdc9a622417a3f80592a94ef3a56ebcc6df (commit)
       via  08b662c7ce38b590270a491326c34176a4c2da58 (commit)
       via  d8d8f3fa4abb4730d5d9963cf0272a01c0b6c006 (commit)
       via  fbd05e02f5869b1c22dbbd0556d2fa9652010ed1 (commit)
       via  49510f4275d485bb64f370cf2606d9de31835dbd (commit)
       via  7f0630bafa4eadb3dbcdcb95cc86c9c45834468d (commit)
       via  4a61ce9d611e8a49dd1c02c97eaba4133d986165 (commit)
      from  15b26b224c1b849305b973f518980be7cf861ee1 (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 2c279fdc9a622417a3f80592a94ef3a56ebcc6df
Merge: 08b662c 15b26b2
Author: pbiava <pierre.biava at nerim.net>
Date:   Sun Feb 26 16:29:41 2012 +0100

    Merge branch 'grisbi-gtk3' of ssh://grisbi.git.sourceforge.net/gitroot/grisbi/grisbi into grisbi-gtk3

commit 08b662c7ce38b590270a491326c34176a4c2da58
Author: pbiava <pierre.biava at nerim.net>
Date:   Sun Feb 26 16:27:07 2012 +0100

    constructs the preferences widget: left panel

commit d8d8f3fa4abb4730d5d9963cf0272a01c0b6c006
Author: pbiava <pierre.biava at nerim.net>
Date:   Sun Feb 26 16:23:22 2012 +0100

    Moves the function: etats_config_ui_left_panel_tree_view_selection_changed () in utils.c

commit fbd05e02f5869b1c22dbbd0556d2fa9652010ed1
Author: pbiava <pierre.biava at nerim.net>
Date:   Sun Feb 26 15:45:30 2012 +0100

    Moves the function: etats_config_ui_left_panel_tree_view_selectable_func () in utils.c

commit 49510f4275d485bb64f370cf2606d9de31835dbd
Author: pbiava <pierre.biava at nerim.net>
Date:   Sun Feb 26 15:42:10 2012 +0100

    minor changes

commit 7f0630bafa4eadb3dbcdcb95cc86c9c45834468d
Author: pbiava <pierre.biava at nerim.net>
Date:   Sun Feb 26 15:41:17 2012 +0100

    Moves the function: etats_config_ui_left_panel_add_line () in utils.c

commit 4a61ce9d611e8a49dd1c02c97eaba4133d986165
Author: pbiava <pierre.biava at nerim.net>
Date:   Wed Feb 22 22:14:20 2012 +0100

    grisbi_prefs: add files

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

Changes:
diff --git a/src/Makefile.am b/src/Makefile.am
index 97d020e..6f3f938 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -44,6 +44,7 @@ libgrisbi_la_SOURCES = \
 	file_obfuscate_qif.c	\
 	grisbi_app.c \
 	grisbi_osx.c \
+	grisbi_prefs.c \
 	grisbi_ui.h \
 	grisbi_window.c \
 	gsb_account.c		\
@@ -189,6 +190,7 @@ libgrisbi_la_SOURCES = \
 	export_csv.h            \
 	grisbi_app.h \
 	grisbi_osx.h \
+	grisbi_prefs.h \
 	grisbi_window.h \
 	gsb_account.h		\
 	gsb_account_property.h	\
diff --git a/src/etats_config_ui.c b/src/etats_config_ui.c
index 7df9661..fda2785 100644
--- a/src/etats_config_ui.c
+++ b/src/etats_config_ui.c
@@ -44,12 +44,6 @@
 
 
 /*START_STATIC*/
-static void etats_config_ui_left_panel_add_line ( GtkTreeStore *tree_model,
-                        GtkTreeIter *iter,
-                        GtkWidget *notebook,
-                        GtkWidget *child,
-                        const gchar *title,
-                        gint page );
 GtkWidget *etats_config_ui_left_panel_create_tree_view ( void );
 static void etats_config_ui_left_panel_notebook_change_page ( GtkNotebook *notebook,
                         gpointer npage,
@@ -57,13 +51,6 @@ static void etats_config_ui_left_panel_notebook_change_page ( GtkNotebook *noteb
                         gpointer user_data );
 static void etats_config_ui_left_panel_populate_tree_model ( GtkTreeStore *tree_model,
                         GtkWidget *notebook );
-static gboolean etats_config_ui_left_panel_tree_view_selectable_func (GtkTreeSelection *selection,
-                        GtkTreeModel *model,
-                        GtkTreePath *path,
-                        gboolean path_currently_selected,
-                        gpointer data);
-static gboolean etats_config_ui_left_panel_tree_view_selection_changed ( GtkTreeSelection *selection,
-                        gpointer data );
 static gboolean etats_config_ui_left_panel_tree_view_update_style ( GtkWidget *button,
                         gint *page_number );
 static GtkWidget *etats_config_ui_onglet_affichage_devises_create_page ( gint page );
@@ -157,16 +144,6 @@ static GtkWidget *etats_config_ui_tree_view_new_with_model ( const gchar *treevi
 
 
 /*START_GLOBAL_VARIABLES*/
-/* definition of the columns of model for the left panel  */
-enum left_panel_tree_columns
-{
-    LEFT_PANEL_TREE_TEXT_COLUMN,
-    LEFT_PANEL_TREE_PAGE_COLUMN,
-    LEFT_PANEL_TREE_BOLD_COLUMN,
-    LEFT_PANEL_TREE_ITALIC_COLUMN,
-    LEFT_PANEL_TREE_NUM_COLUMNS,
-};
-
 /* liste des plages de date possibles */
 static gchar *etats_config_liste_plages_dates[] =
 {
@@ -336,16 +313,22 @@ GtkWidget *etats_config_ui_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 ( etats_config_builder, "notebook_config_etat" ) );
+    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 ( etats_config_ui_left_panel_tree_view_selection_changed ),
-                        NULL );
+                        G_CALLBACK ( utils_ui_left_panel_tree_view_selection_changed ),
+                        notebook );
 
     /* Choose which entries will be selectable */
     gtk_tree_selection_set_select_function ( selection,
-                        etats_config_ui_left_panel_tree_view_selectable_func, NULL, NULL );
+                        utils_ui_left_panel_tree_view_selectable_func, NULL, NULL );
 
     /* expand all rows after the treeview widget has been realized */
     g_signal_connect ( tree_view,
@@ -353,12 +336,6 @@ GtkWidget *etats_config_ui_left_panel_create_tree_view ( void )
                         G_CALLBACK ( utils_tree_view_set_expand_all_and_select_path_realize ),
                         "0:0" );
 
-    /* initialisation du notebook pour les pages de la configuration */
-    notebook = GTK_WIDGET ( gtk_builder_get_object ( etats_config_builder, "notebook_config_etat" ) );
-    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 );
-
     /* remplissage du paned gauche */
     etats_config_ui_left_panel_populate_tree_model ( model, notebook );
 
@@ -392,191 +369,98 @@ void etats_config_ui_left_panel_populate_tree_model ( GtkTreeStore *tree_model,
     gint page = 0;
 
     /* append group page */
-    etats_config_ui_left_panel_add_line ( tree_model, &iter, NULL, NULL, _("Data selection"), -1 );
+    utils_ui_left_panel_add_line ( tree_model, &iter, NULL, NULL, _("Data selection"), -1 );
 
     /* append page Dates */
     widget = etats_config_ui_onglet_periode_create_page ( page );
-    etats_config_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Dates"), page );
+    utils_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Dates"), page );
     page++;
 
     /* append page Transferts */
     widget = etats_config_ui_onglet_virements_create_page ( page );
-    etats_config_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Transfers"), page );
+    utils_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Transfers"), page );
     page++;
 
     /* append page Accounts */
     widget = etats_config_ui_onglet_comptes_create_page ( page );
-    etats_config_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Accounts"), page );
+    utils_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Accounts"), page );
     page++;
 
     /* append page Payee */
     widget = etats_config_ui_onglet_tiers_create_page ( page );
-    etats_config_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Payee"), page );
+    utils_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Payee"), page );
     page++;
 
     /* append page Categories */
     widget = etats_config_ui_onglet_categories_create_page ( page );
-    etats_config_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Categories"), page );
+    utils_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Categories"), page );
     page++;
 
     /* append page Budgetary lines */
     widget = etats_config_ui_onglet_budgets_create_page ( page );
-    etats_config_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Budgetary lines"), page );
+    utils_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Budgetary lines"), page );
     page++;
 
     /* append page Texts */
     widget = etats_config_ui_onglet_textes_create_page ( page );
-    etats_config_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Texts"), page );
+    utils_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Texts"), page );
     page++;
 
     /* append page Amounts */
     widget = etats_config_ui_onglet_montants_create_page ( page );
-    etats_config_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Amounts"), page );
+    utils_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Amounts"), page );
     page++;
 
     /* append page Payment methods */
     widget = etats_config_ui_onglet_mode_paiement_create_page ( page );
-    etats_config_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Payment methods"), page );
+    utils_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Payment methods"), page );
     page++;
 
     /* append page Misc. */
     widget = etats_config_ui_onglet_divers_create_page ( page );
-    etats_config_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Miscellaneous"), page );
+    utils_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Miscellaneous"), page );
     page++;
 
     /* remplissage de l'onglet d'organisation */
-    etats_config_ui_left_panel_add_line ( tree_model, &iter, NULL, NULL, _("Data organization"), -1 );
+    utils_ui_left_panel_add_line ( tree_model, &iter, NULL, NULL, _("Data organization"), -1 );
 
     /* Data grouping */
     widget = etats_config_ui_onglet_data_grouping_create_page ( page );
-    etats_config_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Data grouping"), page );
+    utils_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Data grouping"), page );
     page++;
 
     /* Data separation */
     widget = etats_config_ui_onglet_data_separation_create_page ( page );
-    etats_config_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Data separation"), page );
+    utils_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Data separation"), page );
     page++;
 
     /* remplissage de l'onglet d'affichage */
-    etats_config_ui_left_panel_add_line ( tree_model, &iter, NULL, NULL, _("Data display"), -1 );
+    utils_ui_left_panel_add_line ( tree_model, &iter, NULL, NULL, _("Data display"), -1 );
 
     /* append page Generalities */
     widget = etats_config_ui_onglet_affichage_generalites_create_page ( page );
-    etats_config_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Generalities"), page );
+    utils_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Generalities"), page );
     page++;
 
     /* append page divers */
     widget = etats_config_ui_onglet_affichage_titles_create_page ( page );
-    etats_config_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Titles"), page );
+    utils_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Titles"), page );
     page++;
 
     /* append page Transactions */
     widget = etats_config_ui_onglet_affichage_operations_create_page ( page );
-    etats_config_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Transactions"), page );
+    utils_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Transactions"), page );
     page++;
 
     /* append page Currencies */
     widget = etats_config_ui_onglet_affichage_devises_create_page ( page );
-    etats_config_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Currencies"), page );
+    utils_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Currencies"), page );
 
     /* fin de fonction */
 }
 
 
 /**
- *
- *
- * \param
- *
- * \return
- */
-gboolean etats_config_ui_left_panel_tree_view_selection_changed ( GtkTreeSelection *selection,
-                        gpointer data )
-{
-    GtkTreeModel *model;
-    GtkTreeIter iter;
-    gint selected;
-
-    if (! gtk_tree_selection_get_selected ( selection, &model, &iter ) )
-        return(FALSE);
-
-    gtk_tree_model_get ( model, &iter, 1, &selected, -1 );
-
-    gtk_notebook_set_current_page ( GTK_NOTEBOOK (
-                        gtk_builder_get_object ( etats_config_builder, "notebook_config_etat" ) ),
-                        selected );
-
-    /* return */
-    return FALSE;
-}
-
-
-/**
- *
- *
- * \param
- *
- * \return
- */
-gboolean etats_config_ui_left_panel_tree_view_selectable_func (GtkTreeSelection *selection,
-                        GtkTreeModel *model,
-                        GtkTreePath *path,
-                        gboolean path_currently_selected,
-                        gpointer data )
-{
-    GtkTreeIter iter;
-    gint selectable;
-
-    gtk_tree_model_get_iter ( model, &iter, path );
-    gtk_tree_model_get ( model, &iter, 1, &selectable, -1 );
-
-    return ( selectable != -1 );
-}
-
-
-/**
- * ajoute une ligne dans le tree_model du panel de gauche
- *
- *
- *
- * */
-void etats_config_ui_left_panel_add_line ( GtkTreeStore *tree_model,
-                        GtkTreeIter *iter,
-                        GtkWidget *notebook,
-                        GtkWidget *child,
-                        const gchar *title,
-                        gint page )
-{
-    GtkTreeIter iter2;
-
-    if ( page == -1 )
-    {
-        /* append page groupe */
-        gtk_tree_store_append ( GTK_TREE_STORE ( tree_model ), iter, NULL );
-        gtk_tree_store_set (GTK_TREE_STORE ( tree_model ), iter,
-                        LEFT_PANEL_TREE_TEXT_COLUMN, title,
-                        LEFT_PANEL_TREE_PAGE_COLUMN, -1,
-                        LEFT_PANEL_TREE_BOLD_COLUMN, 800,
-                        -1 );
-    }
-    else
-    {
-        /* append page onglet*/
-        gtk_notebook_append_page ( GTK_NOTEBOOK ( notebook ),
-                        child,
-                        gtk_label_new ( title ) );
-
-        gtk_tree_store_append (GTK_TREE_STORE ( tree_model ), &iter2, iter );
-        gtk_tree_store_set (GTK_TREE_STORE ( tree_model ), &iter2,
-                        LEFT_PANEL_TREE_TEXT_COLUMN, title,
-                        LEFT_PANEL_TREE_PAGE_COLUMN, page,
-                        LEFT_PANEL_TREE_BOLD_COLUMN, 400,
-                        -1);
-    }
-}
-
-
-/**
  * If applicable, update report navigation tree style to reflect which
  * pages have been changed.
  *
diff --git a/src/etats_gtktable.c b/src/etats_gtktable.c
index cedcf71..d9d513e 100644
--- a/src/etats_gtktable.c
+++ b/src/etats_gtktable.c
@@ -146,7 +146,7 @@ void gtktable_attach_label ( gchar * text, gdouble properties, int x, int x2, in
 	g_signal_connect_swapped ( G_OBJECT ( event_box ),
 				    "button_press_event",
 				    G_CALLBACK ( gtktable_click_sur_ope_etat ),
-				    (GtkObject *) GINT_TO_POINTER (transaction_number) );
+				    GINT_TO_POINTER ( transaction_number ) );
 	gtk_table_attach ( GTK_TABLE ( table_etat ), event_box,
 			   x, x2, y, y2,
 			   GTK_SHRINK | GTK_FILL,
diff --git a/src/grisbi_prefs.c b/src/grisbi_prefs.c
new file mode 100644
index 0000000..bb191bb
--- /dev/null
+++ b/src/grisbi_prefs.c
@@ -0,0 +1,383 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*     Copyright (C)    2001-2008 Cédric Auger (cedric at grisbi.org)            */
+/*          2003-2008 Benjamin Drieu (bdrieu at april.org)                       */
+/*          2009-2012 Pierre Biava (grisbi at pierre.biava.name)                 */
+/*          http://www.grisbi.org                                             */
+/*                                                                            */
+/*  This program is free software; you can redistribute it and/or modify      */
+/*  it under the terms of the GNU General Public License as published by      */
+/*  the Free Software Foundation; either version 2 of the License, or         */
+/*  (at your option) any later version.                                       */
+/*                                                                            */
+/*  This program is distributed in the hope that it will be useful,           */
+/*  but WITHOUT ANY WARRANTY; without even the implied warranty of            */
+/*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             */
+/*  GNU General Public License for more details.                              */
+/*                                                                            */
+/*  You should have received a copy of the GNU General Public License         */
+/*  along with this program; if not, write to the Free Software               */
+/*  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+/*                                                                            */
+/* ************************************************************************** */
+
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <string.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <glib/gi18n.h>
+
+/*START_INCLUDE*/
+#include "grisbi_app.h"
+#include "grisbi_prefs.h"
+#include "utils.h"
+#include "utils_gtkbuilder.h"
+#include "erreur.h"
+/*END_INCLUDE*/
+
+
+/*START_STATIC*/
+/*END_STATIC*/
+
+
+#define GRISBI_PREFS_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), GRISBI_TYPE_PREFS, GrisbiPrefsPrivate))
+
+static GtkBuilder *grisbi_prefs_builder = NULL;
+static GtkWidget *grisbi_prefs_dialog = NULL;
+
+
+struct _GrisbiPrefsPrivate
+{
+    GtkWidget           *hpaned;
+
+    /* tree_store du panel de gauche */
+    GtkWidget           *treeview_left_panel;
+    GtkTreeStore        *prefs_tree_model;
+};
+
+
+G_DEFINE_TYPE(GrisbiPrefs, grisbi_prefs, GTK_TYPE_DIALOG)
+
+/**
+ * finalise GrisbiPrefs
+ *
+ * \param object
+ *
+ * \return
+ */
+static void grisbi_prefs_finalize ( GObject *object )
+{
+/*     GrisbiPrefs *prefs = GRISBI_PREFS ( object );  */
+
+    devel_debug (NULL);
+
+    /* libération de l'objet prefs */
+    G_OBJECT_CLASS ( grisbi_prefs_parent_class )->finalize ( object );
+}
+
+
+/**
+ * Initialise GrisbiPrefsClass
+ *
+ * \param
+ *
+ * \return
+ */
+static void grisbi_prefs_class_init ( GrisbiPrefsClass *klass )
+{
+    GObjectClass *object_class = G_OBJECT_CLASS ( klass );
+
+    object_class->finalize = grisbi_prefs_finalize;
+
+    g_type_class_add_private ( object_class, sizeof( GrisbiPrefsPrivate ) );
+}
+
+
+/* GTK_BUILDER */
+/**
+ * callback pour la fermeture des preferences
+ *
+ * \param prefs_dialog
+ * \param result_id
+ *
+ * \return
+ **/
+static void grisbi_prefs_dialog_response  (GtkDialog *prefs,
+                        gint result_id )
+{
+    if ( !prefs )
+        return;
+
+    switch (result_id)
+    {
+        case GTK_RESPONSE_HELP:
+
+            g_signal_stop_emission_by_name ( prefs, "response" );
+
+            break;
+
+        default:
+            gtk_widget_destroy ( GTK_WIDGET ( prefs ) );
+    }
+}
+
+
+/* GTK_BUILDER */
+/**
+ * Crée un builder et récupère les widgets du fichier grisbi.ui
+ *
+ * \param
+ *
+ * \rerurn
+ * */
+static gboolean grisbi_prefs_initialise_builder ( void )
+{
+    /* Creation d'un nouveau GtkBuilder */
+    grisbi_prefs_builder = gtk_builder_new ( );
+    if ( grisbi_prefs_builder == NULL )
+        return FALSE;
+
+    /* récupère les widgets */
+    if ( utils_gtkbuilder_merge_ui_data_in_builder ( grisbi_prefs_builder, "grisbi_prefs.ui" ) )
+        return TRUE;
+    else
+        return FALSE;
+}
+
+
+/*LEFT_PANEL*/
+/**
+ * remplit le model pour la configuration des états
+ *
+ * \param
+ * \param
+ *
+ * \return
+ * */
+static void grisbi_prefs_left_panel_populate_tree_model ( GtkTreeStore *tree_model,
+                        GtkWidget *notebook )
+{
+    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 group page "Display" */
+    utils_ui_left_panel_add_line ( tree_model, &iter, NULL, NULL, _("Display"), -1 );
+page++;
+
+    /* append group page "Transactions" */
+    utils_ui_left_panel_add_line ( tree_model, &iter, NULL, NULL, _("Transactions"), -1 );
+page++;
+
+    /* append group page "Transaction form" */
+
+    utils_ui_left_panel_add_line ( tree_model, &iter, NULL, NULL, _("Transaction form"), -1 );
+page++;
+
+    /* append group page "Resources" */
+    utils_ui_left_panel_add_line ( tree_model, &iter, NULL, NULL, _("Resources"), -1 );
+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++;
+ */
+
+
+    /* fin de fonction */
+}
+
+
+/**
+ * création du tree_view qui liste les onglets de la fenêtre de dialogue
+ *
+ *
+ *\return tree_view or NULL;
+ * */
+static GtkWidget *grisbi_prefs_left_panel_create_tree_view ( void )
+{
+    GtkWidget *tree_view = NULL;
+    GtkWidget *notebook;
+    GtkTreeStore *model = NULL;
+    GtkTreeViewColumn *column;
+    GtkCellRenderer *cell;
+    GtkTreeSelection *selection;
+
+    devel_debug (NULL);
+
+    /* Création du model */
+    model = gtk_tree_store_new ( LEFT_PANEL_TREE_NUM_COLUMNS,
+                        G_TYPE_STRING,  /* LEFT_PANEL_TREE_TEXT_COLUMN */
+                        G_TYPE_INT,     /* LEFT_PANEL_TREE_PAGE_COLUMN */
+                        G_TYPE_INT,     /* LEFT_PANEL_TREE_BOLD_COLUMN */
+                        G_TYPE_INT );   /* LEFT_PANEL_TREE_ITALIC_COLUMN */
+
+    /* Create container + TreeView */
+    tree_view = 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 );
+
+    /* make column */
+    cell = gtk_cell_renderer_text_new ( );
+    column = gtk_tree_view_column_new_with_attributes ( "Categories",
+                        cell,
+                        "text", LEFT_PANEL_TREE_TEXT_COLUMN,
+                        "weight", LEFT_PANEL_TREE_BOLD_COLUMN,
+                        "style", LEFT_PANEL_TREE_ITALIC_COLUMN,
+                        NULL );
+    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 );
+
+    /* Choose which entries will be selectable */
+    gtk_tree_selection_set_select_function ( selection,
+                        utils_ui_left_panel_tree_view_selectable_func, NULL, NULL );
+
+    /* expand all rows after the treeview widget has been realized */
+    g_signal_connect ( tree_view,
+                        "realize",
+                        G_CALLBACK ( utils_tree_view_set_expand_all_and_select_path_realize ),
+                        "0:0" );
+
+    /* remplissage du paned gauche */
+    grisbi_prefs_left_panel_populate_tree_model ( model, notebook );
+
+    /* show all widgets */
+    gtk_widget_show_all ( tree_view );
+
+    return tree_view;
+}
+
+
+/*CREATE OBJECT */
+/**
+ * Initialise GrisbiPrefs
+ *
+ * \param prefs
+ *
+ * \return
+ */
+static void grisbi_prefs_init ( GrisbiPrefs *prefs )
+{
+    GrisbiAppConf *conf;
+
+    devel_debug (NULL);
+    conf = grisbi_app_get_conf ( );
+
+    prefs->priv = GRISBI_PREFS_GET_PRIVATE ( prefs );
+
+    if ( !grisbi_prefs_initialise_builder ( ) )
+        exit ( 1 );
+
+    gtk_dialog_add_buttons ( GTK_DIALOG ( prefs ),
+                        GTK_STOCK_CLOSE,
+                        GTK_RESPONSE_CLOSE,
+                        GTK_STOCK_HELP,
+                        GTK_RESPONSE_HELP,
+                        NULL );
+
+    gtk_window_set_title ( GTK_WINDOW ( prefs ), _("Grisbi preferences") );
+    gtk_dialog_set_has_separator ( GTK_DIALOG ( prefs ), FALSE );
+    gtk_window_set_destroy_with_parent ( GTK_WINDOW ( prefs ), TRUE );
+
+    gtk_container_set_border_width ( GTK_CONTAINER ( prefs ), 5 );
+    gtk_box_set_spacing (GTK_BOX ( gtk_dialog_get_content_area ( GTK_DIALOG ( prefs ) ) ), 2 );
+    gtk_container_set_border_width ( GTK_CONTAINER ( gtk_dialog_get_action_area ( GTK_DIALOG ( prefs ) ) ), 5 );
+    gtk_box_set_spacing (GTK_BOX ( gtk_dialog_get_action_area (GTK_DIALOG ( prefs ) ) ), 6 );
+
+    /* set the default size */
+    if ( conf->prefs_width )
+        gtk_window_set_default_size ( GTK_WINDOW ( prefs ),
+                        conf->prefs_width, -1 );
+
+    /* create the tree_view */
+    prefs->priv->treeview_left_panel = grisbi_prefs_left_panel_create_tree_view ( );
+
+    /* connect the signals */
+    g_signal_connect ( prefs,
+                        "response",
+                        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 );
+
+    /* return */
+}
+
+
+/**
+ * show the preferences dialog
+ *
+ * \param parent
+ *
+ * \return
+ **/
+void grisb_show_prefs_dialog ( GrisbiWindow *parent )
+{
+    if ( !GRISBI_IS_WINDOW ( parent ) )
+        return;
+
+    if ( grisbi_prefs_dialog == NULL )
+    {
+        grisbi_prefs_dialog = GTK_WIDGET ( g_object_new ( GRISBI_TYPE_PREFS, NULL ) );
+        g_signal_connect ( grisbi_prefs_dialog,
+                        "destroy",
+                        G_CALLBACK ( gtk_widget_destroyed ),
+                        &grisbi_prefs_dialog );
+    }
+
+    if ( GTK_WINDOW ( parent) != gtk_window_get_transient_for ( GTK_WINDOW ( grisbi_prefs_dialog ) ) )
+    {
+        gtk_window_set_transient_for ( GTK_WINDOW ( grisbi_prefs_dialog ), GTK_WINDOW ( parent ) );
+    }
+
+    gtk_window_present ( GTK_WINDOW ( grisbi_prefs_dialog ) );
+
+}
+
+
+/**
+ *
+ *
+ * \param parent
+ *
+ * \return
+ **/
+/* Local Variables: */
+/* c-basic-offset: 4 */
+/* End: */
+
diff --git a/src/grisbi_prefs.h b/src/grisbi_prefs.h
new file mode 100644
index 0000000..a2457bb
--- /dev/null
+++ b/src/grisbi_prefs.h
@@ -0,0 +1,55 @@
+#ifndef __GRISBI_PREFS_H__
+#define __GRISBI_PREFS_H__
+
+#include <gtk/gtk.h>
+
+/*START_INCLUDE*/
+#include "grisbi_window.h"
+#include "structures.h"
+/*END_INCLUDE*/
+
+G_BEGIN_DECLS
+
+/*
+ * Type checking and casting macros
+ */
+#define GRISBI_TYPE_PREFS              (grisbi_prefs_get_type())
+#define GRISBI_PREFS(obj)              (G_TYPE_CHECK_INSTANCE_CAST((obj), GRISBI_TYPE_PREFS, GrisbiPrefs))
+#define GRISBI_PREFS_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST((klass), GRISBI_TYPE_PREFS, GrisbiPrefsClass))
+#define GRISBI_IS_PREFS(obj)           (G_TYPE_CHECK_INSTANCE_TYPE((obj), GRISBI_TYPE_PREFS))
+#define GRISBI_IS_PREFS_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GRISBI_TYPE_PREFS))
+#define GRISBI_PREFS_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS((obj), GRISBI_TYPE_PREFS, GrisbitPrefsClass))
+
+/* Private structure type */
+typedef struct _GrisbiPrefsPrivate GrisbiPrefsPrivate;
+
+
+/* Main object structure */
+typedef struct _GrisbiPrefs GrisbiPrefs;
+
+struct _GrisbiPrefs
+{
+    GtkDialog dialog;
+
+    /*< private > */
+    GrisbiPrefsPrivate *priv;
+};
+
+
+/* Class definition */
+typedef struct _GrisbiPrefsClass GrisbiPrefsClass;
+
+struct _GrisbiPrefsClass
+{
+    GtkDialogClass parent_class;
+};
+
+
+/* START_DECLARATION */
+GType grisbi_prefs_get_type ( void ) G_GNUC_CONST;
+void grisb_show_prefs_dialog ( GrisbiWindow *parent );
+/* END_DECLARATION */
+
+G_END_DECLS
+
+#endif  /* __GRISBI_PREFS_H__ */
diff --git a/src/grisbi_ui.h b/src/grisbi_ui.h
index 38697a9..61e5627 100644
--- a/src/grisbi_ui.h
+++ b/src/grisbi_ui.h
@@ -118,7 +118,7 @@ static const GtkActionEntry division_sensitive_entries[] =
     {"NewAccountAction", GTK_STOCK_NEW, N_("_New account"), "", NULL,
      G_CALLBACK ( gsb_assistant_account_run ) },
     {"PrefsAction", GTK_STOCK_PREFERENCES, N_("_Preferences"), NULL, NULL,
-     G_CALLBACK ( preferences ) },
+     G_CALLBACK ( gsb_menu_preferences ) },
 };
 
 static const GtkActionEntry file_save_entries[] =
diff --git a/src/grisbi_window.c b/src/grisbi_window.c
index 06e0b14..7dc702e 100644
--- a/src/grisbi_window.c
+++ b/src/grisbi_window.c
@@ -254,7 +254,6 @@ static void grisbi_window_init ( GrisbiWindow *window )
                         G_CALLBACK ( grisbi_window_key_press_event ),
                         NULL );
 }
-/* commentaire_a_supprimer */
 
 /* MENUS */
 static void grisbi_window_init_menus ( GrisbiWindow *window )
diff --git a/src/gtk_combofix.h b/src/gtk_combofix.h
index 75bf5f6..7473394 100644
--- a/src/gtk_combofix.h
+++ b/src/gtk_combofix.h
@@ -44,7 +44,7 @@ struct _GtkComboFix
     GtkWidget *entry;
 
     /* *** private entries *** */
-    GtkComboFixPrivate *GSEAL (priv);
+    GtkComboFixPrivate *priv;
 };
 
 struct _GtkComboFixClass
diff --git a/src/menu.c b/src/menu.c
index b39c31f..078ef70 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -34,6 +34,7 @@
 #include "menu.h"
 #include "fenetre_principale.h"
 #include "grisbi_app.h"
+#include "grisbi_prefs.h"
 #include "gsb_account.h"
 #include "gsb_file.h"
 #include "gsb_form.h"
@@ -649,6 +650,27 @@ void gsb_menu_full_screen_mode ( void )
         gtk_window_fullscreen ( GTK_WINDOW ( window ) );
 }
 
+/**
+ * show the preferences
+ *
+ * \param
+ *
+ * \return
+ **/
+void gsb_menu_preferences ( GtkAction *action,
+                        GrisbiWindow *window )
+{
+    grisb_show_prefs_dialog ( window );
+}
+
+
+/**
+ *
+ *
+ * \param
+ *
+ * \return
+ **/
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */
diff --git a/src/menu.h b/src/menu.h
index ac0f884..29407d9 100644
--- a/src/menu.h
+++ b/src/menu.h
@@ -15,6 +15,7 @@ enum view_menu_action {
 };
 
 /* START_INCLUDE_H */
+#include "grisbi_window.h"
 /* END_INCLUDE_H */
 
 
@@ -34,6 +35,8 @@ GtkUIManager *gsb_menu_get_ui_manager ( void );
 gboolean gsb_menu_reinit_largeur_col_menu ( void );
 void gsb_menu_sensitive ( gboolean sensitif );
 gboolean gsb_menu_set_block_menu_cb ( gboolean etat );
+void gsb_menu_preferences ( GtkAction *action,
+                        GrisbiWindow *window );
 gboolean gsb_menu_transaction_operations_set_sensitive ( gboolean sensitive );
 gboolean gsb_menu_update_accounts_in_menus ( void );
 gboolean gsb_menu_update_view_menu ( gint account_number );
diff --git a/src/structures.h b/src/structures.h
index bf18a66..a5392a7 100644
--- a/src/structures.h
+++ b/src/structures.h
@@ -258,6 +258,17 @@ enum alignement
 };
 
 
+/* definition of the columns of model for the left panel  */
+enum left_panel_tree_columns
+{
+    LEFT_PANEL_TREE_TEXT_COLUMN,
+    LEFT_PANEL_TREE_PAGE_COLUMN,
+    LEFT_PANEL_TREE_BOLD_COLUMN,
+    LEFT_PANEL_TREE_ITALIC_COLUMN,
+    LEFT_PANEL_TREE_NUM_COLUMNS,
+};
+
+
 /* définition du type d'origine pour les données du module budgétaire */
 enum bet_array_origin_data
 {
diff --git a/src/ui/grisbi_prefs.ui b/src/ui/grisbi_prefs.ui
index dba7283..dbd98ea 100644
--- a/src/ui/grisbi_prefs.ui
+++ b/src/ui/grisbi_prefs.ui
@@ -2,142 +2,138 @@
 <interface>
   <requires lib="gtk+" version="2.24"/>
   <!-- interface-naming-policy project-wide -->
-  <object class="GtkDialog" id="grisbi_prefs_dialog">
-    <property name="can_focus">False</property>
-    <property name="border_width">5</property>
-    <property name="title" translatable="yes">Report properties</property>
-    <property name="window_position">center</property>
-    <property name="type_hint">dialog</property>
-    <child internal-child="vbox">
-      <object class="GtkVBox" id="dialog-vbox">
+  <object class="GtkHPaned" id="dialog_hpaned">
+    <property name="visible">True</property>
+    <property name="can_focus">True</property>
+    <child>
+      <object class="GtkAlignment" id="alignment1">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
-        <property name="spacing">5</property>
-        <child internal-child="action_area">
-          <object class="GtkHButtonBox" id="dialog-action_area">
+        <property name="right_padding">5</property>
+        <child>
+          <object class="GtkVBox" id="vbox1">
+            <property name="width_request">220</property>
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="layout_style">end</property>
             <child>
-              <object class="GtkButton" id="button_Annuler">
-                <property name="label">gtk-cancel</property>
+              <object class="GtkScrolledWindow" id="sw_dialog">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_action_appearance">False</property>
-                <property name="use_stock">True</property>
+                <property name="hscrollbar_policy">never</property>
+                <property name="vscrollbar_policy">automatic</property>
+                <property name="shadow_type">in</property>
+                <child>
+                  <object class="GtkTreeView" id="treeview_left_panel">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="can_default">True</property>
+                    <property name="headers_visible">False</property>
+                    <property name="reorderable">True</property>
+                    <property name="enable_search">False</property>
+                    <property name="fixed_height_mode">True</property>
+                  </object>
+                </child>
               </object>
               <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
+                <property name="expand">True</property>
+                <property name="fill">True</property>
+                <property name="padding">5</property>
                 <property name="position">0</property>
               </packing>
             </child>
-            <child>
-              <object class="GtkButton" id="button_OK">
-                <property name="label">gtk-ok</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_action_appearance">False</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
+          </object>
+        </child>
+      </object>
+      <packing>
+        <property name="resize">False</property>
+        <property name="shrink">True</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkAlignment" id="alignment2">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="left_padding">5</property>
+        <property name="right_padding">5</property>
+        <child>
+          <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>
+          </object>
+        </child>
+      </object>
+      <packing>
+        <property name="resize">True</property>
+        <property name="shrink">True</property>
+      </packing>
+    </child>
+  </object>
+  <object class="GtkVBox" id="vbox_paddingbox1">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="spacing">6</property>
+    <child>
+      <object class="GtkLabel" id="title1">
+        <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">title</property>
+        <attributes>
+          <attribute name="weight" value="bold"/>
+        </attributes>
+      </object>
+      <packing>
+        <property name="expand">True</property>
+        <property name="fill">True</property>
+        <property name="position">0</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkHBox" id="hbox1">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <child>
+          <object class="GtkLabel" id="label1">
+            <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">True</property>
-            <property name="pack_type">end</property>
+            <property name="fill">False</property>
             <property name="position">0</property>
           </packing>
         </child>
         <child>
-          <object class="GtkHPaned" id="dialog_hpaned">
+          <object class="GtkVBox" id="paddingbox1">
             <property name="visible">True</property>
-            <property name="can_focus">True</property>
+            <property name="can_focus">False</property>
+            <property name="spacing">6</property>
             <child>
-              <object class="GtkAlignment" id="alignment1">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="right_padding">5</property>
-                <child>
-                  <object class="GtkVBox" id="vbox1">
-                    <property name="width_request">220</property>
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <child>
-                      <object class="GtkScrolledWindow" id="sw_dialog">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="hscrollbar_policy">never</property>
-                        <property name="vscrollbar_policy">automatic</property>
-                        <property name="shadow_type">in</property>
-                        <child>
-                          <object class="GtkTreeView" id="treeview_left_panel">
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="can_default">True</property>
-                            <property name="headers_visible">False</property>
-                            <property name="reorderable">True</property>
-                            <property name="enable_search">False</property>
-                            <property name="fixed_height_mode">True</property>
-                          </object>
-                        </child>
-                      </object>
-                      <packing>
-                        <property name="expand">True</property>
-                        <property name="fill">True</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                  </object>
-                </child>
-              </object>
-              <packing>
-                <property name="resize">False</property>
-                <property name="shrink">True</property>
-              </packing>
+              <placeholder/>
             </child>
             <child>
-              <object class="GtkAlignment" id="alignment2">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="left_padding">5</property>
-                <property name="right_padding">5</property>
-                <child>
-                  <object class="GtkNotebook" id="notebook_prefs">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="show_tabs">False</property>
-                    <property name="tab_border">0</property>
-                    <property name="tab_hborder">0</property>
-                    <property name="tab_vborder">0</property>
-                  </object>
-                </child>
-              </object>
-              <packing>
-                <property name="resize">True</property>
-                <property name="shrink">True</property>
-              </packing>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
             </child>
           </object>
           <packing>
-            <property name="expand">True</property>
-            <property name="fill">True</property>
-            <property name="padding">10</property>
-            <property name="position">2</property>
+            <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>
-    <action-widgets>
-      <action-widget response="-1">button_Annuler</action-widget>
-      <action-widget response="-5">button_OK</action-widget>
-    </action-widgets>
   </object>
 </interface>
diff --git a/src/utils.c b/src/utils.c
index 942a3cc..619cb51 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -627,7 +627,7 @@ void utils_tree_view_set_expand_all_and_select_path_realize ( GtkWidget *tree_vi
                         gtk_tree_view_get_selection ( GTK_TREE_VIEW ( tree_view ) ) ),
                         path );
 
-    gtk_tree_path_free (path);
+    gtk_tree_path_free ( path );
 
 }
 
@@ -745,6 +745,102 @@ GtkWidget *utils_combo_box_make_from_string_array ( gchar **array )
 }
 
 
+/**
+ * ajoute une ligne dans le tree_model du panel de gauche de la fenêtre
+ * des préférences de grisbi ou des états
+ *
+ *
+ *
+ * */
+void utils_ui_left_panel_add_line ( GtkTreeStore *tree_model,
+                        GtkTreeIter *iter,
+                        GtkWidget *notebook,
+                        GtkWidget *child,
+                        const gchar *title,
+                        gint page )
+{
+    GtkTreeIter iter2;
+
+    if ( page == -1 )
+    {
+        /* append page groupe */
+        gtk_tree_store_append ( GTK_TREE_STORE ( tree_model ), iter, NULL );
+        gtk_tree_store_set (GTK_TREE_STORE ( tree_model ), iter,
+                        LEFT_PANEL_TREE_TEXT_COLUMN, title,
+                        LEFT_PANEL_TREE_PAGE_COLUMN, -1,
+                        LEFT_PANEL_TREE_BOLD_COLUMN, 800,
+                        -1 );
+    }
+    else
+    {
+        /* append page onglet*/
+        gtk_notebook_append_page ( GTK_NOTEBOOK ( notebook ),
+                        child,
+                        gtk_label_new ( title ) );
+
+        gtk_tree_store_append (GTK_TREE_STORE ( tree_model ), &iter2, iter );
+        gtk_tree_store_set (GTK_TREE_STORE ( tree_model ), &iter2,
+                        LEFT_PANEL_TREE_TEXT_COLUMN, title,
+                        LEFT_PANEL_TREE_PAGE_COLUMN, page,
+                        LEFT_PANEL_TREE_BOLD_COLUMN, 400,
+                        -1);
+    }
+}
+
+
+/**
+ * indique si la ligne choisie peut être sélectionnée
+ *
+ * \param selection
+ * \param model
+ * \param chemin de la ligne à tester
+ * \param TRUE si la ligne est déja sélectionnée
+ * \param data transmise à la fonction
+ *
+ * \return selectable
+ */
+gboolean utils_ui_left_panel_tree_view_selectable_func (GtkTreeSelection *selection,
+                        GtkTreeModel *model,
+                        GtkTreePath *path,
+                        gboolean path_currently_selected,
+                        gpointer data )
+{
+    GtkTreeIter iter;
+    gint selectable;
+
+    gtk_tree_model_get_iter ( model, &iter, path );
+    gtk_tree_model_get ( model, &iter, 1, &selectable, -1 );
+
+    return ( selectable != -1 );
+}
+
+
+/**
+ *
+ *
+ * \param
+ *
+ * \return
+ */
+gboolean utils_ui_left_panel_tree_view_selection_changed ( GtkTreeSelection *selection,
+                        GtkWidget *notebook )
+{
+    GtkTreeModel *model;
+    GtkTreeIter iter;
+    gint selected;
+
+    if (! gtk_tree_selection_get_selected ( selection, &model, &iter ) )
+        return(FALSE);
+
+    gtk_tree_model_get ( model, &iter, 1, &selected, -1 );
+
+    gtk_notebook_set_current_page ( GTK_NOTEBOOK ( notebook ), selected );
+
+    /* return */
+    return FALSE;
+}
+
+
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */
diff --git a/src/utils.h b/src/utils.h
index a387750..89a9b41 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -43,5 +43,18 @@ gboolean utils_set_tree_view_background_color ( GtkWidget *tree_view,
                         gint color_column );
 void utils_tree_view_set_expand_all_and_select_path_realize ( GtkWidget *tree_view,
                         const gchar *str_path );
+void utils_ui_left_panel_add_line ( GtkTreeStore *tree_model,
+                        GtkTreeIter *iter,
+                        GtkWidget *notebook,
+                        GtkWidget *child,
+                        const gchar *title,
+                        gint page );
+gboolean utils_ui_left_panel_tree_view_selectable_func (GtkTreeSelection *selection,
+                        GtkTreeModel *model,
+                        GtkTreePath *path,
+                        gboolean path_currently_selected,
+                        gpointer data );
+gboolean utils_ui_left_panel_tree_view_selection_changed ( GtkTreeSelection *selection,
+                        GtkWidget *notebook );
 /* END_DECLARATION */
 #endif
diff --git a/src/utils_gtkbuilder.c b/src/utils_gtkbuilder.c
index 37ecec9..9680f2f 100644
--- a/src/utils_gtkbuilder.c
+++ b/src/utils_gtkbuilder.c
@@ -26,12 +26,14 @@
 #include <config.h>
 #endif
 
+#include <errno.h>
 #include <glib/gi18n.h>
 
 /*START_INCLUDE*/
 #include "utils_gtkbuilder.h"
 #include "dialog.h"
 #include "gsb_dirs.h"
+#include "utils_files.h"
 /*END_INCLUDE*/
 
 /*START_STATIC*/
@@ -102,14 +104,9 @@ gint utils_gtkbuilder_merge_ui_data_in_builder ( GtkBuilder *builder,
     filename = utils_gtkbuilder_get_full_path ( ui_name );
     if ( !g_file_test ( filename, G_FILE_TEST_EXISTS ) )
     {
-        gchar* tmpstr;
-
-        tmpstr = g_strdup_printf ( _("Cannot open file '%s': %s"),
-                        filename,
-                        _("File does not exist") );
-        dialogue_error ( tmpstr );
-        g_free ( tmpstr );
+        utils_files_display_dialog_error ( G_FILE_TEST_EXISTS, filename, g_strerror ( errno ) );
         g_free ( filename );
+
         return 0;
     }
 


hooks/post-receive
-- 
grisbi


More information about the cvs mailing list