diff options
-rw-r--r-- | gtk/capture_dlg.c | 4 | ||||
-rw-r--r-- | gtk/file_dlg.c | 6 | ||||
-rw-r--r-- | gtk/main.c | 8 | ||||
-rw-r--r-- | gtk/menu.c | 4 | ||||
-rw-r--r-- | gtk/simple_dialog.c | 7 | ||||
-rw-r--r-- | simple_dialog.h | 24 |
6 files changed, 33 insertions, 20 deletions
diff --git a/gtk/capture_dlg.c b/gtk/capture_dlg.c index 123e1aaf56..26f613ee01 100644 --- a/gtk/capture_dlg.c +++ b/gtk/capture_dlg.c @@ -1,7 +1,7 @@ /* capture_dlg.c * Routines for packet capture windows * - * $Id: capture_dlg.c,v 1.101 2004/01/31 12:13:22 ulfl Exp $ + * $Id: capture_dlg.c,v 1.102 2004/02/04 01:10:36 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -786,7 +786,7 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_) if((cfile.state != FILE_CLOSED) && !cfile.user_saved) { /* user didn't saved his current file, ask him */ dialog = simple_dialog(ESD_TYPE_WARN | ESD_TYPE_MODAL, - ESD_BTN_YES | ESD_BTN_NO | ESD_BTN_CANCEL, + ESD_BTNS_YES_NO_CANCEL, PRIMARY_TEXT_START "Save capture file before starting a new capture?" PRIMARY_TEXT_END "\n\n" "If you start a new capture without saving, your current capture data will be discarded."); simple_dialog_set_cb(dialog, capture_prep_answered_cb, NULL); diff --git a/gtk/file_dlg.c b/gtk/file_dlg.c index 06ec93e1b6..52aadc82ac 100644 --- a/gtk/file_dlg.c +++ b/gtk/file_dlg.c @@ -1,7 +1,7 @@ /* file_dlg.c * Dialog boxes for handling files * - * $Id: file_dlg.c,v 1.92 2004/02/03 17:59:01 ulfl Exp $ + * $Id: file_dlg.c,v 1.93 2004/02/04 01:10:36 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -364,7 +364,7 @@ file_open_cmd_cb(GtkWidget *widget, gpointer data _U_) { if((cfile.state != FILE_CLOSED) && !cfile.user_saved) { /* user didn't saved his current file, ask him */ dialog = simple_dialog(ESD_TYPE_WARN | ESD_TYPE_MODAL, - ESD_BTN_YES | ESD_BTN_NO | ESD_BTN_CANCEL, + ESD_BTNS_YES_NO_CANCEL, PRIMARY_TEXT_START "Save capture file before opening a new one?" PRIMARY_TEXT_END "\n\n" "If you open a new capture file without saving, your capture data will be discarded."); simple_dialog_set_cb(dialog, file_open_answered_cb, widget); @@ -491,7 +491,7 @@ file_close_cmd_cb(GtkWidget *widget _U_, gpointer data _U_) { if((cfile.state != FILE_CLOSED) && !cfile.user_saved) { /* user didn't saved his current file, ask him */ dialog = simple_dialog(ESD_TYPE_WARN | ESD_TYPE_MODAL, - ESD_BTN_YES | ESD_BTN_NO | ESD_BTN_CANCEL, + ESD_BTNS_YES_NO_CANCEL, PRIMARY_TEXT_START "Save capture file before closing it?" PRIMARY_TEXT_END "\n\n" "If you close without saving, your capture data will be discarded."); diff --git a/gtk/main.c b/gtk/main.c index d0602e452f..4dbac7660d 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -1,6 +1,6 @@ /* main.c * - * $Id: main.c,v 1.389 2004/02/03 17:59:01 ulfl Exp $ + * $Id: main.c,v 1.390 2004/02/04 01:10:36 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -1211,7 +1211,7 @@ main_window_delete_event_cb(GtkWidget *widget _U_, GdkEvent *event _U_, gpointer if((cfile.state != FILE_CLOSED) && !cfile.user_saved) { /* user didn't saved his current file, ask him */ dialog = simple_dialog(ESD_TYPE_WARN | ESD_TYPE_MODAL, - ESD_BTN_YES | ESD_BTN_NO | ESD_BTN_CANCEL, + ESD_BTNS_YES_NO_CANCEL, PRIMARY_TEXT_START "Save capture file before program quit?" PRIMARY_TEXT_END "\n\n" "If you quit the program without saving, your capture data will be discarded."); simple_dialog_set_cb(dialog, file_quit_answered_cb, NULL); @@ -1333,7 +1333,7 @@ file_quit_cmd_cb(GtkWidget *widget _U_, gpointer data _U_) if((cfile.state != FILE_CLOSED) && !cfile.user_saved) { /* user didn't saved his current file, ask him */ dialog = simple_dialog(ESD_TYPE_WARN | ESD_TYPE_MODAL, - ESD_BTN_YES | ESD_BTN_NO | ESD_BTN_CANCEL, + ESD_BTNS_YES_NO_CANCEL, PRIMARY_TEXT_START "Save capture file before program quit?" PRIMARY_TEXT_END "\n\n" "If you quit the program without saving, your capture data will be discarded."); simple_dialog_set_cb(dialog, file_quit_answered_cb, NULL); @@ -1764,7 +1764,7 @@ GtkSelectionData *selection_data, guint info, guint t _U_, gpointer data _U_) if((cfile.state != FILE_CLOSED) && !cfile.user_saved) { /* user didn't saved his current file, ask him */ dialog = simple_dialog(ESD_TYPE_WARN | ESD_TYPE_MODAL, - ESD_BTN_YES | ESD_BTN_NO | ESD_BTN_CANCEL, + ESD_BTNS_YES_NO_CANCEL, PRIMARY_TEXT_START "Save capture file before opening a new one?" PRIMARY_TEXT_END "\n\n" "If you open a new capture file without saving, your current capture data will be discarded."); simple_dialog_set_cb(dialog, dnd_open_file_answered_cb, cf_name); diff --git a/gtk/menu.c b/gtk/menu.c index f633db7084..513b7f13a3 100644 --- a/gtk/menu.c +++ b/gtk/menu.c @@ -1,7 +1,7 @@ /* menu.c * Menu routines * - * $Id: menu.c,v 1.157 2004/02/03 17:59:01 ulfl Exp $ + * $Id: menu.c,v 1.158 2004/02/04 01:10:37 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -840,7 +840,7 @@ menu_open_recent_file_cmd_cb(GtkWidget *widget, gpointer data _U_) { if((cfile.state != FILE_CLOSED) && !cfile.user_saved) { /* user didn't saved his current file, ask him */ dialog = simple_dialog(ESD_TYPE_WARN | ESD_TYPE_MODAL, - ESD_BTN_YES | ESD_BTN_NO | ESD_BTN_CANCEL, + ESD_BTNS_YES_NO_CANCEL, PRIMARY_TEXT_START "Save capture file before opening a new one?" PRIMARY_TEXT_END "\n\n" "If you open a new capture file without saving, your current capture data will be discarded."); simple_dialog_set_cb(dialog, menu_open_recent_file_answered_cb, widget); diff --git a/gtk/simple_dialog.c b/gtk/simple_dialog.c index 574979f1e6..ba3ca97ac6 100644 --- a/gtk/simple_dialog.c +++ b/gtk/simple_dialog.c @@ -1,13 +1,12 @@ /* simple_dialog.c * Simple message dialog box routines. * - * $Id: simple_dialog.c,v 1.23 2004/02/03 17:59:01 ulfl Exp $ + * $Id: simple_dialog.c,v 1.24 2004/02/04 01:10:37 guy Exp $ * * Ethereal - Network traffic analyzer - * By Gerald Combs <gerald@zing.org> + * By Gerald Combs <gerald@ethereal.com> * Copyright 1998 Gerald Combs * - * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -150,7 +149,7 @@ simple_dialog(gint type, gint btn_mask, gchar *msg_format, ...) { case(ESD_BTN_CLEAR | ESD_BTN_CANCEL): bbox = dlg_button_row_new(GTK_STOCK_CLEAR, GTK_STOCK_CANCEL, NULL); break; - case(ESD_BTN_YES | ESD_BTN_NO | ESD_BTN_CANCEL): + case(ESD_BTNS_YES_NO_CANCEL): bbox = dlg_button_row_new(GTK_STOCK_YES, GTK_STOCK_NO, GTK_STOCK_CANCEL, NULL); break; default: diff --git a/simple_dialog.h b/simple_dialog.h index 29ced367ca..5f06791435 100644 --- a/simple_dialog.h +++ b/simple_dialog.h @@ -1,14 +1,13 @@ /* simple_dialog.h - * Definitions for dialog box routines with toolkit-independent APIs but + * Definitions for alert box routines with toolkit-independent APIs but * toolkit-dependent implementations. * - * $Id: simple_dialog.h,v 1.8 2004/02/03 17:59:00 ulfl Exp $ + * $Id: simple_dialog.h,v 1.9 2004/02/04 01:10:36 guy Exp $ * * Ethereal - Network traffic analyzer - * By Gerald Combs <gerald@zing.org> + * By Gerald Combs <gerald@ethereal.com> * Copyright 1998 Gerald Combs * - * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -31,7 +30,18 @@ extern "C" { #endif /* __cplusplus */ -/* Dialog type. */ +/* Dialog type. + + INFO: tells the user something they should know, but not requiring + any action; the only button should be "OK". + + WARN: tells the user about a problem; the only button should be "OK" + + QUESTION: asks the user for confirmation; there should be more than one + button + + ERROR: tells the user about a serious problem; the only button should be + "OK". */ #define ESD_TYPE_INFO 0x00 #define ESD_TYPE_WARN 0x01 #define ESD_TYPE_QUESTION 0x02 @@ -48,6 +58,10 @@ extern "C" { #define ESD_BTN_NO 0x08 #define ESD_BTN_CLEAR 0x10 +#define ESD_BTNS_OK_CANCEL (ESD_BTN_OK|ESD_BTN_CANCEL) +#define ESD_BTNS_YES_NO (ESD_BTN_YES|ESD_BTN_NO) +#define ESD_BTNS_YES_NO_CANCEL (ESD_BTN_YES|ESD_BTN_NO|ESD_BTN_CANCEL) + /* show a simple dialog */ #if __GNUC__ >= 2 extern gpointer simple_dialog(gint type, gint btn_mask, gchar *msg_format, ...) |