changeset 467:04f4ed4e34fc

[gaim-migrate @ 477] The Warn Dialog is now prettier. The IM dialog no longer segfaults when you click the 'OK' button. Woops! That was my fault. It's hard to tie an event to a null widget. *giggle* committer: Tailor Script <tailor@pidgin.im>
author Rob Flynn <gaim@robflynn.com>
date Fri, 07 Jul 2000 18:39:53 +0000
parents b5c2359d633e
children ad0371e3c4cb
files pixmaps/Makefile.am pixmaps/warn.xpm src/dialogs.c
diffstat 3 files changed, 274 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/pixmaps/Makefile.am	Thu Jul 06 17:32:29 2000 +0000
+++ b/pixmaps/Makefile.am	Fri Jul 07 18:39:53 2000 +0000
@@ -17,7 +17,7 @@
 	daemon-im.xpm daemon-info.xpm daemon-permadd.xpm \
 	daemon-permdel.xpm daemon.xpm fontface.xpm smile_happy.xpm \
 	smile_sad.xpm smile_wink.xpm save.xpm cancel.xpm ok.xpm \
-	join.xpm add.xpm
+	join.xpm add.xpm warn.xpm
 
 pixmapdir = $(datadir)/pixmaps
 pixmap_DATA = gaim.xpm
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pixmaps/warn.xpm	Fri Jul 07 18:39:53 2000 +0000
@@ -0,0 +1,193 @@
+/* XPM */
+static char * warn_xpm[] = {
+"24 24 166 2",
+"  	c None",
+". 	c #010000",
+"+ 	c #080102",
+"@ 	c #0E0203",
+"# 	c #110305",
+"$ 	c #140505",
+"% 	c #150405",
+"& 	c #130204",
+"* 	c #020000",
+"= 	c #030000",
+"- 	c #B1A4A4",
+"; 	c #CEBBBC",
+"> 	c #DDCCCC",
+", 	c #DDCCCD",
+"' 	c #CBB6B7",
+") 	c #B89A9B",
+"! 	c #7D5E61",
+"~ 	c #210708",
+"{ 	c #270A0B",
+"] 	c #A19999",
+"^ 	c #DED1D1",
+"/ 	c #F3E6E6",
+"( 	c #EFE0E1",
+"_ 	c #EBDCDD",
+": 	c #EADCDC",
+"< 	c #E4D7D7",
+"[ 	c #E6D2D3",
+"} 	c #E1C5C6",
+"| 	c #AC7D7D",
+"1 	c #654040",
+"2 	c #2E0C0D",
+"3 	c #050001",
+"4 	c #DED1D2",
+"5 	c #F4EBEB",
+"6 	c #F1E6E6",
+"7 	c #EBDFDF",
+"8 	c #E4DBDA",
+"9 	c #E5DBDB",
+"0 	c #E2D3D3",
+"a 	c #DDC3C4",
+"b 	c #DBB3B6",
+"c 	c #A06E6E",
+"d 	c #310D0D",
+"e 	c #A39596",
+"f 	c #F5ECEC",
+"g 	c #EEE4E4",
+"h 	c #120808",
+"i 	c #E4DADA",
+"j 	c #E5DEDD",
+"k 	c #0E0505",
+"l 	c #CBB3B4",
+"m 	c #D8B9BB",
+"n 	c #B88B8C",
+"o 	c #633E3F",
+"p 	c #250A0A",
+"q 	c #BFB2B3",
+"r 	c #EADEDE",
+"s 	c #190E0E",
+"t 	c #0F0606",
+"u 	c #130A0A",
+"v 	c #E6DCDC",
+"w 	c #0C0404",
+"x 	c #0F0505",
+"y 	c #130606",
+"z 	c #C3A9A9",
+"A 	c #CBA5A6",
+"B 	c #A57577",
+"C 	c #2C0B0D",
+"D 	c #0D0303",
+"E 	c #D1C3C4",
+"F 	c #EDE1E0",
+"G 	c #120909",
+"H 	c #090303",
+"I 	c #0B0303",
+"J 	c #0D0404",
+"K 	c #B9A7A7",
+"L 	c #DEC6C7",
+"M 	c #CCABAD",
+"N 	c #B68B8F",
+"O 	c #290A0C",
+"P 	c #CCB9B9",
+"Q 	c #ECE1E1",
+"R 	c #E5DDDD",
+"S 	c #DFD1D0",
+"T 	c #DFCDCC",
+"U 	c #CDB1B1",
+"V 	c #CBA7A9",
+"W 	c #B28487",
+"X 	c #2B0A0C",
+"Y 	c #1B0607",
+"Z 	c #C9AFB0",
+"` 	c #ECDFDF",
+" .	c #E6DEDF",
+"..	c #0F0405",
+"+.	c #120506",
+"@.	c #D0B4B6",
+"#.	c #CBAAAB",
+"$.	c #C09699",
+"%.	c #A17273",
+"&.	c #2A0B0C",
+"*.	c #1A0507",
+"=.	c #AD8C8D",
+"-.	c #D6C0C0",
+";.	c #E1D0D1",
+">.	c #0F0504",
+",.	c #100405",
+"'.	c #DECFCF",
+").	c #120505",
+"!.	c #180707",
+"~.	c #24090A",
+"{.	c #C69B9E",
+"].	c #B38083",
+"^.	c #905E5F",
+"/.	c #170405",
+"(.	c #957273",
+"_.	c #C6A3A5",
+":.	c #DAB9BA",
+"<.	c #DCC4C4",
+"[.	c #130505",
+"}.	c #DCC6C7",
+"|.	c #E0C9CA",
+"1.	c #CFB3B4",
+"2.	c #22080A",
+"3.	c #BA8D8F",
+"4.	c #BE8C8D",
+"5.	c #A16C6E",
+"6.	c #774748",
+"7.	c #220809",
+"8.	c #1D0607",
+"9.	c #B88D8F",
+"0.	c #C79FA0",
+"a.	c #D6B2B4",
+"b.	c #D8BEBF",
+"c.	c #CDACAF",
+"d.	c #D9BABC",
+"e.	c #CBA5A7",
+"f.	c #C6999A",
+"g.	c #BF8B8C",
+"h.	c #9F6A6B",
+"i.	c #804F50",
+"j.	c #1E0708",
+"k.	c #A17477",
+"l.	c #C29698",
+"m.	c #C69E9F",
+"n.	c #C69B9C",
+"o.	c #C59898",
+"p.	c #B27C7D",
+"q.	c #AB7475",
+"r.	c #8C5A5B",
+"s.	c #734849",
+"t.	c #210707",
+"u.	c #250909",
+"v.	c #9E7070",
+"w.	c #B98A8B",
+"x.	c #B88888",
+"y.	c #B37D7F",
+"z.	c #9F6767",
+"A.	c #824E4F",
+"B.	c #703F40",
+"C.	c #27090A",
+"D.	c #1B0507",
+"E.	c #1E0707",
+"F.	c #230909",
+"G.	c #280B0B",
+"H.	c #2C0B0C",
+"I.	c #2F0C0C",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                . + @ # $ % &                   ",
+"            * = - ; > , ' ) ! ~ {               ",
+"          = ] ^ / ( _ : < [ } | 1 2             ",
+"          3 4 5 6 7 8 8 9 0 a b c d             ",
+"        3 e f g 7 h 8 i j k l m n o p           ",
+"        + q 6 r s t u v w x y z A B C           ",
+"        D E F r 8 G H I J x K L M N O           ",
+"        $ P Q 8 R R I J J S T U V W X           ",
+"        Y Z `  . .J ....k +.@.#.$.%.&.          ",
+"        *.=.-.;...>.,.'.).!.~.{.].^.O           ",
+"        /.(._.:.<.[.}.|.1.2.3.4.5.6.7.          ",
+"          8.9.0.a.b.c.d.e.f.g.h.i.O             ",
+"          j.k.l.m.n.f.o.4.p.q.r.s.8.            ",
+"            t.u.v.w.x.y.z.A.B.C.D.              ",
+"                E.F.G.H.I.I.C.                  ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                "};
--- a/src/dialogs.c	Thu Jul 06 17:32:29 2000 +0000
+++ b/src/dialogs.c	Fri Jul 07 18:39:53 2000 +0000
@@ -44,6 +44,7 @@
 #include "pixmaps/save.xpm"
 #include "pixmaps/ok.xpm"
 #include "pixmaps/add.xpm"
