From 334f883d7794de7f34a9024f2feb2d1c1946a49e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Sandmann?= Date: Sat, 9 Apr 2005 00:51:25 +0000 Subject: [PATCH] Load the icon, hook up "about" activation. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- ChangeLog | 14 ++++++++++++++ README | 1 + TODO | 8 +++++--- sysprof-icon.png | Bin 0 -> 3761 bytes sysprof.c | 28 +++++++++++++++++++++++++++- 5 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 sysprof-icon.png 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 0000000000000000000000000000000000000000..7325a21d78ee187cfe528b00da84f731c49ed62b GIT binary patch literal 3761 zcmV;i4o>ljP)07Y>NQ-mGY0JQehG zW@hHX)YQ~zv9Yo0dP_^oxvN*N9`X5n@8N3&$PenIFyVee!}fha$in>O{QUe)Wo2bK zg9Z)i@!tLW_sg+k$9A;0x39+68c-`Jpe@s<(s~r&epmp{AXFwl{P4s7o<4oLySlns zjvhVgyLt2G7fnq~b@B1>(L;s|DFEd?^w2}n+S)1`Hf*?5S6BBEe)lz~i9+Dnp?kjk zev{UG8Z=+CYSpUntXZ?dV0b&uy#ks8$^|(!gy#$$I`r(zFTWgKv0_CyEiLUb&J}~w zK{5JSz4C4E%?AcTJv{>SOi4*ePHkcSFc{Mbm`KPapT6tfPo-r7pzn8 zFRaeaPMJS{K81T7l%a*Rn@H)Vq~4wQyZD91z5~#hH+b-1*|u$)56pjpb2rD2A746e z-n<-qE*~>y%-v5kK)K16l zt|*ho@67@+F)3+-r1S3Fx$}eL$B)aYQ>TPZ4b3YG27{mJ z-~H#}#fvg**f4%h1|?_#>^5V4LuviBKu@cu>t>RQ2E&Xbl7pr39Fv!qS2AhRBmumH zny#p*5U-^vFxrtLa1oYEPyt6Plb^{6RRraWc0+e<(b z5p~9$Jb6+)9*@kPJ^N3AKtQ^>x@60iE#h!EY#d4L|&dNfgw<8;XmIN5sX&{W2*jsXQwy%Z)H7 zE|*K;9L_6#zdv%M){zU;5zrC{DG=Ix=g%H}^wH<}xw5jdLg#^YoteYEW#(QjU`CT= z%a*+Zt(5QCvqwJv{PRCTa~@n@51fVpg=HxzDJvlap`w^Ji5fQv7>|(22hX#lfK@I7 zR(od7oLNR;sC^`}&00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zac2qZwU#M%xZeVx1w72KMgiFCa#5hDwi8N#x<;c+CIcOv24g{sAm(w(l#&QksCB<) zoC;`08xckA<62kK3D#Z;LWd3=QrhQG0D0(|Ikg^$03kFf`%x9D{xvTzPick%gzI-p z0~oJG({}^q@$F`4&v&;Vfq)h$V0`mgxFIYApM=g*&q z@6?E%RItQgi`k|J38DT7Kq*6~PoF*kN4{=0=}777V&#dA;;la~UNBq*<6f=5V+{&I z?UGSyx?K~6BjesSgXvqKI;4n1x6vom->i{2lSL`%-FM%OIB;@uvL6l45lf5Nbx#4z zet>4f+RP~$1z=If#p#)&`j2w$mQQ?m+(j6;>W1LEAqW|4f_A;F2E(SdZ+VUDWSosn zyo+6m$R+e#gMq$>fm)wFf z31+_{=@~<1aI#ThGF-A=a%cf4NEePxZHB|v0rP48O|tNrsmix1D=THjj2V%MML|J9 z6WYr^K!{U%PQ>QEqx*oU&)KLJgi<#HO3T3THay(L^P@(MQezNK+v=(gN~Zs!G&VgZ zbxE_u0@56_aCsxHm&(;%YIq-TkTTn84*X_ z$;il$D;fEh81#s~^t*V*diBqiKtMrKR z8}a|!>{8mbKcqm2(yXkk-$R4B>|@OVE;~0)oH;wfb>$z7Ts+777+pA>=IqouJm9@> z+9tr}ugLr-wbpC2^QzF<+ipro~5}7z9NCgvrTD9GWJ>ke6nMD}00gtwfLBbl(0SynojxL>+J-2@SQ^jh5 b{|Ybw$4hqkhry}K00000NkvXXu0mjfV;3yL literal 0 HcmV?d00001 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 */