Module about dialogs now show the module icon in the dialog, and the border.

Note: This breaks e_modules until I get them fixed.


SVN revision: 23660
This commit is contained in:
Christopher Michael 2006-07-02 18:55:33 +00:00
parent 165f5f2309
commit 17475003db
14 changed files with 53 additions and 19 deletions

View File

@ -2448,11 +2448,18 @@ e_border_icon_add(E_Border *bd, Evas *evas)
if (bd->internal)
{
o = edje_object_add(evas);
if (!bd->internal_icon)
if ((!bd->internal_icon) && (!bd->module_eap))
e_util_edje_icon_set(o, "enlightenment/e");
else
if (!e_util_edje_icon_set(o, bd->internal_icon))
e_util_edje_icon_set(o, "enlightenment/e");
else if (bd->internal_icon)
{
if (!e_util_edje_icon_set(o, bd->internal_icon))
e_util_edje_icon_set(o, "enlightenment/e");
}
else if (bd->module_eap)
{
if (!edje_object_file_set(o, bd->module_eap, "icon"))
e_util_edje_icon_set(o, "enlightenment/e");
}
return o;
}
if (e_config->use_app_icon)
@ -3030,6 +3037,7 @@ _e_border_free(E_Border *bd)
if (bd->client.netwm.name) free(bd->client.netwm.name);
if (bd->client.netwm.icon_name) free(bd->client.netwm.icon_name);
e_object_del(E_OBJECT(bd->shape));
if (bd->module_eap) evas_stringshare_del(bd->module_eap);
if (bd->internal_icon) evas_stringshare_del(bd->internal_icon);
if (bd->icon_object) evas_object_del(bd->icon_object);
evas_object_del(bd->bg_object);

View File

@ -135,7 +135,8 @@ struct _E_Border
Evas_Object *icon_object;
Ecore_X_Window event_win;
const char *internal_icon;
const char *module_eap;
struct {
Ecore_X_Window shell_win;
Ecore_X_Window win;

View File

@ -26,6 +26,7 @@ static void _e_module_control_menu_configuration(void *data, E_Menu *m, E_Menu_I
static void _e_module_control_menu_enabled(void *data, E_Menu *m, E_Menu_Item *mi);
static void _e_module_dialog_disable_show(const char *title, const char *body, E_Module *m);
static void _e_module_cb_dialog_disable(void *data, E_Dialog *dia);
static void _e_module_dialog_icon_set(E_Dialog *dia, const char *icon);
/* local subsystem globals */
static Evas_List *_e_modules = NULL;
@ -356,20 +357,30 @@ e_module_list(void)
}
EAPI void
e_module_dialog_show(const char *title, const char *body)
e_module_dialog_show(E_Module *m, const char *title, const char *body)
{
E_Dialog *dia;
E_Border *bd;
char eap[4096];
if (!m) return;
snprintf(eap, sizeof(eap), "%s/module.eap", e_module_dir_get(m));
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/modules", 64);
_e_module_dialog_icon_set(dia, eap);
e_dialog_text_set(dia, body);
e_dialog_button_add(dia, _("OK"), NULL, NULL, NULL);
e_dialog_button_focus_num(dia, 0);
e_win_centered_set(dia->win, 1);
e_dialog_show(dia);
if (!eap) return;
bd = dia->win->border;
if (!bd) return;
bd->module_eap = evas_stringshare_add(eap);
}
/* local subsystem functions */
@ -421,7 +432,7 @@ _e_module_control_menu_new(E_Module *mod)
m = e_menu_new();
mi = e_menu_item_new(m);
e_menu_item_label_set(mi, _("About"));
e_menu_item_label_set(mi, _("About..."));
e_menu_item_callback_set(mi, _e_module_control_menu_about, mod);
mi = e_menu_item_new(m);
@ -529,3 +540,17 @@ _e_module_cb_dialog_disable(void *data, E_Dialog *dia)
e_object_del(E_OBJECT(dia));
e_config_save_queue();
}
static void
_e_module_dialog_icon_set(E_Dialog *dia, const char *icon)
{
/* These should never happen, but just in case */
if (!dia) return;
if (!icon) return;
dia->icon_object = edje_object_add(e_win_evas_get(dia->win));
edje_object_file_set(dia->icon_object, icon, "icon");
edje_extern_object_min_size_set(dia->icon_object, 64, 64);
edje_object_part_swallow(dia->bg_object, "icon_swallow", dia->icon_object);
evas_object_show(dia->icon_object);
}

View File