+#include "pixmaps/warn.xpm"
 
 #define DEFAULT_FONT_NAME "-adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-1"
 
@@ -367,35 +368,94 @@
 	GtkWidget *label;
 	GtkWidget *vbox;
         GtkWidget *bbox;
+	GtkWidget *button_box;
+	GtkWidget *icon_i;
+	GdkBitmap *mask;
+	GdkPixmap *icon;
+	GtkWidget *frame;
+	GtkWidget *fbox;
 
         struct warning *w = g_new0(struct warning, 1);
         
         char *buf = g_malloc(128);
         w->window = gtk_window_new(GTK_WINDOW_DIALOG);
-        dialogwindows = g_list_prepend(dialogwindows, w->window);
+	gtk_window_set_policy(GTK_WINDOW(w->window), FALSE, FALSE, TRUE);
+	gtk_widget_show(w->window);
+	dialogwindows = g_list_prepend(dialogwindows, w->window);
         cancel = gtk_button_new_with_label(_("Cancel"));
         warn = gtk_button_new_with_label(_("Warn"));
         bbox = gtk_hbox_new(TRUE, 10);
         vbox = gtk_vbox_new(FALSE, 5);
-
+	fbox = gtk_vbox_new(FALSE, 5);
+
+	frame = gtk_frame_new(_("Warn"));
+
+	/* Build Warn Button */
+
+	warn = gtk_button_new();
+
+	button_box = gtk_hbox_new(FALSE, 5);
+	icon = gdk_pixmap_create_from_xpm_d ( w->window->window, &mask, NULL, warn_xpm);
+	icon_i = gtk_pixmap_new(icon, mask);
+	
+	label = gtk_label_new(_("Warn"));
+
+	gtk_box_pack_start(GTK_BOX(button_box), icon_i, FALSE, FALSE, 2);
+	gtk_box_pack_end(GTK_BOX(button_box), label, FALSE, FALSE, 2);
+
+	gtk_widget_show(label);
+	gtk_widget_show(icon_i);
+
+	gtk_widget_show(button_box);
+
+	gtk_container_add(GTK_CONTAINER(warn), button_box);
+
+	/* End of OK Button */
+	
+	/* Build Cancel Button */
+
+	cancel = gtk_button_new();
+
+	button_box = gtk_hbox_new(FALSE, 5);
+	icon = gdk_pixmap_create_from_xpm_d ( w->window->window, &mask, NULL, cancel_xpm);
+
+	icon_i = gtk_pixmap_new(icon, mask);
+	
+	label = gtk_label_new(_("Cancel"));
+
+	gtk_box_pack_start(GTK_BOX(button_box), icon_i, FALSE, FALSE, 2);
+	gtk_box_pack_end(GTK_BOX(button_box), label, FALSE, FALSE, 2);
+
+	gtk_widget_show(label);
+	gtk_widget_show(icon_i);
+
+	gtk_widget_show(button_box);
+
+	gtk_container_add(GTK_CONTAINER(cancel), button_box);
+	
+	/* End of Cancel Button */
         /* Put the buttons in the box */
