[grisbi-cvs] grisbi/src accueil.c, 1.205, 1.206 gsb_data_partial_balance.c, 1.2, 1.3 gsb_data_partial_balance.h, 1.2, 1.3 gsb_file_load.c, 1.186, 1.187 gsb_file_save.c, 1.136, 1.137 navigation.c, 1.126, 1.127 navigation.h, 1.21, 1.22 parametres.c, 1.200, 1.201
Pierre Biava
pbiava at users.sourceforge.net
Sun Aug 16 23:00:07 CEST 2009
- Previous message: [grisbi-cvs] grisbi/po cs.po, 1.45, 1.46 da.po, 1.52, 1.53 de.po, 1.107, 1.108 el.po, 1.16, 1.17 eo.po, 1.9, 1.10 es.po, 1.97, 1.98 fa.po, 1.39, 1.40 fr.po, 1.171, 1.172 grisbi.pot, 1.87, 1.88 he.po, 1.45, 1.46 it.po, 1.45, 1.46 nl.po, 1.44, 1.45 pl.po, 1.50, 1.51 pt_BR.po, 1.47, 1.48 ro.po, 1.45, 1.46 ru.po, 1.44, 1.45 zh_CN.po, 1.39, 1.40
- Next message: [grisbi-cvs] grisbi/po cs.po, 1.46, 1.47 da.po, 1.53, 1.54 de.po, 1.108, 1.109 el.po, 1.17, 1.18 eo.po, 1.10, 1.11 es.po, 1.98, 1.99 fa.po, 1.40, 1.41 fr.po, 1.172, 1.173 grisbi.pot, 1.88, 1.89 he.po, 1.46, 1.47 it.po, 1.46, 1.47 nl.po, 1.45, 1.46 pl.po, 1.51, 1.52 pt_BR.po, 1.48, 1.49 ro.po, 1.46, 1.47 ru.po, 1.45, 1.46 zh_CN.po, 1.40, 1.41
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/grisbi/grisbi/src
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv6149/src
Modified Files:
accueil.c gsb_data_partial_balance.c
gsb_data_partial_balance.h gsb_file_load.c gsb_file_save.c
navigation.c navigation.h parametres.c
Log Message:
finalization of the management of partials balances
Index: navigation.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/navigation.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- navigation.h 8 May 2009 09:35:11 -0000 1.21
+++ navigation.h 16 Aug 2009 21:00:05 -0000 1.22
@@ -32,6 +32,7 @@
gboolean gsb_gui_navigation_select_prev ();
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 ) ;
void gsb_navigation_update_account_label ( gint account_number );
void gsb_navigation_update_statement_label ( gint account_number );
Index: parametres.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/parametres.c,v
retrieving revision 1.200
retrieving revision 1.201
diff -u -d -r1.200 -r1.201
--- parametres.c 9 Aug 2009 18:31:42 -0000 1.200
+++ parametres.c 16 Aug 2009 21:00:05 -0000 1.201
@@ -47,9 +47,9 @@
#include "./gsb_payment_method_config.h"
#include "./gsb_reconcile_config.h"
#include "./gsb_reconcile_sort_config.h"
-#include "./accueil.h"
#include "./traitement_variables.h"
#include "./utils_files.h"
+#include "./accueil.h"
#include "./affichage_liste.h"
#include "./affichage.h"
#include "./tiers_onglet.h"
@@ -96,7 +96,6 @@
extern gboolean balances_with_scheduled;
extern gboolean execute_scheduled_of_month;
extern struct conditional_message messages[];
-extern gint mise_a_jour_liste_comptes_accueil;
extern gint nb_days_before_scheduled;
extern gint nb_max_derniers_fichiers_ouverts;
extern GtkWidget *window;
@@ -978,10 +977,8 @@
account_number = gsb_data_account_get_no_account ( list_tmp -> data );
gsb_data_account_set_balances_are_dirty ( account_number );
- if ( gsb_gui_navigation_get_current_page ( ) == GSB_HOME_PAGE )
- mise_a_jour_accueil ( TRUE );
- else
- mise_a_jour_liste_comptes_accueil = ( TRUE );
+ /* MAJ HOME_PAGE */
+ gsb_gui_navigation_update_home_page ( );
list_tmp = list_tmp -> next;
}
Index: gsb_file_save.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_file_save.c,v
retrieving revision 1.136
retrieving revision 1.137
diff -u -d -r1.136 -r1.137
--- gsb_file_save.c 9 Aug 2009 18:31:42 -0000 1.136
+++ gsb_file_save.c 16 Aug 2009 21:00:05 -0000 1.137
@@ -1905,12 +1905,13 @@
partial_balance_number = gsb_data_partial_balance_get_number ( list_tmp -> data );
- new_string = g_markup_printf_escaped ( "\t<Partial_balance Nb=\"%d\" Na=\"%s\" Acc=\"%s\" Kind=\"%d\" Currency=\"%d\" />\n",
+ new_string = g_markup_printf_escaped ( "\t<Partial_balance Nb=\"%d\" Na=\"%s\" Acc=\"%s\" Kind=\"%d\" Currency=\"%d\" Colorise=\"%d\" />\n",
partial_balance_number,
my_safe_null_str(gsb_data_partial_balance_get_name ( partial_balance_number )),
my_safe_null_str(gsb_data_partial_balance_get_liste_cptes ( partial_balance_number )),
gsb_data_partial_balance_get_kind (partial_balance_number),
- gsb_data_partial_balance_get_currency (partial_balance_number) );
+ gsb_data_partial_balance_get_currency (partial_balance_number),
+ gsb_data_partial_balance_get_colorise (partial_balance_number) );
/* append the new string to the file content
* and take the new iterator */
Index: navigation.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/navigation.c,v
retrieving revision 1.126
retrieving revision 1.127
diff -u -d -r1.126 -r1.127
--- navigation.c 9 Aug 2009 18:31:42 -0000 1.126
+++ navigation.c 16 Aug 2009 21:00:05 -0000 1.127
@@ -1689,6 +1689,19 @@
}
+/**
+ * Met à jour la page d'accueil immédiatement si elle est affichée sinon plus tard
+ *
+ */
+void gsb_gui_navigation_update_home_page ( void )
+{
+ if ( gsb_gui_navigation_get_current_page ( ) == GSB_HOME_PAGE )
+ mise_a_jour_accueil ( TRUE );
+ else
+ mise_a_jour_liste_comptes_accueil = ( TRUE );
+}
+
+
/* Local Variables: */
/* c-basic-offset: 4 */
/* End: */
Index: gsb_data_partial_balance.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_data_partial_balance.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- gsb_data_partial_balance.h 9 Aug 2009 18:31:42 -0000 1.2
+++ gsb_data_partial_balance.h 16 Aug 2009 21:00:05 -0000 1.3
@@ -7,6 +7,13 @@
/* END_INCLUDE_H */
/* START_DECLARATION */
+gboolean gsb_data_partial_balance_drag_data_get ( GtkTreeDragSource * drag_source,
+ GtkTreePath * path,
+ GtkSelectionData * selection_data );
+gboolean gsb_data_partial_balance_drag_data_received ( GtkTreeDragDest * drag_dest,
+ GtkTreePath * dest_path,
+ GtkSelectionData * selection_data );
+gboolean gsb_data_partial_balance_get_colorise ( gint partial_balance_number );
gint gsb_data_partial_balance_get_currency ( gint partial_balance_number );
gchar *gsb_data_partial_balance_get_current_balance ( gint partial_balance_number );
kind_account gsb_data_partial_balance_get_kind ( gint partial_balance_number );
@@ -16,7 +23,8 @@
const gchar *gsb_data_partial_balance_get_name ( gint partial_balance_number );
gint gsb_data_partial_balance_get_number ( gpointer balance_ptr );
gboolean gsb_data_partial_balance_init_variables ( void );
-gint gsb_data_partial_balance_new ( const gchar *name );
+gboolean gsb_data_partial_balance_set_colorise ( gint partial_balance_number,
+ gboolean colorise );
gboolean gsb_data_partial_balance_set_currency ( gint partial_balance_number,
gint currency );
gboolean gsb_data_partial_balance_set_kind ( gint partial_balance_number,
@@ -25,11 +33,19 @@
const gchar *liste_cptes );
gboolean gsb_data_partial_balance_set_name ( gint partial_balance_number,
const gchar *name );
-gint gsb_data_partial_balance_set_new_number ( gint partial_balance_number,
- gint new_no_partial_balance );
void gsb_partial_balance_add ( GtkWidget *button, GtkWidget *main_widget );
+gboolean gsb_partial_balance_button_press ( GtkWidget *tree_view,
+ GdkEventButton *ev,
+ gpointer null );
+void gsb_partial_balance_colorise_toggled ( GtkCellRendererToggle *cell,
+ gchar *path_str,
+ GtkWidget *tree_view );
+GtkListStore *gsb_partial_balance_create_model ( void );
void gsb_partial_balance_delete ( GtkWidget *button, GtkWidget *main_widget );
-void gsb_partial_balance_fill_model ( GtkListStore *list_store, kind_account kind );
+void gsb_partial_balance_edit ( GtkWidget *button, GtkWidget *main_widget );
+void gsb_partial_balance_fill_model ( GtkListStore *list_store );
+gboolean gsb_partial_balance_key_press ( GtkWidget *tree_view, GdkEventKey *ev );
+gint gsb_partial_balance_new_at_position ( const gchar *name, gint pos );
gboolean gsb_partial_balance_select_func ( GtkTreeSelection *selection,
GtkTreeModel *model,
GtkTreePath *path,
Index: gsb_data_partial_balance.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_data_partial_balance.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- gsb_data_partial_balance.c 9 Aug 2009 18:31:42 -0000 1.2
+++ gsb_data_partial_balance.c 16 Aug 2009 21:00:05 -0000 1.3
@@ -34,11 +34,9 @@
#include "./gsb_data_currency.h"
#include "./navigation.h"
#include "./gsb_real.h"
-#include "./accueil.h"
#include "./utils_str.h"
#include "./utils.h"
#include "./structures.h"
-#include "./fenetre_principale.h"
#include "./gsb_data_account.h"
#include "./include.h"
#include "./erreur.h"
[...1408 lines suppressed...]
+ bouton = gtk_check_button_new_with_label ( _("Colorized in red if the balance is negative") );
+ gtk_table_attach ( GTK_TABLE ( table ), bouton, 0, 2, 5, 6,
+ GTK_SHRINK | GTK_FILL, 0, 0, 0 );
+ g_object_set_data ( G_OBJECT ( dialog ), "colorise_bouton", bouton );
+
+ g_object_set_data ( G_OBJECT ( dialog ), "entry_name", entry_name );
+ g_object_set_data ( G_OBJECT ( dialog ), "entry_list", entry_list );
+ g_object_set_data ( G_OBJECT ( dialog ), "account_list", account_list );
- partial_balance = list_tmp -> data;
- partial_balance -> partial_balance_number = i;
- i++;
- list_tmp = list_tmp -> next;
- }
+ return dialog;
}
-
/* Local Variables: */
/* c-basic-offset: 4 */
/* End: */
Index: accueil.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/accueil.c,v
retrieving revision 1.205
retrieving revision 1.206
diff -u -d -r1.205 -r1.206
--- accueil.c 13 Aug 2009 19:24:48 -0000 1.205
+++ accueil.c 16 Aug 2009 21:00:04 -0000 1.206
@@ -58,9 +58,11 @@
gint currency_number,
gsb_real solde_global_courant,
gsb_real solde_global_pointe );
-static void affiche_soldes_partiels ( GtkWidget *table,
+static gint affiche_soldes_partiels ( GtkWidget *table,
gint i,
- GSList *liste );
+ GSList *liste,
+ gint currency_number,
+ gint type_compte );
static void gsb_main_page_affiche_ligne_du_compte ( GtkWidget *pTable,
gint account_number,
gint i );
@@ -380,6 +382,7 @@
gchar* tmpstr;
gint i;
gint nb_comptes_bancaires=0, nb_comptes_passif=0, nb_comptes_actif=0;
+ gint new_comptes_bancaires=0, new_comptes_passif=0, new_comptes_actif=0;
if ( !force
&&
@@ -417,11 +420,9 @@
{
if ( gsb_data_account_get_kind (i) == GSB_TYPE_ASSET )
{
- nb_comptes_actif++;
+ nb_comptes_actif++;
}
- else
- {
- if ( gsb_data_account_get_kind (i) == GSB_TYPE_LIABILITIES )
+ else if ( gsb_data_account_get_kind (i) == GSB_TYPE_LIABILITIES )
{
nb_comptes_passif++;
}
@@ -429,11 +430,51 @@
{
nb_comptes_bancaires++;
}
- }
}
list_tmp = list_tmp -> next;
}
+ /* on ajoute les lignes pour le solde */
+ if ( nb_comptes_bancaires > 0 )
+ nb_comptes_bancaires = nb_comptes_bancaires + 3;
+ if ( nb_comptes_actif > 0 )
+ nb_comptes_actif = nb_comptes_actif + 3;
+ if ( nb_comptes_passif > 0 )
+ nb_comptes_passif = nb_comptes_passif + 3;
+
+ list_tmp = gsb_data_partial_balance_get_list ( );
+ if ( list_tmp )
+ {
+ while ( list_tmp )
+ {
+ kind_account i;
+
+ i = gsb_data_partial_balance_get_number ( list_tmp -> data );
+
+ if ( gsb_data_partial_balance_get_kind ( i ) == GSB_TYPE_ASSET )
+ {
+ new_comptes_actif++;
+ }
+ else if ( gsb_data_partial_balance_get_kind ( i ) == GSB_TYPE_LIABILITIES )
+ {
+ new_comptes_passif++;
+ }
+ else
+ {
+ new_comptes_bancaires++;
+ }
+ list_tmp = list_tmp -> next;
+ }
+
+ /* on ajoute les lignes pour les soldes partiels */
+ if ( new_comptes_bancaires > 0 )
+ nb_comptes_bancaires += new_comptes_bancaires + 2;
+ if ( new_comptes_actif > 0 )
+ nb_comptes_actif += new_comptes_actif + 2;
+ if ( new_comptes_passif > 0 )
+ nb_comptes_passif = new_comptes_passif + 2;
+ }
+
/* Affichage des comptes bancaires et de caisse */
for ( devise = gsb_data_currency_get_currency_list (); devise ; devise = devise->next )
{
@@ -456,7 +497,7 @@
paddingbox = new_paddingbox_with_title ( vbox, FALSE, tmpstr );
g_free ( tmpstr );
- pTable = gsb_main_page_get_table_for_accounts ( nb_comptes_bancaires + 3, 3 );
+ pTable = gsb_main_page_get_table_for_accounts ( nb_comptes_bancaires, 3 );
gtk_box_pack_start ( GTK_BOX ( paddingbox ), pTable, FALSE, FALSE, 0 );
/* Affichage des comptes et de leur solde */
@@ -494,14 +535,14 @@
}
/* affichage des soldes partiels s'ils existent */
- list_tmp = gsb_data_partial_balance_get_list ( );
- if ( list_tmp )
+ if ( new_comptes_bancaires > 0 )
{
- gint nbre_lignes = g_slist_length ( list_tmp) + 2;
- gtk_table_resize ( GTK_TABLE ( pTable ), nb_comptes_bancaires + 3 + nbre_lignes, 3 );
- affiche_soldes_partiels ( pTable, i, list_tmp );
- i += nbre_lignes;
+ list_tmp = gsb_data_partial_balance_get_list ( );
+ if ( list_tmp )
+ i += affiche_soldes_partiels ( pTable, i, list_tmp,
+ currency_number, GSB_TYPE_BANK | GSB_TYPE_CASH );
}
+
/* Création et remplissage de la (nb_comptes + 3)ième ligne du tableau :
elle contient la somme des soldes de chaque compte */
affiche_solde_des_comptes ( pTable, i, nb_comptes_bancaires, currency_number,
@@ -533,7 +574,7 @@
paddingbox = new_paddingbox_with_title ( vbox, FALSE, tmpstr );
g_free ( tmpstr );
- pTable = gsb_main_page_get_table_for_accounts ( nb_comptes_passif + 3, 4 );
+ pTable = gsb_main_page_get_table_for_accounts ( nb_comptes_passif, 3 );
gtk_box_pack_start ( GTK_BOX ( paddingbox ), pTable, FALSE, FALSE, 0 );
/* Affichage des comptes et de leur solde */
@@ -568,6 +609,16 @@
i++;
list_tmp = list_tmp -> next;
}
+
+ /* affichage des soldes partiels s'ils existent */
+ if ( new_comptes_passif > 0 )
+ {
+ list_tmp = gsb_data_partial_balance_get_list ( );
+ if ( list_tmp )
+ i += affiche_soldes_partiels ( pTable, i, list_tmp,
+ currency_number, GSB_TYPE_LIABILITIES );
+ }
+
/* Création et remplissage de la (nb_comptes + 3)ième ligne du tableau :
elle contient la somme des soldes de chaque compte */
affiche_solde_des_comptes ( pTable, i, nb_comptes_passif, currency_number,
@@ -599,7 +650,7 @@
paddingbox = new_paddingbox_with_title ( vbox, FALSE, tmpstr );
g_free ( tmpstr );
- pTable = gsb_main_page_get_table_for_accounts ( nb_comptes_actif + 3, 4 );
+ pTable = gsb_main_page_get_table_for_accounts ( nb_comptes_actif, 3 );
gtk_box_pack_start ( GTK_BOX ( paddingbox ), pTable, FALSE, FALSE, 0 );
/* Affichage des comptes et de leur solde */
@@ -635,14 +686,23 @@
}
i++;
list_tmp = list_tmp -> next;
- }
+ }
- /* Création et remplissage de la (nb_comptes + 3)ième ligne du tableau :
- elle contient la somme des soldes de chaque compte */
- affiche_solde_des_comptes ( pTable, i, nb_comptes_actif, currency_number,
- solde_global_courant, solde_global_pointe );
- gtk_widget_show_all ( paddingbox );
- gtk_widget_show_all ( pTable );
+ /* affichage des soldes partiels s'ils existent */
+ if ( new_comptes_actif > 0 )
+ {
+ list_tmp = gsb_data_partial_balance_get_list ( );
+ if ( list_tmp )
+ i += affiche_soldes_partiels ( pTable, i, list_tmp,
+ currency_number, GSB_TYPE_ASSET );
+ }
+
+ /* Création et remplissage de la (nb_comptes + 3)ième ligne du tableau :
+ elle contient la somme des soldes de chaque compte */
+ affiche_solde_des_comptes ( pTable, i, nb_comptes_actif, currency_number,
+ solde_global_courant, solde_global_pointe );
+ gtk_widget_show_all ( paddingbox );
+ gtk_widget_show_all ( pTable );
}
gtk_widget_show_all (vbox);
@@ -892,12 +952,15 @@
* Création de ou des lignes de solde partiels
*
* */
-void affiche_soldes_partiels ( GtkWidget *table,
+gint affiche_soldes_partiels ( GtkWidget *table,
gint i,
- GSList *liste )
+ GSList *liste,
+ gint currency_number,
+ gint type_compte )
{
GtkWidget *label;
gchar *tmpstr;
+ gint nbre_lignes = 0;
/* on commence par une ligne vide */
label = gtk_label_new ( chaine_espace );
@@ -906,6 +969,7 @@
gtk_table_attach_defaults ( GTK_TABLE ( table ), label, 0, 1, i, i+1 );
gtk_widget_show ( label );
i ++;
+ nbre_lignes ++;
/* On met les titres du sous ensemble solde(s) partiel(s) */
if ( g_slist_length ( liste ) == 1 )
@@ -925,42 +989,56 @@
gtk_table_attach_defaults ( GTK_TABLE ( table ), label, 2, 4, i, i+1 );
gtk_widget_show ( label );
i ++;
+ nbre_lignes ++;
while ( liste )
{
gint partial_number;
+ kind_account kind;
partial_number = gsb_data_partial_balance_get_number ( liste -> data );
+ kind = gsb_data_partial_balance_get_kind ( partial_number );
- /* Première colonne : elle contient le nom du solde partiel */
- tmpstr = g_strconcat ( gsb_data_partial_balance_get_name ( partial_number ),
- " : ", NULL );
- label = gtk_label_new ( tmpstr );
- g_free ( tmpstr );
- gtk_misc_set_alignment ( GTK_MISC ( label ), MISC_LEFT, MISC_VERT_CENTER );
- gtk_size_group_add_widget ( GTK_SIZE_GROUP ( size_group_accueil ), label );
- gtk_table_attach_defaults ( GTK_TABLE ( table ), label, 0, 1, i, i+1 );
- gtk_widget_show ( label );
+ if ( ( kind == type_compte
+ || ( kind < GSB_TYPE_LIABILITIES && type_compte < GSB_TYPE_LIABILITIES ) )
+ &&
+ gsb_data_partial_balance_get_currency ( partial_number ) == currency_number )
+ {
- /* Deuxième colonne : elle contient le solde pointé du solde partiel */
- tmpstr = gsb_data_partial_balance_get_marked_balance ( partial_number );
- label = gtk_label_new ( tmpstr );
- g_free ( tmpstr );
- gtk_misc_set_alignment ( GTK_MISC ( label ), MISC_RIGHT, MISC_VERT_CENTER );
- gtk_table_attach_defaults ( GTK_TABLE ( table ), label, 1, 2, i, i+1 );
- gtk_widget_show ( label );
+ /* Première colonne : elle contient le nom du solde partiel */
+ tmpstr = g_strconcat ( gsb_data_partial_balance_get_name ( partial_number ),
+ " : ", NULL );
+ label = gtk_label_new ( tmpstr );
+ g_free ( tmpstr );
+ gtk_misc_set_alignment ( GTK_MISC ( label ), MISC_LEFT, MISC_VERT_CENTER );
+ gtk_size_group_add_widget ( GTK_SIZE_GROUP ( size_group_accueil ), label );
+ gtk_table_attach_defaults ( GTK_TABLE ( table ), label, 0, 1, i, i+1 );
+ gtk_widget_show ( label );
- /* Troisième colonne : elle contient le solde courant du solde partiel */
- tmpstr = gsb_data_partial_balance_get_current_balance ( partial_number );
- label = gtk_label_new ( tmpstr );
- g_free ( tmpstr );
- gtk_misc_set_alignment ( GTK_MISC ( label ), MISC_RIGHT, MISC_VERT_CENTER );
- gtk_table_attach_defaults ( GTK_TABLE ( table ), label, 2, 3, i, i+1 );
- gtk_widget_show ( label );
+ /* Deuxième colonne : elle contient le solde pointé du solde partiel */
+ tmpstr = gsb_data_partial_balance_get_marked_balance ( partial_number );
+ label = gtk_label_new ( tmpstr );
+ g_free ( tmpstr );
+ gtk_misc_set_alignment ( GTK_MISC ( label ), MISC_RIGHT, MISC_VERT_CENTER );
+ gtk_table_attach_defaults ( GTK_TABLE ( table ), label, 1, 2, i, i+1 );
+ gtk_widget_show ( label );
- i++;
+ /* Troisième colonne : elle contient le solde courant du solde partiel */
+ tmpstr = gsb_data_partial_balance_get_current_balance ( partial_number );
+ label = gtk_label_new ( NULL );
+ gtk_label_set_markup ( GTK_LABEL ( label ), tmpstr );
+ g_free ( tmpstr );
+ gtk_misc_set_alignment ( GTK_MISC ( label ), MISC_RIGHT, MISC_VERT_CENTER );
+ gtk_table_attach_defaults ( GTK_TABLE ( table ), label, 2, 3, i, i+1 );
+ gtk_widget_show ( label );
+
+ i++;
+ nbre_lignes ++;
+ }
liste = liste -> next;
}
+
+ return nbre_lignes;
}
@@ -1756,12 +1834,15 @@
{
GtkWidget *vbox_pref, *vbox, *paddingbox, *button;
GtkWidget *hbox, *vbox2, *sw, *treeview ;
- //~ GtkWidget *table, *label, *entry;
GtkListStore *list_store;
GtkTreeViewColumn *column;
GtkCellRenderer *cell;
GtkTreeSelection *selection;
- //~ gchar *texte;
+ GtkTreeDragDestIface * dst_iface;
+ GtkTreeDragSourceIface * src_iface;
+ static GtkTargetEntry row_targets[] = {
+ { "GTK_TREE_MODEL_ROW", GTK_TARGET_SAME_WIDGET, 0 }
+ };
vbox_pref = new_vbox_with_title_and_icon ( _("Configuration of the main page"),
@@ -1773,7 +1854,7 @@
/* Data import settings */
paddingbox = new_paddingbox_with_title (vbox, FALSE,
- _("Balances partial of the list of bank accounts") );
+ _("Balances partials of the list of accounts") );
hbox = gtk_hbox_new ( FALSE, 5 );
gtk_box_pack_start ( GTK_BOX ( paddingbox ), hbox, TRUE, TRUE, 0);
@@ -1786,7 +1867,7 @@
GTK_POLICY_ALWAYS);
gtk_box_pack_start ( GTK_BOX (hbox), sw, TRUE,TRUE, 0 );
- /* Create Add/Remove buttons */
+ /* Create Add/Edit/Remove buttons */
vbox2 = gtk_vbox_new ( FALSE, 5 );
gtk_box_pack_start ( GTK_BOX ( hbox ), vbox2, FALSE, FALSE, 0 );
@@ -1799,6 +1880,15 @@
gtk_box_pack_start ( GTK_BOX ( vbox2 ), button, FALSE, FALSE, 5 );
g_object_set_data ( G_OBJECT (vbox_pref), "add_button", button );
+ /* Button "Edit" */
+ button = gtk_button_new_from_stock (GTK_STOCK_EDIT);
+ g_signal_connect ( G_OBJECT ( button ),
+ "clicked",
+ G_CALLBACK ( gsb_partial_balance_edit ),
+ vbox_pref );
+ gtk_box_pack_start ( GTK_BOX ( vbox2 ), button, FALSE, FALSE, 5 );
+ g_object_set_data ( G_OBJECT (vbox_pref), "edit_button", button );
+
/* Button "Remove" */
button = gtk_button_new_from_stock (GTK_STOCK_REMOVE);
g_signal_connect ( G_OBJECT ( button ),
@@ -1810,20 +1900,40 @@
g_object_set_data ( G_OBJECT (vbox_pref), "remove_button", button );
/* create the model */
- list_store = gtk_list_store_new ( 5, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
- G_TYPE_STRING, G_TYPE_INT );
+ list_store = gsb_partial_balance_create_model ( );
/* remplit le modèle si nécessaire */
if ( g_slist_length ( partial_balance_list ) > 0 )
- gsb_partial_balance_fill_model ( list_store, 0 );
+ gsb_partial_balance_fill_model ( list_store );
/* create the treeview */
treeview = gtk_tree_view_new_with_model (
GTK_TREE_MODEL (list_store) );
- g_object_unref (list_store);
+ g_object_unref ( list_store );
gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (treeview), TRUE);
gtk_widget_set_size_request ( treeview, -1, 230 );
+
+ /* check the keys on the list */
+ g_signal_connect ( G_OBJECT ( treeview ),
+ "key_press_event",
+ G_CALLBACK ( gsb_partial_balance_key_press ),
+ NULL );
+
+ /* check the buttons on the list */
+ g_signal_connect ( G_OBJECT ( treeview ),
+ "button_press_event",
+ G_CALLBACK ( gsb_partial_balance_button_press ),
+ NULL );
+
+ /* Enable drag & drop */
+ gtk_tree_view_enable_model_drag_source ( GTK_TREE_VIEW (treeview),
+ GDK_BUTTON1_MASK, row_targets, 1,
+ GDK_ACTION_MOVE );
+ gtk_tree_view_enable_model_drag_dest ( GTK_TREE_VIEW (treeview), row_targets,
+ 1, GDK_ACTION_MOVE );
+ gtk_tree_view_set_reorderable ( GTK_TREE_VIEW (treeview), TRUE );
+
selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW (treeview) );
gtk_tree_selection_set_select_function ( selection,
(GtkTreeSelectionFunc) gsb_partial_balance_select_func,
@@ -1843,11 +1953,6 @@
/* Liste des comptes */
cell = gtk_cell_renderer_text_new ( );
- g_object_set (cell, "editable", TRUE, NULL);
- //~ g_signal_connect ( cell,
- //~ "edited",
- //~ G_CALLBACK (gsb_import_associations_cell_edited),
- //~ vbox_main );
column = gtk_tree_view_column_new_with_attributes ( _("Accounts list"),
cell, "text", 1, NULL);
gtk_tree_view_column_set_expand ( column, TRUE );
@@ -1873,6 +1978,35 @@
gtk_tree_view_column_set_sort_column_id (column, 3);
gtk_tree_view_append_column ( GTK_TREE_VIEW (treeview), column);
+ /* Colorize */
+ cell = gtk_cell_renderer_toggle_new ( );
+ g_signal_connect ( cell,
+ "toggled",
+ G_CALLBACK ( gsb_partial_balance_colorise_toggled ),
+ treeview );
+ gtk_cell_renderer_toggle_set_radio ( GTK_CELL_RENDERER_TOGGLE(cell), FALSE );
+ g_object_set (cell, "xalign", 0.5, NULL);
+
+ column = gtk_tree_view_column_new_with_attributes ( _("Colorize"),
+ cell,
+ "active", 5,
+ NULL);
+ gtk_tree_view_append_column ( GTK_TREE_VIEW(treeview), column);
+
+ dst_iface = GTK_TREE_DRAG_DEST_GET_IFACE ( list_store );
+ if ( dst_iface )
+ dst_iface -> drag_data_received = &gsb_data_partial_balance_drag_data_received;
+
+ src_iface = GTK_TREE_DRAG_SOURCE_GET_IFACE ( list_store );
+ if ( src_iface )
+ {
+ gtk_selection_add_target ( treeview,
+ GDK_SELECTION_PRIMARY,
+ GDK_SELECTION_TYPE_ATOM,
+ 1 );
+ src_iface -> drag_data_get = &gsb_data_partial_balance_drag_data_get;
+ }
+
gtk_widget_show_all ( vbox_pref );
return ( vbox_pref );
Index: gsb_file_load.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_file_load.c,v
retrieving revision 1.186
retrieving revision 1.187
diff -u -d -r1.186 -r1.187
--- gsb_file_load.c 11 Aug 2009 20:13:15 -0000 1.186
+++ gsb_file_load.c 16 Aug 2009 21:00:05 -0000 1.187
@@ -3433,8 +3433,6 @@
gint i=0;
gint partial_balance_number = 0;
- partial_balance_number = gsb_data_partial_balance_new ( NULL );
-
if ( !attribute_names[i] )
return;
@@ -3442,34 +3440,34 @@
{
/* we test at the beginning if the attribute_value is NULL, if yes, */
/* go to the next */
- if ( !strcmp (attribute_values[i],
- "(null)"))
+ if ( !strcmp ( attribute_values[i],
+ "(null)") )
{
i++;
continue;
}
if ( !strcmp ( attribute_names[i],
- "Nb" ))
+ "Nb" ) )
{
- partial_balance_number = gsb_data_partial_balance_set_new_number (
- partial_balance_number,
+ partial_balance_number = gsb_partial_balance_new_at_position (
+ NULL,
utils_str_atoi ( attribute_values[i] ) );
i++;
continue;
}
if ( !strcmp ( attribute_names[i],
- "Na" ))
+ "Na" ) )
{
gsb_data_partial_balance_set_name ( partial_balance_number,
- attribute_values[i]);
+ attribute_values[i] );
i++;
continue;
}
if ( !strcmp ( attribute_names[i],
- "Acc" ))
+ "Acc" ) )
{
gsb_data_partial_balance_set_liste_cptes ( partial_balance_number,
attribute_values[i] );
@@ -3478,7 +3476,7 @@
}
if ( !strcmp ( attribute_names[i],
- "Kind" ))
+ "Kind" ) )
{
gsb_data_partial_balance_set_kind ( partial_balance_number,
utils_str_atoi ( attribute_values[i] ) );
@@ -3486,11 +3484,20 @@
continue;
}
- if ( !strcmp ( attribute_names[i],
- "Currency" ))
+ if ( !strcmp ( attribute_names[i],
+ "Currency" ) )
{
gsb_data_partial_balance_set_currency ( partial_balance_number,
- utils_str_atoi ( attribute_values[i]));
+ utils_str_atoi ( attribute_values[i] ) );
+ i++;
+ continue;
+ }
+
+ if ( !strcmp ( attribute_names[i],
+ "Colorise" ) )
+ {
+ gsb_data_partial_balance_set_colorise ( partial_balance_number,
+ utils_str_atoi ( attribute_values[i] ) );
i++;
continue;
}
- Previous message: [grisbi-cvs] grisbi/po cs.po, 1.45, 1.46 da.po, 1.52, 1.53 de.po, 1.107, 1.108 el.po, 1.16, 1.17 eo.po, 1.9, 1.10 es.po, 1.97, 1.98 fa.po, 1.39, 1.40 fr.po, 1.171, 1.172 grisbi.pot, 1.87, 1.88 he.po, 1.45, 1.46 it.po, 1.45, 1.46 nl.po, 1.44, 1.45 pl.po, 1.50, 1.51 pt_BR.po, 1.47, 1.48 ro.po, 1.45, 1.46 ru.po, 1.44, 1.45 zh_CN.po, 1.39, 1.40
- Next message: [grisbi-cvs] grisbi/po cs.po, 1.46, 1.47 da.po, 1.53, 1.54 de.po, 1.108, 1.109 el.po, 1.17, 1.18 eo.po, 1.10, 1.11 es.po, 1.98, 1.99 fa.po, 1.40, 1.41 fr.po, 1.172, 1.173 grisbi.pot, 1.88, 1.89 he.po, 1.46, 1.47 it.po, 1.46, 1.47 nl.po, 1.45, 1.46 pl.po, 1.51, 1.52 pt_BR.po, 1.48, 1.49 ro.po, 1.46, 1.47 ru.po, 1.45, 1.46 zh_CN.po, 1.40, 1.41
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the cvs
mailing list