From c8f3f10a81a4450ff6ca505aee076683b945a6e5 Mon Sep 17 00:00:00 2001 From: Kim Woelders Date: Sat, 18 Oct 2008 19:05:18 +0000 Subject: [PATCH] DialogAlert... -> Alert... SVN revision: 36793 --- src/E.h | 2 -- src/actions.c | 88 +++++++++++++++++++++++--------------------------- src/alert.c | 13 ++++++++ src/alert.h | 1 + src/dialog.c | 24 -------------- src/handlers.c | 28 ++++++++-------- src/session.c | 12 +++---- 7 files changed, 73 insertions(+), 95 deletions(-) diff --git a/src/E.h b/src/E.h index 24417de9..1e184c8c 100644 --- a/src/E.h +++ b/src/E.h @@ -453,8 +453,6 @@ int ThemeConfigLoad(void); /* dialog.c */ void __PRINTF_2__ DialogOK(const char *title, const char *fmt, ...); void DialogOKstr(const char *title, const char *txt); -void __PRINTF__ DialogAlert(const char *fmt, ...); -void __PRINTF__ DialogAlertOK(const char *fmt, ...); /* econfig.c */ void ConfigurationLoad(void); diff --git a/src/actions.c b/src/actions.c index 13da9efc..20f61066 100644 --- a/src/actions.c +++ b/src/actions.c @@ -106,25 +106,22 @@ execApplication(const char *params, int flags) { /* absolute path */ if (isabspath(exe)) - DialogAlertOK(_ - ("There was an error running the program:\n" - "%s\n" - "This program could not be executed.\n" - "This is because the file does not exist.\n"), - exe); + AlertOK(_("There was an error running the program:\n" + "%s\n" + "This program could not be executed.\n" + "This is because the file does not exist.\n"), exe); /* relative path */ else - DialogAlertOK(_ - ("There was an error running the program:\n" - "%s\n" - "This program could not be executed.\n" - "This is most probably because this " - "program is not in the\n" - "path for your shell which is %s. " - "I suggest you read the manual\n" - "page for that shell and read up how to " - "change or add to your\n" - "execution path.\n"), exe, sh); + AlertOK(_("There was an error running the program:\n" + "%s\n" + "This program could not be executed.\n" + "This is most probably because this " + "program is not in the\n" + "path for your shell which is %s. " + "I suggest you read the manual\n" + "page for that shell and read up how to " + "change or add to your\n" + "execution path.\n"), exe, sh); } else /* it is a node on the filing sys */ @@ -134,46 +131,41 @@ execApplication(const char *params, int flags) { /* can execute it */ if (canexec(path)) - DialogAlertOK(_ - ("There was an error running the program:\n" - "%s\n" - "This program could not be executed.\n" - "I am unsure as to why you could not " - "do this. The file exists,\n" - "is a file, and you are allowed to " - "execute it. I suggest you look\n" - "into this.\n"), path); + AlertOK(_("There was an error running the program:\n" + "%s\n" + "This program could not be executed.\n" + "I am unsure as to why you could not " + "do this. The file exists,\n" + "is a file, and you are allowed to " + "execute it. I suggest you look\n" + "into this.\n"), path); /* not executable file */ else - DialogAlertOK(_ - ("There was an error running the program:\n" - "%s\n" - "This program could not be executed.\n" - "This is because the file exists, is a " - "file, but you are unable\n" - "to execute it because you do not " - "have execute " - "access to this file.\n"), path); + AlertOK(_("There was an error running the program:\n" + "%s\n" + "This program could not be executed.\n" + "This is because the file exists, is a " + "file, but you are unable\n" + "to execute it because you do not " + "have execute " "access to this file.\n"), path); } /* it's not a file */ else { /* its a dir */ if (isdir(path)) - DialogAlertOK(_ - ("There was an error running the program:\n" - "%s\n" - "This program could not be executed.\n" - "This is because the file is in fact " - "a directory.\n"), path); + AlertOK(_("There was an error running the program:\n" + "%s\n" + "This program could not be executed.\n" + "This is because the file is in fact " + "a directory.\n"), path); /* its not a file or a dir */ else - DialogAlertOK(_ - ("There was an error running the program:\n" - "%s\n" - "This program could not be executed.\n" - "This is because the file is not a " - "regular file.\n"), path); + AlertOK(_("There was an error running the program:\n" + "%s\n" + "This program could not be executed.\n" + "This is because the file is not a " + "regular file.\n"), path); } Efree(path); } @@ -194,7 +186,7 @@ Espawn(int argc __UNUSED__, char **argv) execvp(argv[0], argv); - DialogAlertOK(_("There was an error running the program:\n%s\n"), argv[0]); + AlertOK(_("There was an error running the program:\n%s\n"), argv[0]); exit(100); } diff --git a/src/alert.c b/src/alert.c index 0cc87470..2011eb3e 100644 --- a/src/alert.c +++ b/src/alert.c @@ -569,3 +569,16 @@ Alert(const char *fmt, ...) ShowAlert(_("Enlightenment Message Dialog"), _("Ignore this"), _("Restart Enlightenment"), _("Quit Enlightenment"), text); } + +void +AlertOK(const char *fmt, ...) +{ + char text[10240]; + va_list args; + + va_start(args, fmt); + Evsnprintf(text, 10240, fmt, args); + va_end(args); + + ShowAlert(_("Attention !!!"), _("OK"), NULL, NULL, text); +} diff --git a/src/alert.h b/src/alert.h index 3cbf87da..5ec81d0b 100644 --- a/src/alert.h +++ b/src/alert.h @@ -28,6 +28,7 @@ /* alert.c */ void __PRINTF__ Alert(const char *fmt, ...); +void __PRINTF__ AlertOK(const char *fmt, ...); void __PRINTF_5__ AlertX(const char *title, const char *ignore, const char *restart, const char *quit, const char *fmt, ...); diff --git a/src/dialog.c b/src/dialog.c index 00b42fde..799cd063 100644 --- a/src/dialog.c +++ b/src/dialog.c @@ -2042,30 +2042,6 @@ DialogOKstr(const char *title, const char *txt) DialogShow(d); } -void -DialogAlert(const char *fmt, ...) -{ - char text[10240]; - va_list args; - - va_start(args, fmt); - Evsnprintf(text, 10240, fmt, args); - va_end(args); - Alert(text); -} - -void -DialogAlertOK(const char *fmt, ...) -{ - char text[10240]; - va_list args; - - va_start(args, fmt); - Evsnprintf(text, 10240, fmt, args); - va_end(args); - AlertX(_("Attention !!!"), _("OK"), NULL, NULL, text); -} - /* * Dialog event handlers */ diff --git a/src/handlers.c b/src/handlers.c index a19fc0b1..9b75c55e 100644 --- a/src/handlers.c +++ b/src/handlers.c @@ -31,7 +31,6 @@ SignalHandler(int sig) { static int loop_count = 0; int status; - const char *txt; Mode.wm.in_signal_handler = 1; @@ -59,17 +58,17 @@ SignalHandler(int sig) break; case SIGILL: - txt = _("Enlightenment performed an Illegal Instruction.\n" "\n" + Alert(_("Enlightenment performed an Illegal Instruction.\n" "\n" "This most likely is due to you having installed an run a\n" "binary of Enlightenment that was compiled for a make or model\n" "of CPU not 100%% identical or compatible with yours. Please\n" "either obtain the correct package for your system, or\n" "re-compile Enlightenment and possibly any support libraries\n" - "that you got in binary format to run Enlightenment.\n"); - goto do_alert; + "that you got in binary format to run Enlightenment.\n")); + goto do_abort; case SIGFPE: - txt = _("Enlightenment caused a Floating Point Exception.\n" "\n" + Alert(_("Enlightenment caused a Floating Point Exception.\n" "\n" "This means that Enlightenment or support library routines it calls\n" "have performed an illegal mathematical operation (most likely\n" "dividing a number by zero). This is most likely a bug. It is\n" @@ -77,11 +76,11 @@ SignalHandler(int sig) "compile Enlightenment with debugging symbols in and run\n" "Enlightenment under gdb so you can backtrace for where it died and\n" "send in a useful bug report with backtrace information and variable\n" - "dumps etc.\n"); - goto do_alert; + "dumps etc.\n")); + goto do_abort; case SIGSEGV: - txt = _("Enlightenment caused Segment Violation (Segfault)\n" "\n" + Alert(_("Enlightenment caused Segment Violation (Segfault)\n" "\n" "This means that Enlightenment or support library routines it calls\n" "have accessed areas of your system's memory that they are not\n" "allowed access to. This is most likely a bug. It is recommended to\n" @@ -89,17 +88,17 @@ SignalHandler(int sig) "Enlightenment with debugging symbols in and run Enlightenment\n" "under gdb so you can backtrace for where it died and send in a\n" "useful bug report with backtrace information and variable\n" - "dumps etc.\n"); - goto do_alert; + "dumps etc.\n")); + goto do_abort; case SIGBUS: - txt = _("Enlightenment caused Bus Error.\n" "\n" + Alert(_("Enlightenment caused Bus Error.\n" "\n" "It is suggested you check your hardware and OS installation.\n" "It is highly unusual to cause Bus Errors on operational\n" - "hardware.\n"); - goto do_alert; + "hardware.\n")); + goto do_abort; - do_alert: + do_abort: if (loop_count > 0) abort(); loop_count++; @@ -107,7 +106,6 @@ SignalHandler(int sig) disp = NULL; #endif Mode.wm.exit_now = 1; - DialogAlert(txt); SessionExit(EEXIT_ERROR, NULL); abort(); break; diff --git a/src/session.c b/src/session.c index 8eec45c9..26585a5e 100644 --- a/src/session.c +++ b/src/session.c @@ -340,12 +340,12 @@ ice_msgs_process(void) if (status == IceProcessMessagesIOError) { /* Less of the hope.... E survives */ - DialogAlert(_("ERROR!\n" "\n" - "Lost the Session Manager that was there?\n" - "Here here session manager... come here... want a bone?\n" - "Oh come now! Stop sulking! Bugger. Oh well. " - "Will continue without\n" "a session manager.\n" "\n" - "I'll survive somehow.\n" "\n" "\n" "... I hope.\n")); + Alert(_("ERROR!\n" "\n" + "Lost the Session Manager that was there?\n" + "Here here session manager... come here... want a bone?\n" + "Oh come now! Stop sulking! Bugger. Oh well. " + "Will continue without\n" "a session manager.\n" "\n" + "I'll survive somehow.\n" "\n" "\n" "... I hope.\n")); ice_exit(); } }