-        gtk_box_pack_start(GTK_BOX(bbox), warn, TRUE, TRUE, 10);
-        gtk_box_pack_start(GTK_BOX(bbox), cancel, TRUE, TRUE, 10);
+
+	gtk_box_pack_start(GTK_BOX(bbox), warn, TRUE, TRUE, 5);
+        gtk_box_pack_end(GTK_BOX(bbox), cancel, TRUE, TRUE, 5);
 
         g_snprintf(buf, 127, _("Do you really want to warn %s?"), who);
         label = gtk_label_new(buf);
-        gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 0);
+        gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 5);
         gtk_widget_show(label);
         w->anon = gtk_check_button_new_with_label(_("Warn anonymously?"));
-        gtk_box_pack_start(GTK_BOX(vbox), w->anon, TRUE, TRUE, 0);
+        gtk_box_pack_start(GTK_BOX(vbox), w->anon, TRUE, TRUE, 5);
 
         label = gtk_label_new(_("Anonymous warnings are less harsh."));
-        gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 0);
+        gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 5);
         gtk_widget_show(label);
 
         w->who = who;
-		
-        gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 5);
+	
+	gtk_container_add(GTK_CONTAINER(frame), vbox);
+
+	gtk_box_pack_start(GTK_BOX(fbox), frame, FALSE, FALSE, 5);
+        gtk_box_pack_start(GTK_BOX(fbox), bbox, FALSE, FALSE, 5);
 
         /* Handle closes right */
         gtk_signal_connect(GTK_OBJECT(w->window), "delete_event",
@@ -410,9 +470,13 @@
         gtk_widget_show(w->anon);
         gtk_widget_show(bbox);
         gtk_widget_show(vbox);
-        gtk_window_set_title(GTK_WINDOW(w->window), _("Gaim - Warn user?"));
-        gtk_container_add(GTK_CONTAINER(w->window), vbox);
-        gtk_widget_realize(w->window);
+	gtk_widget_show(frame);
+	gtk_widget_show(fbox);
+
+	gtk_window_set_title(GTK_WINDOW(w->window), _("Gaim - Warn user?"));
+        gtk_container_add(GTK_CONTAINER(w->window), fbox);
+	gtk_container_set_border_width(GTK_CONTAINER(w->window), 5);
+	gtk_widget_realize(w->window);
         aol_icon(w->window->window);
 
         gtk_widget_show(w->window);
@@ -602,9 +666,9 @@
 {
         char *who;
         struct conversation *c;
-
+	char *test;
+	
         who = g_strdup(normalize(gtk_entry_get_text(GTK_ENTRY(imentry))));
-        
 	destroy_dialog(NULL, imdialog);
         imdialog = NULL;
         
@@ -691,6 +755,8 @@
 		fbox = gtk_vbox_new(TRUE, 10);
 
 		frame = gtk_frame_new(_("Send Instant Message"));
+	
+		imentry = gtk_entry_new();
 
 	/* Build OK Button */
 
@@ -755,7 +821,6 @@
                 gtk_box_pack_start(GTK_BOX(ebox), label, TRUE, TRUE, 10);
                 gtk_widget_show(label);
 
-                imentry = gtk_entry_new();
                 gtk_box_pack_start(GTK_BOX(ebox), imentry, TRUE, TRUE, 10);
 
                 gtk_box_pack_start(GTK_BOX(vbox), ebox, FALSE, FALSE, 5);