Ethereal-dev: [ethereal-dev] simple_dialog and about_ethereal enhanced
Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.
From: Laurent Deniel <deniel@xxxxxxxxxxx>
Date: Wed, 14 Oct 1998 22:15:00 +0200
Hi,
I have attached a diff to ethereal 0.4.0 that enhances the
simple_dialog function (with a new ethereal icon). It is used
by the now active "About Ethereal" button (with an INFO type).
Laurent.
--
Laurent DENIEL | E-mail: deniel@xxxxxxxxxxx
Paris, FRANCE | deniel@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
| WWW : http://www.worldnet.fr/~deniel
All above opinions are personal, unless stated otherwise.diff -u --recursive --new-file ethereal-0.4.0/ethereal.c ethereal-0.4.0-deniel/ethereal.c
--- ethereal-0.4.0/ethereal.c Mon Oct 12 03:42:43 1998
+++ ethereal-0.4.0-deniel/ethereal.c Wed Oct 14 22:02:08 1998
@@ -82,6 +82,23 @@
#define E_DFILTER_TE_KEY "display_filter_te"
+/* About Ethereal window */
+void
+about_ethereal( GtkWidget *w, gpointer data ) {
+ simple_dialog(ESD_TYPE_INFO, NULL,
+ "GNU Ethereal - network protocol analyzer\n"
+ "Version %s (C) 1998 Gerald Combs <gerald@xxxxxxxx>\n\n"
+ "Contributors:\n"
+ "Gilbert Ramirez Jr. <gram@xxxxxxxxxxxxxxxxxxx>\n"
+ "Hannes R. Boehm <hannes@xxxxxxxxx>\n"
+ "Mike Hall <mlh@xxxxxx>\n"
+ "Bobo Rajec <bobo@xxxxxxxxxxxxxxxxx>\n"
+ "Laurent Deniel <deniel@xxxxxxxxxxx>\n"
+ "Don Lafontaine <lafont02@xxxxx>\n"
+ "Guy Harris <guy@xxxxxxxxxx>\n\n"
+ "See http://ethereal.zing.org for more information", VERSION);
+}
+
/* Things to do when the OK button is pressed */
void
file_sel_ok_cb(GtkWidget *w, GtkFileSelection *fs) {
diff -u --recursive --new-file ethereal-0.4.0/ethereal.h ethereal-0.4.0-deniel/ethereal.h
--- ethereal-0.4.0/ethereal.h Mon Oct 12 03:42:44 1998
+++ ethereal-0.4.0-deniel/ethereal.h Wed Oct 14 21:44:27 1998
@@ -94,6 +94,7 @@
extern ts_type timestamp_type;
+void about_ethereal( GtkWidget *, gpointer);
void file_sel_ok_cb(GtkWidget *, GtkFileSelection *);
void blank_packetinfo();
gint file_progress_cb(gpointer);
diff -u --recursive --new-file ethereal-0.4.0/image/icon-ethereal.xpm ethereal-0.4.0-deniel/image/icon-ethereal.xpm
--- ethereal-0.4.0/image/icon-ethereal.xpm Thu Jan 1 01:00:00 1970
+++ ethereal-0.4.0-deniel/image/icon-ethereal.xpm Wed Oct 14 21:32:12 1998
@@ -0,0 +1,80 @@
+/* XPM */
+static char *icon_ethereal_xpm[] = {
+/* width height num_colors chars_per_pixel */
+" 66 63 10 1",
+/* colors */
+". c #000000",
+"# c #181c18",
+"a c #383838",
+"b c #505450",
+"c c #707070",
+"d c #888c88",
+"e c #a8a8a8",
+"f c #c0c4c0",
+"g c #e0e0e0",
+"h c #f8fcf8",
+/* pixels */
+"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhfeddbcddfghhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhheb#..........acfhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhhhhhhhhhhhhgc#................adhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhhhhhhhhhhgb#....................ehhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhhhhhhhhhe#......................dhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhhhhhhhgc.........#bcddddca#.....dhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhhhhhhga.......adfhhhhhhhhhgfc##bhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhhhhhga......adhhhhhhhhhhhhhhhhghhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhhhhga......cghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhhhhb.....#ehhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhhhd......ehhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhhf#.....ehhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhha.....ehhhhhhhhhhhhhhhhhhhheaadhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhf.....chhhhhhhhhhhhhhhhhhhda....ehhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhb....aghhhhhhhhhhhhhhhhhda......dhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhf#....ehhhhhhhhhhhhhhhhda........dhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhc....bhhhhhhhhhhhhhhhda.........bhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhh#....fhhhhhhhhhhhhhda.........bfhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhf....aghhhhhhhhhhhda.........bfhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhd....bhhhhhhhhhhda.........bfhhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhha....ehhhhhhhhda.........bfhhhhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhh#....fhhhhhhda.........bfhhhhhhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhg#...#ghhhhfa.........bfhhhhhhhhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhg#...#ghhhha........bfhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhf....#hhhhg.......bfhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhg#...#ghhhh#....bfhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhh#...#ghhhhe##bfghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhg#....ghhhhhhghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhb....ehhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhd....chhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhf....ahhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhg#....ghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhc....bhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhf....#fhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhha....bhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhe.....dhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhh#....#fhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhhe.....#fhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhhhb.....#fhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhhhga.....aghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhhhhf#.....#ehhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhhhhhf#......bghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhhhhhhf#.......cfghhhhhhhhhhfeaachhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhhhhhhhgb........#abccddcba##....bhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhhhhhhhhhe#......................ahhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhhhhhhhhhhgb#....................chhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhhhhhhhhhhhhgd#................achhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhheca#........#bcfhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhgffeddfffghhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh",
+"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh"
+};
diff -u --recursive --new-file ethereal-0.4.0/menu.c ethereal-0.4.0-deniel/menu.c
--- ethereal-0.4.0/menu.c Mon Oct 12 03:42:46 1998
+++ ethereal-0.4.0-deniel/menu.c Wed Oct 14 21:43:22 1998
@@ -76,7 +76,7 @@
{"<Main>/Tools/Capture", "<control>K", capture_prep_cb, NULL},
{"<Main>/Tools/Follow TCP Stream", NULL, follow_stream_cb, NULL},
{"<Main>/Tools/Graph", NULL, NULL, NULL},
- {"<Main>/Help/About Ethereal", NULL, NULL, NULL}
+ {"<Main>/Help/About Ethereal", NULL, about_ethereal, NULL}
};
/* calculate the number of menu_items */
@@ -120,7 +120,6 @@
set_menu_sensitivity("<Main>/Edit/Paste", FALSE);
set_menu_sensitivity("<Main>/Edit/Find", FALSE);
set_menu_sensitivity("<Main>/Tools/Graph", FALSE);
- set_menu_sensitivity("<Main>/Help/About Ethereal", FALSE);
if ((mp = gtk_menu_factory_find(factory, "<Main>/Help")) != NULL) {
gtk_menu_item_right_justify((GtkMenuItem *) mp->widget);
}
diff -u --recursive --new-file ethereal-0.4.0/util.c ethereal-0.4.0-deniel/util.c
--- ethereal-0.4.0/util.c Mon Oct 12 03:42:52 1998
+++ ethereal-0.4.0-deniel/util.c Wed Oct 14 22:02:57 1998
@@ -37,6 +37,7 @@
#include "util.h"
#include "image/icon-excl.xpm"
+#include "image/icon-ethereal.xpm"
const gchar *bm_key = "button mask";
@@ -44,7 +45,7 @@
* text.
*
* Args:
- * type : One of ESD_TYPE_*. Currently ignored.
+ * type : One of ESD_TYPE_*.
* btn_mask : The address of a gint. The value passed in determines if
* the 'Cancel' button is displayed. The button pressed by the
* user is passed back.
@@ -65,11 +66,28 @@
GdkColormap *cmap;
va_list ap;
gchar message[ESD_MAX_MSG_LEN];
-
+ gchar **icon;
+
/* Main window */
win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_container_border_width(GTK_CONTAINER(win), 7);
- gtk_window_set_title(GTK_WINDOW(win), "Ethereal: Warning");
+
+ switch (type) {
+ case ESD_TYPE_WARN :
+ gtk_window_set_title(GTK_WINDOW(win), "Ethereal: Warning");
+ icon = icon_excl_xpm;
+ break;
+ case ESD_TYPE_CRIT :
+ gtk_window_set_title(GTK_WINDOW(win), "Ethereal: Critical");
+ icon = icon_excl_xpm;
+ break;
+ case ESD_TYPE_INFO :
+ default :
+ icon = icon_ethereal_xpm;
+ gtk_window_set_title(GTK_WINDOW(win), "Ethereal: Information");
+ break;
+ }
+
gtk_object_set_data(GTK_OBJECT(win), bm_key, btn_mask);
/* Container for our rows */
@@ -86,7 +104,7 @@
style = gtk_widget_get_style(win);
cmap = gdk_colormap_get_system();
pixmap = gdk_pixmap_colormap_create_from_xpm_d(NULL, cmap, &mask,
- &style->bg[GTK_STATE_NORMAL], icon_excl_xpm);
+ &style->bg[GTK_STATE_NORMAL], icon);
type_pm = gtk_pixmap_new(pixmap, mask);
gtk_container_add(GTK_CONTAINER(top_hb), type_pm);
gtk_widget_show(type_pm);
diff -u --recursive --new-file ethereal-0.4.0/util.h ethereal-0.4.0-deniel/util.h
--- ethereal-0.4.0/util.h Mon Oct 12 03:42:52 1998
+++ ethereal-0.4.0-deniel/util.h Wed Oct 14 21:33:47 1998
@@ -30,7 +30,7 @@
extern "C" {
#endif /* __cplusplus */
-/* Dialog type. Currently, only ESD_TYPE_WARN is supported. */
+/* Dialog type. */
#define ESD_TYPE_INFO 0
#define ESD_TYPE_WARN 1
#define ESD_TYPE_CRIT 2
- Prev by Date: Re: [ethereal-dev] Patch to "packet-fddi.c" + another question
- Next by Date: [ethereal-dev] Poll: what OS are you using to validate ethereal ?
- Previous by thread: [ethereal-dev] NetBIOS Name Services
- Next by thread: [ethereal-dev] Poll: what OS are you using to validate ethereal ?
- Index(es):





