aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristopher Michael <cpmichael1@comcast.net>2006-07-03 07:35:44 +0000
committerChristopher Michael <cpmichael1@comcast.net>2006-07-03 07:35:44 +0000
commit73a7ba6011e3a6d2bb20c955011b68da6668f530 (patch)
tree1eb1578f72a984e8a666ae7911ec9fcd9d1a28a0 /src
parentasparagus time... (diff)
downloadenlightenment-73a7ba6011e3a6d2bb20c955011b68da6668f530.tar.gz
As per HandyAndE request, this patch gives ability for modules config
dialogs to show their icon in their config dialog by passing in the module_eap path to the config_dialog_new function as the icon parameter ie: e_config_dialog_new(con, module_name, eap_path, 0, v, data); Update E core modules to use this ability. Fix dropshadow config dialog to fit in 640x480. SVN revision: 23682
Diffstat (limited to 'src')
-rw-r--r--src/bin/e_border.c22
-rw-r--r--src/bin/e_border.h1
-rw-r--r--src/bin/e_dialog.h24
-rw-r--r--src/bin/e_module.c7
-rw-r--r--src/modules/battery/e_mod_config.c6
-rw-r--r--src/modules/dropshadow/e_mod_config.c25
-rw-r--r--src/modules/ibar/e_mod_config.c8
-rw-r--r--src/modules/ibox/e_mod_config.c6
-rw-r--r--src/modules/pager/e_mod_config.c6
-rw-r--r--src/modules/temperature/e_mod_config.c6
10 files changed, 65 insertions, 46 deletions
diff --git a/src/bin/e_border.c b/src/bin/e_border.c
index 64140e904..b8d5b8bba 100644
--- a/src/bin/e_border.c
+++ b/src/bin/e_border.c
@@ -2448,17 +2448,20 @@ e_border_icon_add(E_Border *bd, Evas *evas)
if (bd->internal)
{
o = edje_object_add(evas);
- if ((!bd->internal_icon) && (!bd->module_eap))
+ if (!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)
+ else
{
- if (!edje_object_file_set(o, bd->module_eap, "icon"))
- e_util_edje_icon_set(o, "enlightenment/e");
+ if (!strcmp(bd->internal_icon + strlen(bd->internal_icon) - 4, ".eap"))
+ {
+ if (!edje_object_file_set(o, bd->internal_icon, "icon"))
+ 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");
+ }
}
return o;
}
@@ -3037,7 +3040,6 @@ _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);
diff --git a/src/bin/e_border.h b/src/bin/e_border.h
index efc8477f6..7e9136652 100644
--- a/src/bin/e_border.h
+++ b/src/bin/e_border.h
@@ -135,7 +135,6 @@ 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;
diff --git a/src/bin/e_dialog.h b/src/bin/e_dialog.h
index 4fc15b38f..f9d930c02 100644
--- a/src/bin/e_dialog.h
+++ b/src/bin/e_dialog.h
@@ -29,18 +29,18 @@ struct _E_Dialog
unsigned char resizable : 1;
};
-EAPI E_Dialog *e_dialog_new (E_Container *con);
-EAPI void e_dialog_button_add (E_Dialog *dia, const char *label, const char *icon, void (*func) (void *data, E_Dialog *dia), void *data);
-EAPI int e_dialog_button_focus_num (E_Dialog *dia, int button);
-EAPI int e_dialog_button_disable_num_set (E_Dialog *dia, int button, int disabled);
-EAPI int e_dialog_button_disable_num_get (E_Dialog *dia, int button);
-EAPI void e_dialog_title_set (E_Dialog *dia, const char *title);
-EAPI void e_dialog_text_set (E_Dialog *dia, const char *text);
-EAPI void e_dialog_icon_set (E_Dialog *dia, const char *icon, Evas_Coord size);
-EAPI void e_dialog_border_icon_set (E_Dialog *dia, const char *icon);
-EAPI void e_dialog_content_set (E_Dialog *dia, Evas_Object *obj, Evas_Coord minw, Evas_Coord minh);
-EAPI void e_dialog_resizable_set (E_Dialog *dia, int resizable);
-EAPI void e_dialog_show (E_Dialog *dia);
+EAPI E_Dialog *e_dialog_new (E_Container *con);
+EAPI void e_dialog_button_add (E_Dialog *dia, const char *label, const char *icon, void (*func) (void *data, E_Dialog *dia), void *data);
+EAPI int e_dialog_button_focus_num (E_Dialog *dia, int button);
+EAPI int e_dialog_button_disable_num_set (E_Dialog *dia, int button, int disabled);
+EAPI int e_dialog_button_disable_num_get (E_Dialog *dia, int button);
+EAPI void e_dialog_title_set (E_Dialog *dia, const char *title);
+EAPI void e_dialog_text_set (E_Dialog *dia, const char *text);
+EAPI void e_dialog_icon_set (E_Dialog *dia, const char *icon, Evas_Coord size);
+EAPI void e_dialog_border_icon_set (E_Dialog *dia, const char *icon);
+EAPI void e_dialog_content_set (E_Dialog *dia, Evas_Object *obj, Evas_Coord minw, Evas_Coord minh);
+EAPI void e_dialog_resizable_set (E_Dialog *dia, int resizable);
+EAPI void e_dialog_show (E_Dialog *dia);
#endif
#endif
diff --git a/src/bin/e_module.c b/src/bin/e_module.c
index d89aab8e5..2c89dae2f 100644
--- a/src/bin/e_module.c
+++ b/src/bin/e_module.c
@@ -383,7 +383,7 @@ e_module_dialog_show(E_Module *m, const char *title, const char *body)
if (!m) return;
bd = dia->win->border;
if (!bd) return;
- bd->module_eap = evas_stringshare_add(eap);
+ bd->internal_icon = evas_stringshare_add(eap);
}
/* local subsystem functions */
@@ -505,9 +505,8 @@ _e_module_control_menu_enabled(void *data, E_Menu *m, E_Menu_Item *mi)
e_module_disable(mod);
}
else if ((!mod->enabled) && (enabled))
- {
- e_module_enable(mod);
- }
+ e_module_enable(mod);
+
e_menu_item_toggle_set(mi, e_module_enabled_get(mod));
}
diff --git a/src/modules/battery/e_mod_config.c b/src/modules/battery/e_mod_config.c
index 894487832..01127f2cd 100644
--- a/src/modules/battery/e_mod_config.c
+++ b/src/modules/battery/e_mod_config.c
@@ -21,6 +21,7 @@ _config_battery_module(void)
{
E_Config_Dialog *cfd;
E_Config_Dialog_View *v;
+ char buf[4096];
v = E_NEW(E_Config_Dialog_View, 1);
@@ -30,10 +31,11 @@ _config_battery_module(void)
v->basic.create_widgets = _basic_create_widgets;
v->advanced.apply_cfdata = _advanced_apply_data;
v->advanced.create_widgets = _advanced_create_widgets;
-
+
+ snprintf(buf, sizeof(buf), "%s/module.eap", e_module_dir_get(battery_config->module));
cfd = e_config_dialog_new(e_container_current_get(e_manager_current_get()),
_("Battery Monitor Configuration"),
- NULL, 0, v, NULL);
+ buf, 0, v, NULL);
battery_config->config_dialog = cfd;
}
diff --git a/src/modules/dropshadow/e_mod_config.c b/src/modules/dropshadow/e_mod_config.c
index b33fb7966..cec3b9b94 100644
--- a/src/modules/dropshadow/e_mod_config.c
+++ b/src/modules/dropshadow/e_mod_config.c
@@ -23,6 +23,7 @@ _config_dropshadow_module(E_Container *con, Dropshadow *ds)
{
E_Config_Dialog *cfd;
E_Config_Dialog_View *v;
+ char buf[4096];
v = E_NEW(E_Config_Dialog_View, 1);
@@ -30,8 +31,9 @@ _config_dropshadow_module(E_Container *con, Dropshadow *ds)
v->free_cfdata = _free_data;
v->basic.apply_cfdata = _basic_apply_data;
v->basic.create_widgets = _basic_create_widgets;
-
- cfd = e_config_dialog_new(con, _("Dropshadow Configuration"), NULL, 0, v, ds);
+
+ snprintf(buf, sizeof(buf), "%s/module.eap", e_module_dir_get(ds->module));
+ cfd = e_config_dialog_new(con, _("Dropshadow Configuration"), buf, 0, v, ds);
ds->config_dialog = cfd;
}
@@ -90,12 +92,14 @@ _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
static Evas_Object *
_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
{
- Evas_Object *o, *ob, *of;
+ Evas_Object *o, *ob, *of, *ot;
E_Radio_Group *rg;
o = e_widget_list_add(evas, 0, 0);
-
+ ot = e_widget_table_add(evas, 1);
+
of = e_widget_framelist_add(evas, _("Quality"), 0);
+ e_widget_framelist_content_align_set(of, 0.5, 0.0);
rg = e_widget_radio_group_new(&(cfdata->quality));
ob = e_widget_radio_add(evas, _("High Quality"), 1, rg);
e_widget_framelist_object_append(of, ob);
@@ -103,9 +107,10 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
e_widget_framelist_object_append(of, ob);
ob = e_widget_radio_add(evas, _("Low Quality"), 4, rg);
e_widget_framelist_object_append(of, ob);
- e_widget_list_object_append(o, of, 1, 1, 0.5);
+ e_widget_table_object_append(ot, of, 0, 0, 1, 1, 1, 1, 1, 1);
of = e_widget_framelist_add(evas, _("Blur Type"), 0);
+ e_widget_framelist_content_align_set(of, 0.5, 0.0);
rg = e_widget_radio_group_new(&(cfdata->blur_size));
ob = e_widget_radio_add(evas, _("Very Fuzzy"), 80, rg);
e_widget_framelist_object_append(of, ob);
@@ -117,9 +122,10 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
e_widget_framelist_object_append(of, ob);
ob = e_widget_radio_add(evas, _("Very Sharp"), 5, rg);
e_widget_framelist_object_append(of, ob);
- e_widget_list_object_append(o, of, 1, 1, 0.5);
+ e_widget_table_object_append(ot, of, 0, 1, 1, 1, 1, 1, 1, 1);
of = e_widget_framelist_add(evas, _("Shadow Distance"), 0);
+ e_widget_framelist_content_align_set(of, 0.5, 0.0);
rg = e_widget_radio_group_new(&(cfdata->shadow_x));
ob = e_widget_radio_add(evas, _("Very Far"), 32, rg);
e_widget_framelist_object_append(of, ob);
@@ -133,9 +139,10 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
e_widget_framelist_object_append(of, ob);
ob = e_widget_radio_add(evas, _("Underneath"), 0, rg);
e_widget_framelist_object_append(of, ob);
- e_widget_list_object_append(o, of, 1, 1, 0.5);
+ e_widget_table_object_append(ot, of, 1, 0, 1, 1, 1, 1, 1, 1);
of = e_widget_framelist_add(evas, _("Shadow Darkness"), 0);
+ e_widget_framelist_content_align_set(of, 0.5, 0.0);
rg = e_widget_radio_group_new(&(cfdata->darkness));
ob = e_widget_radio_add(evas, _("Very Dark"), 0, rg);
e_widget_framelist_object_append(of, ob);
@@ -145,7 +152,9 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
e_widget_framelist_object_append(of, ob);
ob = e_widget_radio_add(evas, _("Very Light"), 3, rg);
e_widget_framelist_object_append(of, ob);
- e_widget_list_object_append(o, of, 1, 1, 0.5);
+ e_widget_table_object_append(ot, of, 1, 1, 1, 1, 1, 1, 1, 1);
+
+ e_widget_list_object_append(o, ot, 1, 1, 0.5);
return o;
}
diff --git a/src/modules/ibar/e_mod_config.c b/src/modules/ibar/e_mod_config.c
index 4bf70f9d2..ac231fae4 100644
--- a/src/modules/ibar/e_mod_config.c
+++ b/src/modules/ibar/e_mod_config.c
@@ -34,7 +34,8 @@ _config_ibar_module(Config_Item *ci)
{
E_Config_Dialog *cfd;
E_Config_Dialog_View *v;
-
+ char buf[4096];
+
v = E_NEW(E_Config_Dialog_View, 1);
/* Dialog Methods */
@@ -44,10 +45,11 @@ _config_ibar_module(Config_Item *ci)
v->basic.create_widgets = _basic_create_widgets;
v->advanced.apply_cfdata = NULL;
v->advanced.create_widgets = NULL;
-
+
+ snprintf(buf, sizeof(buf), "%s/module.eap", e_module_dir_get(ibar_config->module));
/* Create The Dialog */
cfd = e_config_dialog_new(e_container_current_get(e_manager_current_get()),
- _("IBar Configuration"), NULL, 0, v, ci);
+ _("IBar Configuration"), buf, 0, v, ci);
ibar_config->config_dialog = cfd;
}
diff --git a/src/modules/ibox/e_mod_config.c b/src/modules/ibox/e_mod_config.c
index dc015f41c..c8a59b744 100644
--- a/src/modules/ibox/e_mod_config.c
+++ b/src/modules/ibox/e_mod_config.c
@@ -33,7 +33,8 @@ _config_ibox_module(Config_Item *ci)
{
E_Config_Dialog *cfd;
E_Config_Dialog_View *v;
-
+ char buf[4096];
+
v = E_NEW(E_Config_Dialog_View, 1);
/* Dialog Methods */
@@ -45,8 +46,9 @@ _config_ibox_module(Config_Item *ci)
v->advanced.create_widgets = NULL;
/* Create The Dialog */
+ snprintf(buf, sizeof(buf), "%s/module.eap", e_module_dir_get(ibox_config->module));
cfd = e_config_dialog_new(e_container_current_get(e_manager_current_get()),
- _("IBox Configuration"), NULL, 0, v, ci);
+ _("IBox Configuration"), buf, 0, v, ci);
ibox_config->config_dialog = evas_list_append(ibox_config->config_dialog, cfd);
}
diff --git a/src/modules/pager/e_mod_config.c b/src/modules/pager/e_mod_config.c
index d75ab0d17..d5b9fd56f 100644
--- a/src/modules/pager/e_mod_config.c
+++ b/src/modules/pager/e_mod_config.c
@@ -21,6 +21,7 @@ _config_pager_module(Config_Item *ci)
{
E_Config_Dialog *cfd;
E_Config_Dialog_View *v;
+ char buf[4096];
v = E_NEW(E_Config_Dialog_View, 1);
@@ -30,9 +31,10 @@ _config_pager_module(Config_Item *ci)
v->basic.create_widgets = _basic_create_widgets;
v->advanced.apply_cfdata = _advanced_apply_data;
v->advanced.create_widgets = _advanced_create_widgets;
-
+
+ snprintf(buf, sizeof(buf), "%s/module.eap", e_module_dir_get(pager_config->module));
cfd = e_config_dialog_new(e_container_current_get(e_manager_current_get()),
- _("Pager Configuration"), NULL, 0, v, ci);
+ _("Pager Configuration"), buf, 0, v, ci);
pager_config->config_dialog = cfd;
}
diff --git a/src/modules/temperature/e_mod_config.c b/src/modules/temperature/e_mod_config.c
index b92ade2d4..4a94df971 100644
--- a/src/modules/temperature/e_mod_config.c
+++ b/src/modules/temperature/e_mod_config.c
@@ -44,6 +44,7 @@ _config_temperature_module(void)
{
E_Config_Dialog *cfd;
E_Config_Dialog_View *v;
+ char buf[4096];
v = E_NEW(E_Config_Dialog_View, 1);
@@ -53,9 +54,10 @@ _config_temperature_module(void)
v->basic.create_widgets = _basic_create_widgets;
v->advanced.apply_cfdata = _advanced_apply_data;
v->advanced.create_widgets = _advanced_create_widgets;
-
+
+ snprintf(buf, sizeof(buf), "%s/module.eap", e_module_dir_get(temperature_config->module));
cfd = e_config_dialog_new(e_container_current_get(e_manager_current_get()),
- _("Temperature Configuration"), NULL, 0, v, NULL);
+ _("Temperature Configuration"), buf, 0, v, NULL);
temperature_config->config_dialog = cfd;
}