diff options
author | Ulf Lamping <ulf.lamping@web.de> | 2006-02-09 21:37:14 +0000 |
---|---|---|
committer | Ulf Lamping <ulf.lamping@web.de> | 2006-02-09 21:37:14 +0000 |
commit | ba7b92bc020da26f46ea913085d9c5e5adaa7d03 (patch) | |
tree | 91d51790e6bbc0ba3afb6f7fa143cc220e6e452b /gtk | |
parent | 48c4f86c90fda796b7881c8d36da09d2fa0d3f2f (diff) | |
download | wireshark-ba7b92bc020da26f46ea913085d9c5e5adaa7d03.tar.gz |
Win32 inconvenience: a call to g_error will terminate the program and the user won't see anything.
To avoid this, the log handler in the error case:
- opens a console window (regardless of the users settings)
- waits for a keypress before continuing to terminate the program
This way, the user will be notified that there's a problem, instead of simply seeing a terminating program only.
svn path=/trunk/; revision=17236
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/main.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gtk/main.c b/gtk/main.c index 12de6d8442..77476c8a71 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -2927,7 +2927,8 @@ console_log_handler(const char *log_domain, GLogLevelFlags log_level, today = localtime(&curr); #ifdef _WIN32 - if (prefs.gui_console_open != console_open_never) { + if (prefs.gui_console_open != console_open_never || log_level & G_LOG_LEVEL_ERROR) { + /* the user wants a console or the application will terminate immediately */ create_console(); } if (has_console) { @@ -2966,6 +2967,12 @@ console_log_handler(const char *log_domain, GLogLevelFlags log_level, log_domain != NULL ? log_domain : "", level, message); #ifdef _WIN32 + if(log_level & G_LOG_LEVEL_ERROR) { + /* wait for a key press before the following error handler will terminate the program + this way the user at least can read the error message */ + printf("\n\nPress any key to exit\n"); + _getch(); + } } else { g_log_default_handler(log_domain, log_level, message, user_data); } |