[grisbi-cvs] grisbi/src accueil.c, 1.213, 1.214 categories_onglet.c, 1.198, 1.199 dialog.c, 1.72, 1.73 dialog.h, 1.31, 1.32 export.c, 1.26, 1.27 fenetre_principale.c, 1.121, 1.122 gsb_account_property.c, 1.47, 1.48 gsb_assistant.c, 1.47, 1.48 gsb_assistant_archive.c, 1.39, 1.40 gsb_assistant_archive_export.c, 1.18, 1.19 gsb_assistant_first.c, 1.27, 1.28 gsb_assistant_reconcile_config.c, 1.27, 1.28 gsb_data_currency_link.c, 1.15, 1.16 gsb_data_fyear.c, 1.17, 1.18 gsb_data_fyear.h, 1.6, 1.7 gsb_form.c, 1.131, 1.132 gsb_fyear.c, 1.9, 1.10 gsb_fyear.h, 1.6, 1.7 gsb_reconcile.c, 1.41, 1.42 gsb_transactions_list_sort.h, 1.3, 1.4 import.c, 1.293, 1.294 import_csv.c, 1.55, 1.56 imputation_budgetaire.c, 1.160, 1.161 parametres.c, 1.206, 1.207 tiers_onglet.c, 1.166, 1.167 utils.c, 1.54, 1.55
Pierre Biava
pbiava at users.sourceforge.net
Sun Oct 4 00:14:58 CEST 2009
Update of /cvsroot/grisbi/grisbi/src
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv18071/src
Modified Files:
accueil.c categories_onglet.c dialog.c dialog.h export.c
fenetre_principale.c gsb_account_property.c gsb_assistant.c
gsb_assistant_archive.c gsb_assistant_archive_export.c
gsb_assistant_first.c gsb_assistant_reconcile_config.c
gsb_data_currency_link.c gsb_data_fyear.c gsb_data_fyear.h
gsb_form.c gsb_fyear.c gsb_fyear.h gsb_reconcile.c
gsb_transactions_list_sort.h import.c import_csv.c
imputation_budgetaire.c parametres.c tiers_onglet.c utils.c
Log Message:
escape the string for gtk_label_set_markup with g_markup_escape_text() or g_markup_printf_escaped() and minor corrections
Index: gsb_assistant_archive_export.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_assistant_archive_export.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- gsb_assistant_archive_export.c 29 Aug 2009 08:36:41 -0000 1.18
+++ gsb_assistant_archive_export.c 3 Oct 2009 22:14:56 -0000 1.19
@@ -374,8 +374,9 @@
case ARCHIVE_EXPORT_ASSISTANT_NAME:
/* if we come here, an archive must have been selected,
* so needn't to check */
- tmpstr = g_strdup_printf ( _("<span size=\"x-large\">Exporting the archive : %s</span>"),
- gsb_data_archive_get_name (archive_number));
+ tmpstr = g_markup_printf_escaped (
+ _("<span size=\"x-large\">Exporting the archive : %s</span>"),
+ gsb_data_archive_get_name (archive_number));
gtk_label_set_markup ( GTK_LABEL ( archive_export_label ), tmpstr);
g_free ( tmpstr );
/* on remplace les slash des dates par des points
Index: gsb_data_fyear.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_data_fyear.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- gsb_data_fyear.h 30 Sep 2008 22:28:49 -0000 1.6
+++ gsb_data_fyear.h 3 Oct 2009 22:14:56 -0000 1.7
@@ -1,6 +1,23 @@
#ifndef _GSB_DATA_FYEAR_H
#define _GSB_DATA_FYEAR_H (1)
+/**
+ * \struct
+ * Describe a fyear
+ */
+typedef struct
+{
+ guint fyear_number;
+ gchar *fyear_name;
+ GDate *beginning_date;
+ GDate *end_date;
+ gboolean showed_in_form;
+
+ /* 0 if the fyear is valid, >0 if invalid (the number
+ * contains why it's invalid) */
+ gint invalid_fyear;
+} struct_fyear;
+
/* START_INCLUDE_H */
/* END_INCLUDE_H */
@@ -8,8 +25,9 @@
/* START_DECLARATION */
void gsb_data_fyear_check_all_for_invalid ( void );
gboolean gsb_data_fyear_check_for_invalid ( gint fyear_number );
-gint gsb_data_fyear_compare ( gint fyear_number_1,
- gint fyear_number_2 );
+gint gsb_data_fyear_compare ( gint fyear_number_1, gint fyear_number_2 );
+gint gsb_data_fyear_compare_from_struct ( struct_fyear *fyear_1,
+ struct_fyear *fyear_2 );
GDate *gsb_data_fyear_get_beginning_date ( gint fyear_number );
GDate *gsb_data_fyear_get_end_date ( gint fyear_number );
gboolean gsb_data_fyear_get_form_show ( gint fyear_number );
@@ -31,6 +49,6 @@
gboolean gsb_data_fyear_set_name ( gint fyear_number,
const gchar *name );
gint gsb_data_fyear_set_new_number ( gint fyear_number,
- gint new_no_fyear );
+ gint new_no_fyear );
/* END_DECLARATION */
#endif
Index: dialog.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/dialog.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -d -r1.72 -r1.73
--- dialog.c 30 Aug 2009 20:36:10 -0000 1.72
+++ dialog.c 3 Oct 2009 22:14:56 -0000 1.73
@@ -1,8 +1,8 @@
/* ************************************************************************** */
/* */
-/* Copyright (C) 2000-2008 Cédric Auger (cedric at grisbi.org) */
-/* 2003-2008 Benjamin Drieu (bdrieu at april.org) */
-/* http://www.grisbi.org */
+/* Copyright (C) 2000-2008 Cédric Auger (cedric at grisbi.org) */
+/* 2003-2008 Benjamin Drieu (bdrieu at april.org) */
+/* 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 */
@@ -30,12 +30,12 @@
/*END_INCLUDE*/
/*START_STATIC*/
-static void dialogue_conditional ( gchar *text, gchar * var );
-static void dialogue_conditional_hint ( gchar *hint, gchar * text, gchar * var );
-static GtkDialog * dialogue_conditional_new ( gchar *text, gchar * var, GtkMessageType type,
- GtkButtonsType buttons );
-static void dialogue_conditional_special ( gchar *text, gchar * var, GtkMessageType type );
-static gboolean dialogue_update_var ( GtkWidget * checkbox, gint message );
+static void dialogue_conditional ( gchar *text, gchar *var );
+static void dialogue_conditional_hint ( gchar *hint, gchar *text, gchar *var );
+static GtkDialog *dialogue_conditional_new ( gchar *text, gchar * var, GtkMessageType type,
+ GtkButtonsType buttons );
+static void dialogue_conditional_special ( gchar *text, gchar *var, GtkMessageType type );
+static gboolean dialogue_update_var ( GtkWidget *checkbox, gint message );
/*END_STATIC*/
@@ -149,7 +149,7 @@
* \param text Text to display in window
* \param hint Text to display in window as hint (bold, larger)
*/
-void dialogue_error_hint ( gchar *text, gchar * hint )
+void dialogue_error_hint ( gchar *text, gchar *hint )
{
dialogue_special ( GTK_MESSAGE_ERROR, make_hint(hint, text) );
}
@@ -174,7 +174,7 @@
* \param text Text to display in window
* \param hint Text to display in window as hint (bold, larger)
*/
-void dialogue_warning_hint ( gchar *text, gchar * hint )
+void dialogue_warning_hint ( gchar *text, gchar *hint )
{
dialogue_special ( GTK_MESSAGE_WARNING, make_hint (hint, text) );
}
@@ -183,11 +183,13 @@
/**
* Display a dialog window with arbitrary icon.
+ * WARNING you may need to escape text with g_markup_escape_text()
+ * or g_markup_printf_escaped():
*
* \param param Type of Window to display
* \param text Text to display in window
*/
-void dialogue_special ( GtkMessageType param, gchar * text )
+void dialogue_special ( GtkMessageType param, gchar *text )
{
GtkWidget *dialog;
@@ -206,12 +208,15 @@
/**
* Display a dialog window with arbitrary icon.
- *
+ * WARNING you may need to escape text with g_markup_escape_text()
+ * or g_markup_printf_escaped():
+ *
* \param param Type of Window to display
* \param text Text to display in window
*/
-GtkWidget * dialogue_special_no_run ( GtkMessageType param, GtkButtonsType buttons,
- gchar *text )
+GtkWidget *dialogue_special_no_run ( GtkMessageType param,
+ GtkButtonsType buttons,
+ gchar *text )
{
GtkWidget *dialog;
@@ -238,7 +243,7 @@
*
* \return FALSE.
*/
-gboolean dialogue_update_var ( GtkWidget * checkbox, gint message )
+gboolean dialogue_update_var ( GtkWidget *checkbox, gint message )
{
messages[message].hidden = gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON(checkbox) );
@@ -249,33 +254,35 @@
/**
* Create a dialog with an informal text and a checkbox that allow
* this message not to be displayed again thanks to preferences.
+ * WARNING you may need to escape text with g_markup_escape_text()
+ * or g_markup_printf_escaped():
*
- * \param text Text to be displayed
- * \param var Variable that both controls whether the dialog will
- * appear or not and that indicates which variable could
- * be modified so that this message won't appear again.
+ * \param text Text to be displayed
+ * \param var Variable that both controls whether the dialog will
+ * appear or not and that indicates which variable could
+ * be modified so that this message won't appear again.
*
- * \return A newly-created GtkDialog.
+ * \return A newly-created GtkDialog.
*/
-GtkDialog * dialogue_conditional_new ( gchar *text, gchar * var, GtkMessageType type,
- GtkButtonsType buttons )
+GtkDialog *dialogue_conditional_new ( gchar *text, gchar * var, GtkMessageType type,
+ GtkButtonsType buttons )
{
GtkWidget * vbox, * checkbox, *dialog;
int i;
if ( !var || !strlen ( var ) )
- return NULL;
+ return NULL;
for ( i = 0; messages[i].name; i++ )
{
- if ( !strcmp ( messages[i].name, var ) )
- {
- if ( messages[i].hidden )
- {
- return NULL;
- }
- break;
- }
+ if ( !strcmp ( messages[i].name, var ) )
+ {
+ if ( messages[i].hidden )
+ {
+ return NULL;
+ }
+ break;
+ }
}
dialog = gtk_message_dialog_new ( GTK_WINDOW (window),
@@ -289,7 +296,7 @@
checkbox = gtk_check_button_new_with_label ( _("Do not show this message again") );
g_signal_connect ( G_OBJECT ( checkbox ), "toggled",
- G_CALLBACK ( dialogue_update_var ), GINT_TO_POINTER ( i ) );
+ G_CALLBACK ( dialogue_update_var ), GINT_TO_POINTER ( i ) );
gtk_box_pack_start ( GTK_BOX ( vbox ), checkbox, TRUE, TRUE, 6 );
gtk_widget_show_all ( checkbox );
@@ -312,7 +319,7 @@
* appear or not and that indicates which variable could be modified
* so that this message won't appear again.
*/
-void dialogue_conditional_hint ( gchar *hint, gchar * text, gchar * var )
+void dialogue_conditional_hint ( gchar *hint, gchar *text, gchar *var )
{
dialogue_conditional ( make_hint(hint, text), var );
}
@@ -329,7 +336,7 @@
* appear or not and that indicates which variable could be modified
* so that this message won't appear again.
*/
-void dialogue_conditional ( gchar *text, gchar * var )
+void dialogue_conditional ( gchar *text, gchar *var )
{
dialogue_conditional_special ( text, var, GTK_MESSAGE_WARNING );
}
@@ -346,7 +353,7 @@
* appear or not and that indicates which variable could
* be modified so that this message won't appear again.
*/
-void dialogue_conditional_special ( gchar *text, gchar * var, GtkMessageType type )
+void dialogue_conditional_special ( gchar *text, gchar *var, GtkMessageType type )
{
GtkDialog *dialog;
@@ -385,9 +392,9 @@
*
* \return TRUE if user pressed 'OK'. FALSE otherwise.
*/
-gboolean question_yes_no_hint ( gchar * hint,
- gchar *texte,
- gint default_answer )
+gboolean question_yes_no_hint ( gchar *hint,
+ gchar *texte,
+ gint default_answer )
{
return question_yes_no ( make_hint ( hint, texte ), default_answer );
}
@@ -397,35 +404,35 @@
/**
* Pop up a warning dialog window with a question and wait for user to
* press 'OK' or 'Cancel'.
+ * WARNING you may need to escape text with g_markup_escape_text()
+ * or g_markup_printf_escaped():
*
* \param texte Text to be displayed
* \param default_answer GTK_RESPONSE_OK or GTK_RESPONSE_CANCEL, will give the focus to the button
*
* \return TRUE if user pressed 'OK'. FALSE otherwise.
*/
-gboolean question_yes_no ( gchar *texte,
- gint default_answer )
+gboolean question_yes_no ( gchar *text, gint default_answer )
{
GtkWidget *dialog;
gint response;
dialog = gtk_message_dialog_new ( GTK_WINDOW (window),
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_YES_NO,
- "%s", texte );
- gtk_label_set_markup ( GTK_LABEL ( GTK_MESSAGE_DIALOG(dialog)->label ), texte );
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_QUESTION,
+ GTK_BUTTONS_YES_NO,
+ "%s", text );
+ gtk_label_set_markup ( GTK_LABEL ( GTK_MESSAGE_DIALOG(dialog)->label ), text );
- gtk_dialog_set_default_response (GTK_DIALOG (dialog),
- default_answer );
+ gtk_dialog_set_default_response (GTK_DIALOG (dialog), default_answer );
response = gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy ( dialog );
if ( response == GTK_RESPONSE_YES )
- return TRUE;
+ return TRUE;
else
- return FALSE;
+ return FALSE;
}
@@ -441,21 +448,21 @@
*
* \return TRUE if user pressed 'OK'. FALSE otherwise.
*/
-gboolean question_conditional_yes_no ( gchar * var )
+gboolean question_conditional_yes_no ( gchar *var )
{
gint response, i;
GtkDialog *dialog;
for ( i = 0; messages[i].name; i++ )
{
- if ( !strcmp ( messages[i].name, var ) )
- {
- if ( messages[i].hidden )
- {
- return messages[i].default_answer;
- }
- break;
- }
+ if ( !strcmp ( messages[i].name, var ) )
+ {
+ if ( messages[i].hidden )
+ {
+ return messages[i].default_answer;
+ }
+ break;
+ }
}
dialog = dialogue_conditional_new ( make_hint ( _(messages[i].hint),
@@ -465,11 +472,11 @@
GTK_BUTTONS_YES_NO );
response = gtk_dialog_run (GTK_DIALOG (dialog));
-
+
if ( response == GTK_RESPONSE_YES )
- messages[i].default_answer = TRUE;
+ messages[i].default_answer = TRUE;
else
- messages[i].default_answer = FALSE;
+ messages[i].default_answer = FALSE;
gtk_widget_destroy (GTK_WIDGET (dialog));
return messages[i].default_answer;
@@ -525,14 +532,61 @@
*
* \return a pango formated string with the two arguments concatenated. It returns a newly allocated string which must be freed when no more used.
*/
-gchar * make_hint ( gchar * hint, gchar * text )
+gchar *make_hint ( gchar *hint, gchar *text )
{
- return g_strconcat ("<span size=\"larger\" weight=\"bold\">",
- hint, "</span>\n\n",
- text, NULL );
+ gchar *tmpstr;
+
+ tmpstr = g_markup_printf_escaped (
+ "<span size=\"larger\" weight=\"bold\">%s</span>\n\n%s", hint, text );
+
+ return tmpstr;
}
+/**
+ * use pango layout to produce a string that will contain a text.
+ *
+ * \param text Text
+ *
+ * \return a pango formated string It returns a newly allocated string which must
+ * be freed when no more used.
+ */
+gchar *make_red ( gchar *text )
+{
+ gchar *tmpstr;
+
+ tmpstr = g_markup_printf_escaped ( "<span foreground=\"red\">%s</span>", text );
+
+ return tmpstr;
+}
+
+
+gchar *make_pango_attribut ( gchar *attribut, gchar *text )
+{
+ gchar *tmpstr;
+
+ tmpstr = g_markup_printf_escaped (
+ g_strconcat ( "<span ", attribut, ">%s</span>", NULL ), text );
+
+ return tmpstr;
+}
+/**
+ * use pango layout to produce a string that will contain a text.
+ *
+ * \param text Text
+ *
+ * \return a pango formated string It returns a newly allocated string which must
+ * be freed when no more used.
+ */
+gchar *make_blue ( gchar *text )
+{
+ gchar *tmpstr;
+
+ tmpstr = g_markup_printf_escaped ( "<span foreground=\"blue\">%s</span>", text );
+
+ return tmpstr;
+}
+
/**
* Displays a dialog message stating that bad things will happen
@@ -565,7 +619,7 @@
*
*
*/
-void dialog_message ( gchar * label, ... )
+void dialog_message ( gchar *label, ... )
{
va_list ap;
int i = 0;
@@ -610,7 +664,7 @@
GtkWidget *label;
const gchar *string;
- format_text = make_hint (hint, text);
+ format_text = make_hint ( hint, text );
dialog = gtk_message_dialog_new ( GTK_WINDOW (window),
GTK_DIALOG_DESTROY_WITH_PARENT,
@@ -621,18 +675,14 @@
hbox = gtk_hbox_new (FALSE, 5);
gtk_box_pack_start ( GTK_BOX (GTK_DIALOG (dialog) -> vbox),
- hbox,
- FALSE, FALSE, 0);
+ hbox,
+ FALSE, FALSE, 0);
label = gtk_label_new (entry_description);
- gtk_box_pack_start ( GTK_BOX (hbox),
- label,
- FALSE, FALSE, 0);
+ gtk_box_pack_start ( GTK_BOX (hbox), label, FALSE, FALSE, 0);
entry = gtk_entry_new ();
- gtk_box_pack_start ( GTK_BOX (hbox),
- entry,
- FALSE, FALSE, 0);
+ gtk_box_pack_start ( GTK_BOX (hbox), entry, FALSE, FALSE, 0);
gtk_widget_show_all (dialog);
Index: dialog.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/dialog.h,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- dialog.h 23 Sep 2009 20:28:20 -0000 1.31
+++ dialog.h 3 Oct 2009 22:14:56 -0000 1.32
@@ -5,27 +5,30 @@
/* START_DECLARATION */
-void dialog_message ( gchar * label, ... );
+void dialog_message ( gchar *label, ... );
void dialogue ( gchar *texte_dialogue );
void dialogue_error ( gchar *text );
void dialogue_error_brain_damage ();
-void dialogue_error_hint ( gchar *text, gchar * hint );
+void dialogue_error_hint ( gchar *text, gchar *hint );
void dialogue_error_memory ();
void dialogue_hint ( gchar *text, gchar *hint );
const gchar *dialogue_hint_with_entry ( gchar *text, gchar *hint, gchar *entry_description );
-void dialogue_special ( GtkMessageType param, gchar * text );
-GtkWidget * dialogue_special_no_run ( GtkMessageType param, GtkButtonsType buttons,
- gchar *text );
+void dialogue_special ( GtkMessageType param, gchar *text );
+GtkWidget *dialogue_special_no_run ( GtkMessageType param,
+ GtkButtonsType buttons,
+ gchar *text );
void dialogue_warning ( gchar *text );
-void dialogue_warning_hint ( gchar *text, gchar * hint );
-gchar * make_hint ( gchar * hint, gchar * text );
+void dialogue_warning_hint ( gchar *text, gchar *hint );
+gchar *make_blue ( gchar *text );
+gchar *make_hint ( gchar *hint, gchar *text );
+gchar *make_pango_attribut ( gchar *attribut, gchar *text );
+gchar *make_red ( gchar *text );
gboolean question ( gchar *texte );
-gboolean question_conditional_yes_no ( gchar * var );
-gboolean question_yes_no ( gchar *texte,
- gint default_answer );
-gboolean question_yes_no_hint ( gchar * hint,
- gchar *texte,
- gint default_answer );
+gboolean question_conditional_yes_no ( gchar *var );
+gboolean question_yes_no ( gchar *text, gint default_answer );
+gboolean question_yes_no_hint ( gchar *hint,
+ gchar *texte,
+ gint default_answer );
/* END_DECLARATION */
struct conditional_message
Index: gsb_assistant.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_assistant.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- gsb_assistant.c 24 Aug 2009 13:11:48 -0000 1.47
+++ gsb_assistant.c 3 Oct 2009 22:14:56 -0000 1.48
@@ -100,7 +100,8 @@
gtk_container_set_border_width ( GTK_CONTAINER(hbox), 12 );
label = gtk_label_new ( NULL );
- tmpstr = g_strconcat ( "<b><span size=\"x-large\">", title, "</span></b>", NULL );
+ tmpstr = g_markup_printf_escaped (
+ "<b><span size=\"x-large\">%s</span></b>", title );
gtk_label_set_markup ( GTK_LABEL(label), tmpstr );
g_free ( tmpstr );
gtk_box_pack_start ( GTK_BOX(hbox), label, TRUE, TRUE, 0 );
Index: tiers_onglet.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/tiers_onglet.c,v
retrieving revision 1.166
retrieving revision 1.167
diff -u -d -r1.166 -r1.167
--- tiers_onglet.c 30 Aug 2009 17:59:48 -0000 1.166
+++ tiers_onglet.c 3 Oct 2009 22:14:56 -0000 1.167
@@ -467,8 +467,6 @@
/** Then, populate tree with payee. */
payee_list_tmp = gsb_data_payee_get_payees_list ();
- if ( payee_list_tmp == NULL )
- return;
payee_list_tmp = g_slist_prepend ( payee_list_tmp, gsb_data_payee_get_empty_payee ());
@@ -479,7 +477,9 @@
payee_number = gsb_data_payee_get_no_payee (payee_list_tmp -> data);
/* no display the payee without transactions (archived) */
- if ( gsb_data_payee_get_nb_transactions ( payee_number ) )
+ if ( payee_number == 0
+ ||
+ gsb_data_payee_get_nb_transactions ( payee_number ) )
{
gtk_tree_store_append (GTK_TREE_STORE (payee_tree_model), &iter_payee, NULL);
fill_division_row ( GTK_TREE_MODEL(payee_tree_model), payee_interface,
@@ -1368,7 +1368,7 @@
}
else
{
- tmpstr = g_strdup_printf (
+ tmpstr = g_markup_printf_escaped (
_("You are about to replace %d payees whose names contain %s by %s\n\n"
"Are you sure?"),
g_slist_length (sup_payees),
Index: export.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/export.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- export.c 27 Apr 2009 19:41:03 -0000 1.26
+++ export.c 3 Oct 2009 22:14:56 -0000 1.27
@@ -30,6 +30,7 @@
#include "./export_csv.h"
#include "./gsb_data_account.h"
#include "./gsb_file.h"
+#include "./dialog.h"
#include "./utils.h"
#include "./qif.h"
#include "./structures.h"
@@ -343,16 +344,20 @@
GtkWidget * create_export_account_resume_page ( struct exported_account * account )
{
GtkWidget * vbox, * hbox, * label, * combo;
+ gchar *tmpstr;
vbox = gtk_vbox_new ( FALSE, 6 );
gtk_container_set_border_width ( GTK_CONTAINER(vbox), 12 );
+ tmpstr = make_pango_attribut ( "size=\"x-large\"",
+ g_strdup_printf ( "Export of : %s",
+ gsb_data_account_get_name ( account -> account_nb ) ) );
+
label = gtk_label_new ( NULL );
gtk_misc_set_alignment ( GTK_MISC ( label ), 0, 0.5);
gtk_label_set_justify ( GTK_LABEL ( label ), GTK_JUSTIFY_LEFT );
- gtk_label_set_markup ( GTK_LABEL ( label ),
- g_strdup_printf ( _("<span size=\"x-large\">Export of : %s</span>"),
- gsb_data_account_get_name ( account -> account_nb ) ) );
+ gtk_label_set_markup ( GTK_LABEL ( label ), tmpstr );
+ g_free ( tmpstr );
gtk_box_pack_start ( GTK_BOX ( vbox ), label, FALSE, FALSE, 0 );
/* Layout */
Index: accueil.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/accueil.c,v
retrieving revision 1.213
retrieving revision 1.214
diff -u -d -r1.213 -r1.214
--- accueil.c 2 Oct 2009 21:35:04 -0000 1.213
+++ accueil.c 3 Oct 2009 22:14:56 -0000 1.214
@@ -2105,7 +2105,7 @@
return;
if ( title && strlen ( title ) > 0 )
- tmpstr = g_strconcat ("<span size=\"x-large\">", title, "</span>", NULL );
+ tmpstr = g_markup_printf_escaped ("<span size=\"x-large\">%s</span>", title );
else
tmpstr = g_strconcat ("<span size=\"x-large\">", _("My accounts"), "</span>", NULL );
Index: categories_onglet.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/categories_onglet.c,v
retrieving revision 1.198
retrieving revision 1.199
diff -u -d -r1.198 -r1.199
--- categories_onglet.c 29 Aug 2009 08:36:40 -0000 1.198
+++ categories_onglet.c 3 Oct 2009 22:14:56 -0000 1.199
@@ -230,9 +230,7 @@
/** Then, populate tree with categories. */
category_list = gsb_data_category_get_categories_list ();
- if ( category_list == NULL )
- return;
-
+
/* add first the empty category */
category_list = g_slist_prepend ( category_list, gsb_data_category_get_empty_category ());
Index: gsb_assistant_archive.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_assistant_archive.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- gsb_assistant_archive.c 30 Aug 2009 17:59:47 -0000 1.39
+++ gsb_assistant_archive.c 3 Oct 2009 22:14:56 -0000 1.40
@@ -44,6 +44,7 @@
#include "./navigation.h"
#include "./gsb_report.h"
#include "./gsb_transactions_list.h"
+#include "./dialog.h"
#include "./traitement_variables.h"
#include "./utils_str.h"
#include "./etats_calculs.h"
@@ -195,182 +196,137 @@
GtkWidget *hbox;
page = gtk_hbox_new (FALSE, 15);
- gtk_container_set_border_width ( GTK_CONTAINER (page),
- 10 );
+ gtk_container_set_border_width ( GTK_CONTAINER (page), 10 );
vbox = gtk_vbox_new (FALSE, 5);
- gtk_box_pack_start ( GTK_BOX (page),
- vbox,
- FALSE, FALSE, 0 );
+ gtk_box_pack_start ( GTK_BOX (page), vbox, FALSE, FALSE, 0 );
/* set up the menu */
label = gtk_label_new (_("Please select a way to select transactions for this archive"));
- gtk_misc_set_alignment ( GTK_MISC (label),
- 0, 0.5 );
- gtk_box_pack_start ( GTK_BOX (vbox),
- label,
- FALSE, FALSE, 0 );
+ gtk_misc_set_alignment ( GTK_MISC (label), 0, 0.5 );
+ gtk_box_pack_start ( GTK_BOX (vbox), label, FALSE, FALSE, 0 );
/* archive by date */
button = gtk_radio_button_new_with_label ( NULL, _("Archive by date"));
g_signal_connect_object ( G_OBJECT (button),
- "toggled",
- G_CALLBACK (gsb_assistant_archive_update_labels),
- G_OBJECT (assistant),
- G_CONNECT_AFTER | G_CONNECT_SWAPPED);
- gtk_box_pack_start ( GTK_BOX (vbox),
- button,
- FALSE, FALSE, 0 );
+ "toggled",
+ G_CALLBACK (gsb_assistant_archive_update_labels),
+ G_OBJECT (assistant),
+ G_CONNECT_AFTER | G_CONNECT_SWAPPED);
+ gtk_box_pack_start ( GTK_BOX (vbox), button, FALSE, FALSE, 0 );
- label = gtk_label_new (_("Grisbi will archive all transactions between initial and final dates."));
- gtk_misc_set_alignment ( GTK_MISC (label),
- 0, 0.5 );
- gtk_misc_set_padding ( GTK_MISC (label),
- 24, 0 );
- gtk_box_pack_start ( GTK_BOX (vbox),
- label,
- FALSE, FALSE, 0 );
+ label = gtk_label_new ( _("Grisbi will archive all transactions between initial and "
+ "final dates.") );
+ gtk_misc_set_alignment ( GTK_MISC (label), 0, 0.5 );
+ gtk_misc_set_padding ( GTK_MISC (label), 24, 0 );
+ gtk_box_pack_start ( GTK_BOX (vbox), label, FALSE, FALSE, 0 );
hbox = gtk_hbox_new ( FALSE, 6 );
g_signal_connect ( G_OBJECT (button),
- "toggled",
- G_CALLBACK (sens_desensitive_pointeur),
- G_OBJECT (hbox));
- gtk_box_pack_start ( GTK_BOX (vbox),
- hbox,
- FALSE, FALSE, 0 );
+ "toggled",
+ G_CALLBACK (sens_desensitive_pointeur),
+ G_OBJECT (hbox));
+ gtk_box_pack_start ( GTK_BOX (vbox), hbox, FALSE, FALSE, 0 );
label = gtk_label_new ( COLON ( _("Initial date" ) ) );
- gtk_misc_set_padding ( GTK_MISC (label),
- 24, 0 );
- gtk_box_pack_start ( GTK_BOX (hbox),
- label,
- FALSE, FALSE, 0 );
+ gtk_misc_set_padding ( GTK_MISC (label), 24, 0 );
+ gtk_box_pack_start ( GTK_BOX (hbox), label, FALSE, FALSE, 0 );
+
initial_date = gsb_calendar_entry_new (FALSE);
g_signal_connect_object ( G_OBJECT (initial_date),
- "changed",
- G_CALLBACK (gsb_assistant_archive_update_labels),
- G_OBJECT (assistant),
- G_CONNECT_AFTER | G_CONNECT_SWAPPED);
- gtk_box_pack_start ( GTK_BOX (hbox),
- initial_date,
- FALSE, FALSE, 0 );
+ "changed",
+ G_CALLBACK (gsb_assistant_archive_update_labels),
+ G_OBJECT (assistant),
+ G_CONNECT_AFTER | G_CONNECT_SWAPPED);
+ gtk_box_pack_start ( GTK_BOX (hbox), initial_date, FALSE, FALSE, 0 );
label = gtk_label_new ( COLON ( _("Final date")) );
- gtk_misc_set_padding ( GTK_MISC (label),
- 24, 0 );
- gtk_box_pack_start ( GTK_BOX (hbox),
- label,
- FALSE, FALSE, 0 );
+ gtk_misc_set_padding ( GTK_MISC (label), 24, 0 );
+ gtk_box_pack_start ( GTK_BOX (hbox), label, FALSE, FALSE, 0 );
+
final_date = gsb_calendar_entry_new (FALSE);
g_signal_connect_object ( G_OBJECT (final_date),
- "changed",
- G_CALLBACK (gsb_assistant_archive_update_labels),
- G_OBJECT (assistant),
- G_CONNECT_AFTER | G_CONNECT_SWAPPED);
- gtk_box_pack_start ( GTK_BOX (hbox),
- final_date,
- FALSE, FALSE, 0 );
+ "changed",
+ G_CALLBACK (gsb_assistant_archive_update_labels),
+ G_OBJECT (assistant),
+ G_CONNECT_AFTER | G_CONNECT_SWAPPED);
+ gtk_box_pack_start ( GTK_BOX (hbox), final_date, FALSE, FALSE, 0 );
/* archive by financial year */
- button = gtk_radio_button_new_with_label ( gtk_radio_button_get_group (GTK_RADIO_BUTTON (button)),
- _("Archive by financial year"));
+ button = gtk_radio_button_new_with_label (
+ gtk_radio_button_get_group ( GTK_RADIO_BUTTON ( button ) ),
+ _("Archive by financial year") );
g_signal_connect_object ( G_OBJECT (button),
- "toggled",
- G_CALLBACK (gsb_assistant_archive_update_labels),
- G_OBJECT (assistant),
- G_CONNECT_AFTER | G_CONNECT_SWAPPED);
- gtk_box_pack_start ( GTK_BOX (vbox),
- button,
- FALSE, FALSE, 0 );
+ "toggled",
+ G_CALLBACK (gsb_assistant_archive_update_labels),
+ G_OBJECT (assistant),
+ G_CONNECT_AFTER | G_CONNECT_SWAPPED);
+ gtk_box_pack_start ( GTK_BOX (vbox), button, FALSE, FALSE, 0 );
- label = gtk_label_new (_("Grisbi will archive all transactions belonging to a financial year." ));
- gtk_misc_set_padding ( GTK_MISC (label),
- 24, 0 );
- gtk_misc_set_alignment ( GTK_MISC (label),
- 0, 0.5 );
- gtk_box_pack_start ( GTK_BOX (vbox),
- label,
- FALSE, FALSE, 0 );
+ label = gtk_label_new ( _("Grisbi will archive all transactions belonging to a "
+ "financial year." ) );
+ gtk_misc_set_padding ( GTK_MISC (label), 24, 0 );
+ gtk_misc_set_alignment ( GTK_MISC (label), 0, 0.5 );
+ gtk_box_pack_start ( GTK_BOX (vbox), label, FALSE, FALSE, 0 );
hbox = gtk_hbox_new ( FALSE, 10 );
g_signal_connect ( G_OBJECT (button),
- "toggled",
- G_CALLBACK (sens_desensitive_pointeur),
- G_OBJECT (hbox));
- gtk_box_pack_start ( GTK_BOX (vbox),
- hbox,
- FALSE, FALSE, 0 );
+ "toggled",
+ G_CALLBACK ( sens_desensitive_pointeur ),
+ G_OBJECT (hbox));
+ gtk_box_pack_start ( GTK_BOX (vbox), hbox, FALSE, FALSE, 0 );
+
+ label = gtk_label_new ( _("Financial year :") );
+ gtk_misc_set_padding ( GTK_MISC (label), 24, 0 );
+ gtk_box_pack_start ( GTK_BOX (hbox), label, FALSE, FALSE, 0 );
- label = gtk_label_new (_("Financial year :"));
- gtk_misc_set_padding ( GTK_MISC (label),
- 24, 0 );
- gtk_box_pack_start ( GTK_BOX (hbox),
- label,
- FALSE, FALSE, 0 );
financial_year_button = gsb_fyear_make_combobox (FALSE);
g_signal_connect_object ( G_OBJECT (financial_year_button),
- "changed",
- G_CALLBACK (gsb_assistant_archive_update_labels),
- G_OBJECT (assistant),
- G_CONNECT_AFTER | G_CONNECT_SWAPPED);
- gtk_box_pack_start ( GTK_BOX (hbox),
- financial_year_button,
- FALSE, FALSE, 0 );
+ "changed",
+ G_CALLBACK (gsb_assistant_archive_update_labels),
+ G_OBJECT (assistant),
+ G_CONNECT_AFTER | G_CONNECT_SWAPPED);
+ gtk_box_pack_start ( GTK_BOX (hbox), financial_year_button, FALSE, FALSE, 0 );
gtk_widget_set_sensitive ( hbox, FALSE );
/* archive by budget */
- button = gtk_radio_button_new_with_label ( gtk_radio_button_get_group (GTK_RADIO_BUTTON (button)),
- _("Archive by report"));
+ button = gtk_radio_button_new_with_label ( gtk_radio_button_get_group (
+ GTK_RADIO_BUTTON ( button ) ),
+ _("Archive by report"));
g_signal_connect_object ( G_OBJECT (button),
- "toggled",
- G_CALLBACK (gsb_assistant_archive_update_labels),
- G_OBJECT (assistant),
- G_CONNECT_AFTER | G_CONNECT_SWAPPED);
- gtk_box_pack_start ( GTK_BOX (vbox),
- button,
- FALSE, FALSE, 0 );
+ "toggled",
+ G_CALLBACK (gsb_assistant_archive_update_labels),
+ G_OBJECT (assistant),
+ G_CONNECT_AFTER | G_CONNECT_SWAPPED);
+ gtk_box_pack_start ( GTK_BOX (vbox), button, FALSE, FALSE, 0 );
label = gtk_label_new (_("Grisbi will archive transactions selected by a report." ));
- gtk_misc_set_padding ( GTK_MISC (label),
- 24, 0 );
- gtk_misc_set_alignment ( GTK_MISC (label),
- 0, 0.5 );
- gtk_box_pack_start ( GTK_BOX (vbox),
- label,
- FALSE, FALSE, 0 );
+ gtk_misc_set_padding ( GTK_MISC (label), 24, 0 );
+ gtk_misc_set_alignment ( GTK_MISC (label), 0, 0.5 );
+ gtk_box_pack_start ( GTK_BOX (vbox), label, FALSE, FALSE, 0 );
hbox = gtk_hbox_new ( FALSE, 10 );
g_signal_connect ( G_OBJECT (button),
- "toggled",
- G_CALLBACK (sens_desensitive_pointeur),
- G_OBJECT (hbox));
- gtk_box_pack_start ( GTK_BOX (vbox),
- hbox,
- FALSE, FALSE, 0 );
+ "toggled",
+ G_CALLBACK (sens_desensitive_pointeur),
+ G_OBJECT (hbox));
+ gtk_box_pack_start ( GTK_BOX (vbox), hbox, FALSE, FALSE, 0 );
label = gtk_label_new ( COLON ( _("Report") ) );
- gtk_misc_set_padding ( GTK_MISC (label),
- 24, 0 );
- gtk_box_pack_start ( GTK_BOX (hbox),
- label,
- FALSE, FALSE, 0 );
+ gtk_misc_set_padding ( GTK_MISC (label), 24, 0 );
+ gtk_box_pack_start ( GTK_BOX (hbox), label, FALSE, FALSE, 0 );
report_button = gsb_report_make_combobox ();
g_signal_connect_object ( G_OBJECT (report_button),
- "changed",
- G_CALLBACK (gsb_assistant_archive_update_labels),
- G_OBJECT (assistant),
- G_CONNECT_AFTER | G_CONNECT_SWAPPED);
- gtk_box_pack_start ( GTK_BOX (hbox),
- report_button,
- FALSE, FALSE, 0 );
+ "changed",
+ G_CALLBACK (gsb_assistant_archive_update_labels),
+ G_OBJECT (assistant),
+ G_CONNECT_AFTER | G_CONNECT_SWAPPED);
+ gtk_box_pack_start ( GTK_BOX (hbox), report_button, FALSE, FALSE, 0 );
gtk_widget_set_sensitive ( hbox, FALSE );
label_archived = gtk_label_new (NULL);
- gtk_box_pack_start ( GTK_BOX (vbox),
- label_archived,
- FALSE, FALSE, 0 );
gtk_misc_set_alignment ( GTK_MISC (label_archived), 0, 0 );
+ gtk_box_pack_start ( GTK_BOX (vbox), label_archived, FALSE, FALSE, 0 );
gsb_assistant_sensitive_button_next ( assistant, FALSE );
@@ -622,32 +578,34 @@
if ( GTK_WIDGET_IS_SENSITIVE (initial_date) )
{
- gchar * sdate, * fdate;
- sdate = gsb_format_gdate ( gsb_calendar_entry_get_date (initial_date));
- fdate = gsb_format_gdate (gsb_calendar_entry_get_date (final_date));
- string = g_strdup_printf ( _("Archive from %s to %s"), sdate, fdate );
- g_free ( sdate );
- g_free ( fdate );
+ gchar * sdate, * fdate;
+
+ sdate = gsb_format_gdate ( gsb_calendar_entry_get_date (initial_date));
+ fdate = gsb_format_gdate (gsb_calendar_entry_get_date (final_date));
+ string = g_strdup_printf ( _("Archive from %s to %s"), sdate, fdate );
+ g_free ( sdate );
+ g_free ( fdate );
}
else if ( GTK_WIDGET_IS_SENSITIVE (financial_year_button) )
{
- gint fyear;
- fyear = gsb_fyear_get_fyear_from_combobox ( financial_year_button, NULL );
- string = g_strdup_printf ( _("Archive of financial year %s"),
- gsb_data_fyear_get_name ( fyear ) );
+ gint fyear;
+
+ fyear = gsb_fyear_get_fyear_from_combobox ( financial_year_button, NULL );
+ string = g_strdup_printf ( _("Archive of financial year %s"),
+ gsb_data_fyear_get_name ( fyear ) );
}
else if ( GTK_WIDGET_IS_SENSITIVE (report_button) )
{
- gint report_number;
- report_number = gsb_report_get_report_from_combobox (report_button);
- string = g_strdup_printf ( _("Archive of report %s"),
- gsb_data_report_get_report_name ( report_number ) );
+ gint report_number;
+ report_number = gsb_report_get_report_from_combobox (report_button);
+ string = g_strdup_printf ( _("Archive of report %s"),
+ gsb_data_report_get_report_name ( report_number ) );
}
if ( string )
{
- gtk_entry_set_text ( GTK_ENTRY ( name_entry ), string );
- g_free ( string );
+ gtk_entry_set_text ( GTK_ENTRY ( name_entry ), string );
+ g_free ( string );
}
gsb_assistant_sensitive_button_next ( assistant, TRUE );
@@ -807,7 +765,7 @@
gchar *string;
GSList *tmp_list;
GtkWidget * notebook;
- GSList *report_transactions_list;
+ GSList *report_transactions_list;
notebook = g_object_get_data ( G_OBJECT(assistant), "notebook" );
@@ -830,12 +788,12 @@
final_gdate = gsb_calendar_entry_get_date (final_date);
string = NULL;
- if (!strlen ( gtk_entry_get_text (GTK_ENTRY (initial_date))))
- string = my_strdup (_("<span foreground=\"red\">Please fill the initial date</span>"));
- if (!string
+ if ( !strlen ( gtk_entry_get_text ( GTK_ENTRY ( initial_date ) ) ) )
+ string = make_red ( _("Please fill the initial date."));
+ if ( !string
&&
- !strlen ( gtk_entry_get_text (GTK_ENTRY (final_date))))
- string = my_strdup (_("<span foreground=\"red\">Please fill the final date</span>"));
+ !strlen ( gtk_entry_get_text ( GTK_ENTRY ( final_date ) ) ) )
+ string = make_red ( _("Please fill the final date.") );
if ( !string
&&
init_gdate
@@ -843,23 +801,23 @@
final_gdate
&&
g_date_compare (init_gdate, final_gdate) > 0 )
- string = my_strdup (_("<span foreground=\"red\">The initial date is after the final date</span>"));
+ string = make_red (_("The initial date is after the final date."));
if ( !string
&&
!init_gdate)
- string = my_strdup (_("<span foreground=\"red\">The initial date is not valid.</span>"));
+ string = make_red (_("The initial date is not valid."));
if ( !string
&&
!final_gdate )
- string = my_strdup (_("<span foreground=\"red\">The final date is not valid</span>"));
+ string = make_red (_("The final date is not valid."));
if ( !string
&&
gsb_data_archive_get_from_date (init_gdate) )
- string = my_strdup (_("<span foreground=\"red\">The initial date belongs already to an archive.</span>"));
+ string = make_red (_("The initial date belongs already to an archive."));
if ( !string
&&
gsb_data_archive_get_from_date (final_gdate) )
- string = my_strdup (_("<span foreground=\"red\">The final date belongs already to an archive.</span>"));
+ string = make_red (_("The final date belongs already to an archive."));
if (string)
{
@@ -894,114 +852,111 @@
/* ok for now the choice is on fyear */
if ( gtk_notebook_get_current_page (GTK_NOTEBOOK(notebook)) == ARCHIVE_ASSISTANT_MENU &&
- GTK_WIDGET_IS_SENSITIVE (financial_year_button))
+ GTK_WIDGET_IS_SENSITIVE (financial_year_button))
{
- gint fyear_number;
- string = NULL;
+ gint fyear_number;
+ string = NULL;
- fyear_number = gsb_fyear_get_fyear_from_combobox (financial_year_button,NULL);
+ fyear_number = gsb_fyear_get_fyear_from_combobox ( financial_year_button, NULL );
- if (!fyear_number)
- string = my_strdup (_("<span foreground=\"red\">Please choose a financial year</span>"));
+ if (!fyear_number)
+ string = make_red (_("Please choose a financial year."));
- if ( !string
- &&
- gsb_data_archive_get_from_fyear (fyear_number))
- string = my_strdup (_("<span foreground=\"red\">There is already an archive for that financial year.</span>"));
+ if ( !string
+ &&
+ gsb_data_archive_get_from_fyear ( fyear_number ) )
+ string = make_red (_("There is already an archive for that financial year."));
- if (string)
- {
- gtk_label_set_markup ( GTK_LABEL (label_archived),
- string );
- g_free (string);
- gsb_assistant_sensitive_button_next ( assistant, FALSE );
- return FALSE;
- }
+ if (string)
+ {
+ gtk_label_set_markup ( GTK_LABEL (label_archived), string );
+ g_free (string);
+ gsb_assistant_sensitive_button_next ( assistant, FALSE );
+ return FALSE;
+ }
- /* the fyear is ok */
- tmp_list = gsb_data_transaction_get_transactions_list ();
- while (tmp_list)
- {
- gint transaction_number;
+ /* the fyear is ok */
+ 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);
+ transaction_number = gsb_data_transaction_get_transaction_number (tmp_list -> data);
- if (gsb_data_transaction_get_financial_year_number (transaction_number) == fyear_number)
- {
- /* the transaction belongs to the fyear, we append its address to the list to archive
- * all the linked transactions will be taken */
- gsb_assistant_archive_add_transaction_to_list (tmp_list -> data);
- }
- tmp_list = tmp_list -> next;
- }
+ if (gsb_data_transaction_get_financial_year_number (transaction_number) == fyear_number)
+ {
+ /* the transaction belongs to the fyear, we append its address to the list to archive
+ * all the linked transactions will be taken */
+ gsb_assistant_archive_add_transaction_to_list (tmp_list -> data);
+ }
+ tmp_list = tmp_list -> next;
+ }
}
/* ok for now the choice is on report */
if ( gtk_notebook_get_current_page (GTK_NOTEBOOK(notebook)) == ARCHIVE_ASSISTANT_MENU &&
- GTK_WIDGET_IS_SENSITIVE (report_button))
+ GTK_WIDGET_IS_SENSITIVE (report_button))
{
- gint report_number;
- string = NULL;
+ gint report_number;
+ string = NULL;
- report_number = gsb_report_get_report_from_combobox (report_button);
+ report_number = gsb_report_get_report_from_combobox (report_button);
- if (!report_number)
- string = my_strdup (_("<span foreground=\"red\">Please choose a report</span>"));
+ if (!report_number)
+ string = make_red (_("Please choose a report."));
- if (string)
- {
- gtk_label_set_markup ( GTK_LABEL (label_archived),
- string );
- g_free (string);
- gsb_assistant_sensitive_button_next ( assistant, FALSE );
- return FALSE;
- }
+ if (string)
+ {
+ gtk_label_set_markup ( GTK_LABEL (label_archived), string );
+ g_free (string);
+ gsb_assistant_sensitive_button_next ( assistant, FALSE );
+ return FALSE;
+ }
- /* the report is ok */
- report_transactions_list = recupere_opes_etat (report_number);
+ /* the report is ok */
+ report_transactions_list = recupere_opes_etat (report_number);
- /* the list from report doesn't contain contra-transaction and mother/children split,
- * so for each transaction of that list, we need to check the contra-transaction, the mother and children
- * and add them to the list */
- tmp_list = report_transactions_list;
- while (tmp_list)
- {
- /* just call add_transaction_to_list, all the linked transactions will be taken */
- gsb_assistant_archive_add_transaction_to_list (tmp_list -> data);
- tmp_list = tmp_list -> next;
- }
- g_slist_free (report_transactions_list);
+ /* the list from report doesn't contain contra-transaction and mother/children split,
+ * so for each transaction of that list, we need to check the contra-transaction, the mother and children
+ * and add them to the list */
+ tmp_list = report_transactions_list;
+ while (tmp_list)
+ {
+ /* just call add_transaction_to_list, all the linked transactions will be taken */
+ gsb_assistant_archive_add_transaction_to_list (tmp_list -> data);
+ tmp_list = tmp_list -> next;
+ }
+ g_slist_free (report_transactions_list);
}
/* update the labels */
if (gtk_notebook_get_current_page (GTK_NOTEBOOK(notebook)) == ARCHIVE_ASSISTANT_MENU )
{
- /* there is some transactions to archive */
- string = g_strdup_printf (_("%d transactions out of %d will be archived."),
- g_slist_length (list_transaction_to_archive),
- g_slist_length (gsb_data_transaction_get_transactions_list () ) );
- gtk_label_set_text ( GTK_LABEL (label_archived),
- string);
- g_free (string);
+ /* there is some transactions to archive */
+ string = g_strdup_printf (_("%d transactions out of %d will be archived."),
+ g_slist_length (list_transaction_to_archive),
+ g_slist_length (gsb_data_transaction_get_transactions_list () ) );
+ gtk_label_set_text ( GTK_LABEL (label_archived), string);
+ g_free (string);
- if ( gtk_notebook_get_current_page (GTK_NOTEBOOK(notebook)) !=
- ARCHIVE_ASSISTANT_ARCHIVE_NAME )
- {
- gsb_assistant_sensitive_button_next ( assistant, TRUE );
- }
+ if ( gtk_notebook_get_current_page (GTK_NOTEBOOK(notebook)) !=
+ ARCHIVE_ASSISTANT_ARCHIVE_NAME )
+ {
+ gsb_assistant_sensitive_button_next ( assistant, TRUE );
+ }
}
if ( gtk_notebook_get_current_page (GTK_NOTEBOOK(notebook)) ==
- ARCHIVE_ASSISTANT_ARCHIVE_NAME )
+ ARCHIVE_ASSISTANT_ARCHIVE_NAME )
{
- if ( strlen ( gtk_entry_get_text ( GTK_ENTRY ( name_entry ) ) ) )
- {
- gsb_assistant_sensitive_button_next ( assistant, TRUE );
- }
- else
- {
- gsb_assistant_sensitive_button_next ( assistant, FALSE );
- }
+ if ( strlen ( gtk_entry_get_text ( GTK_ENTRY ( name_entry ) ) ) )
+ {
+ gsb_assistant_sensitive_button_next ( assistant, TRUE );
+ }
+ else
+ {
+ gsb_assistant_sensitive_button_next ( assistant, FALSE );
+ }
}
return FALSE;
Index: gsb_assistant_first.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_assistant_first.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- gsb_assistant_first.c 29 Aug 2009 08:36:41 -0000 1.27
+++ gsb_assistant_first.c 3 Oct 2009 22:14:56 -0000 1.28
@@ -1,7 +1,7 @@
/* ************************************************************************** */
/* */
/* Copyright (C) 2000-2008 Cédric Auger (cedric at grisbi.org) */
-/* 2003-2009 Benjamin Drieu (bdrieu at april.org) */
+/* 2003-2009 Benjamin Drieu (bdrieu at april.org) */
/* http://www.grisbi.org */
/* */
/* This program is free software; you can redistribute it and/or modify */
@@ -36,6 +36,7 @@
#include "./parametres.h"
#include "./gsb_file.h"
#include "./traitement_variables.h"
+#include "./dialog.h"
#include "./utils_files.h"
#include "./utils.h"
#include "./structures.h"
@@ -220,13 +221,12 @@
entry = gsb_automem_entry_new ( &etat.browser_command, NULL, NULL );
gtk_table_attach ( GTK_TABLE(table), entry, 1, 2, 1, 2, GTK_EXPAND|GTK_FILL, 0, 0, 0 );
- text = g_strconcat ( "<span foreground=\"blue\">",
- _("You may use %s to expand the URL - I.e: 'firefox -remote %s' "), "</span>", NULL );
+ text = make_blue ( _("You may use %s to expand the URL - I.e: 'firefox -remote %s' ") );
label = gtk_label_new ( text );
gtk_label_set_use_markup ( GTK_LABEL(label), TRUE );
gtk_misc_set_alignment ( GTK_MISC ( label ), 0.0, 0.5 );
gtk_table_attach ( GTK_TABLE(table), label, 1, 2, 2, 3,
- GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0 );
+ GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0 );
g_free ( text );
/* Account file handling */
Index: imputation_budgetaire.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/imputation_budgetaire.c,v
retrieving revision 1.160
retrieving revision 1.161
diff -u -d -r1.160 -r1.161
--- imputation_budgetaire.c 29 Aug 2009 08:36:41 -0000 1.160
+++ imputation_budgetaire.c 3 Oct 2009 22:14:56 -0000 1.161
@@ -242,9 +242,7 @@
/** Then, populate tree with budgetary lines. */
budget_list = gsb_data_budget_get_budgets_list ();
- if ( budget_list == NULL )
- return;
-
+
/* add first the empty budget */
budget_list = g_slist_prepend ( budget_list,
gsb_data_budget_get_empty_budget ());
Index: import.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/import.c,v
retrieving revision 1.293
retrieving revision 1.294
diff -u -d -r1.293 -r1.294
--- import.c 27 Sep 2009 15:30:49 -0000 1.293
+++ import.c 3 Oct 2009 22:14:56 -0000 1.294
@@ -1089,7 +1089,7 @@
label = gtk_label_new ( NULL );
gtk_misc_set_alignment ( GTK_MISC ( label ), 0, 0.5);
gtk_label_set_justify ( GTK_LABEL ( label ), GTK_JUSTIFY_LEFT );
- tmpstr = g_strdup_printf ( _("<span size=\"x-large\">%s</span>\n\n"
+ tmpstr = g_markup_printf_escaped ( _("<span size=\"x-large\">%s</span>\n\n"
"What do you want to do with contents from <span "
"foreground=\"blue\">%s</span> ?\n"),
compte -> nom_de_compte, short_filename );
Index: import_csv.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/import_csv.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- import_csv.c 30 Aug 2009 20:36:11 -0000 1.55
+++ import_csv.c 3 Oct 2009 22:14:56 -0000 1.56
@@ -909,8 +909,9 @@
if ( label )
{
gtk_label_set_markup ( g_object_get_data ( G_OBJECT(assistant), "validity_label" ),
- g_strdup_printf ( _("<b>Following fields are missing:</b> %s"),
- label ) );
+ g_markup_printf_escaped (
+ _("<b>Following fields are missing:</b> %s"),
+ label ) );
gtk_widget_show ( g_object_get_data ( G_OBJECT(assistant), "validity_icon" ) );
gtk_widget_set_sensitive ( g_object_get_data ( G_OBJECT (assistant),
"button_next" ), FALSE );
Index: gsb_data_currency_link.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_data_currency_link.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- gsb_data_currency_link.c 27 Apr 2009 19:41:03 -0000 1.15
+++ gsb_data_currency_link.c 3 Oct 2009 22:14:56 -0000 1.16
@@ -29,6 +29,7 @@
/*START_INCLUDE*/
#include "gsb_data_currency_link.h"
+#include "./dialog.h"
#include "./include.h"
#include "./gsb_real.h"
/*END_INCLUDE*/
@@ -466,15 +467,15 @@
currency_link = gsb_data_currency_link_get_structure ( currency_link_number );
if (!currency_link)
- return 0;
+ return 0;
if (!currency_link -> invalid_link)
- return NULL;
+ return NULL;
if ( currency_link -> first_currency == currency_link -> second_currency)
- return _("<span foreground=\"red\">Warning : the two currencies of the link are identicals</span>");
+ return make_red ( _("Warning : the two currencies of the link are identicals.") );
- return _("<span foreground=\"red\">Warning : that link is already defined</span>");
+ return make_red ( _("Warning : that link is already defined.") );
}
Index: gsb_fyear.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_fyear.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- gsb_fyear.c 10 May 2009 13:06:56 -0000 1.9
+++ gsb_fyear.c 3 Oct 2009 22:14:56 -0000 1.10
@@ -1,8 +1,8 @@
/* ************************************************************************** */
/* */
-/* Copyright (C) 2000-2008 Cédric Auger (cedric at grisbi.org) */
-/* 2003-2008 Benjamin Drieu (bdrieu at april.org) */
-/* http://www.grisbi.org */
+/* Copyright (C) 2000-2008 Cédric Auger (cedric at grisbi.org) */
+/* 2003-2008 Benjamin Drieu (bdrieu at april.org) */
+/* 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 */
@@ -96,20 +96,21 @@
GtkWidget *combo_box;
if (!fyear_model_filter)
- gsb_fyear_create_combobox_store ();
+ gsb_fyear_create_combobox_store ();
- combo_box = gtk_combo_box_new_with_model (GTK_TREE_MODEL (fyear_model_filter));
+ combo_box = gtk_combo_box_new_with_model ( GTK_TREE_MODEL ( fyear_model_filter ) );
renderer = gtk_cell_renderer_text_new ();
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo_box), renderer, TRUE);
- gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo_box), renderer,
- "text", FYEAR_COL_NAME,
- NULL);
+ gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo_box),
+ renderer,
+ "text", FYEAR_COL_NAME,
+ NULL);
- gtk_combo_box_set_active ( GTK_COMBO_BOX (combo_box),
- 0 );
+ gtk_combo_box_set_active ( GTK_COMBO_BOX (combo_box), 0 );
/* show or hide the automatic line */
gsb_fyear_set_automatic ( set_automatic );
+
return (combo_box);
}
@@ -126,7 +127,7 @@
* \return TRUE fyear found, FALSE fyear not found, nothing change
* */
gboolean gsb_fyear_set_combobox_history ( GtkWidget *combo_box,
- gint fyear_number )
+ gint fyear_number )
{
GtkTreeIter iter;
gint result;
@@ -189,26 +190,25 @@
* \return the number of fyear or 0 if problem
* */
gint gsb_fyear_get_fyear_from_combobox ( GtkWidget *combo_box,
- const GDate *date )
+ const GDate *date )
{
gint fyear_number = 0;
GtkTreeIter iter;
- if (!fyear_model_filter)
- gsb_fyear_create_combobox_store ();
+ if ( !fyear_model_filter )
+ gsb_fyear_create_combobox_store ( );
- if (gtk_combo_box_get_active_iter ( GTK_COMBO_BOX (combo_box),
- &iter ))
+ if ( gtk_combo_box_get_active_iter ( GTK_COMBO_BOX (combo_box), &iter ) )
{
- gtk_tree_model_get ( GTK_TREE_MODEL (fyear_model_filter),
- &iter,
- FYEAR_COL_NUMBER, &fyear_number,
- -1 );
- if (!fyear_number
- &&
- date )
- fyear_number = gsb_data_fyear_get_from_date (date);
+
+ gtk_tree_model_get ( GTK_TREE_MODEL (fyear_model_filter),
+ &iter,
+ FYEAR_COL_NUMBER, &fyear_number,
+ -1 );
+ if ( !fyear_number && date )
+ fyear_number = gsb_data_fyear_get_from_date ( date );
}
+
return fyear_number;
}
@@ -257,41 +257,41 @@
/* if no filter, thats because not created, but don't create here
* because we can come here without needed of fyear button */
- if (!fyear_model_filter)
- return FALSE;
+ if ( !fyear_model_filter )
+ return FALSE;
- gtk_list_store_clear (GTK_LIST_STORE (fyear_model));
+ gtk_list_store_clear (GTK_LIST_STORE ( fyear_model ) );
/* put at the beginning 'Automatic' wich mean at the validation of
* the transaction, the fyear will take the value of the date */
- gtk_list_store_append ( GTK_LIST_STORE (fyear_model),
- &iter );
+ gtk_list_store_append ( GTK_LIST_STORE (fyear_model), &iter );
gtk_list_store_set ( GTK_LIST_STORE (fyear_model),
- &iter,
- FYEAR_COL_NAME, _("Automatic"),
- FYEAR_COL_NUMBER, 0,
- FYEAR_COL_VIEW, TRUE,
- -1 );
+ &iter,
+ FYEAR_COL_NAME, _("Automatic"),
+ FYEAR_COL_NUMBER, 0,
+ FYEAR_COL_VIEW, TRUE,
+ -1 );
- /* fill the list */
- list_tmp = gsb_data_fyear_get_fyears_list ();
+ /* fill the list with the copy of fyears_list */
+ list_tmp = g_slist_sort ( g_slist_copy ( gsb_data_fyear_get_fyears_list ( ) ),
+ ( GCompareFunc ) gsb_data_fyear_compare_from_struct );
while ( list_tmp )
{
- gint fyear_number;
+ gint fyear_number;
- fyear_number = gsb_data_fyear_get_no_fyear (list_tmp -> data);
+ fyear_number = gsb_data_fyear_get_no_fyear (list_tmp -> data);
- gtk_list_store_append ( GTK_LIST_STORE (fyear_model),
- &iter );
- gtk_list_store_set ( GTK_LIST_STORE (fyear_model),
- &iter,
- FYEAR_COL_NAME, gsb_data_fyear_get_name (fyear_number),
- FYEAR_COL_NUMBER, fyear_number,
- FYEAR_COL_VIEW, gsb_data_fyear_get_form_show (fyear_number),
- -1 );
- list_tmp = list_tmp -> next;
+ gtk_list_store_append ( GTK_LIST_STORE (fyear_model), &iter );
+ gtk_list_store_set ( GTK_LIST_STORE (fyear_model),
+ &iter,
+ FYEAR_COL_NAME, gsb_data_fyear_get_name ( fyear_number ),
+ FYEAR_COL_NUMBER, fyear_number,
+ FYEAR_COL_VIEW, gsb_data_fyear_get_form_show (fyear_number),
+ -1 );
+ list_tmp = list_tmp -> next;
}
+
return FALSE;
}
@@ -312,20 +312,16 @@
* FYEAR_COL_VIEW : it tha fyear should be showed */
fyear_model = GTK_TREE_MODEL ( gtk_list_store_new ( 3,
- G_TYPE_STRING,
- G_TYPE_INT,
- G_TYPE_BOOLEAN ));
- fyear_model_filter = gtk_tree_model_filter_new ( fyear_model,
- NULL );
- gtk_tree_model_filter_set_visible_column ( GTK_TREE_MODEL_FILTER (fyear_model_filter),
- FYEAR_COL_VIEW );
- gsb_fyear_update_fyear_list ();
+ G_TYPE_STRING,
+ G_TYPE_INT,
+ G_TYPE_BOOLEAN ));
+ fyear_model_filter = gtk_tree_model_filter_new ( fyear_model, NULL );
+ gtk_tree_model_filter_set_visible_column ( GTK_TREE_MODEL_FILTER ( fyear_model_filter ),
+ FYEAR_COL_VIEW );
+ gsb_fyear_update_fyear_list ( );
+
return TRUE;
}
-
-
-
-
/* Local Variables: */
/* c-basic-offset: 4 */
/* End: */
Index: gsb_assistant_reconcile_config.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_assistant_reconcile_config.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- gsb_assistant_reconcile_config.c 29 Aug 2009 08:36:41 -0000 1.27
+++ gsb_assistant_reconcile_config.c 3 Oct 2009 22:14:56 -0000 1.28
@@ -51,24 +51,24 @@
/*START_STATIC*/
static gboolean gsb_assistant_reconcile_config_hide_label_error ( GtkWidget *editable,
- GtkWidget *label );
+ GtkWidget *label );
static gboolean gsb_assistant_reconcile_config_lauch_auto_asso ( GtkWidget *button,
- GtkWidget *assistant );
+ GtkWidget *assistant );
static gboolean gsb_assistant_reconcile_config_lauch_manu_asso ( GtkWidget *button,
- GtkWidget *assistant );
+ GtkWidget *assistant );
static gboolean gsb_assistant_reconcile_config_page_add_new_reconcile ( GtkWidget *button,
- GtkWidget *label );
+ GtkWidget *label );
static GtkWidget *gsb_assistant_reconcile_config_page_automaticaly_associate ( GtkWidget *assistant );
static GtkWidget *gsb_assistant_reconcile_config_page_manually_associate ( GtkWidget *assistant );
static GtkWidget *gsb_assistant_reconcile_config_page_menu ( GtkWidget *assistant );
static gboolean gsb_assistant_reconcile_config_page_menu_toggled ( GtkWidget *button,
- GtkWidget *assistant );
+ GtkWidget *assistant );
static GtkWidget *gsb_assistant_reconcile_config_page_new_reconcile ( void );
static GtkWidget *gsb_assistant_reconcile_config_page_success ( void );
static gboolean gsb_assistant_reconcile_config_update_auto_asso ( GtkWidget *assistant,
- gint new_page );
+ gint new_page );
static gboolean gsb_assistant_reconcile_config_update_manu_asso ( GtkWidget *assistant,
- gint new_page );
+ gint new_page );
/*END_STATIC*/
/*START_EXTERN*/
@@ -730,7 +730,7 @@
* \return FALSE
* */
static gboolean gsb_assistant_reconcile_config_page_menu_toggled ( GtkWidget *button,
- GtkWidget *assistant )
+ GtkWidget *assistant )
{
gint new_next_page;
@@ -755,89 +755,95 @@
* \return FALSE
* */
static gboolean gsb_assistant_reconcile_config_page_add_new_reconcile ( GtkWidget *button,
- GtkWidget *label )
+ GtkWidget *label )
{
gint reconcile_number;
gchar *string;
/* first, we check the date are valid */
- if (!gsb_date_check_entry (reconcile_init_date_entry))
+ if ( !gsb_date_check_entry ( reconcile_init_date_entry ) )
{
- gtk_label_set_markup (GTK_LABEL (label),
- _("<span foreground=\"red\">The initial date is not valid, please check it</span>"));
- gtk_widget_grab_focus (reconcile_init_date_entry);
- return FALSE;
+ string = make_red ( _("The initial date is not valid, please check it.") );
+ gtk_label_set_markup ( GTK_LABEL ( label) , string );
+ gtk_widget_grab_focus (reconcile_init_date_entry);
+ g_free ( string );
+ return FALSE;
}
- if (!gsb_date_check_entry (reconcile_final_date_entry))
+ if ( !gsb_date_check_entry ( reconcile_final_date_entry ) )
{
- gtk_label_set_markup (GTK_LABEL (label),
- _("<span foreground=\"red\">The final date is not valid, please check it</span>"));
- gtk_widget_grab_focus (reconcile_final_date_entry);
- return FALSE;
+ string = make_red ( _("The final date is not valid, please check it.") );
+ gtk_label_set_markup ( GTK_LABEL ( label) , string );
+ gtk_widget_grab_focus ( reconcile_final_date_entry );
+ g_free ( string );
+ return FALSE;
}
/* check there is a name */
- if (!strlen (gtk_entry_get_text (GTK_ENTRY (reconcile_name_entry))))
+ if ( !strlen (gtk_entry_get_text ( GTK_ENTRY ( reconcile_name_entry ) ) ) )
{
- gtk_label_set_markup (GTK_LABEL (label),
- _("<span foreground=\"red\">Please give a name to the new reconcile</span>"));
- gtk_widget_grab_focus (reconcile_name_entry);
- return FALSE;
+ string = make_red ( _("Please give a name to the new reconcile.") );
+ gtk_label_set_markup ( GTK_LABEL ( label) , string );
+ gtk_widget_grab_focus ( reconcile_name_entry );
+ g_free ( string );
+ return FALSE;
}
/* check if already exist the name */
- if (gsb_data_reconcile_get_number_by_name (gtk_entry_get_text (GTK_ENTRY (reconcile_name_entry))))
+ if ( gsb_data_reconcile_get_number_by_name (
+ gtk_entry_get_text (GTK_ENTRY (reconcile_name_entry) ) ) )
{
- gtk_label_set_markup (GTK_LABEL (label),
- _("<span foreground=\"red\">That name already exists, please find another one.</span>"));
- gtk_widget_grab_focus (reconcile_name_entry);
- return FALSE;
+ string = make_red ( _("That name already exists, please find another one.") );
+ gtk_label_set_markup ( GTK_LABEL ( label) , string );
+ gtk_widget_grab_focus ( reconcile_name_entry );
+ g_free ( string );
+ return FALSE;
}
/* ok, now we can create the reconcile */
- reconcile_number = gsb_data_reconcile_new (gtk_entry_get_text (GTK_ENTRY (reconcile_name_entry)));
- if (!reconcile_number)
- if (gsb_data_reconcile_get_number_by_name (gtk_entry_get_text (GTK_ENTRY (reconcile_name_entry))))
+ reconcile_number = gsb_data_reconcile_new (
+ gtk_entry_get_text ( GTK_ENTRY ( reconcile_name_entry ) ) );
+ if ( !reconcile_number )
+ if (gsb_data_reconcile_get_number_by_name ( gtk_entry_get_text (
+ GTK_ENTRY ( reconcile_name_entry ) ) ) )
{
- gtk_label_set_markup (GTK_LABEL (label),
- _("<span foreground=\"red\">Cannot allocate memory : Bad things will happen soon.</span>"));
- gtk_widget_grab_focus (reconcile_name_entry);
- return FALSE;
+ string = make_red ( _("Cannot allocate memory : Bad things will happen soon.") );
+ gtk_label_set_markup ( GTK_LABEL ( label) , string );
+ gtk_widget_grab_focus ( reconcile_name_entry );
+ g_free ( string );
+ return FALSE;
}
gsb_data_reconcile_set_init_date ( reconcile_number,
- gsb_calendar_entry_get_date (reconcile_init_date_entry));
+ gsb_calendar_entry_get_date ( reconcile_init_date_entry ) );
gsb_data_reconcile_set_final_date ( reconcile_number,
- gsb_calendar_entry_get_date (reconcile_final_date_entry));
+ gsb_calendar_entry_get_date ( reconcile_final_date_entry ) );
gsb_data_reconcile_set_init_balance ( reconcile_number,
- gsb_real_get_from_string (gtk_entry_get_text (GTK_ENTRY (reconcile_init_balance_entry))));
+ gsb_real_get_from_string ( gtk_entry_get_text (
+ GTK_ENTRY (reconcile_init_balance_entry ) ) ) );
gsb_data_reconcile_set_final_balance ( reconcile_number,
- gsb_real_get_from_string (gtk_entry_get_text (GTK_ENTRY (reconcile_final_balance_entry))));
+ gsb_real_get_from_string ( gtk_entry_get_text (
+ GTK_ENTRY ( reconcile_final_balance_entry ) ) ) );
gsb_data_reconcile_set_account ( reconcile_number,
- gsb_account_get_combo_account_number (reconcile_account_button));
+ gsb_account_get_combo_account_number ( reconcile_account_button ) );
/* erase the entries but not the account wich can be used again */
- gtk_entry_set_text ( GTK_ENTRY (reconcile_name_entry),
- "" );
- gtk_entry_set_text ( GTK_ENTRY (reconcile_init_date_entry),
- "" );
- gtk_entry_set_text ( GTK_ENTRY (reconcile_final_date_entry),
- "" );
- gtk_entry_set_text ( GTK_ENTRY (reconcile_init_balance_entry),
- "" );
- gtk_entry_set_text ( GTK_ENTRY (reconcile_final_balance_entry),
- "" );
- string = g_strdup_printf ( _("<span foreground=\"blue\">Reconciliation %s successfully appended !</span>"),
- gsb_data_reconcile_get_name (reconcile_number));
- gtk_label_set_markup ( GTK_LABEL (label),
- string );
- g_free (string);
+ gtk_entry_set_text ( GTK_ENTRY (reconcile_name_entry), "" );
+ gtk_entry_set_text ( GTK_ENTRY (reconcile_init_date_entry), "" );
+ gtk_entry_set_text ( GTK_ENTRY (reconcile_final_date_entry), "" );
+ gtk_entry_set_text ( GTK_ENTRY (reconcile_init_balance_entry), "" );
+ gtk_entry_set_text ( GTK_ENTRY (reconcile_final_balance_entry), "" );
+
+ string = make_blue ( g_strdup_printf ( _("Reconciliation %s successfully appended !"),
+ gsb_data_reconcile_get_name ( reconcile_number ) ) );
+ gtk_label_set_markup ( GTK_LABEL ( label ), string );
+ g_free ( string );
/* update the list of reconcile in the configuration list */
- gsb_reconcile_config_fill ();
+ gsb_reconcile_config_fill ( );
+
+ gtk_widget_grab_focus ( reconcile_name_entry );
- gtk_widget_grab_focus (reconcile_name_entry);
return FALSE;
}
@@ -850,7 +856,7 @@
* \return FALSE
* */
static gboolean gsb_assistant_reconcile_config_hide_label_error ( GtkWidget *editable,
- GtkWidget *label )
+ GtkWidget *label )
{
gtk_label_set_text ( GTK_LABEL (label),
NULL );
@@ -868,7 +874,7 @@
* \return FALSE
* */
gboolean gsb_assistant_reconcile_config_update_auto_asso ( GtkWidget *assistant,
- gint new_page )
+ gint new_page )
{
gchar *string;
GSList *tmp_list;
@@ -965,7 +971,7 @@
* \return FALSE
* */
static gboolean gsb_assistant_reconcile_config_lauch_auto_asso ( GtkWidget *button,
- GtkWidget *assistant )
+ GtkWidget *assistant )
{
GSList *tmp_list;
@@ -1029,7 +1035,7 @@
* \return FALSE
* */
gboolean gsb_assistant_reconcile_config_update_manu_asso ( GtkWidget *assistant,
- gint new_page )
+ gint new_page )
{
gchar *string;
GSList *tmp_list;
@@ -1094,7 +1100,7 @@
* \return FALSE
* */
static gboolean gsb_assistant_reconcile_config_lauch_manu_asso ( GtkWidget *button,
- GtkWidget *assistant )
+ GtkWidget *assistant )
{
GList *tmp_list;
GtkTreeIter iter;
Index: gsb_data_fyear.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_data_fyear.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- gsb_data_fyear.c 26 Oct 2008 21:40:37 -0000 1.17
+++ gsb_data_fyear.c 3 Oct 2009 22:14:56 -0000 1.18
@@ -1,8 +1,8 @@
/* ************************************************************************** */
/* */
/* */
-/* Copyright (C) 2000-2008 Cédric Auger (cedric at grisbi.org) */
-/* http://www.grisbi.org */
+/* Copyright (C) 2000-2008 Cédric Auger (cedric at grisbi.org) */
+/* 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 */
@@ -32,29 +32,13 @@
#include "gsb_data_fyear.h"
#include "./utils_dates.h"
#include "./gsb_fyear.h"
+#include "./dialog.h"
#include "./utils_str.h"
#include "./include.h"
/*END_INCLUDE*/
/**
- * \struct
- * Describe a fyear
- */
-typedef struct
-{
- guint fyear_number;
- gchar *fyear_name;
- GDate *beginning_date;
- GDate *end_date;
- gboolean showed_in_form;
-
- /* 0 if the fyear is valid, >0 if invalid (the number
- * contains why it's invalid) */
- gint invalid_fyear;
-} struct_fyear;
-
-/**
* describe the invalid numbers
* */
enum fyear_invalid {
@@ -119,30 +103,30 @@
GSList *tmp;
if (!fyear_number)
- return NULL;
+ return NULL;
/* before checking all the fyears, we check the buffer */
if ( fyear_buffer
&&
fyear_buffer -> fyear_number == fyear_number )
- return fyear_buffer;
+ return fyear_buffer;
tmp = fyear_list;
-
+
while ( tmp )
{
- struct_fyear *fyear;
+ struct_fyear *fyear;
- fyear = tmp -> data;
+ fyear = tmp -> data;
- if ( fyear -> fyear_number == fyear_number )
- {
- fyear_buffer = fyear;
- return fyear;
- }
+ if ( fyear -> fyear_number == fyear_number )
+ {
+ fyear_buffer = fyear;
+ return fyear;
+ }
- tmp = tmp -> next;
+ tmp = tmp -> next;
}
return NULL;
}
@@ -292,7 +276,7 @@
* \return the new number or 0 if the fyear doen't exist
* */
gint gsb_data_fyear_set_new_number ( gint fyear_number,
- gint new_no_fyear )
+ gint new_no_fyear )
{
struct_fyear *fyear;
@@ -339,7 +323,7 @@
fyear = gsb_data_fyear_get_structure ( fyear_number );
if (!fyear)
- return NULL;
+ return NULL;
return fyear -> fyear_name;
}
@@ -563,22 +547,20 @@
fyear = gsb_data_fyear_get_structure ( fyear_number );
- if (!fyear
- ||
- !fyear -> invalid_fyear)
- return NULL;
+ if ( !fyear || !fyear -> invalid_fyear )
+ return NULL;
- switch (fyear -> invalid_fyear)
+ switch ( fyear -> invalid_fyear )
{
- case FYEAR_INVALID_DATE_ORDER:
- string = _("<span foreground=\"red\">Warning : the dates are not in good order</span>");
- break;
- case FYEAR_INVALID_CROSS:
- string = _("<span foreground=\"red\">Warning : that financial year cross with another one</span>");
- break;
- case FYEAR_INVALID_DATE:
- string = _("<span foreground=\"red\">Warning : Invalid date</span>");
- break;
+ case FYEAR_INVALID_DATE_ORDER:
+ string = make_red ( _("Warning : the dates are not in good order.") );
+ break;
+ case FYEAR_INVALID_CROSS:
+ string = make_red ( _("Warning : that financial year cross with another one.") );
+ break;
+ case FYEAR_INVALID_DATE:
+ string = make_red ( _("Warning : Invalid date.") );
+ break;
}
return string;
@@ -711,8 +693,7 @@
*
* \return -1 if fyear 1 is before 2 ; +1 if fyear 1 is after 2 ; 0 if problem
* */
-gint gsb_data_fyear_compare ( gint fyear_number_1,
- gint fyear_number_2 )
+gint gsb_data_fyear_compare ( gint fyear_number_1, gint fyear_number_2 )
{
struct_fyear *fyear_1;
struct_fyear *fyear_2;
@@ -720,17 +701,28 @@
fyear_1 = gsb_data_fyear_get_structure (fyear_number_1);
fyear_2 = gsb_data_fyear_get_structure (fyear_number_2);
- if (!fyear_1
- ||
- !fyear_2)
- return 0;
+ return gsb_data_fyear_compare_from_struct ( fyear_1, fyear_2 );
+
+ }
+
+
+/**
+ * compare 2 financial years bye struct_fyear *fyear
+ *
+ * \param struct_fyear *fyear_1
+ * \param struct_fyear *fyear_2
+ *
+ * \return -1 if fyear 1 is before 2 ; +1 if fyear 1 is after 2 ; 0 if problem
+ * */
+gint gsb_data_fyear_compare_from_struct ( struct_fyear *fyear_1,
+ struct_fyear *fyear_2 )
+{
+ if ( !fyear_1 || !fyear_2 )
+ return 0;
if (g_date_compare (fyear_1 -> beginning_date, fyear_2 -> end_date) >= 0)
- return 1;
+ return 1;
if (g_date_compare (fyear_2 -> beginning_date, fyear_1 -> end_date) >= 0)
- return -1;
+ return -1;
return 0;
}
-
-
-
Index: parametres.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/parametres.c,v
retrieving revision 1.206
retrieving revision 1.207
diff -u -d -r1.206 -r1.207
--- parametres.c 8 Sep 2009 20:43:48 -0000 1.206
+++ parametres.c 3 Oct 2009 22:14:56 -0000 1.207
@@ -868,9 +868,9 @@
entry = gsb_automem_entry_new ( &etat.browser_command, NULL, NULL );
gtk_table_attach ( GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_EXPAND|GTK_FILL, 0, 0, 0 );
- text = g_strconcat ( "<span foreground=\"blue\">",
+ text = make_blue ( g_strconcat (
_("You may use %s to expand the URL I.e:\n'firefox -remote %s'"),
- "</span>", NULL );
+ NULL ) );
label = gtk_label_new ( text );
gtk_label_set_use_markup ( GTK_LABEL(label), TRUE );
gtk_misc_set_alignment ( GTK_MISC ( label ), 0.0, 0.5 );
@@ -879,8 +879,8 @@
g_free ( text );
- paddingbox = new_paddingbox_with_title (vbox_pref, FALSE,
- _("LaTeX support (old print system)"));
+ paddingbox = new_paddingbox_with_title ( vbox_pref, FALSE,
+ _("LaTeX support (old print system)") );
table = gtk_table_new ( 0, 2, FALSE );
gtk_box_pack_start ( GTK_BOX ( paddingbox ), table, FALSE, FALSE, 0 );
Index: fenetre_principale.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/fenetre_principale.c,v
retrieving revision 1.121
retrieving revision 1.122
diff -u -d -r1.121 -r1.122
--- fenetre_principale.c 29 Aug 2009 08:36:41 -0000 1.121
+++ fenetre_principale.c 3 Oct 2009 22:14:56 -0000 1.122
@@ -337,12 +337,15 @@
const gchar *text,
gboolean escape_text )
{
- const gchar* escstr = escape_text ? g_markup_escape_text ( text, -1 ) : text;
- gchar* tmpstr = g_strconcat ( "<b>", escstr, "</b>", NULL );
+ gchar* tmpstr;
+
+ if ( escape_text )
+ tmpstr = g_markup_printf_escaped ("<b>%s</b>", text );
+ else
+ tmpstr = g_strconcat ( "<b>", text, "</b>", NULL );
gtk_label_set_markup ( label, tmpstr );
+
g_free ( tmpstr );
- if ( escape_text )
- g_free ( (gchar*)escstr );
}
/**
Index: gsb_fyear.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_fyear.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- gsb_fyear.h 20 Mar 2007 10:12:53 -0000 1.6
+++ gsb_fyear.h 3 Oct 2009 22:14:56 -0000 1.7
@@ -7,12 +7,12 @@
/* START_DECLARATION */
gint gsb_fyear_get_fyear_from_combobox ( GtkWidget *combo_box,
- const GDate *date );
+ const GDate *date );
void gsb_fyear_init_variables ( void );
GtkWidget *gsb_fyear_make_combobox ( gboolean set_automatic );
gboolean gsb_fyear_set_automatic ( gboolean set_automatic );
gboolean gsb_fyear_set_combobox_history ( GtkWidget *combo_box,
- gint fyear_number );
+ gint fyear_number );
gboolean gsb_fyear_update_fyear_list ( void );
/* END_DECLARATION */
#endif
Index: gsb_form.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_form.c,v
retrieving revision 1.131
retrieving revision 1.132
diff -u -d -r1.131 -r1.132
--- gsb_form.c 29 Aug 2009 08:36:41 -0000 1.131
+++ gsb_form.c 3 Oct 2009 22:14:56 -0000 1.132
@@ -221,9 +221,7 @@
/* set the label transaction form */
label = gtk_label_new ( NULL );
- tmpstr = g_strconcat ( "<span weight=\"bold\">",
- _("Transaction/Scheduled _form"),
- "</span>", NULL );
+ tmpstr = make_pango_attribut ( "weight=\"bold\"", _("Transaction/Scheduled _form") );
gtk_label_set_markup_with_mnemonic ( GTK_LABEL ( label ), tmpstr );
g_free ( tmpstr );
gtk_box_pack_start ( GTK_BOX ( hbox ),
Index: utils.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/utils.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -r1.54 -r1.55
--- utils.c 24 Aug 2009 21:41:49 -0000 1.54
+++ utils.c 3 Oct 2009 22:14:56 -0000 1.55
@@ -231,8 +231,7 @@
/* Creating label */
label = gtk_label_new ( NULL );
gtk_misc_set_alignment ( GTK_MISC ( label ), 0, 1 );
- tmp_str = g_strconcat ("<span weight=\"bold\">",
- title, "</span>", NULL );
+ tmp_str = g_markup_printf_escaped ("<span weight=\"bold\">%s</span>", title );
gtk_label_set_markup ( GTK_LABEL ( label ), tmp_str );
g_free(tmp_str);
gtk_box_pack_start ( GTK_BOX ( vbox ), label,
Index: gsb_reconcile.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_reconcile.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- gsb_reconcile.c 24 Aug 2009 13:56:59 -0000 1.41
+++ gsb_reconcile.c 3 Oct 2009 22:14:56 -0000 1.42
@@ -411,7 +411,7 @@
gtk_entry_set_text ( GTK_ENTRY ( reconcile_final_balance_entry ), "" );
/* set the title */
- tmpstr = g_strdup_printf ( _(" <b>%s reconciliation</b> "),
+ tmpstr = g_markup_printf_escaped ( _(" <b>%s reconciliation</b> "),
gsb_data_account_get_name (account_number));
gtk_label_set_markup ( GTK_LABEL (gtk_frame_get_label_widget (GTK_FRAME (reconcile_panel))),
tmpstr );
Index: gsb_account_property.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_account_property.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- gsb_account_property.c 2 Oct 2009 21:35:04 -0000 1.47
+++ gsb_account_property.c 3 Oct 2009 22:14:56 -0000 1.48
@@ -717,7 +717,6 @@
gint origin = GPOINTER_TO_INT (p_origin);
gint account_number;
GtkWidget *image;
- const gchar *tmpstr;
account_number = gsb_gui_navigation_get_current_account ();
if ( account_number == -1)
Index: gsb_transactions_list_sort.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_transactions_list_sort.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- gsb_transactions_list_sort.h 28 Aug 2008 21:49:38 -0000 1.3
+++ gsb_transactions_list_sort.h 3 Oct 2009 22:14:56 -0000 1.4
@@ -7,11 +7,11 @@
/* START_DECLARATION */
gint gsb_transactions_list_sort (CustomRecord **a,
- CustomRecord **b,
- CustomList *custom_list);
+ CustomRecord **b,
+ CustomList *custom_list);
gint gsb_transactions_list_sort_check_archive ( CustomRecord *record_1,
- CustomRecord *record_2 );
+ CustomRecord *record_2 );
gint gsb_transactions_list_sort_general_test ( CustomRecord *record_1,
- CustomRecord *record_2 );
+ CustomRecord *record_2 );
/* END_DECLARATION */
#endif
More information about the cvs
mailing list