Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Macros | Enumerations | Functions
simple_dialog.h File Reference
#include <glib.h>
#include <stdbool.h>

Go to the source code of this file.

Macros

#define ESD_BTN_NONE   0x00
 
#define ESD_BTN_OK   0x01
 
#define ESD_BTN_CANCEL   0x02
 
#define ESD_BTN_YES   0x04
 
#define ESD_BTN_NO   0x08
 
#define ESD_BTN_CLEAR   0x10
 
#define ESD_BTN_SAVE   0x20
 
#define ESD_BTN_DONT_SAVE   0x40
 
#define ESD_BTN_QUIT_DONT_SAVE   0x80
 
#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)
 
#define ESD_BTNS_SAVE_DONTSAVE   (ESD_BTN_SAVE|ESD_BTN_DONT_SAVE)
 
#define ESD_BTNS_SAVE_DONTSAVE_CANCEL   (ESD_BTN_DONT_SAVE|ESD_BTN_CANCEL|ESD_BTN_SAVE)
 
#define ESD_BTNS_SAVE_QUIT_DONTSAVE_CANCEL   (ESD_BTN_QUIT_DONT_SAVE|ESD_BTN_CANCEL|ESD_BTN_SAVE)
 
#define ESD_BTNS_QUIT_DONTSAVE_CANCEL   (ESD_BTN_QUIT_DONT_SAVE|ESD_BTN_CANCEL)
 

Enumerations

enum  ESD_TYPE_E {
  ESD_TYPE_INFO , ESD_TYPE_WARN , ESD_TYPE_CONFIRMATION , ESD_TYPE_ERROR ,
  ESD_TYPE_STOP
}
 

Functions

void * simple_dialog (ESD_TYPE_E type, int btn_mask, const char *msg_format,...)
 
void * simple_dialog_async (ESD_TYPE_E type, int btn_mask, const char *msg_format,...)
 Show a simple dialog asynchronously.
 
char * simple_dialog_format_message (const char *msg)
 
void simple_message_box (ESD_TYPE_E type, bool *notagain, const char *secondary_msg, const char *msg_format,...)
 Show an Alert box, with optional "don't show this message again" variable and checkbox, and optional secondary text.
 
void vsimple_error_message_box (const char *msg_format, va_list ap)
 Display an error alert box, taking a format and a va_list argument.
 
void simple_error_message_box (const char *msg_format,...)
 Display an error alert box, taking a format and a list of arguments.
 
void vsimple_warning_message_box (const char *msg_format, va_list ap)
 Display a warning alert box, taking a format and a va_list argument.
 

Detailed Description

Definitions for alert box routines with toolkit-independent APIs but toolkit-dependent implementations.

Wireshark - Network traffic analyzer By Gerald Combs geral.nosp@m.d@wi.nosp@m.resha.nosp@m.rk.o.nosp@m.rg Copyright 1998 Gerald Combs

SPDX-License-Identifier: GPL-2.0-or-later

Simple dialog box.

Macro Definition Documentation

◆ ESD_BTN_CANCEL

#define ESD_BTN_CANCEL   0x02

display a "Cancel" button

◆ ESD_BTN_CLEAR

#define ESD_BTN_CLEAR   0x10

display a "Clear" button

◆ ESD_BTN_DONT_SAVE

#define ESD_BTN_DONT_SAVE   0x40

display a "Continue without Saving" button

◆ ESD_BTN_NO

#define ESD_BTN_NO   0x08

display a "No" button

◆ ESD_BTN_NONE

#define ESD_BTN_NONE   0x00

display no buttons at all

◆ ESD_BTN_OK

#define ESD_BTN_OK   0x01

display an "Ok" button

◆ ESD_BTN_QUIT_DONT_SAVE

#define ESD_BTN_QUIT_DONT_SAVE   0x80

display a "Quit without Saving" button

◆ ESD_BTN_SAVE

#define ESD_BTN_SAVE   0x20

display a "Save" button

◆ ESD_BTN_YES

#define ESD_BTN_YES   0x04

display a "Yes" button

◆ ESD_BTNS_OK_CANCEL

#define ESD_BTNS_OK_CANCEL   (ESD_BTN_OK|ESD_BTN_CANCEL)

Standard button combination "Ok" + "Cancel".

◆ ESD_BTNS_QUIT_DONTSAVE_CANCEL

