[grisbi-cvs] [SCM] grisbi branch, pbiava_integration_mac_osx, updated. upstream_version_0_7_3-34-g2c6ee27

Pierre Biava nobody at users.sourceforge.net
Thu Sep 16 19:12:19 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  2c6ee27e9ca819d5fb2999c15e8d6325e97aac0f (commit)
      from  8227db285b1ce5f75810a4495c2ea3ed3cc53134 (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 2c6ee27e9ca819d5fb2999c15e8d6325e97aac0f
Author: pbiava <pierre.biava at nerim.net>
Date:   Thu Sep 16 19:11:36 2010 +0200

    Adaptation for Mac OSX - treatment directories LOCALEDIR PLUGINSDIR PIXMAPSDIR

-----------------------------------------------------------------------

Changes:
diff --git a/src/affichage.c b/src/affichage.c
index a45f5b3..1d32a3e 100644
--- a/src/affichage.c
+++ b/src/affichage.c
@@ -521,7 +521,7 @@ void change_logo_accueil ( GtkWidget * file_selector )
             }
             else
             {
-                if ( g_strcmp0 ( g_path_get_dirname ( chemin_logo ), PIXMAPS_DIR ) == 0 )
+                if ( g_strcmp0 ( g_path_get_dirname ( chemin_logo ), GRISBI_PIXMAPS_DIR ) == 0 )
                 {
                     gchar *name_logo;
 
@@ -585,7 +585,7 @@ gboolean modification_logo_accueil ( )
 
     if ( etat.is_pixmaps_dir )
         gtk_file_chooser_set_current_folder ( GTK_FILE_CHOOSER (
-                        file_selector ), PIXMAPS_DIR );
+                        file_selector ), GRISBI_PIXMAPS_DIR );
     else
         gtk_file_chooser_set_current_folder ( GTK_FILE_CHOOSER (
                         file_selector ), gsb_file_get_last_path () );
diff --git a/src/bet_finance_ui.c b/src/bet_finance_ui.c
index 1ec7db2..146a115 100644
--- a/src/bet_finance_ui.c
+++ b/src/bet_finance_ui.c
@@ -37,6 +37,7 @@
 #include "navigation.h"
 #include "print_tree_view_list.h"
 #include "structures.h"
+#include "utils.h"
 #include "utils_dates.h"
 #include "erreur.h"
 /*END_INCLUDE*/
@@ -984,7 +985,7 @@ void bet_finance_data_list_context_menu ( GtkWidget *tree_view, gint page_num )
 
     menu = gtk_menu_new ();
 
-    tmp_str = g_build_filename ( PIXMAPS_DIR, "ac_liability_16.png", NULL);
+    tmp_str = g_build_filename ( GRISBI_PIXMAPS_DIR, "ac_liability_16.png", NULL);
     image = gtk_image_new_from_file ( tmp_str );
     gtk_image_set_pixel_size ( GTK_IMAGE ( image ), GTK_ICON_SIZE_MENU );
     g_free ( tmp_str );
diff --git a/src/bet_tab.c b/src/bet_tab.c
index e139a23..03c8a85 100644
--- a/src/bet_tab.c
+++ b/src/bet_tab.c
@@ -61,6 +61,7 @@
 #include "structures.h"
 #include "traitement_variables.h"
 #include "transaction_list_select.h"
+#include "utils.h"
 #include "utils_dates.h"
 #include "erreur.h"
 /*END_INCLUDE*/
@@ -1462,7 +1463,7 @@ void bet_array_list_context_menu ( GtkWidget *tree_view )
     gtk_widget_show ( menu_item );
 
     /* Insert an account balance */
