diff --git a/ChangeLog b/ChangeLog index aa9c6acf..78cb630a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +Fri Apr 8 20:48:58 2005 Søren Sandmann + + * sysprof.c (build_gui): Load the icon, hook up "about" + activation. + + * sysprof.c (on_about_activated): New function. Show an about + dialog. + + * sysprof.c (struct Application): Add an icon field + + * TODO: Updates + + * sysprof-icon.png: Icon, drawn by Diana Fong + Tue Apr 5 23:01:02 2005 Søren Sandmann * binfile.c (read_symbols): Put back the weird loop, and stop diff --git a/README b/README index 096cc1de..653dcf5f 100644 --- a/README +++ b/README @@ -50,6 +50,7 @@ program "sysprof". Credits: + Diana Fong for the icon Kristian Høgsberg for the first port to the 2.6 kernel. Owen Taylor for the symbol lookup code in memprof diff --git a/TODO b/TODO index fd0170b5..e86fdc47 100644 --- a/TODO +++ b/TODO @@ -5,8 +5,6 @@ Before 1.0: - When the module is unloaded, kill all processes blocking in read * Interface - - hook up about box - - Need an icon - If the current profile has a name, display it in the title bar - Sould just install the kernel module if it running as root, pop up a dialog if not. Note we must be able to start without module now, @@ -23,7 +21,7 @@ Before 1.0: (ask for sucess/failure-stories in 0.9.x releases) - auto*? - .desktop file - - translations + - translation should be hooked up Before 1.2: @@ -162,6 +160,10 @@ Later: DONE: +- Need an icon + +- hook up about box + - Add busy cursors, - when you hit "Profile" - when you click something in the main list and we don't respond diff --git a/sysprof-icon.png b/sysprof-icon.png new file mode 100644 index 00000000..7325a21d Binary files /dev/null and b/sysprof-icon.png differ diff --git a/sysprof.c b/sysprof.c index 2f322c8f..96dc9fb1 100644 --- a/sysprof.c +++ b/sysprof.c @@ -17,6 +17,8 @@ /* FIXME */ #define _(a) a +#define APPLICATION_NAME "System Profiler" + typedef struct Application Application; typedef enum @@ -33,6 +35,7 @@ struct Application StackStash * stash; GtkWidget * main_window; + GdkPixbuf * icon; GtkTreeView * object_view; GtkTreeView * callers_view; @@ -676,6 +679,23 @@ ensure_profile (Application *app) update_sensitivity (app); } +static void +on_about_activated (GtkWidget *widget, gpointer data) +{ +#define OSLASH "\303\270" + Application *app = data; + const char *artist[] = { "Diana Fong", NULL } ; + + gtk_show_about_dialog (GTK_WINDOW (app->main_window), + "logo", app->icon, + "name", APPLICATION_NAME, +#if 0 + "copyright", "Copyright S"OSLASH"ren Sandmann", +#endif + "comments", "FIXME, write something informative here", + NULL); +} + static void on_profile_toggled (GtkWidget *widget, gpointer data) { @@ -714,7 +734,7 @@ sorry (GtkWidget *parent_window, GTK_BUTTONS_OK, message); free (message); - gtk_window_set_title (GTK_WINDOW (dialog), "System Profiler Warning"); + gtk_window_set_title (GTK_WINDOW (dialog), APPLICATION_NAME " Warning"); gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); @@ -1074,6 +1094,9 @@ build_gui (Application *app) /* Main Window */ app->main_window = glade_xml_get_widget (xml, "main_window"); + app->icon = gdk_pixbuf_new_from_file ("sysprof-icon.png", NULL); + + gtk_window_set_icon (GTK_WINDOW (app->main_window), app->icon); g_signal_connect (G_OBJECT (app->main_window), "delete_event", G_CALLBACK (on_delete), NULL); @@ -1104,6 +1127,9 @@ build_gui (Application *app) /* quit */ g_signal_connect (G_OBJECT (glade_xml_get_widget (xml, "quit")), "activate", G_CALLBACK (on_delete), NULL); + + g_signal_connect (G_OBJECT (glade_xml_get_widget (xml, "about")), "activate", + G_CALLBACK (on_about_activated), app); /* Tool items */