#define ESD_BTNS_QUIT_DONTSAVE_CANCEL   (ESD_BTN_QUIT_DONT_SAVE|ESD_BTN_CANCEL)

Standard button combination "Quit without saving" + "Cancel".

◆ ESD_BTNS_SAVE_DONTSAVE

#define ESD_BTNS_SAVE_DONTSAVE   (ESD_BTN_SAVE|ESD_BTN_DONT_SAVE)

Standard button combination "No" + "Cancel" + "Save".

◆ ESD_BTNS_SAVE_QUIT_DONTSAVE_CANCEL

#define ESD_BTNS_SAVE_QUIT_DONTSAVE_CANCEL   (ESD_BTN_QUIT_DONT_SAVE|ESD_BTN_CANCEL|ESD_BTN_SAVE)

Standard button combination "Quit without saving" + "Cancel" + "Save".

◆ ESD_BTNS_YES_NO

#define ESD_BTNS_YES_NO   (ESD_BTN_YES|ESD_BTN_NO)

Standard button combination "Yes" + "No".

◆ ESD_BTNS_YES_NO_CANCEL

#define ESD_BTNS_YES_NO_CANCEL   (ESD_BTN_YES|ESD_BTN_NO|ESD_BTN_CANCEL)

Standard button combination "Yes" + "No" + "Cancel".

Enumeration Type Documentation

◆ ESD_TYPE_E

enum ESD_TYPE_E

Dialog types.

Enumerator
ESD_TYPE_INFO 

tells the user something they should know, but not requiring any action; the only button should be "OK"

ESD_TYPE_WARN 

tells the user about a problem; the only button should be "OK"

ESD_TYPE_CONFIRMATION 

asks the user for confirmation; there should be more than one button

ESD_TYPE_ERROR 

tells the user about a serious problem; the only button should be "OK"

ESD_TYPE_STOP 

tells the user a stop action is in progress, there should be no button

Function Documentation

◆ simple_dialog()

void * simple_dialog ( ESD_TYPE_E  type,
int  btn_mask,
const char *  msg_format,
  ... 
)
extern

Create and show a simple dialog.

Parameters
typetype of dialog, e.g. ESD_TYPE_WARN
btn_maskThe buttons to display, e.g. ESD_BTNS_OK_CANCEL
msg_formatPrintf like message format. Text must be plain.
...Printf like parameters
Returns
The newly created dialog

◆ simple_dialog_async()

void * simple_dialog_async ( ESD_TYPE_E  type,
int  btn_mask,
const char *  msg_format,
  ... 
)
extern

Show a simple dialog asynchronously.

Parameters
typeType of the dialog to show.
btn_maskBitmask defining which buttons to display on the dialog.
msg_formatFormat string for the message to be displayed.
Returns
void* Always returns NULL.

◆ simple_dialog_format_message()

char * simple_dialog_format_message ( const char *  msg)
extern

Escape the message text, if it probably contains Pango escape sequences. For example html like tags starting with a <.

Parameters
msgthe string to escape
Returns
the escaped message text, must be freed with g_free() later

◆ simple_error_message_box()

void simple_error_message_box ( const char *  msg_format,
  ... 
)
extern

Display an error alert box, taking a format and a list of arguments.

Parameters
msg_formatThe format string for the message.
...Arguments for the format string.

◆ simple_message_box()

void simple_message_box ( ESD_TYPE_E  type,
bool *  notagain,
const char *  secondary_msg,
const char *  msg_format,
  ... 
)
extern

Show an Alert box, with optional "don't show this message again" variable and checkbox, and optional secondary text.

Parameters
typeType of the alert box to show.
notagainPointer to a boolean variable that will be set to true if the user checks the "don't show this message again" checkbox, or false otherwise.
secondary_msgOptional secondary message to display in the alert box, or NULL if no secondary message is needed.
msg_formatFormat string for the primary message to be displayed in the alert box.
...Additional arguments for the format string of the primary message.

◆ vsimple_error_message_box()

void vsimple_error_message_box ( const char *  msg_format,
va_list  ap 
)
extern

Display an error alert box, taking a format and a va_list argument.

Parameters
msg_formatThe format string for the message.
apThe va_list of arguments for the format string.

◆ vsimple_warning_message_box()

void vsimple_warning_message_box ( const char *  msg_format,
va_list  ap 
)
extern

Display a warning alert box, taking a format and a va_list argument.

Parameters
msg_formatThe format string for the message.
apThe va_list of arguments for the format string.