[grisbi-cvs] [SCM] grisbi branch, master, updated. upstream_version_0_9.0-132-g19b2199
Pierre Biava
nobody at users.sourceforge.net
Sun Apr 17 22:05:16 CEST 2011
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grisbi".
The branch, master has been updated
via 19b219962b592042d8ece953ef5bd763cfb51d67 (commit)
via 3aebc059820cb7582ee7ae38551d8542de89843f (commit)
from 13bac591896626c2521138b146a6798ce89f649c (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 19b219962b592042d8ece953ef5bd763cfb51d67
Author: pbiava <pierre.biava at nerim.net>
Date: Sun Apr 17 22:04:24 2011 +0200
minor changes
commit 3aebc059820cb7582ee7ae38551d8542de89843f
Author: pbiava <pierre.biava at nerim.net>
Date: Sun Apr 17 19:55:38 2011 +0200
new_gestion_left_paned
-----------------------------------------------------------------------
Changes:
diff --git a/src/etats_config.c b/src/etats_config.c
index 4cef5c4..b17bfd4 100644
--- a/src/etats_config.c
+++ b/src/etats_config.c
@@ -1910,7 +1910,7 @@ void recuperation_info_perso_etat ( void )
/* on repasse à la 1ère page du notebook */
gtk_notebook_set_current_page ( GTK_NOTEBOOK ( notebook_etats ),
0 );
- gtk_widget_set_sensitive ( gsb_gui_get_navigation_tree_view ( ), TRUE );
+ gtk_widget_set_sensitive ( gsb_gui_navigation_get_tree_view ( ), TRUE );
gsb_gui_navigation_update_report ( gsb_gui_navigation_get_current_report ());
}
diff --git a/src/gsb_file.c b/src/gsb_file.c
index 9247c92..a27e6b9 100644
--- a/src/gsb_file.c
+++ b/src/gsb_file.c
@@ -491,7 +491,7 @@ gboolean gsb_file_open_file ( gchar *filename )
gsb_gui_navigation_set_selection ( GSB_HOME_PAGE, -1, NULL );
/* set the focus to the selection tree at left */
- gtk_widget_grab_focus ( gsb_gui_get_navigation_tree_view ( ) );
+ gtk_widget_grab_focus ( gsb_gui_navigation_get_tree_view ( ) );
return TRUE;
}
diff --git a/src/gsb_file_load.c b/src/gsb_file_load.c
index 4f678d1..4a71b13 100644
--- a/src/gsb_file_load.c
+++ b/src/gsb_file_load.c
@@ -70,6 +70,7 @@
#include "gsb_select_icon.h"
#include "gsb_scheduler_list.h"
#include "import.h"
+#include "navigation.h"
#include "structures.h"
#include "traitement_variables.h"
#include "utils.h"
@@ -822,6 +823,11 @@ void gsb_file_load_general_part ( const gchar **attribute_names,
no_devise_totaux_ib = utils_str_atoi ( attribute_values[i]);
}
+ else if ( !strcmp ( attribute_names[i], "Navigation_list_order" ) )
+ {
+ gsb_gui_navigation_set_page_list_order ( attribute_values[i] );
+ }
+
else if ( !strcmp ( attribute_names[i],
"Scheduler_view" ))
{
diff --git a/src/gsb_file_save.c b/src/gsb_file_save.c
index 6f5cc98..4e11752 100644
--- a/src/gsb_file_save.c
+++ b/src/gsb_file_save.c
@@ -570,6 +570,7 @@ gulong gsb_file_save_general_part ( gulong iterator,
gchar **file_content,
gint archive_number )
{
+ GQueue *tmp_queue;
gchar *first_string_to_free;
gchar *second_string_to_free;
gint i,j;
@@ -583,6 +584,7 @@ gulong gsb_file_save_general_part ( gulong iterator,
gchar *date_format;
gchar *mon_decimal_point;
gchar *mon_thousands_sep;
+ gchar *navigation_order_list = NULL;
gboolean is_archive = FALSE;
/* prepare stuff to save general information */
@@ -652,16 +654,42 @@ gulong gsb_file_save_general_part ( gulong iterator,
else
transaction_column_align_write = utils_str_itoa ( transaction_col_align[i] );
+ /* prépare l'ordre des pages dans le panneau de gauche */
+ tmp_queue = gsb_gui_navigation_get_pages_list ( );
+
+ for ( i = 0 ; i < tmp_queue -> length ; i++ )
+ {
+ struct_page *page;
+
+ page = g_queue_peek_nth ( tmp_queue, i );
+
+ if ( navigation_order_list == NULL )
+ navigation_order_list = utils_str_itoa ( page -> type_page );
+ else
+ {
+ navigation_order_list = g_strconcat (
+ first_string_to_free = navigation_order_list,
+ "-",
+ second_string_to_free = utils_str_itoa ( page -> type_page ),
+ NULL );
+
+ g_free ( first_string_to_free );
+ g_free ( second_string_to_free );
+ }
+ }
+
/* CSV skipped lines */
skipped_lines_string = utils_str_itoa ( etat.csv_skipped_lines[0] );
for ( i = 1; i < CSV_MAX_TOP_LINES ; i ++ )
{
- gchar* tmpstr = skipped_lines_string;
- skipped_lines_string = g_strconcat ( tmpstr ,
- "-",
- utils_str_itoa ( etat.csv_skipped_lines[i] ),
- NULL );
- g_free ( tmpstr );
+ skipped_lines_string = g_strconcat (
+ first_string_to_free = skipped_lines_string ,
+ "-",
+ second_string_to_free = utils_str_itoa ( etat.csv_skipped_lines[i] ),
+ NULL );
+
+ g_free ( first_string_to_free );
+ g_free ( second_string_to_free );
}
/* prepare bet_array_column_width_write */
@@ -710,6 +738,7 @@ gulong gsb_file_save_general_part ( gulong iterator,
"\t\tParty_list_currency_number=\"%d\"\n"
"\t\tCategory_list_currency_number=\"%d\"\n"
"\t\tBudget_list_currency_number=\"%d\"\n"
+ "\t\tNavigation_list_order=\"%s\"\n"
"\t\tScheduler_view=\"%d\"\n"
"\t\tScheduler_custom_number=\"%d\"\n"
"\t\tScheduler_custom_menu=\"%d\"\n"
@@ -761,6 +790,7 @@ gulong gsb_file_save_general_part ( gulong iterator,
no_devise_totaux_tiers,
no_devise_totaux_categ,
no_devise_totaux_ib,
+ my_safe_null_str ( navigation_order_list ),
affichage_echeances,
affichage_echeances_perso_nb_libre,
affichage_echeances_perso_j_m_a,
@@ -808,6 +838,7 @@ gulong gsb_file_save_general_part ( gulong iterator,
g_free ( date_format );
g_free ( mon_decimal_point );
g_free ( mon_thousands_sep );
+ g_free ( navigation_order_list );
/* append the new string to the file content
* and return the new iterator */
diff --git a/src/gsb_form.c b/src/gsb_form.c
index 2b386d9..85eb89f 100644
--- a/src/gsb_form.c
+++ b/src/gsb_form.c
@@ -3476,7 +3476,7 @@ gboolean gsb_form_escape_form ( void )
{
case ORIGIN_VALUE_OTHER:
notice_debug ("Should not come here... (gsb_form_escape_form)");
- gtk_widget_grab_focus ( gsb_gui_get_navigation_tree_view ( ) );
+ gtk_widget_grab_focus ( gsb_gui_navigation_get_tree_view ( ) );
break;
case ORIGIN_VALUE_HOME:
diff --git a/src/gsb_reconcile.c b/src/gsb_reconcile.c
index ae76997..badcd8b 100644
--- a/src/gsb_reconcile.c
+++ b/src/gsb_reconcile.c
@@ -669,7 +669,7 @@ void gsb_reconcile_sensitive ( gboolean sensitive )
GtkUIManager *ui_manager;
ui_manager = gsb_menu_get_ui_manager ( );
- gtk_widget_set_sensitive ( gsb_gui_get_navigation_tree_view ( ), sensitive );
+ gtk_widget_set_sensitive ( gsb_gui_navigation_get_tree_view ( ), sensitive );
gsb_gui_sensitive_headings (sensitive);
/* add by pbiava 02/11/2009 */
gtk_widget_set_sensitive ( gtk_ui_manager_get_widget ( ui_manager,
diff --git a/src/gsb_scheduler_list.c b/src/gsb_scheduler_list.c
index 9f3720f..896d6f3 100644
--- a/src/gsb_scheduler_list.c
+++ b/src/gsb_scheduler_list.c
@@ -41,7 +41,7 @@
#include "gsb_scheduler_list.h"
#include "barre_outils.h"
#include "dialog.h"
-#include "utils_dates.h"
+#include "fenetre_principale.h"
#include "gsb_automem.h"
#include "gsb_calendar.h"
#include "gsb_data_account.h"
@@ -49,19 +49,20 @@
#include "gsb_data_currency.h"
#include "gsb_data_payee.h"
#include "gsb_data_scheduled.h"
+#include "gsb_dirs.h"
#include "gsb_form.h"
#include "gsb_form_scheduler.h"
-#include "fenetre_principale.h"
#include "gsb_real.h"
#include "gsb_scheduler.h"
+#include "gsb_transactions_list.h"
+#include "mouse.h"
+#include "navigation.h"
+#include "structures.h"
#include "traitement_variables.h"
#include "utils.h"
+#include "utils_dates.h"
#include "utils_str.h"
-#include "structures.h"
-#include "gsb_transactions_list.h"
-#include "mouse.h"
#include "erreur.h"
-#include "gsb_dirs.h"
/*END_INCLUDE*/
/*START_STATIC*/
@@ -1646,7 +1647,7 @@ gboolean gsb_scheduler_list_key_press ( GtkWidget *tree_view,
case GDK_Left:
/* if we press left, give back the focus to the tree at left */
- gtk_widget_grab_focus ( gsb_gui_get_navigation_tree_view ( ) );
+ gtk_widget_grab_focus ( gsb_gui_navigation_get_tree_view ( ) );
break;
case GDK_space:
diff --git a/src/gsb_transactions_list.c b/src/gsb_transactions_list.c
index 1ad8dd3..2274c24 100644
--- a/src/gsb_transactions_list.c
+++ b/src/gsb_transactions_list.c
@@ -1353,7 +1353,7 @@ gboolean gsb_transactions_list_key_press ( GtkWidget *widget,
case GDK_Left:
/* if we press left, give back the focus to the tree at left */
- gtk_widget_grab_focus ( gsb_gui_get_navigation_tree_view ( ) );
+ gtk_widget_grab_focus ( gsb_gui_navigation_get_tree_view ( ) );
break;
case GDK_Home:
diff --git a/src/main.c b/src/main.c
index 15aa949..019c4c1 100644
--- a/src/main.c
+++ b/src/main.c
@@ -101,7 +101,6 @@ static void main_win_32 ( int argc, char **argv );
static gboolean main_window_delete_event (GtkWidget *window, gpointer data);
static void main_window_destroy_event ( GObject* obj, gpointer data);
static void main_window_set_size_and_position ( void );
-static void gsb_main_init_main_window ( void );
/*END_STATIC*/
/* Fenetre principale de grisbi */
@@ -133,7 +132,6 @@ int main ( int argc, char **argv )
g_mem_set_vtable(glib_mem_profiler_table);
#endif
- gsb_main_init_main_window ( );
gsb_dirs_init ( );
#ifdef _WIN32
@@ -861,17 +859,6 @@ GtkWidget *gsb_main_get_main_window ( void )
}
-/**
- * initialise la fenêtre principale de Grisbi
- *
- *
- */
-void gsb_main_init_main_window ( void )
-{
- main_window = NULL;
-}
-
-
/* Local Variables: */
/* c-basic-offset: 4 */
/* End: */
diff --git a/src/menu.c b/src/menu.c
index 4fbda3e..29973d7 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -658,7 +658,7 @@ gboolean gsb_gui_toggle_show_closed_accounts ( void )
{
etat.show_closed_accounts = ! etat.show_closed_accounts;
- gsb_gui_navigation_create_account_list ( gsb_gui_get_navigation_model ( ) );
+ gsb_gui_navigation_create_account_list ( gsb_gui_navigation_get_model ( ) );
gsb_gui_navigation_update_home_page ( );
if ( etat.modification_fichier == 0 )
diff --git a/src/metatree.c b/src/metatree.c
index 9167c34..2173ae9 100644
--- a/src/metatree.c
+++ b/src/metatree.c
@@ -1189,7 +1189,7 @@ gboolean division_row_drop_possible ( GtkTreeDragDest *drag_dest,
gtk_tree_get_row_drag_data (selection_data, &model, &orig_path);
- if ( model == GTK_TREE_MODEL( gsb_gui_get_navigation_model ( ) ) )
+ if ( model == GTK_TREE_MODEL( gsb_gui_navigation_get_model ( ) ) )
{
return navigation_row_drop_possible ( drag_dest, dest_path, selection_data );
}
@@ -1267,7 +1267,7 @@ gboolean division_drag_data_received ( GtkTreeDragDest *drag_dest,
gtk_tree_get_row_drag_data (selection_data, &model, &orig_path);
/* if we are on the navigation list, work with it */
- if ( model == GTK_TREE_MODEL( gsb_gui_get_navigation_model ( ) ) )
+ if ( model == GTK_TREE_MODEL( gsb_gui_navigation_get_model ( ) ) )
{
return navigation_drag_data_received ( drag_dest, dest_path, selection_data );
}
diff --git a/src/navigation.c b/src/navigation.c
index 2e87692..2340530 100644
--- a/src/navigation.c
+++ b/src/navigation.c
@@ -65,11 +65,13 @@
#include "erreur.h"
/*END_INCLUDE*/
+
/*START_STATIC*/
static void create_report_list ( GtkTreeModel * model, GtkTreeIter * reports_iter );
static gboolean gsb_gui_navigation_check_key_press ( GtkWidget *tree_view,
GdkEventKey *ev,
GtkTreeModel *model );
+static void gsb_gui_navigation_clear_pages_list ( void );
static gboolean gsb_gui_navigation_remove_account_iterator ( GtkTreeModel * tree_model,
GtkTreePath *path,
GtkTreeIter *iter,
@@ -80,9 +82,13 @@ static gboolean gsb_gui_navigation_remove_report_iterator ( GtkTreeModel * tree_
gpointer data );
static gboolean gsb_gui_navigation_select_line ( GtkTreeSelection *selection,
GtkTreeModel *model );
+static void gsb_gui_navigation_set_navigation_pages ( GtkTreeModel *model,
+ gint type_page );
static void gsb_gui_navigation_set_selection_branch ( GtkTreeSelection * selection,
- GtkTreeIter * iter, gint page,
- gint account_number, gpointer report );
+ GtkTreeIter *iter,
+ gint page,
+ gint account_number,
+ gpointer report );
static void gsb_gui_navigation_update_account_iter ( GtkTreeModel * model,
GtkTreeIter * account_iter,
gint account_number );
@@ -130,6 +136,9 @@ GtkWidget *reconcile_panel;
* at the end of the switch, contains the current account number */
static gint buffer_last_account = -1;
+/** contains a g_slist of struct_navigation_page */
+static GQueue *pages_list = NULL;
+
/**
* Create the navigation pane on the left of the GUI. It contains
@@ -140,13 +149,12 @@ static gint buffer_last_account = -1;
GtkWidget *gsb_gui_navigation_create_navigation_pane ( void )
{
GtkWidget * sw, *vbox;
- GdkPixbuf * pixbuf;
- GtkTreeIter iter, account_iter, reports_iter;
+ GQueue *tmp_queue;
GtkCellRenderer * renderer;
GtkTreeDragDestIface * navigation_dst_iface;
GtkTreeDragSourceIface * navigation_src_iface;
GtkTreeViewColumn * column;
- gchar* tmpstr;
+ gint i;
static GtkTargetEntry row_targets[] = {
{ "GTK_TREE_MODEL_ROW", GTK_TARGET_SAME_WIDGET, 0 }
};
@@ -170,9 +178,9 @@ GtkWidget *gsb_gui_navigation_create_navigation_pane ( void )
G_TYPE_INT, G_TYPE_INT,
G_TYPE_INT ));
- gtk_tree_sortable_set_sort_column_id ( GTK_TREE_SORTABLE(navigation_model),
+ gtk_tree_sortable_set_sort_column_id ( GTK_TREE_SORTABLE ( navigation_model ),
NAVIGATION_PAGE, GTK_SORT_ASCENDING );
- gtk_tree_sortable_set_sort_func ( GTK_TREE_SORTABLE(navigation_model),
+ gtk_tree_sortable_set_sort_func ( GTK_TREE_SORTABLE ( navigation_model ),
NAVIGATION_PAGE, navigation_sort_column,
NULL, NULL );
@@ -243,122 +251,20 @@ GtkWidget *gsb_gui_navigation_create_navigation_pane ( void )
gtk_tree_view_append_column ( GTK_TREE_VIEW ( navigation_tree_view ),
GTK_TREE_VIEW_COLUMN ( column ) );
- /* Account list */
- tmpstr = g_build_filename ( gsb_dirs_get_pixmaps_dir ( ), "ac_home.png", NULL );
- pixbuf = gdk_pixbuf_new_from_file ( tmpstr , NULL );
- g_free ( tmpstr );
- gtk_tree_store_append(GTK_TREE_STORE(navigation_model), &account_iter, NULL);
- gtk_tree_store_set(GTK_TREE_STORE(navigation_model), &account_iter,
- NAVIGATION_PIX, pixbuf,
- NAVIGATION_TEXT, _("Accounts"),
- NAVIGATION_PIX_VISIBLE, TRUE,
- NAVIGATION_FONT, 800,
- NAVIGATION_PAGE, GSB_HOME_PAGE,
- NAVIGATION_ACCOUNT, -1,
- NAVIGATION_REPORT, -1,
- NAVIGATION_SENSITIVE, 1,
- -1);
- gsb_gui_navigation_create_account_list ( GTK_TREE_MODEL( navigation_model ) );
-
- /* Scheduler */
- tmpstr = g_build_filename( gsb_dirs_get_pixmaps_dir ( ), "scheduler.png", NULL );
- pixbuf = gdk_pixbuf_new_from_file ( tmpstr , NULL );
- g_free ( tmpstr );
- gtk_tree_store_append(GTK_TREE_STORE(navigation_model), &iter, NULL);
- gtk_tree_store_set(GTK_TREE_STORE(navigation_model), &iter,
- NAVIGATION_PIX, pixbuf,
- NAVIGATION_TEXT, _("Scheduler"),
- NAVIGATION_PIX_VISIBLE, TRUE,
- NAVIGATION_FONT, 800,
- NAVIGATION_PAGE, GSB_SCHEDULER_PAGE,
- NAVIGATION_ACCOUNT, -1,
- NAVIGATION_REPORT, -1,
- NAVIGATION_SENSITIVE, 1,
- -1 );
-
- /* Payees */
- tmpstr = g_build_filename( gsb_dirs_get_pixmaps_dir ( ), "payees.png", NULL );
- pixbuf = gdk_pixbuf_new_from_file ( tmpstr , NULL );
- g_free ( tmpstr );
- gtk_tree_store_append(GTK_TREE_STORE(navigation_model), &iter, NULL);
- gtk_tree_store_set(GTK_TREE_STORE(navigation_model), &iter,
- NAVIGATION_PIX, pixbuf,
- NAVIGATION_TEXT, _("Payees"),
- NAVIGATION_PIX_VISIBLE, TRUE,
- NAVIGATION_FONT, 800,
- NAVIGATION_PAGE, GSB_PAYEES_PAGE,
- NAVIGATION_ACCOUNT, -1,
- NAVIGATION_REPORT, -1,
- NAVIGATION_SENSITIVE, 1,
- -1 );
-
- /* Credits simulator */
- tmpstr = g_build_filename( gsb_dirs_get_pixmaps_dir ( ), "ac_liability.png", NULL );
- pixbuf = gdk_pixbuf_new_from_file ( tmpstr , NULL );
- g_free ( tmpstr );
- gtk_tree_store_append(GTK_TREE_STORE(navigation_model), &iter, NULL);
- gtk_tree_store_set(GTK_TREE_STORE(navigation_model), &iter,
- NAVIGATION_PIX, pixbuf,
- NAVIGATION_TEXT, _("Credits simulator"),
- NAVIGATION_PIX_VISIBLE, TRUE,
- NAVIGATION_FONT, 800,
- NAVIGATION_PAGE, GSB_SIMULATOR_PAGE,
- NAVIGATION_ACCOUNT, -1,
- NAVIGATION_REPORT, -1,
- NAVIGATION_SENSITIVE, 1,
- -1 );
- /* Categories */
- tmpstr = g_build_filename( gsb_dirs_get_pixmaps_dir ( ), "categories.png", NULL );
- pixbuf = gdk_pixbuf_new_from_file ( tmpstr , NULL );
- g_free ( tmpstr );
- gtk_tree_store_append(GTK_TREE_STORE(navigation_model), &iter, NULL);
- gtk_tree_store_set(GTK_TREE_STORE(navigation_model), &iter,
- NAVIGATION_PIX, pixbuf,
- NAVIGATION_TEXT, _("Categories"),
- NAVIGATION_PIX_VISIBLE, TRUE,
- NAVIGATION_FONT, 800,
- NAVIGATION_PAGE, GSB_CATEGORIES_PAGE,
- NAVIGATION_ACCOUNT, -1,
- NAVIGATION_REPORT, -1,
- NAVIGATION_SENSITIVE, 1,
- -1 );
+ /* crée les pages dans le panneau de gauche */
+ tmp_queue = gsb_gui_navigation_get_pages_list ( );
- /* Budgetary lines */
- tmpstr = g_build_filename( gsb_dirs_get_pixmaps_dir ( ), "budgetary_lines.png", NULL );
- pixbuf = gdk_pixbuf_new_from_file ( tmpstr , NULL );
- g_free ( tmpstr );
- gtk_tree_store_append(GTK_TREE_STORE(navigation_model), &iter, NULL);
- gtk_tree_store_set(GTK_TREE_STORE(navigation_model), &iter,
- NAVIGATION_PIX, pixbuf,
- NAVIGATION_TEXT, _("Budgetary lines"),
- NAVIGATION_PIX_VISIBLE, TRUE,
- NAVIGATION_FONT, 800,
- NAVIGATION_PAGE, GSB_BUDGETARY_LINES_PAGE,
- NAVIGATION_ACCOUNT, -1,
- NAVIGATION_REPORT, -1,
- NAVIGATION_SENSITIVE, 1,
- -1 );
+ for ( i = 0 ; i < tmp_queue -> length ; i++ )
+ {
+ struct_page *page;
- /* Reports */
- tmpstr = g_build_filename( gsb_dirs_get_pixmaps_dir ( ), "reports.png", NULL );
- pixbuf = gdk_pixbuf_new_from_file ( tmpstr , NULL );
- g_free ( tmpstr );
- gtk_tree_store_append(GTK_TREE_STORE(navigation_model), &reports_iter, NULL);
- gtk_tree_store_set(GTK_TREE_STORE(navigation_model), &reports_iter,
- NAVIGATION_PIX, pixbuf,
- NAVIGATION_TEXT, _("Reports"),
- NAVIGATION_PIX_VISIBLE, TRUE,
- NAVIGATION_FONT, 800,
- NAVIGATION_PAGE, GSB_REPORTS_PAGE,
- NAVIGATION_ACCOUNT, -1,
- NAVIGATION_REPORT, -1,
- NAVIGATION_SENSITIVE, 1,
- -1 );
- create_report_list ( GTK_TREE_MODEL(navigation_model), &reports_iter );
+ page = g_queue_peek_nth ( tmp_queue, i );
+ gsb_gui_navigation_set_navigation_pages ( navigation_model, page -> type_page );
+ }
/* Finish tree. */
- /* gtk_tree_view_expand_all ( GTK_TREE_VIEW(navigation_tree_view) ); */
+ gtk_tree_view_expand_all ( GTK_TREE_VIEW(navigation_tree_view) );
gtk_box_pack_start ( GTK_BOX(vbox), sw, TRUE, TRUE, 0 );
/* Create calendar (hidden for now). */
@@ -1691,7 +1597,7 @@ void gsb_gui_navigation_update_home_page ( void )
*
*
*/
-GtkWidget *gsb_gui_get_navigation_tree_view ( void )
+GtkWidget *gsb_gui_navigation_get_tree_view ( void )
{
return navigation_tree_view;
}
@@ -1707,7 +1613,13 @@ void gsb_gui_navigation_init_tree_view ( void )
navigation_tree_view = NULL;
}
-GtkTreeModel *gsb_gui_get_navigation_model ( void )
+
+/**
+ *
+ *
+ *
+ */
+GtkTreeModel *gsb_gui_navigation_get_model ( void )
{
if ( navigation_model )
return navigation_model;
@@ -1715,6 +1627,161 @@ GtkTreeModel *gsb_gui_get_navigation_model ( void )
return NULL;
}
+
+/**
+ *
+ *
+ *
+ */
+gboolean gsb_gui_navigation_set_page_list_order ( const gchar *order_list )
+{
+ gchar **pointeur_char;
+ gint i;
+
+ if ( pages_list )
+ gsb_gui_navigation_clear_pages_list ( );
+
+ pointeur_char = g_strsplit ( order_list, "-", 0 );
+
+ for ( i = 0 ; i < g_strv_length ( pointeur_char ) ; i++ )
+ {
+ struct_page *page;
+
+ page = g_malloc0 ( sizeof ( struct_page ) );
+ page -> ordre = i;
+ page -> type_page = utils_str_atoi ( pointeur_char[i] );
+
+ g_queue_push_tail ( pages_list, page );
+ }
+
+ return TRUE;
+}
+
+
+/**
+ *
+ *
+ *
+ */
+void gsb_gui_navigation_init_pages_list ( const gchar *order_list )
+{
+ GQueue *new_queue;
+
+ new_queue = g_queue_new ( );
+ pages_list = new_queue;
+ gsb_gui_navigation_set_page_list_order ( order_list );
+}
+
+
+/**
+ *
+ *
+ *
+ */
+void gsb_gui_navigation_clear_pages_list ( void )
+{
+ g_queue_foreach ( pages_list, (GFunc) g_free, NULL );
+ g_queue_clear ( pages_list );
+}
+
+
+/**
+ *
+ *
+ *
+ */
+void gsb_gui_navigation_free_pages_list ( void )
+{
+ g_queue_foreach ( pages_list, (GFunc) g_free, NULL );
+ g_queue_free ( pages_list );
+}
+
+
+/**
+ * return a pointer on the first element of g_queue of navigation pages
+ *
+ * \param none
+ * \return a GList
+ * */
+GQueue *gsb_gui_navigation_get_pages_list ( void )
+{
+ return pages_list;
+}
+
+
+/**
+ *
+ *
+ *
+ */
+void gsb_gui_navigation_set_navigation_pages ( GtkTreeModel *model, gint type_page )
+{
+ GdkPixbuf *pixbuf;
+ GtkTreeIter iter;
+ gchar *title;
+ gchar* tmpstr;
+
+ switch ( type_page )
+ {
+ case GSB_HOME_PAGE :
+ tmpstr = g_build_filename ( gsb_dirs_get_pixmaps_dir ( ), "ac_home.png", NULL );
+ title = g_strdup ( _("Accounts") );
+ break;
+ case GSB_SCHEDULER_PAGE :
+ tmpstr = g_build_filename( gsb_dirs_get_pixmaps_dir ( ), "scheduler.png", NULL );
+ title = g_strdup ( _("Scheduler") );
+ break;
+ case GSB_PAYEES_PAGE :
+ tmpstr = g_build_filename( gsb_dirs_get_pixmaps_dir ( ), "payees.png", NULL );
+ title = g_strdup ( _("Payees") );
+ break;
+ case GSB_SIMULATOR_PAGE :
+ tmpstr = g_build_filename( gsb_dirs_get_pixmaps_dir ( ), "ac_liability.png", NULL );
+ title = g_strdup ( _("Credits simulator") );
+ break;
+ case GSB_CATEGORIES_PAGE :
+ tmpstr = g_build_filename( gsb_dirs_get_pixmaps_dir ( ), "categories.png", NULL );
+ title = g_strdup ( _("Categories") );
+ break;
+ case GSB_BUDGETARY_LINES_PAGE :
+ tmpstr = g_build_filename( gsb_dirs_get_pixmaps_dir ( ), "budgetary_lines.png", NULL );
+ title = g_strdup ( _("Budgetary lines") );
+ break;
+ case GSB_REPORTS_PAGE :
+ tmpstr = g_build_filename( gsb_dirs_get_pixmaps_dir ( ), "reports.png", NULL );
+ title = g_strdup ( _("Reports") );
+ break;
+ }
+
+ pixbuf = gdk_pixbuf_new_from_file ( tmpstr , NULL );
+ gtk_tree_store_append ( GTK_TREE_STORE ( model ), &iter, NULL );
+ gtk_tree_store_set( GTK_TREE_STORE ( navigation_model ), &iter,
+ NAVIGATION_PIX, pixbuf,
+ NAVIGATION_TEXT, title,
+ NAVIGATION_PIX_VISIBLE, TRUE,
+ NAVIGATION_FONT, 800,
+ NAVIGATION_PAGE, type_page,
+ NAVIGATION_ACCOUNT, -1,
+ NAVIGATION_REPORT, -1,
+ NAVIGATION_SENSITIVE, 1,
+ -1);
+
+ g_free ( tmpstr );
+ g_free ( title );
+
+ switch ( type_page )
+ {
+ case GSB_HOME_PAGE : /* Account list */
+ gsb_gui_navigation_create_account_list ( GTK_TREE_MODEL( model ) );
+ break;
+ case GSB_REPORTS_PAGE :
+ create_report_list ( GTK_TREE_MODEL( model), &iter );
+ break;
+ }
+
+}
+
+
/* Local Variables: */
/* c-basic-offset: 4 */
/* End: */
diff --git a/src/navigation.h b/src/navigation.h
index dabedd7..e9f5db5 100644
--- a/src/navigation.h
+++ b/src/navigation.h
@@ -5,14 +5,27 @@
/** Holds data for the navigation tree. */
enum navigation_cols {
- NAVIGATION_PIX, NAVIGATION_PIX_VISIBLE,
- NAVIGATION_TEXT, NAVIGATION_FONT,
- NAVIGATION_PAGE, NAVIGATION_ACCOUNT,
- NAVIGATION_REPORT, NAVIGATION_SENSITIVE,
+ NAVIGATION_PIX,
+ NAVIGATION_PIX_VISIBLE,
+ NAVIGATION_TEXT,
+ NAVIGATION_FONT,
+ NAVIGATION_PAGE,
+ NAVIGATION_ACCOUNT,
+ NAVIGATION_REPORT,
+ NAVIGATION_SENSITIVE,
NAVIGATION_TOTAL,
};
+/** \struct describe a page
+ * */
+typedef struct
+{
+ gint ordre;
+ gint type_page; /* GSB_GENERAL_NOTEBOOK_PAGES */
+} struct_page;
+
+
/* START_INCLUDE_H */
/* END_INCLUDE_H */
@@ -23,20 +36,24 @@ void gsb_gui_navigation_add_account ( gint account_number,
void gsb_gui_navigation_add_report ( gint report_number );
void gsb_gui_navigation_create_account_list ( GtkTreeModel *model );
GtkWidget *gsb_gui_navigation_create_navigation_pane ( void );
+void gsb_gui_navigation_free_pages_list ( void );
gint gsb_gui_navigation_get_current_account ( void );
gint gsb_gui_navigation_get_current_page ( void );
gint gsb_gui_navigation_get_current_report ( void );
gint gsb_gui_navigation_get_last_account ( void );
-GtkTreeModel *gsb_gui_get_navigation_model ( void );
-GtkWidget *gsb_gui_get_navigation_tree_view ( void );
+GtkTreeModel *gsb_gui_navigation_get_model ( void );
GQueue *gsb_gui_navigation_get_pages_list ( void );
+GtkWidget *gsb_gui_navigation_get_tree_view ( void );
+void gsb_gui_navigation_init_pages_list ( const gchar *order_list );
void gsb_gui_navigation_init_tree_view ( void );
-void gsb_gui_navigation_init_pages_list ( void );
void gsb_gui_navigation_remove_account ( gint account_number );
void gsb_gui_navigation_remove_report ( gint report_number );
gboolean gsb_gui_navigation_select_next ();
gboolean gsb_gui_navigation_select_prev ();
-gboolean gsb_gui_navigation_set_selection ( gint page, gint account_number, gpointer report );
+gboolean gsb_gui_navigation_set_page_list_order ( const gchar *order_list );
+gboolean gsb_gui_navigation_set_selection ( gint page,
+ gint account_number,
+ gpointer report );
void gsb_gui_navigation_update_account ( gint account_number );
void gsb_gui_navigation_update_home_page ( void );
void gsb_gui_navigation_update_report ( gint report_number ) ;
diff --git a/src/traitement_variables.c b/src/traitement_variables.c
index 05eaae1..ed80fcc 100644
--- a/src/traitement_variables.c
+++ b/src/traitement_variables.c
@@ -108,6 +108,7 @@ static gchar *labels_titres_colonnes_liste_ope[] = {
N_("Number"),
NULL };
+
/* background color */
#define BG_COLOR_1_RED 55000
#define BG_COLOR_1_GREEN 55000
@@ -291,6 +292,7 @@ void init_variables ( void )
gint transaction_col_width_init[CUSTOM_MODEL_VISIBLE_COLUMNS] = {10, 12, 36, 6, 12, 12, 12 };
gint bet_array_col_width_init[BET_ARRAY_COLUMNS] = {15, 40, 15, 15, 15 };
gint transaction_col_align_init[CUSTOM_MODEL_VISIBLE_COLUMNS] = { 1, 1, 0, 1, 2, 2, 2 };
+ gchar *default_navigation_order_list = "0-2-3-4-5-6-7";
gint i;
/* xxx on devrait séparer ça en 2 : les variables liées au fichier de compte, qui doivent être remises à 0,
@@ -306,6 +308,9 @@ void init_variables ( void )
/* init the decimal point and the thousands separator. */
initialise_number_separators ( );
+ /* initialise l'ordre des pages du panneau de gauche */
+ gsb_gui_navigation_init_pages_list ( default_navigation_order_list );
+
/* if ever there is still something from the previous list,
* erase now */
transaction_model_initialize();
@@ -495,6 +500,7 @@ void init_variables ( void )
void free_variables ( void )
{
gsb_data_print_config_free ();
+ gsb_gui_navigation_free_pages_list ( );
}
/**
hooks/post-receive
--
grisbi
More information about the cvs
mailing list