/* 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>
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);
/* 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>
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);
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.");
/* 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>
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);
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);
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);
/* 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>
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);
/* 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
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:
/* 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
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
#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, ...)