[grisbi-cvs] [SCM] grisbi branch, master, updated. upstream_version_0_9.0-120-ga0ddc6e
Pierre Biava
nobody at users.sourceforge.net
Sun Apr 3 10:22:06 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 a0ddc6ea3f3e9797bb17a405dd9e73d6dd11aa22 (commit)
from 43be8da9e791b1a4904f6f86ef6c45407f58d1df (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 a0ddc6ea3f3e9797bb17a405dd9e73d6dd11aa22
Author: pbiava <pierre.biava at nerim.net>
Date: Sun Apr 3 10:10:17 2011 +0200
replaces the global variable "window" by run.window
-----------------------------------------------------------------------
Changes:
diff --git a/src/accueil.c b/src/accueil.c
index 2868bb3..7edf2ea 100644
--- a/src/accueil.c
+++ b/src/accueil.c
@@ -102,7 +102,6 @@ extern GtkWidget *form_transaction_part;
extern gsb_real null_real;
extern GSList *scheduled_transactions_taken;
extern GSList *scheduled_transactions_to_take;
-extern GtkWidget *window;
/*END_EXTERN*/
GtkWidget *logo_accueil = NULL;
@@ -309,7 +308,7 @@ gboolean saisie_echeance_accueil ( GtkWidget *event_box,
/* Create the dialog */
dialog = gtk_dialog_new_with_buttons ( _("Enter a scheduled transaction"),
- GTK_WINDOW ( window ),
+ GTK_WINDOW ( run.window ),
GTK_DIALOG_MODAL,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
diff --git a/src/affichage.c b/src/affichage.c
index 1552026..d258196 100644
--- a/src/affichage.c
+++ b/src/affichage.c
@@ -110,7 +110,6 @@ extern GtkWidget *logo_accueil;
extern GdkColor split_background;
extern GdkColor text_color[2];
extern gchar *titre_fichier;
-extern GtkWidget *window;
/*END_EXTERN*/
diff --git a/src/bet_finance_ui.c b/src/bet_finance_ui.c
index 8d21d89..6755f50 100644
--- a/src/bet_finance_ui.c
+++ b/src/bet_finance_ui.c
@@ -100,7 +100,6 @@ extern GtkWidget *account_page;
extern GdkColor calendar_entry_color;
extern GdkColor couleur_fond[2];
extern GdkColor couleur_selection;
-extern GtkWidget *window;
/*END_EXTERN*/
/* notebook pour la simulation de crédits */
@@ -1927,7 +1926,7 @@ void bet_finance_ui_export_tab ( GtkWidget *menu_item, GtkTreeView *tree_view )
gchar *filename;
dialog = gtk_file_chooser_dialog_new ( _("Export the array"),
- GTK_WINDOW ( window ),
+ GTK_WINDOW ( run.window ),
GTK_FILE_CHOOSER_ACTION_SAVE,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_SAVE, GTK_RESPONSE_OK,
diff --git a/src/bet_future.c b/src/bet_future.c
index 7e92ec8..23d9e7a 100644
--- a/src/bet_future.c
+++ b/src/bet_future.c
@@ -110,7 +110,6 @@ static gboolean bet_transfert_take_data ( struct_transfert_data *transfert, Gtk
/*START_EXTERN*/
extern gsb_real null_real;
-extern GtkWidget *window;
/*END_EXTERN*/
#define BET_SCHEDULED_WIDTH 4
@@ -258,7 +257,7 @@ GtkWidget *bet_future_create_dialog ( gint account_number )
/* Create the dialog */
dialog = gtk_dialog_new_with_buttons ( _("Enter a budget line"),
- GTK_WINDOW ( window ),
+ GTK_WINDOW ( run.window ),
GTK_DIALOG_MODAL,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
@@ -1910,7 +1909,7 @@ GtkWidget *bet_transfert_create_dialog ( gint account_number )
/* Create the dialog */
dialog = gtk_dialog_new_with_buttons ( _("Select an account"),
- GTK_WINDOW ( window ),
+ GTK_WINDOW ( run.window ),
GTK_DIALOG_MODAL,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
diff --git a/src/bet_tab.c b/src/bet_tab.c
index e6e24fb..188e6a3 100644
--- a/src/bet_tab.c
+++ b/src/bet_tab.c
@@ -159,7 +159,6 @@ extern GtkWidget *notebook_general;
extern gsb_real null_real;
extern const gdouble prev_month_max;
extern gint valeur_echelle_recherche_date_import;
-extern GtkWidget *window;
/*END_EXTERN*/
/* gestion de la largeur des colonnes du tableau */
@@ -2948,7 +2947,7 @@ void bet_array_export_tab ( GtkWidget *menu_item, GtkTreeView *tree_view )
gchar *filename;
dialog = gtk_file_chooser_dialog_new ( _("Export the array of forecast"),
- GTK_WINDOW ( window ),
+ GTK_WINDOW ( run.window ),
GTK_FILE_CHOOSER_ACTION_SAVE,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_SAVE, GTK_RESPONSE_OK,
diff --git a/src/categories_onglet.c b/src/categories_onglet.c
index b32d283..03c7ccf 100644
--- a/src/categories_onglet.c
+++ b/src/categories_onglet.c
@@ -82,7 +82,6 @@ struct metatree_hold_position *category_hold_position;
/*START_EXTERN*/
extern MetatreeInterface * category_interface;
extern GdkColor couleur_selection;
-extern GtkWidget *window;
/*END_EXTERN*/
@@ -360,7 +359,7 @@ gboolean exporter_categ ( GtkButton * widget, gpointer data )
gchar *nom_categ;
dialog = gtk_file_chooser_dialog_new ( _("Export categories"),
- GTK_WINDOW ( window ),
+ GTK_WINDOW ( run.window ),
GTK_FILE_CHOOSER_ACTION_SAVE,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_SAVE, GTK_RESPONSE_OK,
@@ -403,7 +402,7 @@ void importer_categ ( void )
GtkFileFilter * filter;
dialog = gtk_file_chooser_dialog_new ( _("Import categories"),
- GTK_WINDOW ( window ),
+ GTK_WINDOW ( run.window ),
GTK_FILE_CHOOSER_ACTION_OPEN,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OPEN, GTK_RESPONSE_OK,
@@ -665,7 +664,7 @@ gboolean edit_category ( GtkTreeView * view )
_("No category defined") ));
dialog = gtk_dialog_new_with_buttons ( title,
- GTK_WINDOW ( window ),
+ GTK_WINDOW ( run.window ),
GTK_DIALOG_MODAL,
GTK_STOCK_CANCEL, GTK_RESPONSE_NO,
GTK_STOCK_APPLY, GTK_RESPONSE_OK,
diff --git a/src/dialog.c b/src/dialog.c
index a9ce0fa..8a398a4 100644
--- a/src/dialog.c
+++ b/src/dialog.c
@@ -31,6 +31,7 @@
/*START_INCLUDE*/
#include "dialog.h"
#include "parametres.h"
+#include "structures.h"
/*END_INCLUDE*/
/*START_STATIC*/
@@ -45,7 +46,6 @@ static gboolean dialogue_update_var ( GtkWidget *checkbox, gint message );
/*START_EXTERN*/
-extern GtkWidget *window;
/*END_EXTERN*/
@@ -203,7 +203,7 @@ void dialogue_special ( GtkMessageType param, gchar *text )
{
GtkWidget *dialog;
- dialog = gtk_message_dialog_new ( GTK_WINDOW (window),
+ dialog = gtk_message_dialog_new ( GTK_WINDOW ( run.window ),
GTK_DIALOG_DESTROY_WITH_PARENT,
param, GTK_BUTTONS_CLOSE,
"%s", text );
@@ -229,7 +229,7 @@ GtkWidget *dialogue_special_no_run ( GtkMessageType param,
{
GtkWidget *dialog;
- dialog = gtk_message_dialog_new ( GTK_WINDOW (window),
+ dialog = gtk_message_dialog_new ( GTK_WINDOW ( run.window ),
GTK_DIALOG_DESTROY_WITH_PARENT,
param, buttons,
"%s", text );
@@ -314,7 +314,7 @@ GtkDialog *dialogue_conditional_new ( gchar *text,
}
}
- dialog = gtk_message_dialog_new ( GTK_WINDOW (window),
+ dialog = gtk_message_dialog_new ( GTK_WINDOW ( run.window ),
GTK_DIALOG_DESTROY_WITH_PARENT,
type, buttons,
"%s", text );
@@ -427,7 +427,7 @@ gboolean question_yes_no ( gchar *text, gint default_answer )
GtkWidget *dialog;
gint response;
- dialog = gtk_message_dialog_new ( GTK_WINDOW (window),
+ dialog = gtk_message_dialog_new ( GTK_WINDOW ( run.window ),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_QUESTION,
GTK_BUTTONS_YES_NO,
@@ -512,7 +512,7 @@ gboolean question_conditional_yes_no_with_struct ( struct conditional_message *m
return message -> default_answer;
text = make_hint ( _(message -> hint), message -> message );
- dialog = gtk_message_dialog_new ( GTK_WINDOW (window),
+ dialog = gtk_message_dialog_new ( GTK_WINDOW ( run.window ),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_YES_NO,
@@ -726,7 +726,7 @@ const gchar *dialogue_hint_with_entry ( gchar *text, gchar *hint, gchar *entry_d
format_text = make_hint ( hint, text );
- dialog = gtk_message_dialog_new ( GTK_WINDOW (window),
+ dialog = gtk_message_dialog_new ( GTK_WINDOW ( run.window ),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_INFO,
GTK_BUTTONS_CLOSE,
diff --git a/src/etats_config.c b/src/etats_config.c
index e8c4ac2..344d995 100644
--- a/src/etats_config.c
+++ b/src/etats_config.c
@@ -376,7 +376,6 @@ extern GtkWidget * navigation_tree_view;
extern GtkWidget *notebook_config_etat;
extern GtkWidget *notebook_etats;
extern GtkWidget *notebook_general;
-extern GtkWidget *window;
/*END_EXTERN*/
@@ -404,7 +403,7 @@ void personnalisation_etat (void)
GSB_REPORTS_PAGE );
dialog = gtk_dialog_new_with_buttons ( _("Report properties"),
- GTK_WINDOW ( window ),
+ GTK_WINDOW ( run.window ),
GTK_DIALOG_MODAL,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
diff --git a/src/etats_onglet.c b/src/etats_onglet.c
index 409b737..42d50ef 100644
--- a/src/etats_onglet.c
+++ b/src/etats_onglet.c
@@ -85,7 +85,6 @@ static GtkWidget *reports_toolbar = NULL;
extern struct struct_etat_affichage csv_affichage;
extern struct struct_etat_affichage html_affichage;
extern GtkWidget *notebook_general;
-extern GtkWidget *window;
/*END_EXTERN*/
/** Different formats supported. */
@@ -1095,7 +1094,7 @@ void exporter_etat ( void )
gtk_notebook_set_current_page ( GTK_NOTEBOOK ( notebook_general), GSB_REPORTS_PAGE );
fenetre_nom = gtk_file_chooser_dialog_new ( _("Export report"),
- GTK_WINDOW ( window ),
+ GTK_WINDOW ( run.window ),
GTK_FILE_CHOOSER_ACTION_SAVE,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_SAVE, GTK_RESPONSE_OK,
@@ -1179,7 +1178,7 @@ void importer_etat ( void )
gtk_notebook_set_current_page ( GTK_NOTEBOOK ( notebook_general), GSB_REPORTS_PAGE );
fenetre_nom = gtk_file_chooser_dialog_new ( _("Import a report"),
- GTK_WINDOW ( window ),
+ GTK_WINDOW ( run.window ),
GTK_FILE_CHOOSER_ACTION_OPEN,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OPEN, GTK_RESPONSE_OK,
diff --git a/src/fenetre_principale.c b/src/fenetre_principale.c
index 52fe294..965b416 100644
--- a/src/fenetre_principale.c
+++ b/src/fenetre_principale.c
@@ -66,7 +66,6 @@ static gboolean on_simpleclick_event_run ( GtkWidget * button, GdkEvent * button
/*START_EXTERN*/
extern gint mini_paned_width;
-extern GtkWidget *window;
/*END_EXTERN*/
@@ -160,7 +159,7 @@ GtkWidget * create_main_widget ( void )
{
gint width, height;
- gtk_window_get_size ( GTK_WINDOW ( window ), &width, &height );
+ gtk_window_get_size ( GTK_WINDOW ( run.window ), &width, &height );
if ( height < mini_paned_width )
height = mini_paned_width;
gtk_paned_set_position ( GTK_PANED ( main_hpaned ), (gint) width / 4 );
diff --git a/src/go-optionmenu.c b/src/go-optionmenu.c
index 6b90468..16039b2 100644
--- a/src/go-optionmenu.c
+++ b/src/go-optionmenu.c
@@ -105,7 +105,6 @@ static void go_option_menu_update_contents_real (GOOptionMenu *option_menu,
/*END_STATIC*/
/*START_EXTERN*/
-extern GtkWidget *window;
/*END_EXTERN*/
diff --git a/src/gsb_archive_config.c b/src/gsb_archive_config.c
index 2ecec8a..20279a3 100644
--- a/src/gsb_archive_config.c
+++ b/src/gsb_archive_config.c
@@ -83,7 +83,6 @@ static gboolean gsb_archive_config_select ( GtkTreeSelection *selection,
/*END_STATIC*/
/*START_EXTERN*/
-extern GtkWidget *window;
/*END_EXTERN*/
/**
diff --git a/src/gsb_assistant.c b/src/gsb_assistant.c
index b1932f3..0e614b2 100644
--- a/src/gsb_assistant.c
+++ b/src/gsb_assistant.c
@@ -47,7 +47,6 @@ static gboolean gsb_assistant_change_page ( GtkNotebook * notebook, GtkNotebookP
/*END_STATIC*/
/*START_EXTERN*/
-extern GtkWidget *window;
/*END_EXTERN*/
@@ -77,14 +76,14 @@ GtkWidget * gsb_assistant_new ( const gchar * title, const gchar * explanation,
gchar* tmpstr;
assistant = gtk_dialog_new_with_buttons ( title,
- GTK_WINDOW ( window ),
+ GTK_WINDOW ( run.window ),
GTK_DIALOG_MODAL | GTK_DIALOG_NO_SEPARATOR,
NULL );
gtk_window_set_default_size ( GTK_WINDOW ( assistant ), 800, 500 );
gtk_window_set_position ( GTK_WINDOW ( assistant ), GTK_WIN_POS_CENTER_ON_PARENT );
gtk_window_set_resizable ( GTK_WINDOW ( assistant ), TRUE );
- g_object_set_data ( G_OBJECT ( window ), "assistant", assistant );
+ g_object_set_data ( G_OBJECT ( run.window ), "assistant", assistant );
button_cancel = gtk_dialog_add_button ( GTK_DIALOG(assistant),
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL );
diff --git a/src/gsb_assistant_archive_export.c b/src/gsb_assistant_archive_export.c
index 20cc45b..81996e4 100644
--- a/src/gsb_assistant_archive_export.c
+++ b/src/gsb_assistant_archive_export.c
@@ -90,7 +90,6 @@ static gboolean gsb_assistant_archive_switch ( GtkWidget *assistant,
/*END_STATIC*/
/*START_EXTERN*/
-extern GtkWidget *window;
/*END_EXTERN*/
diff --git a/src/gsb_assistant_file.c b/src/gsb_assistant_file.c
index 656d4cb..3e746fb 100644
--- a/src/gsb_assistant_file.c
+++ b/src/gsb_assistant_file.c
@@ -70,7 +70,6 @@ static GtkWidget *gsb_assistant_file_page_finish ( GtkWidget *assistant,
extern gchar *adresse_commune;
extern gchar *nom_fichier_comptes;
extern gchar *titre_fichier;
-extern GtkWidget *window;
/*END_EXTERN*/
enum file_assistant_page
@@ -600,7 +599,7 @@ static gboolean gsb_assistant_file_choose_filename ( GtkWidget *button,
gchar *tmpstr;
dialog = gtk_file_chooser_dialog_new ( _("Create filename"),
- GTK_WINDOW ( window ),
+ GTK_WINDOW ( run.window ),
GTK_FILE_CHOOSER_ACTION_SAVE,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
diff --git a/src/gsb_assistant_first.c b/src/gsb_assistant_first.c
index 72a8ad2..6d6ddc9 100644
--- a/src/gsb_assistant_first.c
+++ b/src/gsb_assistant_first.c
@@ -59,7 +59,6 @@ static GtkWidget *gsb_assistant_first_page_3 ( GtkWidget *assistant );
/*START_EXTERN*/
extern gboolean result_reconcile;
-extern GtkWidget *window;
/*END_EXTERN*/
enum first_assistant_page
@@ -294,7 +293,7 @@ static GtkWidget *gsb_assistant_first_page_2 ( GtkWidget *assistant )
gtk_box_pack_start ( GTK_BOX ( hbox ), label,
FALSE, FALSE, 0);
- dialog = utils_files_create_file_chooser ( window,
+ dialog = utils_files_create_file_chooser ( run.window,
_("Select/Create backup directory") );
button = gtk_file_chooser_button_new_with_dialog (dialog);
gtk_file_chooser_set_current_folder ( GTK_FILE_CHOOSER (button),
diff --git a/src/gsb_bank.c b/src/gsb_bank.c
index 8ecc141..d3738e9 100644
--- a/src/gsb_bank.c
+++ b/src/gsb_bank.c
@@ -114,7 +114,6 @@ static GtkWidget *bank_notes;
/*START_EXTERN*/
-extern GtkWidget *window;
/*END_EXTERN*/
@@ -997,7 +996,7 @@ static gboolean gsb_bank_edit_bank ( gint bank_number,
return FALSE;
dialog = gtk_dialog_new_with_buttons ( _("Edit bank"),
- GTK_WINDOW ( window ),
+ GTK_WINDOW ( run.window ),
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
NULL );
diff --git a/src/gsb_calendar_entry.c b/src/gsb_calendar_entry.c
index 7222bb0..048d34b 100644
--- a/src/gsb_calendar_entry.c
+++ b/src/gsb_calendar_entry.c
@@ -38,8 +38,9 @@
/*START_INCLUDE*/
#include "gsb_calendar_entry.h"
-#include "utils_dates.h"
#include "gsb_form_widget.h"
+#include "structures.h"
+#include "utils_dates.h"
/*END_INCLUDE*/
/*START_STATIC*/
@@ -68,7 +69,6 @@ static void gsb_calendar_entry_step_date ( GtkWidget *entry,
/*START_EXTERN*/
extern GdkColor calendar_entry_color;
-extern GtkWidget *window;
/*END_EXTERN*/
#define ENTRY_NORMAL 0
@@ -454,7 +454,7 @@ GtkWidget *gsb_calendar_entry_popup ( GtkWidget *entry )
popup = gtk_window_new ( GTK_WINDOW_TOPLEVEL );
gtk_window_set_modal ( GTK_WINDOW ( popup ), TRUE );
gtk_window_set_transient_for ( GTK_WINDOW ( popup ),
- GTK_WINDOW ( window ) );
+ GTK_WINDOW ( run.window ) );
gtk_window_set_decorated ( GTK_WINDOW ( popup ), FALSE );
g_signal_connect_swapped ( G_OBJECT ( popup ),
"destroy",
diff --git a/src/gsb_currency.c b/src/gsb_currency.c
index 272873c..0ce4e83 100644
--- a/src/gsb_currency.c
+++ b/src/gsb_currency.c
@@ -114,7 +114,6 @@ extern gint mise_a_jour_liste_comptes_accueil;
extern gint mise_a_jour_liste_echeances_auto_accueil;
extern gint mise_a_jour_liste_echeances_manuelles_accueil;
extern gsb_real null_real;
-extern GtkWidget *window;
/*END_EXTERN*/
@@ -525,7 +524,7 @@ void gsb_currency_exchange_dialog ( gint account_currency_number,
}
dialog = gtk_dialog_new_with_buttons ( _("Enter exchange rate"),
- GTK_WINDOW ( window ),
+ GTK_WINDOW ( run.window ),
GTK_DIALOG_MODAL,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
diff --git a/src/gsb_currency_config.c b/src/gsb_currency_config.c
index 28dd0cb..ede0451 100644
--- a/src/gsb_currency_config.c
+++ b/src/gsb_currency_config.c
@@ -82,7 +82,6 @@ extern GtkWidget *main_vbox;
extern gint no_devise_totaux_categ;
extern gint no_devise_totaux_ib;
extern gint no_devise_totaux_tiers;
-extern GtkWidget *window;
/*END_EXTERN*/
GtkWidget *combo_devise_totaux_tiers;
@@ -945,7 +944,7 @@ gboolean gsb_currency_config_add_currency ( GtkWidget *button,
GtkTreeModel *model;
dialog = gtk_dialog_new_with_buttons ( _("Add a currency"),
- GTK_WINDOW ( window ),
+ GTK_WINDOW ( run.window ),
GTK_DIALOG_MODAL,
GTK_STOCK_CLOSE, 1,
NULL );
diff --git a/src/gsb_data_partial_balance.c b/src/gsb_data_partial_balance.c
index fbeca45..7df8c77 100644
--- a/src/gsb_data_partial_balance.c
+++ b/src/gsb_data_partial_balance.c
@@ -85,7 +85,6 @@ static void gsb_partial_balance_selectionne_cptes ( GtkWidget *tree_view,
/*START_EXTERN*/
extern gsb_real null_real;
-extern GtkWidget *window;
/*END_EXTERN*/
/* devise de base des soldes partiels de comptes ayant des devises différentes */
@@ -1523,14 +1522,14 @@ GtkWidget *gsb_partial_balance_create_dialog ( gint action, gint spin_value )
if ( action == 1 )
dialog = gtk_dialog_new_with_buttons ( _("Add a partial balance"),
- GTK_WINDOW ( window ),
+ GTK_WINDOW ( run.window ),
GTK_DIALOG_MODAL,
GTK_STOCK_CANCEL, 0,
GTK_STOCK_OK, 1,
NULL );
else
dialog = gtk_dialog_new_with_buttons ( _("Modify a partial balance"),
- GTK_WINDOW ( window ),
+ GTK_WINDOW ( run.window ),
GTK_DIALOG_MODAL,
GTK_STOCK_CANCEL, 0,
GTK_STOCK_OK, 1,
diff --git a/src/gsb_file.c b/src/gsb_file.c
index c151dc3..85f16d5 100644
--- a/src/gsb_file.c
+++ b/src/gsb_file.c
@@ -105,7 +105,6 @@ extern gchar **tab_noms_derniers_fichiers_ouverts;
extern GtkWidget *table_etat;
extern gchar *titre_fichier;
extern GtkWidget *tree_view_vbox;
-extern GtkWidget *window;
/*END_EXTERN*/
@@ -180,7 +179,7 @@ void gsb_file_new_gui ( void )
/* Create main widget. */
gsb_status_message ( _("Creating main window"));
- window_vbox_principale = g_object_get_data ( G_OBJECT ( window ), "window_vbox_principale" );
+ window_vbox_principale = g_object_get_data ( G_OBJECT ( run.window ), "window_vbox_principale" );
gtk_box_pack_start ( GTK_BOX ( window_vbox_principale), create_main_widget(), TRUE, TRUE, 0 );
/* create the model */
@@ -225,7 +224,7 @@ gboolean gsb_file_open_menu ( void )
GtkFileFilter * filter;
selection_fichier = gtk_file_chooser_dialog_new ( _("Open an accounts file"),
- GTK_WINDOW ( window ),
+ GTK_WINDOW ( run.window ),
GTK_FILE_CHOOSER_ACTION_OPEN,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OPEN, GTK_RESPONSE_OK,
@@ -805,7 +804,7 @@ static gint gsb_file_dialog_save ( void )
/* si le fichier était déjà locké et que force enregistrement n'est pas mis, */
/* on prévient ici */
- dialog = gtk_message_dialog_new ( GTK_WINDOW (window),
+ dialog = gtk_message_dialog_new ( GTK_WINDOW ( run.window ),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_NONE,
@@ -889,7 +888,7 @@ static gchar *gsb_file_dialog_ask_name ( void )
gint result;
dialog = gtk_file_chooser_dialog_new ( _("Name the accounts file"),
- GTK_WINDOW ( window ),
+ GTK_WINDOW ( run.window ),
GTK_FILE_CHOOSER_ACTION_SAVE,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_SAVE, GTK_RESPONSE_OK,
@@ -1141,7 +1140,7 @@ void gsb_file_save_remove_old_file ( gchar *filename )
dialog = gtk_dialog_new_with_buttons (
_("Delete file copy from a previous version of grisbi"),
- GTK_WINDOW ( window ),
+ GTK_WINDOW ( run.window ),
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_NO, GTK_RESPONSE_CANCEL,
GTK_STOCK_YES, GTK_RESPONSE_OK,
diff --git a/src/gsb_file_config.c b/src/gsb_file_config.c
index aeb0dd9..f7ae2a8 100644
--- a/src/gsb_file_config.c
+++ b/src/gsb_file_config.c
@@ -70,7 +70,6 @@ extern GtkWidget *main_hpaned;
extern struct conditional_message messages[];
extern gint nb_days_before_scheduled;
extern gchar *nom_fichier_comptes;
-extern GtkWidget *window;
/*END_EXTERN*/
/* global variable, see structures.h */
@@ -532,8 +531,8 @@ gboolean gsb_file_config_save_config ( void )
#endif
/* get the geometry */
- if ( GTK_WIDGET ( window) -> window )
- gtk_window_get_size ( GTK_WINDOW ( window ),
+ if ( GTK_WIDGET ( run.window ) -> window )
+ gtk_window_get_size ( GTK_WINDOW ( run.window ),
&conf.main_width, &conf.main_height);
else
{
@@ -1301,7 +1300,7 @@ static void gsb_file_config_remove_old_config_file ( gchar *filename )
gchar *tmpstr;
dialog = gtk_dialog_new_with_buttons ( _("Delete config file from a previous version"),
- GTK_WINDOW ( window ),
+ GTK_WINDOW ( run.window ),
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_NO, GTK_RESPONSE_CANCEL,
GTK_STOCK_YES, GTK_RESPONSE_OK,
@@ -1388,7 +1387,7 @@ gchar *gsb_config_get_old_conf_name ( void )
NULL );
dialog = gtk_dialog_new_with_buttons ( _("Choose a file"),
- GTK_WINDOW ( window ),
+ GTK_WINDOW ( run.window ),
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
diff --git a/src/gsb_form.c b/src/gsb_form.c
index 1ca6f5d..367b930 100644
--- a/src/gsb_form.c
+++ b/src/gsb_form.c
@@ -110,7 +110,6 @@ extern GdkColor calendar_entry_color;
extern gint mise_a_jour_liste_comptes_accueil;
extern GtkWidget *navigation_tree_view;
extern gsb_real null_real;
-extern GtkWidget *window;
/*END_EXTERN*/
/** label of the last statement */
@@ -3475,7 +3474,7 @@ gboolean gsb_form_escape_form ( void )
break;
case ORIGIN_VALUE_HOME:
- gtk_widget_grab_focus (window);
+ gtk_widget_grab_focus ( run.window );
break;
case ORIGIN_VALUE_SCHEDULED:
diff --git a/src/gsb_form_config.c b/src/gsb_form_config.c
index 51feb53..3303c62 100644
--- a/src/gsb_form_config.c
+++ b/src/gsb_form_config.c
@@ -81,7 +81,6 @@ static gboolean gsb_form_config_update_form_config ( gint account_number );
/*START_EXTERN*/
extern GtkWidget *form_transaction_part;
extern gint saved_allocation_size;
-extern GtkWidget *window;
/*END_EXTERN*/
diff --git a/src/gsb_scheduler_list.c b/src/gsb_scheduler_list.c
index f29eead..7e4180b 100644
--- a/src/gsb_scheduler_list.c
+++ b/src/gsb_scheduler_list.c
@@ -122,7 +122,6 @@ extern GtkWidget *scheduler_button_delete;
extern GtkWidget *scheduler_button_edit;
extern GtkWidget *scheduler_button_execute;
extern GdkColor split_background;
-extern GtkWidget *window;
/*END_EXTERN*/
@@ -1967,7 +1966,7 @@ gboolean gsb_scheduler_list_popup_custom_periodicity_dialog (void)
int i;
dialog = gtk_dialog_new_with_buttons ( _("Show scheduled transactions"),
- GTK_WINDOW ( window ),
+ GTK_WINDOW ( run.window ),
GTK_DIALOG_MODAL,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_APPLY, GTK_RESPONSE_OK,
diff --git a/src/gsb_select_icon.c b/src/gsb_select_icon.c
index 15c8238..d362de8 100644
--- a/src/gsb_select_icon.c
+++ b/src/gsb_select_icon.c
@@ -55,7 +55,6 @@ static gchar * gsb_select_icon_troncate_name_icon ( gchar *name_icon, gint trunc
/*END_STATIC*/
/*START_EXTERN*/
-extern GtkWidget *window;
/*END_EXTERN*/
static GtkWidget * dialog;
@@ -161,7 +160,7 @@ gchar * gsb_select_icon_create_window ( gchar *name_icon )
path_icon = g_path_get_dirname ( name_icon );
dialog = gtk_dialog_new_with_buttons ( _("Browse icons"),
- GTK_WINDOW ( window ),
+ GTK_WINDOW ( run.window ),
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_CANCEL,
GTK_RESPONSE_REJECT,
diff --git a/src/gsb_status.c b/src/gsb_status.c
index a418b06..04ac73e 100644
--- a/src/gsb_status.c
+++ b/src/gsb_status.c
@@ -34,6 +34,7 @@
/*START_INCLUDE*/
#include "gsb_status.h"
#include "main.h"
+#include "structures.h"
#include "utils.h"
/*END_INCLUDE*/
@@ -41,7 +42,6 @@
/*END_STATIC*/
/*START_EXTERN*/
-extern GtkWidget *window;
/*END_EXTERN*/
/** Status bar displayed in the bottom of Grisbi window. */
@@ -141,15 +141,16 @@ void gsb_status_wait ( gboolean force_update )
{
GdkWindow * current_window;
- gdk_window_set_cursor ( window -> window,
+ gdk_window_set_cursor ( run.window -> window,
gdk_cursor_new_for_display ( gdk_display_get_default ( ),
GDK_WATCH ) );
current_window = gdk_display_get_window_at_pointer ( gdk_display_get_default ( ),
NULL, NULL );
- if ( current_window && GDK_IS_WINDOW ( current_window ) &&
- current_window != window -> window )
+ if ( current_window && GDK_IS_WINDOW ( current_window )
+ &&
+ current_window != run.window -> window )
{
GdkWindow * parent = gdk_window_get_toplevel ( current_window );
@@ -181,10 +182,10 @@ void gsb_status_wait ( gboolean force_update )
*/
void gsb_status_stop_wait ( gboolean force_update )
{
- if ( ! window )
+ if ( ! run.window )
return;
- gdk_window_set_cursor ( window -> window, NULL );
+ gdk_window_set_cursor ( run.window -> window, NULL );
if ( tracked_window && gdk_window_is_visible ( tracked_window ) )
{
diff --git a/src/gsb_transactions_list.c b/src/gsb_transactions_list.c
index 0bc4775..1895a42 100644
--- a/src/gsb_transactions_list.c
+++ b/src/gsb_transactions_list.c
@@ -179,7 +179,6 @@ extern GtkWidget * navigation_tree_view;
extern GtkWidget *notebook_general;
extern GtkWidget *reconcile_sort_list_button;
extern gint tab_affichage_ope[TRANSACTION_LIST_ROWS_NB][CUSTOM_MODEL_VISIBLE_COLUMNS];
-extern GtkWidget *window;
/*END_EXTERN*/
/** All delete messages */
@@ -1746,7 +1745,7 @@ gint gsb_transactions_list_choose_reconcile ( gint account_number,
gint reconcile_number;
dialog = gtk_dialog_new_with_buttons ( _("Selection of a reconciliation"),
- GTK_WINDOW ( window ),
+ GTK_WINDOW ( run.window ),
GTK_DIALOG_MODAL,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
diff --git a/src/help.c b/src/help.c
index 5f01364..e8528b9 100644
--- a/src/help.c
+++ b/src/help.c
@@ -31,10 +31,11 @@
/*START_INCLUDE*/
#include "help.h"
-#include "utils.h"
-#include "utils_dates.h"
#include "gsb_plugins.h"
#include "gsb_select_icon.h"
+#include "structures.h"
+#include "utils.h"
+#include "utils_dates.h"
#include "utils_str.h"
/*END_INCLUDE*/
@@ -44,7 +45,6 @@ static void launch_url (GtkAboutDialog *about, const gchar * link, gpointer data
/*START_EXTERN*/
-extern GtkWidget *window;
/*END_EXTERN*/
@@ -197,7 +197,7 @@ NULL};
gtk_window_set_position ( GTK_WINDOW ( about ), GTK_WIN_POS_CENTER_ON_PARENT );
gtk_window_set_resizable ( GTK_WINDOW ( about ), TRUE );
gtk_window_set_modal ( GTK_WINDOW ( about ), TRUE );
- gtk_window_set_transient_for ( GTK_WINDOW ( about ), GTK_WINDOW ( window ) );
+ gtk_window_set_transient_for ( GTK_WINDOW ( about ), GTK_WINDOW ( run.window ) );
gtk_dialog_run ( GTK_DIALOG (about)) ;
diff --git a/src/import.c b/src/import.c
index a9d5b2e..1f0c28b 100644
--- a/src/import.c
+++ b/src/import.c
@@ -166,7 +166,6 @@ extern gint mise_a_jour_soldes_minimaux;
extern gint no_devise_totaux_categ;
extern gint no_devise_totaux_ib;
extern gint no_devise_totaux_tiers;
-extern GtkWidget *window;
/*END_EXTERN*/
/* recopie des types de transaction de la libofx en attendant une version propre */
@@ -1418,7 +1417,7 @@ gint gsb_import_add_currency ( struct struct_compte_importation * compte )
g_free ( tmpstr );
g_free ( tmpstr2 );
- dialog = gtk_message_dialog_new ( GTK_WINDOW ( window ),
+ dialog = gtk_message_dialog_new ( GTK_WINDOW ( run.window ),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_QUESTION,
GTK_BUTTONS_YES_NO,
@@ -2257,7 +2256,7 @@ void confirmation_enregistrement_ope_import ( struct struct_compte_importation *
tmpstr = g_strdup (
_("Confirmation of importation of transactions") );
dialog = gtk_dialog_new_with_buttons ( tmpstr,
- GTK_WINDOW ( window ),
+ GTK_WINDOW ( run.window ),
GTK_DIALOG_MODAL,
GTK_STOCK_SELECT_ALL, -12,
_("Unselect all"), -13,
@@ -3216,7 +3215,7 @@ void gsb_import_show_orphan_transactions ( GSList *orphan_list )
GSList *list_tmp;
dialog = gtk_dialog_new_with_buttons ( _("Orphaned transactions"),
- GTK_WINDOW ( window ),
+ GTK_WINDOW ( run.window ),
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_SELECT_ALL, GTK_RESPONSE_ACCEPT,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
@@ -4523,7 +4522,7 @@ gchar **gsb_import_by_rule_ask_filename ( gint rule )
return NULL;
dialog = gtk_dialog_new_with_buttons (_("Import a file with a rule"),
- GTK_WINDOW ( window ),
+ GTK_WINDOW ( run.window ),
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
@@ -4637,7 +4636,7 @@ gboolean gsb_import_by_rule_get_file ( GtkWidget *button,
rule = GPOINTER_TO_INT ( g_object_get_data (G_OBJECT (entry), "rule"));
enc = gsb_data_import_rule_get_charmap ( rule );
- filenames = gsb_import_create_file_chooser ( enc, window );
+ filenames = gsb_import_create_file_chooser ( enc, run.window );
if (!filenames)
return FALSE;
@@ -4894,7 +4893,7 @@ GtkWidget *gsb_import_progress_bar_affiche ( struct struct_compte_importation *i
progress = gtk_window_new ( GTK_WINDOW_TOPLEVEL );
gtk_window_set_decorated ( GTK_WINDOW ( progress ), FALSE );
- assistant = g_object_get_data ( G_OBJECT ( window ), "assistant" );
+ assistant = g_object_get_data ( G_OBJECT ( run.window ), "assistant" );
gtk_window_set_modal ( GTK_WINDOW ( assistant ), FALSE );
gtk_window_set_transient_for ( GTK_WINDOW ( progress ), GTK_WINDOW ( assistant ) );
gtk_window_set_modal ( GTK_WINDOW ( progress ), TRUE );
diff --git a/src/import_csv.c b/src/import_csv.c
index 8f49b22..7e19d92 100644
--- a/src/import_csv.c
+++ b/src/import_csv.c
@@ -43,7 +43,6 @@
/*START_EXTERN*/
extern GSList *liste_comptes_importes;
extern GSList *liste_comptes_importes_error;
-extern GtkWidget *window;
/*END_EXTERN*/
/*START_STATIC*/
diff --git a/src/imputation_budgetaire.c b/src/imputation_budgetaire.c
index be6745d..56db397 100644
--- a/src/imputation_budgetaire.c
+++ b/src/imputation_budgetaire.c
@@ -85,7 +85,6 @@ static struct metatree_hold_position *budgetary_hold_position;
/*START_EXTERN*/
extern MetatreeInterface * budgetary_interface;
extern GdkColor couleur_selection;
-extern GtkWidget *window;
/*END_EXTERN*/
@@ -384,7 +383,7 @@ void exporter_ib ( void )
gchar *nom_ib;
dialog = gtk_file_chooser_dialog_new ( _("Export the budgetary lines"),
- GTK_WINDOW ( window ),
+ GTK_WINDOW ( run.window ),
GTK_FILE_CHOOSER_ACTION_SAVE,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_SAVE, GTK_RESPONSE_OK,
@@ -433,7 +432,7 @@ void importer_ib ( void )
GtkFileFilter * filter;
dialog = gtk_file_chooser_dialog_new ( _("Import budgetary lines"),
- GTK_WINDOW ( window ),
+ GTK_WINDOW ( run.window ),
GTK_FILE_CHOOSER_ACTION_OPEN,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OPEN, GTK_RESPONSE_OK,
@@ -699,7 +698,7 @@ gboolean edit_budgetary_line ( GtkTreeView * view )
_("No budget defined") ));
dialog = gtk_dialog_new_with_buttons ( title ,
- GTK_WINDOW ( window ),
+ GTK_WINDOW ( run.window ),
GTK_DIALOG_MODAL,
GTK_STOCK_CANCEL, GTK_RESPONSE_NO,
GTK_STOCK_APPLY, GTK_RESPONSE_OK,
diff --git a/src/main.c b/src/main.c
index 32b7722..c9d52ab 100644
--- a/src/main.c
+++ b/src/main.c
@@ -95,17 +95,18 @@ static gboolean gsb_grisbi_init_app ( void );
static void gsb_grisbi_load_file_if_necessary ( cmdline_options *opt );
static gboolean gsb_grisbi_print_environment_var ( void );
static void gsb_grisbi_trappe_signal_sigsegv ( void );
-static void gsb_main_free_global_definitions ( void );
static void main_mac_osx ( int argc, char **argv );
static void main_linux ( int argc, char **argv );
static void main_win_32 ( int argc, char **argv );
static gboolean main_window_delete_event (GtkWidget *window, gpointer data);
static void main_window_destroy_event ( GObject* obj, gpointer data);
static void main_window_set_size_and_position ( void );
+static void gsb_main_struct_run_free ( void );
+static void gsb_main_struct_run_init ( void );
/*END_STATIC*/
/* Fenetre principale de grisbi */
-G_MODULE_EXPORT GtkWidget *window = NULL;
+/* G_MODULE_EXPORT GtkWidget *window = NULL; */
/*START_EXTERN*/
extern gchar *nom_fichier_comptes;
@@ -133,7 +134,9 @@ int main ( int argc, char **argv )
g_mem_set_vtable(glib_mem_profiler_table);
#endif
+ gsb_main_struct_run_init ( );
gsb_dirs_init ( );
+
#ifdef _WIN32
main_win_32 ( argc, argv );
#else
@@ -193,7 +196,7 @@ void main_linux ( int argc, char **argv )
gsb_grisbi_create_main_menu ( vbox );
main_window_set_size_and_position ( );
- gtk_widget_show ( window );
+ gtk_widget_show ( run.window );
#if IS_DEVELOPMENT_VERSION == 1
dialog_message ( "development-version", VERSION );
@@ -468,25 +471,25 @@ GtkWidget *gsb_grisbi_create_top_window ( void )
GtkWidget *statusbar;
/* create the toplevel window */
- window = gtk_window_new ( GTK_WINDOW_TOPLEVEL );
- g_signal_connect ( G_OBJECT ( window ),
+ run.window = gtk_window_new ( GTK_WINDOW_TOPLEVEL );
+ g_signal_connect ( G_OBJECT ( run.window ),
"delete_event",
G_CALLBACK ( main_window_delete_event ),
NULL);
- g_signal_connect ( G_OBJECT ( window ),
+ g_signal_connect ( G_OBJECT ( run.window ),
"destroy",
G_CALLBACK ( main_window_destroy_event ),
NULL);
- g_signal_connect ( G_OBJECT ( window ),
+ g_signal_connect ( G_OBJECT ( run.window ),
"window-state-event",
G_CALLBACK (gsb_grisbi_change_state_window),
NULL );
- gtk_window_set_policy ( GTK_WINDOW ( window ), TRUE, TRUE, FALSE );
+ gtk_window_set_policy ( GTK_WINDOW ( run.window ), TRUE, TRUE, FALSE );
/* create the main window : a vbox */
vbox = gtk_vbox_new ( FALSE, 0 );
- g_object_set_data ( G_OBJECT ( window ), "window_vbox_principale", vbox );
- gtk_container_add ( GTK_CONTAINER ( window ), vbox );
+ g_object_set_data ( G_OBJECT ( run.window ), "window_vbox_principale", vbox );
+ gtk_container_add ( GTK_CONTAINER ( run.window ), vbox );
g_signal_connect ( G_OBJECT ( vbox ),
"destroy",
G_CALLBACK ( gtk_widget_destroyed ),
@@ -535,16 +538,16 @@ void main_window_set_size_and_position ( void )
{
/* set the size of the window */
if ( conf.main_width && conf.main_height )
- gtk_window_set_default_size ( GTK_WINDOW ( window ), conf.main_width, conf.main_height );
+ gtk_window_set_default_size ( GTK_WINDOW ( run.window ), conf.main_width, conf.main_height );
else
- gtk_window_set_default_size ( GTK_WINDOW ( window ), 900, 600 );
+ gtk_window_set_default_size ( GTK_WINDOW ( run.window ), 900, 600 );
/* display window at position */
- gtk_window_move ( GTK_WINDOW ( window ), conf.root_x, conf.root_y );
+ gtk_window_move ( GTK_WINDOW ( run.window ), conf.root_x, conf.root_y );
/* set the full screen if necessary */
if ( conf.full_screen )
- gtk_window_maximize ( GTK_WINDOW ( window ) );
+ gtk_window_maximize ( GTK_WINDOW ( run.window ) );
}
@@ -648,17 +651,17 @@ gboolean gsb_grisbi_close ( void )
{
devel_debug (NULL);
/* sauvegarde la position de la fenetre principale */
- gtk_window_get_position ( GTK_WINDOW ( window ), &conf.root_x, &conf.root_y );
+ gtk_window_get_position ( GTK_WINDOW ( run.window ), &conf.root_x, &conf.root_y );
- if (! main_window_delete_event (window, NULL))
- gtk_widget_destroy ( window );
+ if ( !main_window_delete_event ( run.window, NULL ) )
+ gtk_widget_destroy ( run.window );
/* clean finish of the debug file */
if ( etat.debug_mode )
gsb_debug_finish_log ( );
- /* clean the initial vars */
- gsb_main_free_global_definitions ( );
+ /* clean the run.xxxx vars */
+ gsb_main_struct_run_free ( );
return FALSE;
}
@@ -683,7 +686,7 @@ static gboolean main_window_delete_event (GtkWidget *window, gpointer data)
static void main_window_destroy_event ( GObject* obj, gpointer data)
{
free_variables();
- window = NULL;
+ run.window = NULL;
gtk_main_quit();
}
@@ -756,7 +759,7 @@ gboolean gsb_main_set_grisbi_title ( gint account_number )
return_value = FALSE;
}
}
- gtk_window_set_title ( GTK_WINDOW ( window ), titre_grisbi );
+ gtk_window_set_title ( GTK_WINDOW ( run.window ), titre_grisbi );
gsb_main_page_update_homepage_title ( titre_grisbi );
@@ -850,15 +853,25 @@ gchar *gsb_main_get_print_dir_var ( void )
/**
- * libère la mémoire des définitions globales
+ * libère la mémoire de la structure run
*
*
*/
-void gsb_main_free_global_definitions ( void )
+void gsb_main_struct_run_free ( void )
{
+/* g_free ( run.xxxx ); */
}
+/**
+ * initialise la structure run
+ *
+ *
+ */
+void gsb_main_struct_run_init ( void )
+{
+ run.window = NULL;
+}
/* Local Variables: */
/* c-basic-offset: 4 */
/* End: */
diff --git a/src/menu.c b/src/menu.c
index 17f548a..448aaf2 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -79,7 +79,6 @@ extern GtkTreeModel * navigation_model;
extern gsize nb_derniers_fichiers_ouverts;
extern gint nb_max_derniers_fichiers_ouverts;
extern gchar **tab_noms_derniers_fichiers_ouverts;
-extern GtkWidget *window;
/*END_EXTERN*/
@@ -302,7 +301,7 @@ GtkWidget *init_menus ( GtkWidget *vbox )
gtk_action_group_add_actions (actions,
entries,
G_N_ELEMENTS ( entries ),
- (gpointer) window );
+ (gpointer) run.window );
gtk_action_group_add_radio_actions ( actions,
radio_entries,
@@ -323,7 +322,7 @@ GtkWidget *init_menus ( GtkWidget *vbox )
NULL );
#ifndef GTKOSXAPPLICATION
- gtk_window_add_accel_group ( GTK_WINDOW ( window ),
+ gtk_window_add_accel_group ( GTK_WINDOW ( run.window ),
gtk_ui_manager_get_accel_group ( ui_manager ) );
#endif /* GTKOSXAPPLICATION */
diff --git a/src/parametres.c b/src/parametres.c
index 118cc36..a724499 100644
--- a/src/parametres.c
+++ b/src/parametres.c
@@ -129,7 +129,6 @@ extern gchar *nom_fichier_comptes;
extern gint nb_days_before_scheduled;
extern gint nb_max_derniers_fichiers_ouverts;
extern GtkWidget *payee_tree;
-extern GtkWidget *window;
/*END_EXTERN*/
@@ -263,7 +262,7 @@ gboolean preferences ( gint page )
/* Create dialog */
fenetre_preferences = gtk_dialog_new_with_buttons (_("Grisbi preferences"),
- GTK_WINDOW ( window ),
+ GTK_WINDOW ( run.window ),
GTK_DIALOG_MODAL,
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
NULL );
@@ -949,7 +948,7 @@ GtkWidget *onglet_fichier ( void )
/* on passe par une fonction intermédiaire pour pallier à un bug
* du gtk_file_chooser_button_new qui donne le répertoire home
* lorsque l'on annule le choix du nouveau répertoire */
- dialog = utils_files_create_file_chooser ( window,
+ dialog = utils_files_create_file_chooser ( run.window,
_("Select/Create backup directory") );
button = gtk_file_chooser_button_new_with_dialog ( dialog );
diff --git a/src/plugins/openssl/openssl.c b/src/plugins/openssl/openssl.c
index 167513d..b05e84a 100644
--- a/src/plugins/openssl/openssl.c
+++ b/src/plugins/openssl/openssl.c
@@ -49,7 +49,6 @@
#endif
/*START_EXTERN*/
-SYMBOL_IMPORT GtkWidget *window;
/*END_EXTERN*/
#ifdef HAVE_SSL
@@ -318,7 +317,7 @@ gchar *gsb_file_util_ask_for_crypt_key ( gchar * file_name, gchar * additional_m
gint result;
dialog = gtk_dialog_new_with_buttons ( _("Grisbi password"),
- GTK_WINDOW ( window ),
+ GTK_WINDOW ( run.window ),
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
( encrypt ? _("Crypt file") : _("Decrypt file") ), GTK_RESPONSE_OK,
diff --git a/src/print_dialog_config.c b/src/print_dialog_config.c
index 80cd897..9886ada 100644
--- a/src/print_dialog_config.c
+++ b/src/print_dialog_config.c
@@ -34,6 +34,7 @@
/*START_INCLUDE*/
#include "print_dialog_config.h"
+#include "structures.h"
#include "erreur.h"
/*END_INCLUDE*/
@@ -41,7 +42,6 @@
/*END_STATIC*/
/*START_EXTERN*/
-extern GtkWidget *window;
/*END_EXTERN*/
static GtkPrintSettings *settings = NULL;
@@ -86,7 +86,7 @@ void print_dialog_config ( GCallback begin_callback,
res = gtk_print_operation_run (print, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG,
- GTK_WINDOW (window), NULL);
+ GTK_WINDOW ( run.window ), NULL);
if (res == GTK_PRINT_OPERATION_RESULT_APPLY)
{
diff --git a/src/structures.h b/src/structures.h
index 8e03daf..6c7a66c 100644
--- a/src/structures.h
+++ b/src/structures.h
@@ -2,6 +2,7 @@
#define _STRUCTURES_H (1)
#include <glib.h>
+#include <gtk/gtk.h>
/* fichier d'en tête structures.h */
/* contient presque toutes les structures du prog */
@@ -205,6 +206,9 @@ extern struct gsb_conf_t conf;
struct gsb_run_t
{
+ /* main window of grisbi */
+ GtkWidget *window;
+
/* initialisation variables */
gboolean new_crypted_file; /* 0 à l'exécution de init_variables () 1 si new crypted file*/
diff --git a/src/tiers_onglet.c b/src/tiers_onglet.c
index 3806a43..ddc3567 100644
--- a/src/tiers_onglet.c
+++ b/src/tiers_onglet.c
@@ -120,7 +120,6 @@ static struct conditional_message *overwrite_payee;
extern GdkColor couleur_selection;
extern GSList *liste_associations_tiers;
extern MetatreeInterface * payee_interface;
-extern GtkWidget *window;
/*END_EXTERN*/
enum payees_assistant_page
@@ -618,7 +617,7 @@ gboolean edit_payee ( GtkTreeView * view )
title = g_strdup_printf ( _("Properties for %s"), old_payee );
dialog = gtk_dialog_new_with_buttons ( title,
- GTK_WINDOW ( window ),
+ GTK_WINDOW ( run.window ),
GTK_DIALOG_MODAL,
GTK_STOCK_CANCEL, GTK_RESPONSE_NO,
GTK_STOCK_APPLY, GTK_RESPONSE_OK,
diff --git a/src/transaction_list.c b/src/transaction_list.c
index 400127c..7643425 100644
--- a/src/transaction_list.c
+++ b/src/transaction_list.c
@@ -79,7 +79,6 @@ extern GSList *orphan_child_transactions;
extern GdkColor split_background;
extern gint tab_affichage_ope[TRANSACTION_LIST_ROWS_NB][CUSTOM_MODEL_VISIBLE_COLUMNS];
extern GdkColor text_color[2];
-extern GtkWidget *window;
/*END_EXTERN*/
diff --git a/src/utils.c b/src/utils.c
index 78b2276..208974d 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -52,7 +52,6 @@
/*START_EXTERN*/
extern GdkColor couleur_selection;
extern GdkColor text_color[2];
-extern GtkWidget *window;
/*END_EXTERN*/
diff --git a/src/utils_buttons.c b/src/utils_buttons.c
index 30d090c..b6faa78 100644
--- a/src/utils_buttons.c
+++ b/src/utils_buttons.c
@@ -40,7 +40,6 @@
/*START_EXTERN*/
-extern GtkWidget *window;
/*END_EXTERN*/
diff --git a/src/utils_files.c b/src/utils_files.c
index 0b1dc2d..fb142d6 100644
--- a/src/utils_files.c
+++ b/src/utils_files.c
@@ -33,12 +33,13 @@
/*START_INCLUDE*/
#include "utils_files.h"
#include "dialog.h"
-#include "utils_file_selection.h"
#include "go-charmap-sel.h"
#include "gsb_dirs.h"
#include "gsb_file.h"
-#include "utils_str.h"
#include "gsb_file_config.h"
+#include "structures.h"
+#include "utils_file_selection.h"
+#include "utils_str.h"
#include "erreur.h"
/*END_INCLUDE*/
@@ -58,7 +59,6 @@ static void utils_files_go_charmap_sel_changed ( GtkWidget *go_charmap_sel,
/*START_EXTERN*/
extern gchar *charmap_imported;
-extern GtkWidget *window;
/*END_EXTERN*/
@@ -187,7 +187,7 @@ void browse_file ( GtkButton *button, gpointer data )
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (file_selector),
gsb_file_get_last_path ());
gtk_window_set_transient_for ( GTK_WINDOW ( file_selector ),
- GTK_WINDOW ( window ));
+ GTK_WINDOW ( run.window ));
gtk_window_set_modal ( GTK_WINDOW ( file_selector ), TRUE );
switch ( gtk_dialog_run ( GTK_DIALOG (file_selector)))
hooks/post-receive
--
grisbi
More information about the cvs
mailing list