If the glade file doesn't exists pop up an alert suggesting running 'make

Fri Sep 23 20:46:40 2005  Soeren Sandmann  <sandmann@redhat.com>

	* 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
This commit is contained in:
Soeren Sandmann
2005-09-24 00:47:22 +00:00
committed by Søren Sandmann Pedersen
parent 15baed047a
commit 03feea82e4
2 changed files with 29 additions and 4 deletions

View File

@ -1,3 +1,10 @@
Fri Sep 23 20:46:40 2005 Soeren Sandmann <sandmann@redhat.com>
* 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 <sandmann@redhat.com>
* Bump version numbers

View File

@ -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);