[grisbi-cvs] [SCM] grisbi branch, master, updated. upstream_version_0_9_1-24-g2316b40
Pierre Biava
nobody at users.sourceforge.net
Mon May 2 22:00:50 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 2316b4003c1a15153d0d16982b1690ace275d88b (commit)
via a4f0891255fd215636e68a76fae8747b03e17168 (commit)
from 6211a362d3a05cb7571c04aff7933df0dd096b9c (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 2316b4003c1a15153d0d16982b1690ace275d88b
Author: pbiava <pierre.biava at nerim.net>
Date: Mon May 2 21:54:30 2011 +0200
finishes the modification of the display of archived transactions in the view of operations
commit a4f0891255fd215636e68a76fae8747b03e17168
Author: pbiava <pierre.biava at nerim.net>
Date: Mon May 2 21:39:09 2011 +0200
add archive_24.png file
-----------------------------------------------------------------------
Changes:
diff --git a/pixmaps/Makefile.am b/pixmaps/Makefile.am
index ccd709b..4d9cf38 100644
--- a/pixmaps/Makefile.am
+++ b/pixmaps/Makefile.am
@@ -13,6 +13,7 @@ grisbi_pixmaps_DATA = \
addresses.png \
amount.png \
archive.png \
+ archive_24.png \
archives.png \
balance_estimate.png \
banks.png \
diff --git a/pixmaps/archive_24.png b/pixmaps/archive_24.png
new file mode 100644
index 0000000..7d3f65b
Binary files /dev/null and b/pixmaps/archive_24.png differ
diff --git a/src/gsb_data_archive_store.c b/src/gsb_data_archive_store.c
index c282afe..e143473 100644
--- a/src/gsb_data_archive_store.c
+++ b/src/gsb_data_archive_store.c
@@ -50,31 +50,6 @@
/*END_INCLUDE*/
-/**
- * \struct
- * Describe an archive store
- */
-typedef struct
-{
- gint archive_store_number;
-
- /* the corresponding archive (1 archive contains several archive store) */
- gint archive_number;
-
- /* account we are working on */
- gint account_number;
-
- /* balance of all the transactions of the archive for that account */
- gsb_real balance;
-
- /* number of transactions in the archive for that account */
- gint nb_transactions;
-
- /* les transactions archivées sont visibles dans la vue des opérations FALSE par défaut */
- gboolean transactions_visibles;
-} struct_store_archive;
-
-
/*START_STATIC*/
static void _gsb_data_archive_store_free ( struct_store_archive *archive );
static struct_store_archive *gsb_data_archive_store_find_struct ( gint archive_number,
@@ -567,6 +542,35 @@ gboolean gsb_data_archive_store_set_transactions_visibles ( gint archive_number,
}
+/**
+ *
+ *
+ *
+ */
+gboolean gsb_data_archive_store_account_have_transactions_visibles ( gint account_number )
+{
+ GSList *tmp_list;
+
+ tmp_list = gsb_data_archive_store_get_archives_list ( );
+
+ while (tmp_list)
+ {
+ struct_store_archive *archive_store;
+
+ archive_store = tmp_list -> data;
+
+ if ( archive_store -> account_number == account_number
+ &&
+ archive_store -> transactions_visibles == TRUE )
+ return TRUE;
+
+ tmp_list = tmp_list -> next;
+ }
+
+ return FALSE;
+}
+
+
/* Local Variables: */
/* c-basic-offset: 4 */
/* End: */
diff --git a/src/gsb_data_archive_store.h b/src/gsb_data_archive_store.h
index dfecf0a..86dd119 100644
--- a/src/gsb_data_archive_store.h
+++ b/src/gsb_data_archive_store.h
@@ -6,7 +6,35 @@
#include "gsb_real.h"
/* END_INCLUDE_H */
+
+/**
+ * \struct
+ * Describe an archive store
+ */
+typedef struct
+{
+ gint archive_store_number;
+
+ /* the corresponding archive (1 archive contains several archive store) */
+ gint archive_number;
+
+ /* account we are working on */
+ gint account_number;
+
+ /* balance of all the transactions of the archive for that account */
+ gsb_real balance;
+
+ /* number of transactions in the archive for that account */
+ gint nb_transactions;
+
+ /* les transactions archivées sont visibles dans la vue des opérations FALSE par défaut */
+ gboolean transactions_visibles;
+} struct_store_archive;
+
+
+
/* START_DECLARATION */
+gboolean gsb_data_archive_store_account_have_transactions_visibles ( gint account_number );
void gsb_data_archive_store_create_list ( void );
gint gsb_data_archive_store_get_account_number ( gint archive_store_number );
gint gsb_data_archive_store_get_archive_number ( gint archive_store_number );
diff --git a/src/gsb_transactions_list.c b/src/gsb_transactions_list.c
index 6053b38..cd18a0c 100644
--- a/src/gsb_transactions_list.c
+++ b/src/gsb_transactions_list.c
@@ -99,8 +99,12 @@ static gint gsb_transactions_list_clone_transaction ( gint transaction_number,
gint mother_transaction_number );
static GtkWidget *gsb_transactions_list_create_tree_view ( GtkTreeModel *model );
static void gsb_transactions_list_create_tree_view_columns ( void );
+static gboolean gsb_transactions_list_delete_archived_transactions ( gint account_number,
+ gint archive_number );
static void gsb_transactions_list_display_contra_transaction ( gint *transaction_number );
static gboolean gsb_transactions_list_fill_model ( void );
+static gboolean gsb_transactions_list_hide_transactions_in_archive_line ( GtkWidget *button,
+ gpointer null );
static gboolean gsb_transactions_list_key_press ( GtkWidget *widget,
GdkEventKey *ev );
static gboolean gsb_transactions_list_move_transaction_to_account ( gint transaction_number,
@@ -321,6 +325,8 @@ GtkWidget *creation_fenetre_operations ( void )
GtkWidget *creation_barre_outils_transaction ( void )
{
GtkWidget *hbox, *menu, *button;
+ GtkWidget *alignement;
+ gint account_number;
/* Hbox */
hbox = gtk_hbox_new ( FALSE, 0 );
@@ -388,13 +394,32 @@ GtkWidget *creation_barre_outils_transaction ( void )
_("Quick file import by rules"));
gtk_box_pack_start ( GTK_BOX(hbox), menu_import_rules, FALSE, FALSE, 0 );
+ alignement = gtk_alignment_new ( 1, 0, 0, 0 );
+ gtk_box_pack_start ( GTK_BOX ( hbox ), alignement, TRUE, TRUE, 0 );
+
+ button = gsb_automem_imagefile_button_new ( etat.display_toolbar,
+ _("Hide Archive"),
+ "archive_24.png",
+ G_CALLBACK ( gsb_transactions_list_hide_transactions_in_archive_line ),
+ NULL );
+ gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ),
+ _("Hide archived transactions") );
+ g_object_set_data ( G_OBJECT ( transaction_toolbar ), "archived_button", button );
+ gtk_container_add ( GTK_CONTAINER ( alignement ), button );
+
gtk_widget_show_all ( hbox );
- if ( gsb_data_import_rule_account_has_rule ( gsb_gui_navigation_get_current_account ( ) ) )
+ account_number = gsb_gui_navigation_get_current_account ( );
+ if ( gsb_data_import_rule_account_has_rule ( account_number ) )
gtk_widget_show ( menu_import_rules );
else
gtk_widget_hide ( menu_import_rules );
+ if ( gsb_data_archive_store_account_have_transactions_visibles ( account_number ) )
+ gsb_transaction_list_set_visible_archived_button ( TRUE );
+ else
+ gsb_transaction_list_set_visible_archived_button ( FALSE );
+
return ( hbox );
}
@@ -2378,7 +2403,6 @@ gboolean gsb_transactions_list_delete_transaction_from_tree_view ( gint transact
}
-
/**
* Pop up a menu with several actions to apply to current transaction.
*
@@ -4011,6 +4035,8 @@ gboolean gsb_transactions_list_add_transactions_from_archive ( gint archive_numb
"Show the R transactions to make them visible.") );
}
+ gsb_transaction_list_set_visible_archived_button ( TRUE );
+
return FALSE;
}
@@ -4328,6 +4354,98 @@ gboolean change_aspect_liste ( gint demande )
}
+/**
+ * Cette fonction supprime les transactions concernées et les remplace par une ligne d'archive
+ *
+ *
+ * \return always FALSE
+ */
+gboolean gsb_transactions_list_hide_transactions_in_archive_line ( GtkWidget *button,
+ gpointer null )
+{
+ GSList *tmp_list;
+ gint account_number;
+
+ account_number = gsb_gui_navigation_get_current_account ( );
+
+ tmp_list = gsb_data_archive_store_get_archives_list ( );
+
+ while (tmp_list)
+ {
+ struct_store_archive *archive_store;
+
+ archive_store = tmp_list -> data;
+
+ if ( archive_store -> account_number == account_number
+ &&
+ archive_store -> transactions_visibles == TRUE )
+ {
+ transaction_list_append_archive ( archive_store -> archive_store_number );
+ gsb_transactions_list_delete_archived_transactions ( account_number,
+ archive_store -> archive_number );
+ gsb_data_archive_store_set_transactions_visibles ( archive_store -> archive_number,
+ account_number, FALSE );
+ }
+
+ tmp_list = tmp_list -> next;
+ }
+
+ gsb_transaction_list_set_visible_archived_button ( FALSE );
+
+ gsb_transactions_list_update_tree_view ( account_number, TRUE );
+
+ return FALSE;
+}
+
+
+/**
+ * Delete the archived transactions in the tree view
+ *
+ * \param account_number
+ * \param archive_number
+ *
+ * \return FALSE
+ * */
+gboolean gsb_transactions_list_delete_archived_transactions ( gint account_number,
+ gint archive_number )
+{
+ GSList *tmp_list;
+
+ tmp_list = gsb_data_transaction_get_transactions_list ( );
+ while (tmp_list)
+ {
+ gint transaction_number;
+
+ transaction_number = gsb_data_transaction_get_transaction_number ( tmp_list -> data );
+
+ if ( gsb_data_transaction_get_account_number ( transaction_number ) == account_number
+ &&
+ gsb_data_transaction_get_archive_number ( transaction_number ) == archive_number )
+ transaction_list_remove_transaction ( transaction_number );
+
+ tmp_list = tmp_list -> next;
+ }
+
+ return FALSE;
+}
+
+
+/**
+ * Rend visible ou cache le bouton utilisé pour cacher les transactions archivées
+ *
+ *
+ *
+ */
+void gsb_transaction_list_set_visible_archived_button ( gboolean visible )
+{
+ GtkWidget *button;
+
+ button = g_object_get_data ( G_OBJECT ( transaction_toolbar ), "archived_button");
+
+ gtk_widget_set_visible ( button, visible );
+}
+
+
/* Local Variables: */
/* c-basic-offset: 4 */
/* End: */
diff --git a/src/gsb_transactions_list.h b/src/gsb_transactions_list.h
index bc60a19..6dc6a84 100644
--- a/src/gsb_transactions_list.h
+++ b/src/gsb_transactions_list.h
@@ -71,6 +71,7 @@ gboolean gsb_transactions_list_restore_archive ( gint archive_number,
void gsb_transactions_list_selection_changed ( gint new_selected_transaction );
gboolean gsb_transactions_list_set_largeur_col ( void );
gboolean gsb_transactions_list_set_row_align ( gfloat row_align );
+void gsb_transaction_list_set_visible_archived_button ( gboolean visible );
void gsb_transactions_list_set_visible_rows_number ( gint rows_number );
void gsb_transactions_list_show_archives_lines ( gboolean show_l );
void gsb_transactions_list_splitted_to_scheduled ( gint transaction_number,
diff --git a/src/navigation.c b/src/navigation.c
index 7170932..c614f4d 100644
--- a/src/navigation.c
+++ b/src/navigation.c
@@ -42,6 +42,7 @@
#include "gsb_assistant_account.h"
#include "gsb_calendar.h"
#include "gsb_data_account.h"
+#include "gsb_data_archive_store.h"
#include "gsb_data_import_rule.h"
#include "gsb_data_reconcile.h"
#include "gsb_data_report.h"
@@ -1111,9 +1112,9 @@ gboolean gsb_gui_navigation_select_line ( GtkTreeSelection *selection,
case GSB_HOME_PAGE:
notice_debug ("Home page selected");
- title = g_strdup(_("My accounts"));
+ title = g_strdup(_("My accounts"));
- gsb_gui_sensitive_menu_item ( "/menubar/ViewMenu/ShowClosed", TRUE );
+ gsb_gui_sensitive_menu_item ( "/menubar/ViewMenu/ShowClosed", TRUE );
/* what to be done if switch to that page */
mise_a_jour_accueil ( FALSE );
@@ -1128,15 +1129,19 @@ gboolean gsb_gui_navigation_select_line ( GtkTreeSelection *selection,
account_number = gsb_gui_navigation_get_current_account ();
- /* update title now -- different from others */
- gsb_navigation_update_account_label (account_number);
+ /* update title now -- different from others */
+ gsb_navigation_update_account_label (account_number);
/* what to be done if switch to that page */
if (account_number >= 0 )
{
- navigation_change_account ( GINT_TO_POINTER (account_number) );
- gsb_account_property_fill_page ();
- clear_suffix = FALSE;
+ navigation_change_account ( GINT_TO_POINTER (account_number) );
+ gsb_account_property_fill_page ();
+ clear_suffix = FALSE;
+ if ( gsb_data_archive_store_account_have_transactions_visibles ( account_number ) )
+ gsb_transaction_list_set_visible_archived_button ( TRUE );
+ else
+ gsb_transaction_list_set_visible_archived_button ( FALSE );
}
gsb_menu_update_accounts_in_menus ();
gsb_menu_update_view_menu ( account_number );
diff --git a/src/utils.c b/src/utils.c
index b28a0ab..813b777 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -451,8 +451,6 @@ gboolean assert_account_loaded ()
*/
void update_gui ( void )
{
- devel_debug (NULL);
-
while ( gtk_events_pending ( ) )
gtk_main_iteration ( );
}
hooks/post-receive
--
grisbi
More information about the cvs
mailing list