@ -57,7 +57,7 @@ EAPI int e_module_enabled_get(E_Module *m);
EAPI int e_module_save_all(void);
EAPI E_Module *e_module_find(const char *name);
EAPI Evas_List *e_module_list(void);
EAPI void e_module_dialog_show(const char *title, const char *body);
EAPI void e_module_dialog_show(E_Module *m, const char *title, const char *body);
#endif
#endif

View File

@ -1430,7 +1430,7 @@ e_modapi_save(E_Module *m)
EAPI int
e_modapi_about(E_Module *m)
{
e_module_dialog_show(_("Enlightenment Battery Module"),
e_module_dialog_show(m, _("Enlightenment Battery Module"),
_("A basic battery meter that uses either"
"<hilight>ACPI</hilight> or <hilight>APM</hilight><br>"
"on Linux to monitor your battery and AC power adaptor<br>"

View File

@ -146,7 +146,7 @@ e_modapi_save(E_Module *m)
EAPI int
e_modapi_about(E_Module *m)
{
e_module_dialog_show(_("Enlightenment Clock Module"),
e_module_dialog_show(m, _("Enlightenment Clock Module"),
_("A simple module to give E17 a clock."));
return 1;
}

View File

@ -936,7 +936,7 @@ e_modapi_save(E_Module *m)
EAPI int
e_modapi_about(E_Module *m)
{
e_module_dialog_show(_("CPU Frequency Controller Module"),
e_module_dialog_show(m, _("CPU Frequency Controller Module"),
_("A simple module to control the frequency of the system CPU.<br>"
"This is especially useful to save power on laptops."));
return 1;

View File

@ -154,7 +154,7 @@ e_modapi_save(E_Module *m)
EAPI int
e_modapi_about(E_Module *m)
{
e_module_dialog_show(_("Enlightenment Dropshadow Module"),
e_module_dialog_show(m, _("Enlightenment Dropshadow Module"),
_("This is the dropshadow module that allows dropshadows to be cast<br>"
"on the desktop background - without special X-Server extensions<br>"
"or hardware acceleration."));

View File

@ -1377,7 +1377,7 @@ e_modapi_save(E_Module *m)
EAPI int
e_modapi_about(E_Module *m)
{
e_module_dialog_show(_("Enlightenment IBar Module"),
e_module_dialog_show(m, _("Enlightenment IBar Module"),
_("This is the IBar Application Launcher bar module for Enlightenment.<br>"
"It is a first example module and is being used to flesh out several<br>"
"interfaces in Enlightenment 0.17.0. It is under heavy development,<br>"

View File

@ -1418,7 +1418,7 @@ e_modapi_save(E_Module *m)
EAPI int
e_modapi_about(E_Module *m)
{
e_module_dialog_show(_("Enlightenment IBox Module"),
e_module_dialog_show(m, _("Enlightenment IBox Module"),
_("This is the IBox Iconified Application module for Enlightenment.<br>"
"It will hold minimized applications"));
return 1;

View File

@ -158,7 +158,7 @@ e_modapi_info(E_Module *m)
EAPI int
e_modapi_about(E_Module *m)
{
e_module_dialog_show(_("Enlightenment ITray Module"),
e_module_dialog_show(m, _("Enlightenment ITray Module"),
_("This is the ITray system tray module for Enlightenment.<br>"
"It will hold system tray icons.<br>"
"Beware that this can be buggy due to many systray providing<br>"

View File

@ -1825,7 +1825,7 @@ e_modapi_save(E_Module *m)
EAPI int
e_modapi_about(E_Module *m)
{
e_module_dialog_show(_("Enlightenment Pager Module"),
e_module_dialog_show(m, _("Enlightenment Pager Module"),
_("A pager module to navigate virtual desktops."));
return 1;
}

View File

@ -252,7 +252,7 @@ e_modapi_save(E_Module *m)
EAPI int
e_modapi_about(E_Module *m)
{
e_module_dialog_show(_("Enlightenment Start Module"),
e_module_dialog_show(m, _("Enlightenment Start Module"),
_("Experimental Button module for E17"));
return 1;
}

View File

@ -446,7 +446,7 @@ e_modapi_save(E_Module *m)
EAPI int
e_modapi_about(E_Module *m)
{
e_module_dialog_show(_("Enlightenment Temperature Module"),
e_module_dialog_show(m, _("Enlightenment Temperature Module"),
_("A module to measure the <hilight>ACPI Thermal sensor</hilight> on Linux.<br>"
"It is especially useful for modern Laptops with high speed<br>"
"CPUs that generate a lot of heat."));