formatting

SVN revision: 72860
This commit is contained in:
Mike Blumenkrantz 2012-06-26 08:58:14 +00:00
parent fc4433e82f
commit 217255af09
1 changed files with 85 additions and 72 deletions

View File

@ -1,16 +1,16 @@
#include "e.h"
static void *_create_data(E_Config_Dialog *cfd);
static void _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
static void *_create_data(E_Config_Dialog *cfd);
static void _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
static Evas_Object *_basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
static void _ilist_fill(E_Config_Dialog_Data *cfdata);
static void _ilist_cb_selected(void *data);
static void _cb_add(void *data, void *data2);
static void _cb_delete(void *data, void *data2);
static void _cb_dialog_yes(void *data);
static void _cb_dialog_destroy(void *data);
static void _cb_config(void *data, void *data2);
static void _cb_contents(void *data, void *data2);
static void _ilist_fill(E_Config_Dialog_Data *cfdata);
static void _ilist_cb_selected(void *data);
static void _cb_add(void *data, void *data2);
static void _cb_delete(void *data, void *data2);
static void _cb_dialog_yes(void *data);
static void _cb_dialog_destroy(void *data);
static void _cb_config(void *data, void *data2);
static void _cb_contents(void *data, void *data2);
struct _E_Config_Dialog_Data
{
@ -18,14 +18,14 @@ struct _E_Config_Dialog_Data
Evas_Object *o_delete;
Evas_Object *o_config;
const char *cur_shelf;
const char *cur_shelf;
};
typedef struct _Shelf_Del_Confirm_Data Shelf_Del_Confirm_Data;
struct _Shelf_Del_Confirm_Data
{
E_Config_Dialog_Data *cfdata;
E_Shelf *es;
E_Config_Dialog_Data *cfdata;
E_Shelf *es;
};
E_Config_Dialog *
@ -42,8 +42,8 @@ e_int_config_shelf(E_Container *con, const char *params __UNUSED__)
v->basic.create_widgets = _basic_create;
cfd = e_config_dialog_new(con, _("Shelf Settings"), "E",
"extensions/shelves",
"preferences-desktop-shelf", 0, v, NULL);
"extensions/shelves",
"preferences-desktop-shelf", 0, v, NULL);
return cfd;
}
@ -81,14 +81,14 @@ _basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
ow = e_widget_button_add(evas, _("Add"), "list-add", _cb_add, cfdata, NULL);
e_widget_table_object_append(ot, ow, 0, 0, 1, 1, 1, 1, 0, 0);
cfdata->o_delete = e_widget_button_add(evas, _("Delete"), "list-remove",
_cb_delete, cfdata, NULL);
_cb_delete, cfdata, NULL);
e_widget_table_object_append(ot, cfdata->o_delete, 1, 0, 1, 1, 1, 1, 0, 0);
cfdata->o_config = e_widget_button_add(evas, _("Contents"), "preferences-desktop-shelf",
_cb_contents, cfdata, NULL);
_cb_contents, cfdata, NULL);
e_widget_table_object_align_append(ot, cfdata->o_config,
2, 0, 1, 1, 0, 1, 1, 1, 1.0, 0.5);
cfdata->o_config = e_widget_button_add(evas, _("Setup"), "configure",
_cb_config, cfdata, NULL);
_cb_config, cfdata, NULL);
e_widget_table_object_align_append(ot, cfdata->o_config,
3, 0, 1, 1, 0, 1, 1, 1, 1.0, 0.5);
e_widget_list_object_append(ol, ot, 1, 0, 0.0);
@ -128,58 +128,70 @@ _ilist_fill(E_Config_Dialog_Data *cfdata)
for (l = e_shelf_list(); l; l = l->next)
{
E_Shelf *es;
Evas_Object *ob;
E_Shelf *es;
Evas_Object *ob;
if (!(es = l->data)) continue;
if (!(es = l->data)) continue;
snprintf(buf, sizeof(buf), "Shelf %s", e_shelf_orient_string_get(es));
ob = e_icon_add(evas);
ob = e_icon_add(evas);
switch (es->cfg->orient)
{
case E_GADCON_ORIENT_LEFT:
e_util_icon_theme_set(ob, "preferences-position-left");
break;
case E_GADCON_ORIENT_RIGHT:
e_util_icon_theme_set(ob, "preferences-position-right");
break;
case E_GADCON_ORIENT_TOP:
e_util_icon_theme_set(ob, "preferences-position-top");
break;
case E_GADCON_ORIENT_BOTTOM:
e_util_icon_theme_set(ob, "preferences-position-bottom");
break;
case E_GADCON_ORIENT_CORNER_TL:
e_util_icon_theme_set(ob, "preferences-position-top-left");
break;
case E_GADCON_ORIENT_CORNER_TR:
e_util_icon_theme_set(ob, "preferences-position-top-right");
break;
case E_GADCON_ORIENT_CORNER_BL:
e_util_icon_theme_set(ob, "preferences-position-bottom-left");
break;
case E_GADCON_ORIENT_CORNER_BR:
e_util_icon_theme_set(ob, "preferences-position-bottom-right");
break;
case E_GADCON_ORIENT_CORNER_LT:
e_util_icon_theme_set(ob, "preferences-position-left-top");
break;
case E_GADCON_ORIENT_CORNER_RT:
e_util_icon_theme_set(ob, "preferences-position-right-top");
break;
case E_GADCON_ORIENT_CORNER_LB:
e_util_icon_theme_set(ob, "preferences-position-left-bottom");
break;
case E_GADCON_ORIENT_CORNER_RB:
e_util_icon_theme_set(ob, "preferences-position-right-bottom");
break;
default:
e_util_icon_theme_set(ob, "enlightenment");
break;
}
e_widget_ilist_append(cfdata->o_list, ob, buf,
_ilist_cb_selected, cfdata, buf);
e_widget_ilist_append(cfdata->o_list, ob, buf,
_ilist_cb_selected, cfdata, buf);
}
e_widget_size_min_set(cfdata->o_list, 155, 250);
@ -190,14 +202,14 @@ _ilist_fill(E_Config_Dialog_Data *cfdata)
if (n > -1)
{
e_widget_disabled_set(cfdata->o_delete, 0);
e_widget_disabled_set(cfdata->o_config, 0);
e_widget_ilist_selected_set(cfdata->o_list, n);
e_widget_disabled_set(cfdata->o_delete, 0);
e_widget_disabled_set(cfdata->o_config, 0);
e_widget_ilist_selected_set(cfdata->o_list, n);
}
else
{
e_widget_disabled_set(cfdata->o_delete, 1);
e_widget_disabled_set(cfdata->o_config, 1);
e_widget_disabled_set(cfdata->o_delete, 1);
e_widget_disabled_set(cfdata->o_config, 1);
}
}
@ -265,7 +277,7 @@ _cb_delete(void *data, void *data2 __UNUSED__)
return;
}
d->es = eina_list_nth(e_shelf_list(),
e_widget_ilist_selected_get(d->cfdata->o_list));
e_widget_ilist_selected_get(d->cfdata->o_list));
if (!d->es)
{
E_FREE(d);
@ -287,12 +299,12 @@ _cb_delete(void *data, void *data2 __UNUSED__)
}
snprintf(buf, sizeof(buf), _("You requested to delete \"%s\".<br><br>"
"Are you sure you want to delete this shelf?"),
d->cfdata->cur_shelf);
"Are you sure you want to delete this shelf?"),
d->cfdata->cur_shelf);
e_confirm_dialog_show(_("Are you sure you want to delete this shelf?"),
"application-exit", buf, _("Delete"), _("Keep"),
_cb_dialog_yes, NULL, d, NULL, _cb_dialog_destroy, d);
"application-exit", buf, _("Delete"), _("Keep"),
_cb_dialog_yes, NULL, d, NULL, _cb_dialog_destroy, d);
}
static void
@ -326,7 +338,7 @@ _cb_config(void *data, void *data2 __UNUSED__)
if (!(cfdata = data)) return;
es = eina_list_nth(e_shelf_list(),
e_widget_ilist_selected_get(cfdata->o_list));
e_widget_ilist_selected_get(cfdata->o_list));
if (!es) return;
if (!es->config_dialog) e_int_shelf_config(es);
}
@ -339,7 +351,8 @@ _cb_contents(void *data, void *data2 __UNUSED__)
if (!(cfdata = data)) return;
es = eina_list_nth(e_shelf_list(),
e_widget_ilist_selected_get(cfdata->o_list));
e_widget_ilist_selected_get(cfdata->o_list));
if (!es) return;
if (!es->config_dialog) e_int_gadcon_config_shelf(es->gadcon);
}