[grisbi-cvs] [SCM] grisbi branch, pbiava_integration_mac_osx, updated. upstream_version_0_7_3-20-g17eff91
Pierre Biava
nobody at users.sourceforge.net
Sat Sep 11 12:17:50 CEST 2010
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, pbiava_integration_mac_osx has been updated
via 17eff91b2d17af04315f3efa0f107fe268d9dd76 (commit)
via 327618fdcc2db8e88628b6e2f88d9f0006445b6e (commit)
from a376a83e2304a5918a0d84b239d821a6642687d3 (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 17eff91b2d17af04315f3efa0f107fe268d9dd76
Author: pbiava <pierre.biava at nerim.net>
Date: Sat Sep 11 12:17:03 2010 +0200
Adaptation for Mac OSX - version at Sept. 10, 2010
commit 327618fdcc2db8e88628b6e2f88d9f0006445b6e
Author: pbiava <pierre.biava at nerim.net>
Date: Thu Sep 9 20:26:09 2010 +0200
Fixed a bug in the backup when closing of grisbi
-----------------------------------------------------------------------
Changes:
diff --git a/src/grisbi_osx.c b/src/grisbi_osx.c
index 7005970..abdc23a 100644
--- a/src/grisbi_osx.c
+++ b/src/grisbi_osx.c
@@ -57,7 +57,7 @@ typedef struct {
GtkWindow *window;
GtkWidget *open_item;
GtkWidget *edit_item;
- GtkWidget *copy_item;
+ GtkWidget *view_item;
GtkWidget *quit_item;
GtkWidget *help_menu;
GtkWidget *about_item;
@@ -156,40 +156,6 @@ static void menu_cbdata_delete ( MenuCBData *datum )
*
*
* */
-static void menu_item_activate_cb ( GtkWidget *item, MenuCBData *datum )
-{
- gboolean visible;
- gboolean sensitive;
- MenuItems *items = g_object_get_qdata ( G_OBJECT ( datum->item ), menu_items_quark );
-
- if ( GTK_IS_WINDOW ( G_OBJECT ( datum->item ) ) )
- g_print ( "Item activated: %s:%s\n",
- gtk_window_get_title ( GTK_WINDOW ( datum->item ) ),
- datum->label);
- else
- g_print ("Item activated %s\n", datum->label);
-
- if ( !items )
- return;
-
- g_object_get ( G_OBJECT ( items->copy_item ),
- "visible", &visible,
- "sensitive", &sensitive,
- NULL);
-
- if ( item == items->open_item )
- {
- gtk_widget_set_sensitive ( items->copy_item, !gtk_widget_get_sensitive ( items->copy_item ) );
- }
-}
-
-
-/**
- *
- *
- *
- *
- * */
static void action_activate_cb ( GtkAction *action, gpointer data )
{
GtkWindow *window = data;
@@ -263,93 +229,9 @@ void grisbi_osx_app_active_cb ( GtkOSXApplication* app, gboolean* data )
*
*
* */
-gboolean grisbi_osx_app_should_quit_cb ( GtkOSXApplication *app, gpointer data )
-{
- static gboolean abort = TRUE;
- gboolean answer;
-
- answer = abort;
- abort = FALSE;
- g_print ("Application has been requested to quit, %s\n", answer ? "but no!" : "it's OK.");
-
- return answer;
-}
-
-
-/**
- *
- *
- *
- *
- * */
-void grisbi_osx_app_will_quit_cb ( GtkOSXApplication *app, gpointer data )
-{
- g_print ("Quitting Now\n");
-
- gtk_main_quit();
-}
-
-
-/**
- *
- *
- *
- *
- * */
-GtkWidget *grisbi_osx_create_window ( gchar *title )
-{
- gpointer dock = NULL;
- GtkWidget *window;
- GtkWidget *vbox;
- GtkWidget *statusbar;
- GtkWidget *menubar;
- GtkWidget *bbox;
- GtkWidget *button;
- GtkWidget *sep;
- MenuItems *items = menu_items_new ();
- GtkUIManager *mgr = gtk_ui_manager_new ();
- GtkActionGroup *actions = gtk_action_group_new ("TestActions");
- guint mergeid;
-
- GtkOSXApplication *theApp = g_object_new ( GTK_TYPE_OSX_APPLICATION, NULL );
-
- /* create the menus */
-/* menubar = grisbi_osx_init_menus ( window, vbox ); */
-
- /* unsensitive the necessaries menus */
-/* menus_sensitifs ( FALSE ); */
-
- /* charge les raccourcis claviers */
- gtk_accel_map_load ( C_PATH_CONFIG_ACCELS );
-
- /* set the last opened files */
- affiche_derniers_fichiers_ouverts ( );
-
- /* 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 );
- else
- gtk_window_set_default_size ( GTK_WINDOW ( window ), 900, 600 );
-
- /* display window at position */
- gtk_window_move ( GTK_WINDOW ( window ), conf.root_x, conf.root_y );
-
- /* set the full screen if necessary */
- if ( conf.full_screen )
- gtk_window_maximize ( GTK_WINDOW ( window ) );
-
- return window;
-}
-
-/**
- *
- *
- *
- *
- * */
-GtkWidget *grisbi_osx_init_menus ( GtkWidget *window, GtkWidget *vbox )
+GtkWidget *grisbi_osx_init_menus ( GtkWidget *window, GtkWidget *menubar )
{
- GtkWidget *menubar;
+ GtkWidget *widget;
GtkWidget *sep;
MenuItems *items;
GtkUIManager *ui_manager;
@@ -357,17 +239,19 @@ GtkWidget *grisbi_osx_init_menus ( GtkWidget *window, GtkWidget *vbox )
theApp = g_object_new ( GTK_TYPE_OSX_APPLICATION, NULL );
- menubar = init_menus ( vbox );
-
ui_manager = gsb_menu_get_ui_manager ( );
items = menu_items_new ( );
items->open_item = gtk_ui_manager_get_widget ( ui_manager, "/menubar/FileMenu/Open" );
items->edit_item = gtk_ui_manager_get_widget ( ui_manager, "/menubar/EditMenu" );
+ items->view_item = gtk_ui_manager_get_widget ( ui_manager, "/menubar/ViewMenu" );
items->help_menu = gtk_ui_manager_get_widget ( ui_manager, "/menubar/Help/Manual" );
items->quit_item = gtk_ui_manager_get_widget ( ui_manager, "/menubar/FileMenu/Quit" );
items->about_item = gtk_ui_manager_get_widget ( ui_manager, "/menubar/Help/About" );
items->preferences_item = gtk_ui_manager_get_widget ( ui_manager, "/menubar/EditMenu/Preferences" );
+
+ gtk_widget_set_sensitive ( items->preferences_item, FALSE );
+ gtk_widget_hide ( items->quit_item );
gtk_widget_hide ( menubar );
gtk_osxapplication_set_menu_bar ( theApp, GTK_MENU_SHELL ( menubar ) );
@@ -378,8 +262,8 @@ GtkWidget *grisbi_osx_init_menus ( GtkWidget *window, GtkWidget *vbox )
gtk_osxapplication_insert_app_menu_item ( theApp, sep, 1 );
gtk_osxapplication_insert_app_menu_item ( theApp, items->preferences_item, 2);
- sep = gtk_separator_menu_item_new();
- g_object_ref(sep);
+ sep = gtk_separator_menu_item_new ( );
+ g_object_ref ( sep );
gtk_osxapplication_insert_app_menu_item ( theApp, sep, 3 );
gtk_osxapplication_set_help_menu ( theApp, GTK_MENU_ITEM ( items->help_menu ) );
diff --git a/src/grisbi_osx.h b/src/grisbi_osx.h
index ef5d626..04a1599 100644
--- a/src/grisbi_osx.h
+++ b/src/grisbi_osx.h
@@ -11,9 +11,6 @@
/* START_DECLARATION */
void grisbi_osx_app_active_cb ( GtkOSXApplication* app, gboolean* data );
-GtkWidget *grisbi_osx_create_window ( gchar *title );
-gboolean grisbi_osx_app_should_quit_cb ( GtkOSXApplication *app, gpointer data );
-void grisbi_osx_app_will_quit_cb ( GtkOSXApplication *app, gpointer data );
GtkWidget *grisbi_osx_init_menus ( GtkWidget *window, GtkWidget *vbox );
/* END_DECLARATION */
diff --git a/src/gsb_file.c b/src/gsb_file.c
index 38ff76c..6b283ee 100644
--- a/src/gsb_file.c
+++ b/src/gsb_file.c
@@ -247,7 +247,7 @@ gboolean gsb_file_open_menu ( void )
{
GtkWidget *selection_fichier;
GtkFileFilter * filter;
-
+devel_debug (NULL);
selection_fichier = gtk_file_chooser_dialog_new ( _("Open an accounts file"),
GTK_WINDOW ( window ),
GTK_FILE_CHOOSER_ACTION_OPEN,
@@ -276,8 +276,9 @@ gboolean gsb_file_open_menu ( void )
{
gtk_widget_hide ( selection_fichier );
nom_fichier_comptes = file_selection_get_filename ( GTK_FILE_CHOOSER ( selection_fichier ) ) ;
- gsb_file_update_last_path (file_selection_get_last_directory ( GTK_FILE_CHOOSER ( selection_fichier),
- TRUE ));
+ gsb_file_update_last_path ( file_selection_get_last_directory (
+ GTK_FILE_CHOOSER ( selection_fichier),
+ TRUE ) );
gsb_file_open_file (nom_fichier_comptes);
}
break;
diff --git a/src/gsb_file_config.c b/src/gsb_file_config.c
index b4fa973..4078d97 100644
--- a/src/gsb_file_config.c
+++ b/src/gsb_file_config.c
@@ -663,7 +663,8 @@ gboolean gsb_file_config_save_config ( void )
gchar *string;
string = my_strdelimit ( conf.browser_command, "&", "\\e" );
- g_key_file_set_string ( config,
+ if ( string )
+ g_key_file_set_string ( config,
"General",
"Web",
string );
@@ -871,7 +872,8 @@ gboolean gsb_file_config_save_config ( void )
"Printer",
etat.print_config.printer );
- g_key_file_set_string ( config,
+ if ( etat.print_config.printer_name )
+ g_key_file_set_string ( config,
"Print config",
"Printer name",
etat.print_config.printer_name );
@@ -893,7 +895,8 @@ gboolean gsb_file_config_save_config ( void )
etat.print_config.orientation );
/* save the paper config */
- g_key_file_set_string ( config,
+ if ( etat.print_config.paper_config.name )
+ g_key_file_set_string ( config,
"Paper config",
"Name",
etat.print_config.paper_config.name );
diff --git a/src/main.c b/src/main.c
index 03f3137..eccc8e7 100644
--- a/src/main.c
+++ b/src/main.c
@@ -86,14 +86,14 @@ static gboolean gsb_grisbi_change_state_window ( GtkWidget *window,
static GtkWidget *gsb_grisbi_create_main_menu ( GtkWidget *vbox );
static GtkWidget *gsb_grisbi_create_top_window ( void );
static gboolean gsb_grisbi_init_app ( void );
-static gboolean gsb_grisbi_init_development_mode ( 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 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_destroy_event ( GObject* obj, gpointer data);
static void main_window_set_size_and_position ( void );
/*END_STATIC*/
@@ -116,12 +116,12 @@ extern gchar *nom_fichier_comptes;
*/
int main ( int argc, char **argv )
{
-#if GSB_GMEMPROFILE
- g_mem_set_vtable(glib_mem_profiler_table);
+#if IS_DEVELOPMENT_VERSION == 1
+ initialize_debugging ( );
#endif
-#if IS_DEVELOPMENT_VERSION == 1
- gsb_grisbi_init_development_mode ( );
+#if GSB_GMEMPROFILE
+ g_mem_set_vtable(glib_mem_profiler_table);
#endif
bindtextdomain (PACKAGE, LOCALEDIR);
@@ -131,6 +131,10 @@ int main ( int argc, char **argv )
/* Setup locale/gettext */
setlocale (LC_ALL, "");
+#if IS_DEVELOPMENT_VERSION == 1
+ gsb_grisbi_print_environment_var ( );
+#endif
+
#ifdef _WIN32
main_win_32 ( argc, argv );
#else
@@ -173,7 +177,7 @@ void main_linux ( int argc, char **argv )
/* initialise les données de l'application */
first_use = gsb_grisbi_init_app ( );
- /* create the toplevel window */
+ /* create the toplevel window and the main menu */
vbox = gsb_grisbi_create_top_window ( );
gsb_grisbi_create_main_menu ( vbox );
main_window_set_size_and_position ( );
@@ -249,15 +253,15 @@ void main_mac_osx ( int argc, char **argv )
&falseval);
g_signal_connect ( theApp,
"NSApplicationBlockTermination",
- G_CALLBACK ( grisbi_osx_app_should_quit_cb ),
+ G_CALLBACK ( gsb_grisbi_close ),
NULL);
g_signal_connect ( theApp,
"NSApplicationWillTerminate",
- G_CALLBACK ( grisbi_osx_app_will_quit_cb ),
+ G_CALLBACK ( main_window_destroy_event ),
NULL );
}
-
- menubar = grisbi_osx_init_menus ( window, vbox );
+ menubar = gsb_grisbi_create_main_menu ( vbox );
+ grisbi_osx_init_menus ( window, menubar );
main_window_set_size_and_position ( );
gtk_widget_show ( window );
@@ -308,6 +312,7 @@ void main_mac_osx ( int argc, char **argv )
void main_win_32 ( int argc, char **argv )
{
#ifdef _WIN32
+ GtkWidget *vbox;
gboolean first_use = FALSE;
cmdline_options opt;
gint status = CMDLINE_SYNTAX_OK; /* be optimistic ;-) */
@@ -337,9 +342,8 @@ void main_win_32 ( int argc, char **argv )
/* initialise les données de l'application */
first_use = gsb_grisbi_init_app ( );
- /* create the toplevel window */
- gsb_grisbi_create_top_window ( );
- vbox = g_object_get_data ( G_OBJECT ( window ), "window_vbox_principale" );
+ /* create the toplevel window and the main menu */
+ vbox = gsb_grisbi_create_top_window ( );
gsb_grisbi_create_main_menu ( vbox );
main_window_set_size_and_position ( );
@@ -374,21 +378,21 @@ void main_win_32 ( int argc, char **argv )
*
*
* */
-gboolean gsb_grisbi_init_development_mode ( void )
+gboolean gsb_grisbi_print_environment_var ( void )
{
- struct lconv *conv;
-
- initialize_debugging ( );
+ struct lconv *conv;
/* test local pour les nombres */
- conv = localeconv();
+ conv = localeconv();
- printf ("currency_symbol = %s\n"
- "mon_thousands_sep = \"%s\"\n"
- "mon_decimal_point = %s\n"
- "positive_sign = \"%s\"\n"
- "negative_sign = \"%s\"\n"
- "frac_digits = \"%d\"\n",
+ printf ("Variables d'environnement :\n\n" );
+ printf ("Currency\n"
+ "\tcurrency_symbol = %s\n"
+ "\tmon_thousands_sep = \"%s\"\n"
+ "\tmon_decimal_point = %s\n"
+ "\tpositive_sign = \"%s\"\n"
+ "\tnegative_sign = \"%s\"\n"
+ "\tfrac_digits = \"%d\"\n\n",
conv->currency_symbol,
g_locale_to_utf8 ( conv->mon_thousands_sep, -1, NULL, NULL, NULL ),
g_locale_to_utf8 ( conv->mon_decimal_point, -1, NULL, NULL, NULL ),
@@ -396,6 +400,16 @@ gboolean gsb_grisbi_init_development_mode ( void )
g_locale_to_utf8 ( conv->negative_sign, -1, NULL, NULL, NULL ),
conv->frac_digits );
+ printf ("Paths\n"
+ "\tC_GRISBIRC = %s\n"
+ "\tC_PATH_CONFIG = %s\n"
+ "\tC_PATH_CONFIG_ACCELS = %s\n"
+ "\tC_PATH_DATA_FILES = %s\n\n",
+ C_GRISBIRC,
+ C_PATH_CONFIG,
+ C_PATH_CONFIG_ACCELS,
+ C_PATH_DATA_FILES );
+
return FALSE;
}
@@ -641,11 +655,11 @@ gboolean gsb_grisbi_close ( void )
gtk_window_get_position ( GTK_WINDOW ( window ), &conf.root_x, &conf.root_y );
if (! main_window_delete_event (window, NULL))
- gtk_widget_destroy ( window );
+ gtk_widget_destroy ( window );
/* clean finish of the debug file */
if (etat.debug_mode && debug_file)
- fclose (debug_file);
+ fclose (debug_file);
return FALSE;
}
@@ -667,7 +681,7 @@ static gboolean main_window_delete_event (GtkWidget *window, gpointer data)
/**
* exit the gtk main loop when the main window is destroyed.
*/
-static void main_window_destroy_event( GObject* obj, gpointer data)
+static void main_window_destroy_event ( GObject* obj, gpointer data)
{
window = NULL;
gtk_main_quit();
diff --git a/src/menu.c b/src/menu.c
index e0535c8..ae444e9 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -122,7 +122,9 @@ static gchar *ui_manager_buffer =
" <separator/>"
" <menuitem name='NewAccount' action='NewAccountAction'/>"
" <menuitem name='RemoveAccount' action='RemoveAccountAction'/>"
+#ifndef GTKOSXAPPLICATION
" <separator/>"
+#endif
" <menuitem name='Preferences' action='PrefsAction'/>"
" </menu>"
" <menu name='ViewMenu' action='ViewMenuAction'>"
@@ -197,7 +199,7 @@ GtkWidget *init_menus ( GtkWidget *vbox )
{"CloseAction", GTK_STOCK_CLOSE, _("_Close"), NULL, NULL,
G_CALLBACK ( gsb_file_close ) },
{"QuitAction", GTK_STOCK_QUIT, _("_Quit"), NULL, NULL,
- G_CALLBACK ( gtk_main_quit ) },
+ G_CALLBACK ( gsb_grisbi_close ) },
/* Editmenu */
{"EditMenuAction", NULL, _("_Edit"), NULL, NULL, NULL },
diff --git a/src/parametres.c b/src/parametres.c
index b69cdf7..5e5ccb9 100644
--- a/src/parametres.c
+++ b/src/parametres.c
@@ -233,6 +233,9 @@ gboolean preferences ( gint page )
devel_debug_int (page);
+ if ( gsb_gui_navigation_get_current_page ( ) == - 1 )
+ return FALSE;
+
/* Create dialog */
fenetre_preferences = gtk_dialog_new_with_buttons (_("Grisbi preferences"),
GTK_WINDOW ( window ),
hooks/post-receive
--
grisbi
More information about the cvs
mailing list