From 9288298ae80c3fa765b1f8c08ec3081fa86601f5 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 22 Sep 2005 18:17:18 +0000 Subject: [PATCH] - move the common code to a function in the e_modules file. SVN revision: 16851 --- AUTHORS | 1 + src/bin/e_module.c | 19 +++++++++++++++ src/bin/e_module.h | 1 + src/modules/battery/e_mod_main.c | 36 +++++++--------------------- src/modules/clock/e_mod_main.c | 28 ++++------------------ src/modules/cpufreq/e_mod_main.c | 30 +++++------------------ src/modules/dropshadow/e_mod_main.c | 32 ++++++------------------- src/modules/ibar/e_mod_main.c | 34 +++++++------------------- src/modules/ibox/e_mod_main.c | 30 +++++------------------ src/modules/pager/e_mod_main.c | 28 ++++------------------ src/modules/randr/e_mod_main.c | 28 ++++------------------ src/modules/start/e_mod_main.c | 28 ++++------------------ src/modules/temperature/e_mod_main.c | 32 ++++++------------------- src/modules/test/e_mod_main.c | 31 ++++++------------------ 14 files changed, 91 insertions(+), 267 deletions(-) diff --git a/AUTHORS b/AUTHORS index 90e2e60b0..0ec41a757 100644 --- a/AUTHORS +++ b/AUTHORS @@ -3,3 +3,4 @@ Ibukun Olumuyiwa Sebastian Dransfeld HandyAndE (Andrew Williams) CodeWarrior (Hisham Mardam Bey) +dj2 (dan sinclair) diff --git a/src/bin/e_module.c b/src/bin/e_module.c index 57e147430..c5afa1067 100644 --- a/src/bin/e_module.c +++ b/src/bin/e_module.c @@ -456,3 +456,22 @@ _e_module_control_menu_enabled(void *data, E_Menu *m, E_Menu_Item *mi) } e_menu_item_toggle_set(mi, e_module_enabled_get(mod)); } + +void +e_module_dialog_show(char *title, char *body) +{ + E_Dialog *dia; + + dia = e_dialog_new (e_container_current_get (e_manager_current_get ())); + if (!dia) return; + + e_dialog_title_set (dia, title); + e_dialog_icon_set (dia, "enlightenment/e", 64); + e_dialog_text_set (dia, body); + e_dialog_button_add (dia, _("Ok"), NULL, NULL, NULL); + e_win_centered_set (dia->win, 1); + e_dialog_show (dia); +} + + + diff --git a/src/bin/e_module.h b/src/bin/e_module.h index f47cbe078..1e3976d8f 100644 --- a/src/bin/e_module.h +++ b/src/bin/e_module.h @@ -65,6 +65,7 @@ EAPI int e_module_save_all(void); EAPI E_Module *e_module_find(char *name); EAPI Evas_List *e_module_list(void); EAPI E_Menu *e_module_menu_new(void); +EAPI void e_module_dialog_show(char *title, char *body); #endif #endif diff --git a/src/modules/battery/e_mod_main.c b/src/modules/battery/e_mod_main.c index 22c2e4aac..7e17adee7 100644 --- a/src/modules/battery/e_mod_main.c +++ b/src/modules/battery/e_mod_main.c @@ -73,23 +73,13 @@ e_modapi_init(E_Module *m) /* check module api version */ if (m->api->version < E_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: Battery
" + snprintf(buf, sizeof(buf), _("Module API Error
Error initializing Module: %s
" "It requires a minimum module API version of: %i.
" "The module API advertized by Enlightenment is: %i.
"), - E_MODULE_API_VERSION, m->api->version); + _("Battery"), 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); + e_module_dialog_show(_("Enlightenment Battery Module"), buf); return NULL; } /* actually init battery */ @@ -136,20 +126,12 @@ e_modapi_info(E_Module *m) int e_modapi_about(E_Module *m) { - 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); + e_module_dialog_show(_("Enlightenment Battery Module"), + _("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.")); return 1; } diff --git a/src/modules/clock/e_mod_main.c b/src/modules/clock/e_mod_main.c index a071d17ab..d8caf11a4 100644 --- a/src/modules/clock/e_mod_main.c +++ b/src/modules/clock/e_mod_main.c @@ -46,23 +46,13 @@ e_modapi_init(E_Module *module) /* check module api version */ if (module->api->version < E_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
" + snprintf(buf, sizeof(buf), _("Module API Error
Error initializing Module: %s
" "It requires a minimum module API version of: %i.
" "The module API advertized by Enlightenment is: %i.
"), - E_MODULE_API_VERSION, module->api->version); + _("Clock"), 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); + e_module_dialog_show(_("Enlightenment Clock Module"), buf); return NULL; } @@ -111,16 +101,8 @@ e_modapi_info(E_Module *module) int e_modapi_about(E_Module *module) { - 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); + e_module_dialog_show(_("Enlightenment Clock Module"), + _("A simple module to give E17 a clock.")); return 1; } diff --git a/src/modules/cpufreq/e_mod_main.c b/src/modules/cpufreq/e_mod_main.c index e0da18e02..0f467e469 100644 --- a/src/modules/cpufreq/e_mod_main.c +++ b/src/modules/cpufreq/e_mod_main.c @@ -64,23 +64,13 @@ e_modapi_init(E_Module *module) if (module->api->version < E_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
" + snprintf(buf, sizeof(buf), _("Module API Error
Error initializing Module: %s
" "It requires a minimum module API version of: %i.
" "The module API advertized by Enlightenment is: %i.
"), - E_MODULE_API_VERSION, module->api->version); + _("Cpufreq"), 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); + e_module_dialog_show(_("Enlightenment Cpufreq Module"), buf); return NULL; } @@ -128,17 +118,9 @@ e_modapi_info(E_Module *module) int e_modapi_about(E_Module *module) { - 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.")); - e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL); - e_win_centered_set(dia->win, 1); - e_dialog_show(dia); + e_module_dialog_show(_("CPU Frequency Controller Module"), + _("A simple module to control the frequency of the system CPU.
" + "This is especially useful to save power on laptops.")); return 1; } diff --git a/src/modules/dropshadow/e_mod_main.c b/src/modules/dropshadow/e_mod_main.c index d89cc92cb..91298a6f3 100644 --- a/src/modules/dropshadow/e_mod_main.c +++ b/src/modules/dropshadow/e_mod_main.c @@ -97,23 +97,13 @@ e_modapi_init(E_Module *m) if (m->api->version < E_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: Dropshadow
" + snprintf(buf, sizeof(buf), _("Module API Error
Error initializing Module: %s
" "It requires a minimum module API version of: %i.
" "The module API advertized by Enlightenment is: %i.
"), - E_MODULE_API_VERSION, m->api->version); + _("Dropshadow"), 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); + e_module_dialog_show(_("Enlightenment Dropshadow Module"), buf); return NULL; } ds = _ds_init(m); @@ -200,18 +190,10 @@ e_modapi_info(E_Module *m) int e_modapi_about(E_Module *m) { - 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.")); - e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL); - e_win_centered_set(dia->win, 1); - e_dialog_show(dia); + e_module_dialog_show(_("Enlightenment Dropshadow Module"), + _("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; } diff --git a/src/modules/ibar/e_mod_main.c b/src/modules/ibar/e_mod_main.c index c62b58494..9d5c02685 100644 --- a/src/modules/ibar/e_mod_main.c +++ b/src/modules/ibar/e_mod_main.c @@ -118,23 +118,13 @@ e_modapi_init(E_Module *m) /* check module api version */ if (m->api->version < E_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: IBar
" + snprintf(buf, sizeof(buf), _("Module API Error
Error initializing Module: %s
" "It requires a minimum module API version of: %i.
" "The module API advertized by Enlightenment is: %i.
"), - E_MODULE_API_VERSION, m->api->version); + _("IBar"), 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); + e_module_dialog_show(_("Enlightenment IBar Module"), buf); return NULL; } /* actually init ibar */ @@ -181,19 +171,11 @@ e_modapi_info(E_Module *m) int e_modapi_about(E_Module *m) { - 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); + e_module_dialog_show(_("Enlightenment IBar Module"), + _("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.")); return 1; } diff --git a/src/modules/ibox/e_mod_main.c b/src/modules/ibox/e_mod_main.c index dd050221f..64f8c7697 100644 --- a/src/modules/ibox/e_mod_main.c +++ b/src/modules/ibox/e_mod_main.c @@ -100,23 +100,13 @@ e_modapi_init(E_Module *m) /* check module api version */ if (m->api->version < E_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: IBox
" + snprintf(buf, sizeof(buf), _("Module API Error
Error initializing Module: %s
" "It requires a minimum module API version of: %i.
" "The module API advertized by Enlightenment is: %i.
"), - E_MODULE_API_VERSION, m->api->version); + _("IBox"), 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); + e_module_dialog_show(_("Enlightenment IBox Module"), buf); return NULL; } /* actually init ibox */ @@ -163,17 +153,9 @@ e_modapi_info(E_Module *m) int e_modapi_about(E_Module *m) { - 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); + e_module_dialog_show(_("Enlightenment IBox Module"), + _("This is the IBox Iconified Application module for Enlightenment.
" + "It will hold minimized applications")); return 1; } diff --git a/src/modules/pager/e_mod_main.c b/src/modules/pager/e_mod_main.c index 71adba635..6390f9434 100644 --- a/src/modules/pager/e_mod_main.c +++ b/src/modules/pager/e_mod_main.c @@ -112,23 +112,13 @@ e_modapi_init(E_Module *module) /* check module api version */ if (module->api->version < E_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
" + snprintf(buf, sizeof(buf), _("Module API Error
Error initializing Module: %s
" "It requires a minimum module API version of: %i.
" "The module API advertized by Enlightenment is: %i.
"), - E_MODULE_API_VERSION, module->api->version); + _("Pager"), 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); + e_module_dialog_show(_("Enlightenment Pager Module"), buf); return NULL; } /* actually init pager */ @@ -178,16 +168,8 @@ e_modapi_info(E_Module *module) int e_modapi_about(E_Module *module) { - 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); + e_module_dialog_show(_("Enlightenment Pager Module"), + _("A pager module to navigate virtual desktops.")); return 1; } diff --git a/src/modules/randr/e_mod_main.c b/src/modules/randr/e_mod_main.c index 82a399dec..44d523ab2 100644 --- a/src/modules/randr/e_mod_main.c +++ b/src/modules/randr/e_mod_main.c @@ -34,23 +34,13 @@ e_modapi_init(E_Module *m) if (m->api->version < E_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: Randr
" + snprintf(buf, sizeof(buf), _("Module API Error
Error initializing Module: %s
" "It requires a minimum module API version of: %i.
" "The module API advertized by Enlightenment is: %i.
"), - E_MODULE_API_VERSION, m->api->version); + _("RandR"), 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); + e_module_dialog_show(_("Enlightenment Randr Module"), buf); return NULL; } @@ -101,16 +91,8 @@ e_modapi_info(E_Module *m) int e_modapi_about(E_Module *m) { - 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); + e_module_dialog_show(_("Enlightenment Randr Module"), + _("Module to change screen resolution for E17")); return 1; } diff --git a/src/modules/start/e_mod_main.c b/src/modules/start/e_mod_main.c index dfac77c6d..58960a622 100644 --- a/src/modules/start/e_mod_main.c +++ b/src/modules/start/e_mod_main.c @@ -29,23 +29,13 @@ e_modapi_init(E_Module *m) if (m->api->version < E_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: Start
" + snprintf(buf, sizeof(buf), _("Module API Error
Error initializing Module: %s
" "It requires a minimum module API version of: %i.
" "The module API advertized by Enlightenment is: %i.
"), - E_MODULE_API_VERSION, m->api->version); + _("Start"), 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); + e_module_dialog_show(_("Enlightenment Start Module"), buf); return NULL; } @@ -92,16 +82,8 @@ e_modapi_info(E_Module *m) int e_modapi_about(E_Module *m) { - 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); + e_module_dialog_show(_("Enlightenment Start Module"), + _("Experimental Button module for E17")); return 1; } diff --git a/src/modules/temperature/e_mod_main.c b/src/modules/temperature/e_mod_main.c index 5f8b7ca62..80f37e1b7 100644 --- a/src/modules/temperature/e_mod_main.c +++ b/src/modules/temperature/e_mod_main.c @@ -46,23 +46,13 @@ e_modapi_init(E_Module *m) /* check module api version */ if (m->api->version < E_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: Temperature
" + snprintf(buf, sizeof(buf), _("Module API Error
Error initializing Module: %s
" "It requires a minimum module API version of: %i.
" "The module API advertized by Enlightenment is: %i.
"), - E_MODULE_API_VERSION, m->api->version); + _("Temperature"), 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); + e_module_dialog_show(_("Enlightenment Temperature Module"), buf); return NULL; } /* actually init temperature */ @@ -109,18 +99,10 @@ e_modapi_info(E_Module *m) int e_modapi_about(E_Module *m) { - 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.")); - e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL); - e_win_centered_set(dia->win, 1); - e_dialog_show(dia); + e_module_dialog_show(_("Enlightenment Temperature Module"), + _("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; } diff --git a/src/modules/test/e_mod_main.c b/src/modules/test/e_mod_main.c index 8844cf578..5a39aa1cd 100644 --- a/src/modules/test/e_mod_main.c +++ b/src/modules/test/e_mod_main.c @@ -9,23 +9,14 @@ e_modapi_init(E_Module *m) { if (m->api->version < E_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: Test
" + snprintf(buf, sizeof(buf), _("Module API Error
Error initializing Module: %s
" "It requires a minimum module API version of: %i.
" "The module API advertized by Enlightenment is: %i.
"), - E_MODULE_API_VERSION, m->api->version); + _("Test"), 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); + e_module_dialog_show(_("Enlightenment Test Module"), buf); return NULL; } { @@ -76,17 +67,9 @@ e_modapi_info(E_Module *m) int e_modapi_about(E_Module *m) { - 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.")); - e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL); - e_win_centered_set(dia->win, 1); - e_dialog_show(dia); + e_module_dialog_show(_("Enlightenment Test Module"), + _("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; }