-    tmp_str = g_build_filename ( PIXMAPS_DIR, "ac_bank_16.png", NULL);
+    tmp_str = g_build_filename ( GRISBI_PIXMAPS_DIR, "ac_bank_16.png", NULL);
     image = gtk_image_new_from_file ( tmp_str );
     g_free ( tmp_str );
     menu_item = gtk_image_menu_item_new_with_label ( 
diff --git a/src/grisbi_osx.c b/src/grisbi_osx.c
index 491f860..41107e3 100644
--- a/src/grisbi_osx.c
+++ b/src/grisbi_osx.c
@@ -300,6 +300,50 @@ void grisbi_osx_app_update_menus_cb ( void )
  *
  *
  * */
+gchar *grisbi_osx_get_locale_dir ( void )
+{
+    gchar *dir;
+
+    dir = g_strconcat (gtk_osxapplication_get_resource_path (), "/share/locale", NULL );
+    g_print ("localedir = %s\n", dir );
+
+    return dir;
+}
+
+
+/**
+ *
+ *
+ *
+ *
+ * */
+gchar *grisbi_osx_get_pixmaps_dir ( void )
+{
+    gchar *dir;
+
+    dir = g_strconcat (gtk_osxapplication_get_resource_path (), "/share/pixmaps/grisbi", NULL );
+    g_print ("pixmapsdir = %s\n", dir );
+
+    return dir;
+}
+
+
+/**
+ *
+ *
+ *
+ *
+ * */
+gchar *grisbi_osx_get_plugins_dir ( void )
+{
+    gchar *dir;
+
+    dir = g_strconcat (gtk_osxapplication_get_resource_path (), "/lib/grisbi", NULL );
+    g_print ("pluginsdir = %s\n", dir );
+
+    return dir;
+}
+
 #endif /* GTKOSXAPPLICATION */
 /**
  *
diff --git a/src/grisbi_osx.h b/src/grisbi_osx.h
index 319ba80..6925540 100644
--- a/src/grisbi_osx.h
+++ b/src/grisbi_osx.h
@@ -12,6 +12,10 @@
 /* START_DECLARATION */
 void grisbi_osx_app_active_cb ( GtkOSXApplication* app, gboolean* data );
 void grisbi_osx_app_update_menus_cb ( void );
+gchar *grisbi_osx_get_locale_dir ( void );
+gchar *grisbi_osx_get_pixmaps_dir ( void );
+gchar *grisbi_osx_get_plugins_dir ( void );
+
 GtkWidget *grisbi_osx_init_menus ( GtkWidget *window, GtkWidget *vbox );
 /* END_DECLARATION */
 
diff --git a/src/gsb_archive_config.c b/src/gsb_archive_config.c
index bd8cbf8..2a755f0 100644
--- a/src/gsb_archive_config.c
+++ b/src/gsb_archive_config.c
@@ -207,7 +207,7 @@ GtkWidget *gsb_archive_config_create ( void )
 		       "clicked",
 		       G_CALLBACK (gsb_archive_config_delete_archive),
 		       archive_treeview );
-    tmpstr = g_build_filename ( PIXMAPS_DIR, "import.png", NULL );
+    tmpstr = g_build_filename ( GRISBI_PIXMAPS_DIR, "import.png", NULL );
     gtk_button_set_image ( GTK_BUTTON(button), 
 			   gtk_image_new_from_file ( tmpstr ) );
     g_free ( tmpstr );
@@ -224,7 +224,7 @@ GtkWidget *gsb_archive_config_create ( void )
 		       "clicked",
 		       G_CALLBACK (gsb_archive_config_destroy_archive),
 		       archive_treeview );
-    tmpstr = g_build_filename ( PIXMAPS_DIR, "import.png", NULL );
+    tmpstr = g_build_filename ( GRISBI_PIXMAPS_DIR, "import.png", NULL );
     gtk_button_set_image ( GTK_BUTTON(button), 
 			   gtk_image_new_from_file ( tmpstr ) );
     g_free ( tmpstr );
diff --git a/src/gsb_assistant.c b/src/gsb_assistant.c
index b1c7fa4..0a1d8f7 100644
--- a/src/gsb_assistant.c
+++ b/src/gsb_assistant.c
@@ -30,8 +30,9 @@
 
 /*START_INCLUDE*/
 #include "gsb_assistant.h"
+#include "structures.h"
+#include "utils.h"
 #include "utils_str.h"
-#include "include.h"
 /*END_INCLUDE*/
 
 /*START_STATIC*/
