From: Enlightenment S. <no-...@en...> - 2008-10-18 19:05:24
|
Log: DialogAlert... -> Alert... Author: kwo Date: 2008-10-18 12:05:18 -0700 (Sat, 18 Oct 2008) New Revision: 36793 Modified: trunk/E16/e/src/E.h trunk/E16/e/src/actions.c trunk/E16/e/src/alert.c trunk/E16/e/src/alert.h trunk/E16/e/src/dialog.c trunk/E16/e/src/handlers.c trunk/E16/e/src/session.c Modified: trunk/E16/e/src/E.h =================================================================== --- trunk/E16/e/src/E.h 2008-10-18 18:43:09 UTC (rev 36792) +++ trunk/E16/e/src/E.h 2008-10-18 19:05:18 UTC (rev 36793) @@ -453,8 +453,6 @@ /* 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); Modified: trunk/E16/e/src/actions.c =================================================================== --- trunk/E16/e/src/actions.c 2008-10-18 18:43:09 UTC (rev 36792) +++ trunk/E16/e/src/actions.c 2008-10-18 19:05:18 UTC (rev 36793) @@ -106,25 +106,22 @@ { /* 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 @@ { /* 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 @@ 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); } Modified: trunk/E16/e/src/alert.c =================================================================== --- trunk/E16/e/src/alert.c 2008-10-18 18:43:09 UTC (rev 36792) +++ trunk/E16/e/src/alert.c 2008-10-18 19:05:18 UTC (rev 36793) @@ -569,3 +569,16 @@ 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); +} Modified: trunk/E16/e/src/alert.h =================================================================== --- trunk/E16/e/src/alert.h 2008-10-18 18:43:09 UTC (rev 36792) +++ trunk/E16/e/src/alert.h 2008-10-18 19:05:18 UTC (rev 36793) @@ -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, ...); Modified: trunk/E16/e/src/dialog.c =================================================================== --- trunk/E16/e/src/dialog.c 2008-10-18 18:43:09 UTC (rev 36792) +++ trunk/E16/e/src/dialog.c 2008-10-18 19:05:18 UTC (rev 36793) @@ -2042,30 +2042,6 @@ 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 */ Modified: trunk/E16/e/src/handlers.c =================================================================== --- trunk/E16/e/src/handlers.c 2008-10-18 18:43:09 UTC (rev 36792) +++ trunk/E16/e/src/handlers.c 2008-10-18 19:05:18 UTC (rev 36793) @@ -31,7 +31,6 @@ { static int loop_count = 0; int status; - const char *txt; Mode.wm.in_signal_handler = 1; @@ -59,17 +58,17 @@ 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 @@ "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 @@ "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 @@ disp = NULL; #endif Mode.wm.exit_now = 1; - DialogAlert(txt); SessionExit(EEXIT_ERROR, NULL); abort(); break; Modified: trunk/E16/e/src/session.c =================================================================== --- trunk/E16/e/src/session.c 2008-10-18 18:43:09 UTC (rev 36792) +++ trunk/E16/e/src/session.c 2008-10-18 19:05:18 UTC (rev 36793) @@ -340,12 +340,12 @@ 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(); } } |