From 78e3b8efed0a5f23348f1ac2aefe0cf448d47e13 Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Wed, 21 Sep 2005 01:18:30 +0000 Subject: [PATCH] Changed module to use e_dialog instead of e_error SVN revision: 16820 --- src/modules/battery/e_mod_main.c | 59 +++++++++++++++++++------- src/modules/clock/e_mod_main.c | 38 ++++++++++++----- src/modules/cpufreq/e_mod_main.c | 62 +++++++++++++++++++++------- src/modules/dropshadow/e_mod_main.c | 40 +++++++++++++----- src/modules/ibar/e_mod_main.c | 44 ++++++++++++++------ src/modules/ibox/e_mod_main.c | 43 ++++++++++++------- src/modules/pager/e_mod_main.c | 38 ++++++++++++----- src/modules/randr/e_mod_main.c | 40 +++++++++++++----- src/modules/start/e_mod_main.c | 40 +++++++++++++----- src/modules/temperature/e_mod_main.c | 42 +++++++++++++------ src/modules/test/e_mod_main.c | 42 +++++++++++++------ 11 files changed, 354 insertions(+), 134 deletions(-) diff --git a/src/modules/battery/e_mod_main.c b/src/modules/battery/e_mod_main.c index cd969bba6..a190e6bd6 100644 --- a/src/modules/battery/e_mod_main.c +++ b/src/modules/battery/e_mod_main.c @@ -73,13 +73,23 @@ e_modapi_init(E_Module *m) /* check module api version */ if (m->api->version < E_MODULE_API_VERSION) { - e_error_dialog_show(_("Module API Error"), - _("Error initializing Module: Battery\n" - "It requires a minimum module API version of: %i.\n" - "The module API advertized by Enlightenment is: %i.\n" - "Aborting module."), - E_MODULE_API_VERSION, - m->api->version); + E_Dialog *dia; + char buf[4096]; + + dia = e_dialog_new(e_container_current_get(e_manager_current_get())); + if (!dia) return NULL; + + snprintf(buf, sizeof(buf), _("Module API Error
Error initializing Module: Battery
" + "It requires a minimum module API version of: %i.
" + "The module API advertized by Enlightenment is: %i.
"), + E_MODULE_API_VERSION, m->api->version); + + e_dialog_title_set(dia, "Enlightenment Battery Module"); + e_dialog_icon_set(dia, "enlightenment/e", 64); + e_dialog_text_set(dia, buf); + e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL); + e_win_centered_set(dia->win, 1); + e_dialog_show(dia); return NULL; } /* actually init battery */ @@ -126,12 +136,21 @@ e_modapi_info(E_Module *m) int e_modapi_about(E_Module *m) { - e_error_dialog_show(_("Enlightenment Battery Module"), - _("A basic battery meter that uses either ACPI or APM\n" - "on Linux to monitor your battery and AC power adaptor\n" - "status. This will work under Linux and FreeBSD and is only\n" - "as accurate as your BIOS or kernel drivers.")); - return 1; + E_Dialog *dia; + + dia = e_dialog_new(e_container_current_get(e_manager_current_get())); + if (!dia) return 0; + e_dialog_title_set(dia, "Enlightenment Battery Module"); + e_dialog_icon_set(dia, "enlightenment/e", 64); + e_dialog_text_set(dia, _("A basic battery meter that uses either" + "ACPI or APM
" + "on Linux to monitor your battery and AC power adaptor
" + "status. This will work under Linux and FreeBSD and is only
" + "as accurate as your BIOS or kernel drivers.")); + e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL); + e_win_centered_set(dia->win, 1); + e_dialog_show(dia); + return 1; } /* module private routines */ @@ -756,9 +775,17 @@ _battery_cb_check(void *data) { if (!ef->alarm_triggered) { - e_error_dialog_show(_("Battery Running Low"), - _("Your battery is running low.\n" - "You may wish to switch to an AC source.")); + E_Dialog *dia; + + dia = e_dialog_new(e_container_current_get(e_manager_current_get())); + if (!dia) return 0; + e_dialog_title_set(dia, "Enlightenment Battery Module"); + e_dialog_icon_set(dia, "enlightenment/e", 64); + e_dialog_text_set(dia, _("Battery Running Low
Your battery is running low.
" + "You may wish to switch to an AC source.")); + e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL); + e_win_centered_set(dia->win, 1); + e_dialog_show(dia); } edje_object_signal_emit(face->bat_object, "pulse", ""); } diff --git a/src/modules/clock/e_mod_main.c b/src/modules/clock/e_mod_main.c index 30e7f7f1b..3dc0f0ff6 100644 --- a/src/modules/clock/e_mod_main.c +++ b/src/modules/clock/e_mod_main.c @@ -46,13 +46,23 @@ e_modapi_init(E_Module *module) /* check module api version */ if (module->api->version < E_MODULE_API_VERSION) { - e_error_dialog_show(_("Module API Error"), - _("Error initializing Module: Clock\n" - "It requires a minimum module API version of: %i.\n" - "The module API advertized by Enlightenment is: %i.\n" - "Aborting module."), - E_MODULE_API_VERSION, - module->api->version); + E_Dialog *dia; + char buf[4096]; + + dia = e_dialog_new(e_container_current_get(e_manager_current_get())); + if (!dia) return NULL; + + snprintf(buf, sizeof(buf), _("Module API Error
Error initializing Module: Clock
" + "It requires a minimum module API version of: %i.
" + "The module API advertized by Enlightenment is: %i.
"), + E_MODULE_API_VERSION, module->api->version); + + e_dialog_title_set(dia, "Enlightenment Clock Module"); + e_dialog_icon_set(dia, "enlightenment/e", 64); + e_dialog_text_set(dia, buf); + e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL); + e_win_centered_set(dia->win, 1); + e_dialog_show(dia); return NULL; } @@ -101,9 +111,17 @@ e_modapi_info(E_Module *module) int e_modapi_about(E_Module *module) { - e_error_dialog_show(_("Enlightenment Clock Module"), - _("A simple module to give E17 a clock.")); - return 1; + E_Dialog *dia; + + dia = e_dialog_new(e_container_current_get(e_manager_current_get())); + if (!dia) return 0; + e_dialog_title_set(dia, "Enlightenment Clock Module"); + e_dialog_icon_set(dia, "enlightenment/e", 64); + e_dialog_text_set(dia, _("A simple module to give E17 a clock.")); + e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL); + e_win_centered_set(dia->win, 1); + e_dialog_show(dia); + return 1; } /* module private routines */ diff --git a/src/modules/cpufreq/e_mod_main.c b/src/modules/cpufreq/e_mod_main.c index 99d987d8e..88eef551b 100644 --- a/src/modules/cpufreq/e_mod_main.c +++ b/src/modules/cpufreq/e_mod_main.c @@ -64,13 +64,23 @@ e_modapi_init(E_Module *module) if (module->api->version < E_MODULE_API_VERSION) { - e_error_dialog_show(_("Module API Error"), - _("Error initializing Module: cpufreq\n" - "It requires a minimum module API version of: %i.\n" - "The module API advertized by Enlightenment is %i.\n" - "Aborting module."), - E_MODULE_API_VERSION, - module->api->version); + E_Dialog *dia; + char buf[4096]; + + dia = e_dialog_new(e_container_current_get(e_manager_current_get())); + if (!dia) return NULL; + + snprintf(buf, sizeof(buf), _("Module API Error
Error initializing Module: Cpufreq
" + "It requires a minimum module API version of: %i.
" + "The module API advertized by Enlightenment is: %i.
"), + E_MODULE_API_VERSION, module->api->version); + + e_dialog_title_set(dia, "Enlightenment Cpufreq Module"); + e_dialog_icon_set(dia, "enlightenment/e", 64); + e_dialog_text_set(dia, buf); + e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL); + e_win_centered_set(dia->win, 1); + e_dialog_show(dia); return NULL; } @@ -118,10 +128,18 @@ e_modapi_info(E_Module *module) int e_modapi_about(E_Module *module) { - e_error_dialog_show(_("CPU Frequency Controller Module"), - _("A simple module to control the frequency of the system CPU. " + E_Dialog *dia; + + dia = e_dialog_new(e_container_current_get(e_manager_current_get())); + if (!dia) return 0; + e_dialog_title_set(dia, "CPU Frequency Controller Module"); + e_dialog_icon_set(dia, "enlightenment/e", 64); + e_dialog_text_set(dia, _("A simple module to control the frequency of the system CPU.
" "This is especially useful to save power on laptops.")); - return 1; + e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL); + e_win_centered_set(dia->win, 1); + e_dialog_show(dia); + return 1; } static Cpufreq * @@ -301,9 +319,17 @@ _cpufreq_set_governor(Cpufreq *e, const char *governor) ret = system(buf); if (ret != 0) { - e_error_dialog_show(_("CPU Frequency ERROR"), - _("There was an error trying to set the cpu frequency\n" + E_Dialog *dia; + + dia = e_dialog_new(e_container_current_get(e_manager_current_get())); + if (!dia) return; + e_dialog_title_set(dia, "Enlightenment Cpufreq Module"); + e_dialog_icon_set(dia, "enlightenment/e", 64); + e_dialog_text_set(dia, _("There was an error trying to set the cpu frequency
" "governor via the module's setfreq utility.")); + e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL); + e_win_centered_set(dia->win, 1); + e_dialog_show(dia); } } @@ -321,9 +347,17 @@ _cpufreq_set_frequency(Cpufreq *e, int frequency) ret = system(buf); if (ret != 0) { - e_error_dialog_show(_("CPU Frequency ERROR"), - _("There was an error trying to set the cpu frequency\n" + E_Dialog *dia; + + dia = e_dialog_new(e_container_current_get(e_manager_current_get())); + if (!dia) return; + e_dialog_title_set(dia, "Enlightenment Cpufreq Module"); + e_dialog_icon_set(dia, "enlightenment/e", 64); + e_dialog_text_set(dia, _("There was an error trying to set the cpu frequency
" "setting via the module's setfreq utility.")); + e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL); + e_win_centered_set(dia->win, 1); + e_dialog_show(dia); } } diff --git a/src/modules/dropshadow/e_mod_main.c b/src/modules/dropshadow/e_mod_main.c index e2b275b6a..bac8691f4 100644 --- a/src/modules/dropshadow/e_mod_main.c +++ b/src/modules/dropshadow/e_mod_main.c @@ -97,13 +97,23 @@ e_modapi_init(E_Module *m) if (m->api->version < E_MODULE_API_VERSION) { - e_error_dialog_show(_("Module API Error"), - _("Error initializing Module: Dropshadow\n" - "It requires a minimum module API version of: %i.\n" - "The module API advertized by Enlightenment is: %i.\n" - "Aborting module."), - E_MODULE_API_VERSION, - m->api->version); + E_Dialog *dia; + char buf[4096]; + + dia = e_dialog_new(e_container_current_get(e_manager_current_get())); + if (!dia) return NULL; + + snprintf(buf, sizeof(buf), _("Module API Error
Error initializing Module: Dropshadow
" + "It requires a minimum module API version of: %i.
" + "The module API advertized by Enlightenment is: %i.
"), + E_MODULE_API_VERSION, m->api->version); + + e_dialog_title_set(dia, "Enlightenment Dropshadow Module"); + e_dialog_icon_set(dia, "enlightenment/e", 64); + e_dialog_text_set(dia, buf); + e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL); + e_win_centered_set(dia->win, 1); + e_dialog_show(dia); return NULL; } ds = _ds_init(m); @@ -190,11 +200,19 @@ e_modapi_info(E_Module *m) int e_modapi_about(E_Module *m) { - e_error_dialog_show(_("Enlightenment Dropshadow Module"), - _("This is the dropshadow module that allows dropshadows to be cast\n" - "on the desktop background - without special X-Server extensions\n" + E_Dialog *dia; + + dia = e_dialog_new(e_container_current_get(e_manager_current_get())); + if (!dia) return 0; + e_dialog_title_set(dia, "Enlightenment Dropshadow Module"); + e_dialog_icon_set(dia, "enlightenment/e", 64); + e_dialog_text_set(dia, _("This is the dropshadow module that allows dropshadows to be cast
" + "on the desktop background - without special X-Server extensions
" "or hardware acceleration.")); - return 1; + e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL); + e_win_centered_set(dia->win, 1); + e_dialog_show(dia); + return 1; } /* module private routines */ diff --git a/src/modules/ibar/e_mod_main.c b/src/modules/ibar/e_mod_main.c index 865cec70a..d4856fbfb 100644 --- a/src/modules/ibar/e_mod_main.c +++ b/src/modules/ibar/e_mod_main.c @@ -118,13 +118,23 @@ e_modapi_init(E_Module *m) /* check module api version */ if (m->api->version < E_MODULE_API_VERSION) { - e_error_dialog_show(_("Module API Error"), - _("Error initializing Module: IBar\n" - "It requires a minimum module API version of: %i.\n" - "The module API advertized by Enlightenment is: %i.\n" - "Aborting module."), - E_MODULE_API_VERSION, - m->api->version); + E_Dialog *dia; + char buf[4096]; + + dia = e_dialog_new(e_container_current_get(e_manager_current_get())); + if (!dia) return NULL; + + snprintf(buf, sizeof(buf), _("Module API Error
Error initializing Module: IBar
" + "It requires a minimum module API version of: %i.
" + "The module API advertized by Enlightenment is: %i.
"), + E_MODULE_API_VERSION, m->api->version); + + e_dialog_title_set(dia, "Enlightenment IBar Module"); + e_dialog_icon_set(dia, "enlightenment/e", 64); + e_dialog_text_set(dia, buf); + e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL); + e_win_centered_set(dia->win, 1); + e_dialog_show(dia); return NULL; } /* actually init ibar */ @@ -171,12 +181,20 @@ e_modapi_info(E_Module *m) int e_modapi_about(E_Module *m) { - e_error_dialog_show(_("Enlightenment IBar Module"), - _("This is the IBar Application Launcher bar module for Enlightenment.\n" - "It is a first example module and is being used to flesh out several\n" - "interfaces in Enlightenment 0.17.0. It is under heavy development,\n" - "so expect it to break often and change as it improves.")); - return 1; + E_Dialog *dia; + + dia = e_dialog_new(e_container_current_get(e_manager_current_get())); + if (!dia) return 0; + e_dialog_title_set(dia, "Enlightenment IBar Module"); + e_dialog_icon_set(dia, "enlightenment/e", 64); + e_dialog_text_set(dia, _("This is the IBar Application Launcher bar module for Enlightenment.
" + "It is a first example module and is being used to flesh out several
" + "interfaces in Enlightenment 0.17.0. It is under heavy development,
" + "so expect it to break often and change as it improves.")); + e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL); + e_win_centered_set(dia->win, 1); + e_dialog_show(dia); + return 1; } /* module private routines */ diff --git a/src/modules/ibox/e_mod_main.c b/src/modules/ibox/e_mod_main.c index e1d0189a1..aedfba8d1 100644 --- a/src/modules/ibox/e_mod_main.c +++ b/src/modules/ibox/e_mod_main.c @@ -100,13 +100,23 @@ e_modapi_init(E_Module *m) /* check module api version */ if (m->api->version < E_MODULE_API_VERSION) { - e_error_dialog_show(_("Module API Error"), - _("Error initializing Module: IBox\n" - "It requires a minimum module API version of: %i.\n" - "The module API advertized by Enlightenment is: %i.\n" - "Aborting module."), - E_MODULE_API_VERSION, - m->api->version); + E_Dialog *dia; + char buf[4096]; + + dia = e_dialog_new(e_container_current_get(e_manager_current_get())); + if (!dia) return NULL; + + snprintf(buf, sizeof(buf), _("Module API Error
Error initializing Module: IBox
" + "It requires a minimum module API version of: %i.
" + "The module API advertized by Enlightenment is: %i.
"), + E_MODULE_API_VERSION, m->api->version); + + e_dialog_title_set(dia, "Enlightenment IBox Module"); + e_dialog_icon_set(dia, "enlightenment/e", 64); + e_dialog_text_set(dia, buf); + e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL); + e_win_centered_set(dia->win, 1); + e_dialog_show(dia); return NULL; } /* actually init ibox */ @@ -153,13 +163,18 @@ e_modapi_info(E_Module *m) int e_modapi_about(E_Module *m) { - /* FIXME: Wrong text */ - e_error_dialog_show(_("Enlightenment IBox Module"), - _("This is the IBox Application Launcher box module for Enlightenment.\n" - "It is a first example module and is being used to flesh out several\n" - "Interfaces in Enlightenment 0.17.0. It is under heavy development,\n" - "so expect it to break often and change as it improves.")); - return 1; + E_Dialog *dia; + + dia = e_dialog_new(e_container_current_get(e_manager_current_get())); + if (!dia) return 0; + e_dialog_title_set(dia, "Enlightenment IBox Module"); + e_dialog_icon_set(dia, "enlightenment/e", 64); + e_dialog_text_set(dia, _("This is the IBox Iconified Application module for Enlightenment.
" + "It will hold minimized applications")); + e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL); + e_win_centered_set(dia->win, 1); + e_dialog_show(dia); + return 1; } /* module private routines */ diff --git a/src/modules/pager/e_mod_main.c b/src/modules/pager/e_mod_main.c index fca56939f..b6dbbb521 100644 --- a/src/modules/pager/e_mod_main.c +++ b/src/modules/pager/e_mod_main.c @@ -112,13 +112,23 @@ e_modapi_init(E_Module *module) /* check module api version */ if (module->api->version < E_MODULE_API_VERSION) { - e_error_dialog_show(_("Module API Error"), - _("Error initializing Module: Pager\n" - "It requires a minimum module API version of: %i.\n" - "The module API advertized by Enlightenment is: %i.\n" - "Aborting module."), - E_MODULE_API_VERSION, - module->api->version); + E_Dialog *dia; + char buf[4096]; + + dia = e_dialog_new(e_container_current_get(e_manager_current_get())); + if (!dia) return NULL; + + snprintf(buf, sizeof(buf), _("Module API Error
Error initializing Module: Pager
" + "It requires a minimum module API version of: %i.
" + "The module API advertized by Enlightenment is: %i.
"), + E_MODULE_API_VERSION, module->api->version); + + e_dialog_title_set(dia, "Enlightenment Pager Module"); + e_dialog_icon_set(dia, "enlightenment/e", 64); + e_dialog_text_set(dia, buf); + e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL); + e_win_centered_set(dia->win, 1); + e_dialog_show(dia); return NULL; } /* actually init pager */ @@ -168,9 +178,17 @@ e_modapi_info(E_Module *module) int e_modapi_about(E_Module *module) { - e_error_dialog_show(_("Enlightenment Pager Module"), - _("A pager module to navigate virtual desktops.")); - return 1; + E_Dialog *dia; + + dia = e_dialog_new(e_container_current_get(e_manager_current_get())); + if (!dia) return 0; + e_dialog_title_set(dia, "Enlightenment Pager Module"); + e_dialog_icon_set(dia, "enlightenment/e", 64); + e_dialog_text_set(dia, _("A pager module to navigate virtual desktops.")); + e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL); + e_win_centered_set(dia->win, 1); + e_dialog_show(dia); + return 1; } /* module private routines */ diff --git a/src/modules/randr/e_mod_main.c b/src/modules/randr/e_mod_main.c index 731d72578..8509c73a7 100644 --- a/src/modules/randr/e_mod_main.c +++ b/src/modules/randr/e_mod_main.c @@ -33,14 +33,24 @@ e_modapi_init(E_Module *m) Randr *e; if (m->api->version < E_MODULE_API_VERSION) { - e_error_dialog_show(_("Module API Error"), - _("Error initializing Module: randr\n" - "It requires a minimum module API version of: %i.\n" - "The module API advertized by Enlightenment is: %i.\n" - "Aborting module."), - E_MODULE_API_VERSION, - m->api->version); - return NULL; + E_Dialog *dia; + char buf[4096]; + + dia = e_dialog_new(e_container_current_get(e_manager_current_get())); + if (!dia) return NULL; + + snprintf(buf, sizeof(buf), _("Module API Error
Error initializing Module: Randr
" + "It requires a minimum module API version of: %i.
" + "The module API advertized by Enlightenment is: %i.
"), + E_MODULE_API_VERSION, m->api->version); + + e_dialog_title_set(dia, "Enlightenment Randr Module"); + e_dialog_icon_set(dia, "enlightenment/e", 64); + e_dialog_text_set(dia, buf); + e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL); + e_win_centered_set(dia->win, 1); + e_dialog_show(dia); + return NULL; } /* Create the button */ @@ -90,9 +100,17 @@ e_modapi_info(E_Module *m) int e_modapi_about(E_Module *m) { - e_error_dialog_show(_("Enlightenment Randr Module"), - _("Module to change screen resolution for E17")); - return 1; + E_Dialog *dia; + + dia = e_dialog_new(e_container_current_get(e_manager_current_get())); + if (!dia) return 0; + e_dialog_title_set(dia, "Enlightenment Randr Module"); + e_dialog_icon_set(dia, "enlightenment/e", 64); + e_dialog_text_set(dia, _("Module to change screen resolution for E17")); + e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL); + e_win_centered_set(dia->win, 1); + e_dialog_show(dia); + return 1; } static Randr * diff --git a/src/modules/start/e_mod_main.c b/src/modules/start/e_mod_main.c index b921d3518..76df25a42 100644 --- a/src/modules/start/e_mod_main.c +++ b/src/modules/start/e_mod_main.c @@ -25,14 +25,24 @@ e_modapi_init(E_Module *m) Start *e; if (m->api->version < E_MODULE_API_VERSION) { - e_error_dialog_show(_("Module API Error"), - _("Error initializing Module: start\n" - "It requires a minimum module API version of: %i.\n" - "The module API advertized by Enlightenment is: %i.\n" - "Aborting module."), - E_MODULE_API_VERSION, - m->api->version); - return NULL; + E_Dialog *dia; + char buf[4096]; + + dia = e_dialog_new(e_container_current_get(e_manager_current_get())); + if (!dia) return NULL; + + snprintf(buf, sizeof(buf), _("Module API Error
Error initializing Module: Start
" + "It requires a minimum module API version of: %i.
" + "The module API advertized by Enlightenment is: %i.
"), + E_MODULE_API_VERSION, m->api->version); + + e_dialog_title_set(dia, "Enlightenment Start Module"); + e_dialog_icon_set(dia, "enlightenment/e", 64); + e_dialog_text_set(dia, buf); + e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL); + e_win_centered_set(dia->win, 1); + e_dialog_show(dia); + return NULL; } /* Create the button */ @@ -78,9 +88,17 @@ e_modapi_info(E_Module *m) int e_modapi_about(E_Module *m) { - e_error_dialog_show(_("Enlightenment Start Module"), - _("Experimental Button module for E17")); - return 1; + E_Dialog *dia; + + dia = e_dialog_new(e_container_current_get(e_manager_current_get())); + if (!dia) return 0; + e_dialog_title_set(dia, "Enlightenment Start Module"); + e_dialog_icon_set(dia, "enlightenment/e", 64); + e_dialog_text_set(dia, _("Experimental Button module for E17")); + e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL); + e_win_centered_set(dia->win, 1); + e_dialog_show(dia); + return 1; } static Start * diff --git a/src/modules/temperature/e_mod_main.c b/src/modules/temperature/e_mod_main.c index 89c62a631..db1bf1569 100644 --- a/src/modules/temperature/e_mod_main.c +++ b/src/modules/temperature/e_mod_main.c @@ -46,14 +46,24 @@ e_modapi_init(E_Module *m) /* check module api version */ if (m->api->version < E_MODULE_API_VERSION) { - e_error_dialog_show(_("Module API Error"), - _("Error initializing Module: Temperature\n" - "It requires a minimum module API version of: %i.\n" - "The module API advertized by Enlightenment is: %i.\n" - "Aborting module."), - E_MODULE_API_VERSION, - m->api->version); - return NULL; + E_Dialog *dia; + char buf[4096]; + + dia = e_dialog_new(e_container_current_get(e_manager_current_get())); + if (!dia) return NULL; + + snprintf(buf, sizeof(buf), _("Module API Error
Error initializing Module: Temperature
" + "It requires a minimum module API version of: %i.
" + "The module API advertized by Enlightenment is: %i.
"), + E_MODULE_API_VERSION, m->api->version); + + e_dialog_title_set(dia, "Enlightenment Temperature Module"); + e_dialog_icon_set(dia, "enlightenment/e", 64); + e_dialog_text_set(dia, buf); + e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL); + e_win_centered_set(dia->win, 1); + e_dialog_show(dia); + return NULL; } /* actually init temperature */ e = _temperature_new(m); @@ -99,11 +109,19 @@ e_modapi_info(E_Module *m) int e_modapi_about(E_Module *m) { - e_error_dialog_show(_("Enlightenment Temperature Module"), - _("A module to measure the ACPI Thermal sensor on Linux.\n" - "It is especially useful for modern Laptops with high speed\n" + E_Dialog *dia; + + dia = e_dialog_new(e_container_current_get(e_manager_current_get())); + if (!dia) return 0; + e_dialog_title_set(dia, "Enlightenment Temperature Module"); + e_dialog_icon_set(dia, "enlightenment/e", 64); + e_dialog_text_set(dia, _("A module to measure the ACPI Thermal sensor on Linux.
" + "It is especially useful for modern Laptops with high speed
" "CPUs that generate a lot of heat.")); - return 1; + e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL); + e_win_centered_set(dia->win, 1); + e_dialog_show(dia); + return 1; } /* module private routines */ diff --git a/src/modules/test/e_mod_main.c b/src/modules/test/e_mod_main.c index 6a024d228..ceadbc863 100644 --- a/src/modules/test/e_mod_main.c +++ b/src/modules/test/e_mod_main.c @@ -6,14 +6,24 @@ e_modapi_init(E_Module *m) { if (m->api->version < E_MODULE_API_VERSION) { - e_error_dialog_show(_("Module API Error"), - _("Error initializing Module: test\n" - "It requires a minimum module API version of: %i.\n" - "The module API advertized by Enlightenment is: %i.\n" - "Aborting module."), - E_MODULE_API_VERSION, - m->api->version); - return NULL; + E_Dialog *dia; + char buf[4096]; + + dia = e_dialog_new(e_container_current_get(e_manager_current_get())); + if (!dia) return NULL; + + snprintf(buf, sizeof(buf), _("Module API Error
Error initializing Module: Test
" + "It requires a minimum module API version of: %i.
" + "The module API advertized by Enlightenment is: %i.
"), + E_MODULE_API_VERSION, m->api->version); + + e_dialog_title_set(dia, "Enlightenment Test Module"); + e_dialog_icon_set(dia, "enlightenment/e", 64); + e_dialog_text_set(dia, buf); + e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL); + e_win_centered_set(dia->win, 1); + e_dialog_show(dia); + return NULL; } { E_Menu *mn; @@ -63,9 +73,17 @@ e_modapi_info(E_Module *m) int e_modapi_about(E_Module *m) { - e_error_dialog_show(_("Enlightenment Test Module"), - _("This module is VERY simple and is only used to test the basic\n" - "interface of the Enlightenment 0.17.0 module system. Please\n" + E_Dialog *dia; + + dia = e_dialog_new(e_container_current_get(e_manager_current_get())); + if (!dia) return 0; + e_dialog_title_set(dia, "Enlightenment Test Module"); + e_dialog_icon_set(dia, "enlightenment/e", 64); + e_dialog_text_set(dia, _("This module is VERY simple and is only used to test the basic
" + "interface of the Enlightenment 0.17.0 module system. Please
" "ignore this module unless you are working on the module system.")); - return 1; + e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL); + e_win_centered_set(dia->win, 1); + e_dialog_show(dia); + return 1; }