@@ -109,7 +110,7 @@ GtkWidget * gsb_assistant_new ( const gchar * title, const gchar * explanation,
     if (!image_filename)
         image_filename = "grisbi-logo.png";
 
-    tmpstr = g_build_filename ( PIXMAPS_DIR, image_filename, NULL);
+    tmpstr = g_build_filename ( GRISBI_PIXMAPS_DIR, image_filename, NULL);
     image = gtk_image_new_from_file ( tmpstr );
     g_free ( tmpstr );
     gtk_box_pack_start ( GTK_BOX(hbox), image, FALSE, FALSE, 0 );
diff --git a/src/gsb_currency.c b/src/gsb_currency.c
index dee1c02..1d4dfc5 100644
--- a/src/gsb_currency.c
+++ b/src/gsb_currency.c
@@ -321,7 +321,7 @@ gboolean gsb_currency_update_combobox_currency_list ( void )
         gint currency_number;
 
         currency_number = gsb_data_currency_get_no_currency (list_tmp -> data);
-        string = g_strconcat( PIXMAPS_DIR, C_DIRECTORY_SEPARATOR,
+        string = g_strconcat( GRISBI_PIXMAPS_DIR, C_DIRECTORY_SEPARATOR,
                     "flags", C_DIRECTORY_SEPARATOR,
                     gsb_data_currency_get_code_iso4217 (currency_number),
                     ".png", NULL );
@@ -1051,7 +1051,7 @@ GtkWidget *gsb_currency_make_combobox_exchange_dialog ( gint transaction_currenc
     combobox_store = gtk_list_store_new ( 3, G_TYPE_INT, GDK_TYPE_PIXBUF,
 						G_TYPE_STRING);
 
-    string = g_strconcat( PIXMAPS_DIR, C_DIRECTORY_SEPARATOR,
+    string = g_strconcat( GRISBI_PIXMAPS_DIR, C_DIRECTORY_SEPARATOR,
                         "flags", C_DIRECTORY_SEPARATOR,
                         gsb_data_currency_get_code_iso4217 (
                         transaction_currency_number ),
@@ -1066,7 +1066,7 @@ GtkWidget *gsb_currency_make_combobox_exchange_dialog ( gint transaction_currenc
                     2, gsb_data_currency_get_name ( transaction_currency_number ),
                     -1 );
 
-    string = g_strconcat( PIXMAPS_DIR, C_DIRECTORY_SEPARATOR,
+    string = g_strconcat( GRISBI_PIXMAPS_DIR, C_DIRECTORY_SEPARATOR,
                         "flags", C_DIRECTORY_SEPARATOR,
                         gsb_data_currency_get_code_iso4217 (
                         account_currency_number ),
diff --git a/src/gsb_currency_config.c b/src/gsb_currency_config.c
index 7164e52..2f50f59 100644
--- a/src/gsb_currency_config.c
+++ b/src/gsb_currency_config.c
@@ -558,7 +558,7 @@ void gsb_currency_append_currency_to_list ( GtkListStore *model,
     GtkTreeIter iter;
     gchar *string;
 
-    string = g_strconcat( PIXMAPS_DIR, C_DIRECTORY_SEPARATOR,
+    string = g_strconcat( GRISBI_PIXMAPS_DIR, C_DIRECTORY_SEPARATOR,
 			  "flags", C_DIRECTORY_SEPARATOR,
 			  gsb_data_currency_get_code_iso4217 (currency_number),
 			  ".png", NULL );
@@ -1243,7 +1243,7 @@ void gsb_currency_config_fill_popup_list ( GtkTreeView * tree_view,
 	    GdkPixbuf * pixbuf;
 	    gchar *string;
 
-	    string = g_build_filename ( PIXMAPS_DIR,
+	    string = g_build_filename ( GRISBI_PIXMAPS_DIR,
 					"flags",
 					currency -> flag_filename,
 					NULL );
diff --git a/src/gsb_data_account.c b/src/gsb_data_account.c
index f2d4bbb..6708bd5 100644
--- a/src/gsb_data_account.c
+++ b/src/gsb_data_account.c
@@ -43,6 +43,7 @@
 #include "navigation.h"
 #include "structures.h"
 #include "traitement_variables.h"
+#include "utils.h"
 #include "utils_dates.h"
 #include "utils_str.h"
 #include "erreur.h"
@@ -2691,7 +2692,7 @@ gchar *gsb_data_account_get_account_standard_pixbuf_filename ( kind_account acco
         break;
     }
 
-    filename = g_build_filename ( PIXMAPS_DIR, account_icon, NULL );
+    filename = g_build_filename ( GRISBI_PIXMAPS_DIR, account_icon, NULL );
 
     return filename;
 }
diff --git a/src/gsb_file_load.c b/src/gsb_file_load.c
index eacf39c..d207880 100644
--- a/src/gsb_file_load.c
+++ b/src/gsb_file_load.c
@@ -79,6 +79,7 @@
 #include "gsb_real.h"
 #include "gsb_currency_config.h"
 #include "gsb_data_report.h"
+#include "utils.h"
 /*END_INCLUDE*/
 
 /*START_STATIC*/
@@ -875,9 +876,9 @@ void gsb_file_load_general_part ( const gchar **attribute_names,
             gchar *chemin_logo = NULL;
 
             if ( etat.name_logo )
-                chemin_logo = g_build_filename  ( PIXMAPS_DIR, etat.name_logo, NULL );
+                chemin_logo = g_build_filename  ( GRISBI_PIXMAPS_DIR, etat.name_logo, NULL );
             else
-                chemin_logo = g_build_filename  ( PIXMAPS_DIR, "grisbi-logo.png", NULL );
+                chemin_logo = g_build_filename  ( GRISBI_PIXMAPS_DIR, "grisbi-logo.png", NULL );
             if ( chemin_logo )
                 pixbuf = gdk_pixbuf_new_from_file ( chemin_logo, NULL );
             if ( chemin_logo && strlen ( chemin_logo ) > 0 )
diff --git a/src/gsb_plugins.h b/src/gsb_plugins.h
index 41b3360..4c80108 100644
--- a/src/gsb_plugins.h
+++ b/src/gsb_plugins.h
@@ -2,6 +2,7 @@
 #define GSB_PLUGINS_H
 
 /* START_INCLUDE_H */
+#include "structures.h"
 /* END_INCLUDE_H */
 
 
diff --git a/src/gsb_scheduler_list.c b/src/gsb_scheduler_list.c
index 70d510e..9bf86fb 100644
--- a/src/gsb_scheduler_list.c
+++ b/src/gsb_scheduler_list.c
@@ -2030,7 +2030,7 @@ void popup_scheduled_context_menu ( void )
     /* Display/hide comments */
     menu_item = gtk_image_menu_item_new_with_label ( _("Displays/Cache comments") );
     gtk_image_menu_item_set_image ( GTK_IMAGE_MENU_ITEM ( menu_item ),
-                        gtk_image_new_from_file ( g_build_filename ( PIXMAPS_DIR,
+                        gtk_image_new_from_file ( g_build_filename ( GRISBI_PIXMAPS_DIR,
                         "comments.png", NULL ) ) );
     g_signal_connect_swapped ( G_OBJECT ( menu_item ),
                         "activate",
diff --git a/src/gsb_select_icon.c b/src/gsb_select_icon.c
index d2090a3..b9ea50c 100644
--- a/src/gsb_select_icon.c
+++ b/src/gsb_select_icon.c
@@ -27,7 +27,8 @@
 #include "gsb_select_icon.h"
 #include "dialog.h"
 #include "utils_str.h"
-#include "include.h"
+#include "structures.h"
+#include "utils.h"
 #include "erreur.h"
 /*END_INCLUDE*/
 
@@ -249,9 +250,9 @@ GtkWidget * gsb_select_icon_create_entry_text ( gchar * name_icon )
         devel_debug ( "combo n'existe pas" );
         store = gtk_list_store_new ( 2, G_TYPE_STRING, G_TYPE_INT );
         gtk_list_store_append (store, &iter);
-        if ( g_strcmp0 ( PIXMAPS_DIR, path_icon ) != 0 )
+        if ( g_strcmp0 ( GRISBI_PIXMAPS_DIR, path_icon ) != 0 )
         {
-            gtk_list_store_set (store, &iter, 0, PIXMAPS_DIR, -1);
+            gtk_list_store_set (store, &iter, 0, GRISBI_PIXMAPS_DIR, -1);
             gtk_list_store_prepend (store, &iter);
         }
         gtk_list_store_set (store, &iter, 0, path_icon, -1);
diff --git a/src/main.c b/src/main.c
index ea6ccb7..36912b5 100644
--- a/src/main.c
+++ b/src/main.c
@@ -124,12 +124,16 @@ int main ( int argc, char **argv )
     g_mem_set_vtable(glib_mem_profiler_table);
 #endif
 
-    bindtextdomain (PACKAGE, LOCALEDIR);
-    bind_textdomain_codeset (PACKAGE, "UTF-8");
-    textdomain (PACKAGE);
+#ifndef GTKOSXAPPLICATION
+    #define GRISBI_LOCALEDIR LOCALEDIR
+
+    bindtextdomain ( PACKAGE, GRISBI_LOCALEDIR );
+    bind_textdomain_codeset ( PACKAGE, "UTF-8" );
+    textdomain ( PACKAGE );
 
     /* Setup locale/gettext */
     setlocale (LC_ALL, "");
+#endif /* !GTKOSXAPPLICATION */
 
 #if IS_DEVELOPMENT_VERSION == 1
     gsb_grisbi_print_environment_var ( );
@@ -216,11 +220,12 @@ void main_mac_osx ( int argc, char **argv )
 #ifdef GTKOSXAPPLICATION
     GtkWidget *vbox;
     GtkWidget *menubar;
-    gboolean first_use = FALSE;
+    GdkPixbuf *pixbuf;
     cmdline_options  opt;
+    const gchar *locale_dir;
+    gboolean first_use = FALSE;
     gint status = CMDLINE_SYNTAX_OK;
     GtkOSXApplication *theApp;
-    GdkPixbuf *pixbuf;
 
     devel_debug ("main_mac_osx");
 
@@ -229,6 +234,14 @@ void main_mac_osx ( int argc, char **argv )
     /* init the app */
     theApp = g_object_new ( GTK_TYPE_OSX_APPLICATION, NULL );
 
+    locale_dir = grisbi_osx_get_locale_dir ( );
+    bindtextdomain ( PACKAGE, locale_dir );
+    bind_textdomain_codeset ( PACKAGE, "UTF-8" );
+    textdomain ( PACKAGE );
+
+    /* Setup locale/gettext */
+    setlocale (LC_ALL, "");
+
     /* on commence par détourner le signal SIGSEGV */
     gsb_grisbi_trappe_signal_sigsegv ( );
 
@@ -270,7 +283,7 @@ void main_mac_osx ( int argc, char **argv )
 #if IS_DEVELOPMENT_VERSION == 1
     dialog_message ( "development-version", VERSION );
 #endif
-
+    
     gsb_grisbi_load_file_if_necessary ( &opt );
 
     if ( first_use && !nom_fichier_comptes )
@@ -280,28 +293,11 @@ void main_mac_osx ( int argc, char **argv )
 
     pixbuf = gsb_select_icon_get_default_logo_pixbuf ( );
     if ( pixbuf )
-    {
         gtk_osxapplication_set_dock_icon_pixbuf ( theApp, pixbuf );
-        printf ("pixbuf existe\n");
-    }
-    else
-        printf ("pixbuf n'existe pas\n");
-
-    if ( quartz_application_get_bundle_id ( ) )
-        gtk_osxapplication_set_dock_icon_resource  ( theApp, "grisbi_logo", "png", "share/pixmaps/grisbi" );
 
     gtk_osxapplication_set_use_quartz_accelerators ( theApp, TRUE );
 
     gtk_osxapplication_ready ( theApp );
-    {
-        const gchar *id;
-
-        id = quartz_application_get_bundle_id ( );
-        if ( id != NULL )
-        {
-            g_print ("Error! Bundle Has ID %s\n", id);
-        }
-    }
 
     gtk_main ();
 
@@ -414,14 +410,20 @@ gboolean gsb_grisbi_print_environment_var ( void )
             "\tC_PATH_CONFIG = %s\n"
             "\tC_PATH_CONFIG_ACCELS = %s\n"
             "\tC_PATH_DATA_FILES = %s\n"
-            "\tPLUGINS_DIR = %s\n"
-            "\tPIXMAPS_DIR = %s\n\n",
+            "\tGRISBI_LOCALEDIR = %s\n"
+            "\tGRISBI_PLUGINS_DIR = %s\n"
+            "\tGRISBI_PIXMAPS_DIR = %s\n\n",
             C_GRISBIRC,
             C_PATH_CONFIG,
             C_PATH_CONFIG_ACCELS,
             C_PATH_DATA_FILES,
-            PLUGINS_DIR,
-            PIXMAPS_DIR );
+#ifdef GTKOSXAPPLICATION
+            grisbi_osx_get_locale_dir ( ),
+#else
+            GRISBI_LOCALEDIR,
+#endif
+            GRISBI_PLUGINS_DIR,
+            GRISBI_PIXMAPS_DIR );
 
     return FALSE;
 }
@@ -439,11 +441,11 @@ gboolean gsb_grisbi_init_app ( void )
     gchar *string;
 
 #ifdef HAVE_PLUGINS
-    gsb_plugins_scan_dir ( PLUGINS_DIR );
+    gsb_plugins_scan_dir ( GRISBI_PLUGINS_DIR );
 #endif
 
     /* create the icon of grisbi (set in the panel of gnome or other) */
-    string = g_build_filename ( PIXMAPS_DIR, "grisbi-logo.png", NULL );
+    string = g_build_filename ( GRISBI_PIXMAPS_DIR, "grisbi-logo.png", NULL );
     if ( g_file_test ( string, G_FILE_TEST_EXISTS ) )
         gtk_window_set_default_icon_from_file ( string, NULL );
     g_free (string);
diff --git a/src/navigation.c b/src/navigation.c
index c01339f..8297851 100644
--- a/src/navigation.c
+++ b/src/navigation.c
@@ -55,9 +55,9 @@
 #include "transaction_list_sort.h"
 #include "utils_str.h"
 #include "fenetre_principale.h"
-#include "include.h"
 #include "erreur.h"
 #include "structures.h"
+#include "utils.h"
 /*END_INCLUDE*/
 
 /*START_STATIC*/
@@ -242,7 +242,7 @@ GtkWidget * create_navigation_pane ( void )
     gtk_tree_view_append_column ( GTK_TREE_VIEW ( navigation_tree_view ), 
 				  GTK_TREE_VIEW_COLUMN ( column ) );
     /* Account list */
-    tmpstr = g_build_filename ( PIXMAPS_DIR, "ac_home.png", NULL );
+    tmpstr = g_build_filename ( GRISBI_PIXMAPS_DIR, "ac_home.png", NULL );
     pixbuf = gdk_pixbuf_new_from_file ( tmpstr , NULL );
     g_free ( tmpstr );
     gtk_tree_store_append(GTK_TREE_STORE(navigation_model), &account_iter, NULL);
@@ -259,7 +259,7 @@ GtkWidget * create_navigation_pane ( void )
     create_account_list ( GTK_TREE_MODEL(navigation_model) );
 
     /* Scheduler */
-    tmpstr = g_build_filename( PIXMAPS_DIR, "scheduler.png", NULL );
+    tmpstr = g_build_filename( GRISBI_PIXMAPS_DIR, "scheduler.png", NULL );
     pixbuf = gdk_pixbuf_new_from_file ( tmpstr , NULL );
     g_free ( tmpstr );
     gtk_tree_store_append(GTK_TREE_STORE(navigation_model), &iter, NULL);
@@ -275,7 +275,7 @@ GtkWidget * create_navigation_pane ( void )
 		       -1 );
 
     /* Payees */
-    tmpstr =  g_build_filename( PIXMAPS_DIR, "payees.png", NULL );
+    tmpstr =  g_build_filename( GRISBI_PIXMAPS_DIR, "payees.png", NULL );
     pixbuf = gdk_pixbuf_new_from_file ( tmpstr , NULL );
     g_free ( tmpstr );
     gtk_tree_store_append(GTK_TREE_STORE(navigation_model), &iter, NULL);
@@ -291,7 +291,7 @@ GtkWidget * create_navigation_pane ( void )
 		       -1 );
 
     /* Credits simulator */
-    tmpstr = g_build_filename( PIXMAPS_DIR, "ac_liability.png", NULL );
+    tmpstr = g_build_filename( GRISBI_PIXMAPS_DIR, "ac_liability.png", NULL );
     pixbuf = gdk_pixbuf_new_from_file ( tmpstr , NULL );
     g_free ( tmpstr );
     gtk_tree_store_append(GTK_TREE_STORE(navigation_model), &iter, NULL);
@@ -307,7 +307,7 @@ GtkWidget * create_navigation_pane ( void )
 		       -1 );
 
     /* Categories */
-    tmpstr = g_build_filename( PIXMAPS_DIR, "categories.png", NULL );
+    tmpstr = g_build_filename( GRISBI_PIXMAPS_DIR, "categories.png", NULL );
     pixbuf = gdk_pixbuf_new_from_file ( tmpstr , NULL );
     g_free ( tmpstr );
     gtk_tree_store_append(GTK_TREE_STORE(navigation_model), &iter, NULL);
@@ -323,7 +323,7 @@ GtkWidget * create_navigation_pane ( void )
 		       -1 );
 
     /* Budgetary lines */
-    tmpstr = g_build_filename( PIXMAPS_DIR, "budgetary_lines.png", NULL );
+    tmpstr = g_build_filename( GRISBI_PIXMAPS_DIR, "budgetary_lines.png", NULL );
     pixbuf = gdk_pixbuf_new_from_file ( tmpstr , NULL );
     g_free ( tmpstr );
     gtk_tree_store_append(GTK_TREE_STORE(navigation_model), &iter, NULL);
@@ -339,7 +339,7 @@ GtkWidget * create_navigation_pane ( void )
 		       -1 );
 
     /* Reports */
-    tmpstr = g_build_filename( PIXMAPS_DIR, "reports.png", NULL );
+    tmpstr = g_build_filename( GRISBI_PIXMAPS_DIR, "reports.png", NULL );
     pixbuf = gdk_pixbuf_new_from_file ( tmpstr , NULL );
     g_free ( tmpstr );
     gtk_tree_store_append(GTK_TREE_STORE(navigation_model), &reports_iter, NULL);
diff --git a/src/parse_cmdline.c b/src/parse_cmdline.c
index b8285aa..b6f4331 100644
--- a/src/parse_cmdline.c
+++ b/src/parse_cmdline.c
@@ -26,6 +26,8 @@
 #include "main.h"
 #include "utils_str.h"
 #include "include.h"
+#include "structures.h"
+#include "utils.h"
 /*END_INCLUDE*/
 
 /*START_STATIC*/
@@ -166,7 +168,7 @@ gboolean  parse_options(int argc, char **argv, cmdline_options *pOpt, gint* pErr
 void show_version(void)
 {
 #ifdef HAVE_PLUGINS
-    gsb_plugins_scan_dir ( PLUGINS_DIR );
+    gsb_plugins_scan_dir ( GRISBI_PLUGINS_DIR );
 #endif
 
     g_print(N_("Grisbi version %s, %s\n"), VERSION, gsb_plugin_get_list());
diff --git a/src/structures.h b/src/structures.h
index d2fc7fa..ae37058 100644
--- a/src/structures.h
+++ b/src/structures.h
@@ -29,6 +29,10 @@
 
 #define CSV_MAX_TOP_LINES 10	/** How many lines to show in CSV preview.  */
 
+/* definition des variables PIXMAPS_DIR PLUGINS_DIR */
+#define GRISBI_PIXMAPS_DIR (utils_get_pixmaps_dir ( ) )
+#define GRISBI_PLUGINS_DIR (utils_get_plugins_dir ( ) ) 
+
 /** structure etat
  * variables contenant juste 0 ou 1
  * FIXME : scinder cette structure en 3 parties :
@@ -61,7 +65,7 @@ struct gsb_etat_t
 
     /* Fonts & logo */
     gint utilise_logo;
-    gboolean is_pixmaps_dir;        /* TRUE if path_icon == PIXMAPS_DIR */
+    gboolean is_pixmaps_dir;        /* TRUE if path_icon == GRISBI_PIXMAPS_DIR */
     gchar *name_logo;
     gint display_grisbi_title;      /* selection du titre principal de grisbi */
     
diff --git a/src/utils.c b/src/utils.c
index 21a9ee4..baf1dac 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -36,6 +36,10 @@
 #include "erreur.h"
 /*END_INCLUDE*/
 
+#ifdef GTKOSXAPPLICATION
+#include "grisbi_osx.h"
+#endif  /* GTKOSXAPPLICATION */
+
 /*START_STATIC*/
 /*END_STATIC*/
 
@@ -326,7 +330,7 @@ GtkWidget *new_vbox_with_title_and_icon ( gchar * title,
     /* Icon */
     if ( image_filename )
     {
-	gchar* tmpstr = g_build_filename (PIXMAPS_DIR,
+	gchar* tmpstr = g_build_filename ( GRISBI_PIXMAPS_DIR,
 					  image_filename, NULL);
 	image = gtk_image_new_from_file (tmpstr);
 	g_free(tmpstr);
@@ -484,6 +488,38 @@ gchar *get_gtk_run_version ( void )
 	return version;
 }
 
+
+/**
+ *
+ *
+ *
+ *
+ * */
+gchar *utils_get_pixmaps_dir ( void )
+{
+#ifdef GTKOSXAPPLICATION
+    return grisbi_osx_get_pixmaps_dir ( );
+#else
+    return PIXMAPS_DIR;
+#endif
+}
+
+
+/**
+ *
+ *
+ *
+ *
+ * */
+gchar *utils_get_plugins_dir ( void )
+{
+#ifdef GTKOSXAPPLICATION
+    return grisbi_osx_get_plugins_dir ( );
+#else
+    return PLUGINS_DIR;
+#endif
+}
+
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */
diff --git a/src/utils.h b/src/utils.h
index 85be125..0103d1e 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -25,5 +25,8 @@ gboolean sens_desensitive_pointeur ( GtkWidget *bouton,
 gboolean sensitive_widget ( gpointer object,
                         GtkWidget *widget );
 void update_ecran ( void );
+gchar *utils_get_pixmaps_dir ( void );
+gchar *utils_get_plugins_dir ( void );
+
 /* END_DECLARATION */
 #endif
diff --git a/src/utils_buttons.c b/src/utils_buttons.c
index 4e57468..20fe79c 100644
--- a/src/utils_buttons.c
+++ b/src/utils_buttons.c
@@ -26,6 +26,8 @@
 /*START_INCLUDE*/
 #include "utils_buttons.h"
 #include "gsb_automem.h"
+#include "structures.h"
+#include "utils.h"
 /*END_INCLUDE*/
 
 /*START_STATIC*/
@@ -94,13 +96,13 @@ GtkWidget * new_image_label ( GsbButtonStyle style, const gchar * image_name, co
     /* Define image */
     if ( style == GSB_BUTTON_ICON || style == GSB_BUTTON_BOTH )
     {
-	image = gtk_image_new_from_file (g_build_filename (PIXMAPS_DIR,
+	image = gtk_image_new_from_file (g_build_filename ( GRISBI_PIXMAPS_DIR,
 							   image_name, NULL));
 	gtk_box_pack_start ( GTK_BOX(vbox), image, TRUE, TRUE, 0 );
     }
     else if (style == GSB_BUTTON_BOTH_HORIZ )
     {
-        image = gtk_image_new_from_file (g_build_filename (PIXMAPS_DIR,
+        image = gtk_image_new_from_file (g_build_filename ( GRISBI_PIXMAPS_DIR,
 							   image_name, NULL));
         gtk_box_pack_start ( GTK_BOX(hbox), image, TRUE, TRUE, 0 );
     }


hooks/post-receive
-- 
grisbi


More information about the cvs mailing list