diff --git a/ChangeLog b/ChangeLog index e59a6a84..ed7d562a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Fri Sep 23 20:46:40 2005 Soeren Sandmann + + * sysprof.c (build_gui): If the glade file doesn't exists pop up + an alert suggesting running 'make install' + + * sysprof.c: Remove some commented out code + Sat Sep 17 14:35:32 2005 Soeren Sandmann * Bump version numbers diff --git a/sysprof.c b/sysprof.c index 2b7284f0..39db5697 100644 --- a/sysprof.c +++ b/sysprof.c @@ -1353,7 +1353,10 @@ set_shadows (void) ); } -static void +#define GLADE_FILE DATADIR "/sysprof.glade" +#define ICON_FILE PIXMAPDIR "/sysprof-icon.png" + +static gboolean build_gui (Application *app) { GladeXML *xml; @@ -1361,12 +1364,24 @@ build_gui (Application *app) GtkTreeViewColumn *col; set_shadows (); + + if (!g_file_test (GLADE_FILE, G_FILE_TEST_EXISTS) || + !g_file_test (ICON_FILE, G_FILE_TEST_EXISTS)) + { + sorry (NULL, + "Sysprof was not compiled or installed correctly.\n" + "\n" + "Running \"make install\" may solve this problem.\n"); + + return FALSE; + } + - xml = glade_xml_new (DATADIR "/sysprof.glade", NULL, NULL); + xml = glade_xml_new (GLADE_FILE, NULL, NULL); /* Main Window */ app->main_window = glade_xml_get_widget (xml, "main_window"); - app->icon = gdk_pixbuf_new_from_file (PIXMAPDIR "/sysprof-icon.png", NULL); + app->icon = gdk_pixbuf_new_from_file (ICON_FILE, NULL); gtk_window_set_icon (GTK_WINDOW (app->main_window), app->icon); @@ -1475,6 +1490,8 @@ build_gui (Application *app) /* Statusbar */ queue_show_samples (app); + + return TRUE; } static Application * @@ -1539,7 +1556,8 @@ main (int argc, char **argv) g_timeout_add (10, on_timeout, app); #endif - build_gui (app); + if (!build_gui (app)) + return -1; update_sensitivity (app);