Load the icon, hook up "about" activation.

Fri Apr  8 20:48:58 2005  Søren Sandmann  <sandmann@redhat.com>

	* 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
This commit is contained in:
Søren Sandmann
2005-04-09 00:51:25 +00:00
committed by Søren Sandmann Pedersen
parent bda89efc68
commit 334f883d77
5 changed files with 47 additions and 4 deletions

View File

@ -1,3 +1,17 @@
Fri Apr 8 20:48:58 2005 Søren Sandmann <sandmann@redhat.com>
* 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 <sandmann@redhat.com> Tue Apr 5 23:01:02 2005 Søren Sandmann <sandmann@redhat.com>
* binfile.c (read_symbols): Put back the weird loop, and stop * binfile.c (read_symbols): Put back the weird loop, and stop

1
README
View File

@ -50,6 +50,7 @@ program "sysprof".
Credits: Credits:
Diana Fong for the icon
Kristian H<>gsberg for the first port to the 2.6 kernel. Kristian H<>gsberg for the first port to the 2.6 kernel.
Owen Taylor for the symbol lookup code in memprof Owen Taylor for the symbol lookup code in memprof

8
TODO
View File

@ -5,8 +5,6 @@ Before 1.0:
- When the module is unloaded, kill all processes blocking in read - When the module is unloaded, kill all processes blocking in read
* Interface * Interface
- hook up about box
- Need an icon
- If the current profile has a name, display it in the title bar - 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 - 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, 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) (ask for sucess/failure-stories in 0.9.x releases)
- auto*? - auto*?
- .desktop file - .desktop file
- translations - translation should be hooked up
Before 1.2: Before 1.2:
@ -162,6 +160,10 @@ Later:
DONE: DONE:
- Need an icon
- hook up about box
- Add busy cursors, - Add busy cursors,
- when you hit "Profile" - when you hit "Profile"
- when you click something in the main list and we don't respond - when you click something in the main list and we don't respond

BIN
sysprof-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@ -17,6 +17,8 @@
/* FIXME */ /* FIXME */
#define _(a) a #define _(a) a
#define APPLICATION_NAME "System Profiler"
typedef struct Application Application; typedef struct Application Application;
typedef enum typedef enum
@ -33,6 +35,7 @@ struct Application
StackStash * stash; StackStash * stash;
GtkWidget * main_window; GtkWidget * main_window;
GdkPixbuf * icon;
GtkTreeView * object_view; GtkTreeView * object_view;
GtkTreeView * callers_view; GtkTreeView * callers_view;
@ -676,6 +679,23 @@ ensure_profile (Application *app)
update_sensitivity (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 static void
on_profile_toggled (GtkWidget *widget, gpointer data) on_profile_toggled (GtkWidget *widget, gpointer data)
{ {
@ -714,7 +734,7 @@ sorry (GtkWidget *parent_window,
GTK_BUTTONS_OK, message); GTK_BUTTONS_OK, message);
free (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_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog); gtk_widget_destroy (dialog);
@ -1074,6 +1094,9 @@ build_gui (Application *app)
/* Main Window */ /* Main Window */
app->main_window = glade_xml_get_widget (xml, "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_signal_connect (G_OBJECT (app->main_window), "delete_event",
G_CALLBACK (on_delete), NULL); G_CALLBACK (on_delete), NULL);
@ -1104,6 +1127,9 @@ build_gui (Application *app)
/* quit */ /* quit */
g_signal_connect (G_OBJECT (glade_xml_get_widget (xml, "quit")), "activate", g_signal_connect (G_OBJECT (glade_xml_get_widget (xml, "quit")), "activate",
G_CALLBACK (on_delete), NULL); 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 */ /* Tool items */