forked from enlightenment/enlightenment
Formatting.
Whitespace Removal. Use E_FREE for cfdata structure. SVN revision: 41972
This commit is contained in:
parent
87b20fcc3c
commit
dada3377d4
|
@ -28,7 +28,6 @@ e_int_config_battery_module(E_Container *con, const char *params __UNUSED__)
|
||||||
char buf[4096];
|
char buf[4096];
|
||||||
|
|
||||||
v = E_NEW(E_Config_Dialog_View, 1);
|
v = E_NEW(E_Config_Dialog_View, 1);
|
||||||
|
|
||||||
v->create_cfdata = _create_data;
|
v->create_cfdata = _create_data;
|
||||||
v->free_cfdata = _free_data;
|
v->free_cfdata = _free_data;
|
||||||
v->basic.apply_cfdata = _basic_apply_data;
|
v->basic.apply_cfdata = _basic_apply_data;
|
||||||
|
@ -36,7 +35,8 @@ e_int_config_battery_module(E_Container *con, const char *params __UNUSED__)
|
||||||
v->advanced.apply_cfdata = _advanced_apply_data;
|
v->advanced.apply_cfdata = _advanced_apply_data;
|
||||||
v->advanced.create_widgets = _advanced_create_widgets;
|
v->advanced.create_widgets = _advanced_create_widgets;
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%s/e-module-battery.edj", e_module_dir_get(battery_config->module));
|
snprintf(buf, sizeof(buf), "%s/e-module-battery.edj",
|
||||||
|
e_module_dir_get(battery_config->module));
|
||||||
cfd = e_config_dialog_new(con,
|
cfd = e_config_dialog_new(con,
|
||||||
_("Battery Monitor Settings"),
|
_("Battery Monitor Settings"),
|
||||||
"E", "_e_mod_battery_config_dialog",
|
"E", "_e_mod_battery_config_dialog",
|
||||||
|
@ -55,7 +55,7 @@ _fill_data(E_Config_Dialog_Data *cfdata)
|
||||||
cfdata->alert_timeout = battery_config->alert_timeout;
|
cfdata->alert_timeout = battery_config->alert_timeout;
|
||||||
cfdata->force_mode = battery_config->force_mode;
|
cfdata->force_mode = battery_config->force_mode;
|
||||||
|
|
||||||
if (cfdata->alert_time > 0 || cfdata->alert_percent > 0)
|
if ((cfdata->alert_time > 0) || (cfdata->alert_percent > 0))
|
||||||
cfdata->show_alert = 1;
|
cfdata->show_alert = 1;
|
||||||
else
|
else
|
||||||
cfdata->show_alert = 0;
|
cfdata->show_alert = 0;
|
||||||
|
@ -81,7 +81,7 @@ _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
||||||
{
|
{
|
||||||
if (!battery_config) return;
|
if (!battery_config) return;
|
||||||
battery_config->config_dialog = NULL;
|
battery_config->config_dialog = NULL;
|
||||||
free(cfdata);
|
E_FREE(cfdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Evas_Object *
|
static Evas_Object *
|
||||||
|
@ -91,7 +91,8 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
|
||||||
|
|
||||||
o = e_widget_list_add(evas, 0, 0);
|
o = e_widget_list_add(evas, 0, 0);
|
||||||
of = e_widget_framelist_add(evas, _("Basic Settings"), 0);
|
of = e_widget_framelist_add(evas, _("Basic Settings"), 0);
|
||||||
ob = e_widget_check_add(evas, _("Show alert when battery is low"), &(cfdata->show_alert));
|
ob = e_widget_check_add(evas, _("Show alert when battery is low"),
|
||||||
|
&(cfdata->show_alert));
|
||||||
e_widget_framelist_object_append(of, ob);
|
e_widget_framelist_object_append(of, ob);
|
||||||
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
||||||
return o;
|
return o;
|
||||||
|
@ -136,24 +137,32 @@ _advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data
|
||||||
|
|
||||||
ob = e_widget_label_add(evas, _("Check every:"));
|
ob = e_widget_label_add(evas, _("Check every:"));
|
||||||
e_widget_table_object_append(o, ob, 0, 0, 1, 1, 1, 0, 1, 0);
|
e_widget_table_object_append(o, ob, 0, 0, 1, 1, 1, 0, 1, 0);
|
||||||
ob = e_widget_slider_add(evas, 1, 0, _("%1.0f ticks"), 1, 256, 4, 0, NULL, &(cfdata->poll_interval), 180);
|
ob = e_widget_slider_add(evas, 1, 0, _("%1.0f ticks"), 1, 256, 4, 0,
|
||||||
|
NULL, &(cfdata->poll_interval), 180);
|
||||||
e_widget_table_object_append(o, ob, 0, 1, 1, 1, 1, 0, 1, 0);
|
e_widget_table_object_append(o, ob, 0, 1, 1, 1, 1, 0, 1, 0);
|
||||||
e_widget_toolbook_page_append(otb, NULL, _("Polling"), o, 0, 0, 0, 0, 0.5, 0.0);
|
e_widget_toolbook_page_append(otb, NULL, _("Polling"), o, 0, 0, 0, 0,
|
||||||
|
0.5, 0.0);
|
||||||
|
|
||||||
o = e_widget_table_add(evas, 0);
|
o = e_widget_table_add(evas, 0);
|
||||||
ob = e_widget_check_add(evas, _("Show alert on low battery"), &(cfdata->show_alert));
|
ob = e_widget_check_add(evas, _("Show alert on low battery"),
|
||||||
|
&(cfdata->show_alert));
|
||||||
e_widget_table_object_append(o, ob, 0, 0, 1, 1, 1, 1, 1, 0);
|
e_widget_table_object_append(o, ob, 0, 0, 1, 1, 1, 1, 1, 0);
|
||||||
ob = e_widget_label_add(evas, _("Alert when at:"));
|
ob = e_widget_label_add(evas, _("Alert when at:"));
|
||||||
e_widget_table_object_append(o, ob, 0, 1, 1, 1, 1, 0, 1, 1);
|
e_widget_table_object_append(o, ob, 0, 1, 1, 1, 1, 0, 1, 1);
|
||||||
ob = e_widget_slider_add(evas, 1, 0, _("%1.0f min"), 0, 60, 1, 0, NULL, &(cfdata->alert_time), 180);
|
ob = e_widget_slider_add(evas, 1, 0, _("%1.0f min"), 0, 60, 1, 0, NULL,
|
||||||
|
&(cfdata->alert_time), 180);
|
||||||
e_widget_table_object_append(o, ob, 0, 2, 1, 1, 1, 0, 1, 0);
|
e_widget_table_object_append(o, ob, 0, 2, 1, 1, 1, 0, 1, 0);
|
||||||
ob = e_widget_slider_add(evas, 1, 0, _("%1.0f %%"), 0, 100, 1, 0, NULL, &(cfdata->alert_percent), 180);
|
ob = e_widget_slider_add(evas, 1, 0, _("%1.0f %%"), 0, 100, 1, 0, NULL,
|
||||||
|
&(cfdata->alert_percent), 180);
|
||||||
e_widget_table_object_append(o, ob, 0, 3, 1, 1, 1, 0, 1, 0);
|
e_widget_table_object_append(o, ob, 0, 3, 1, 1, 1, 0, 1, 0);
|
||||||
ob = e_widget_check_add(evas, _("Auto dismiss in..."), &(cfdata->dismiss_alert));
|
ob = e_widget_check_add(evas, _("Auto dismiss in..."),
|
||||||
|
&(cfdata->dismiss_alert));
|
||||||
e_widget_table_object_append(o, ob, 0, 4, 1, 1, 1, 1, 1, 0);
|
e_widget_table_object_append(o, ob, 0, 4, 1, 1, 1, 1, 1, 0);
|
||||||
ob = e_widget_slider_add(evas, 1, 0, _("%1.0f sec"), 1, 300, 1, 0, NULL, &(cfdata->alert_timeout), 180);
|
ob = e_widget_slider_add(evas, 1, 0, _("%1.0f sec"), 1, 300, 1, 0, NULL,
|
||||||
|
&(cfdata->alert_timeout), 180);
|
||||||
e_widget_table_object_append(o, ob, 0, 5, 1, 1, 1, 0, 1, 0);
|
e_widget_table_object_append(o, ob, 0, 5, 1, 1, 1, 0, 1, 0);
|
||||||
e_widget_toolbook_page_append(otb, NULL, _("Alert"), o, 0, 0, 0, 0, 0.5, 0.0);
|
e_widget_toolbook_page_append(otb, NULL, _("Alert"), o, 0, 0, 0, 0,
|
||||||
|
0.5, 0.0);
|
||||||
|
|
||||||
o = e_widget_list_add(evas, 0, 0);
|
o = e_widget_list_add(evas, 0, 0);
|
||||||
|
|
||||||
|
@ -165,7 +174,8 @@ _advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data
|
||||||
ob = e_widget_radio_add(evas, _("HAL"), 2, rg);
|
ob = e_widget_radio_add(evas, _("HAL"), 2, rg);
|
||||||
e_widget_list_object_append(o, ob, 1, 0, 0.0);
|
e_widget_list_object_append(o, ob, 1, 0, 0.0);
|
||||||
|
|
||||||
e_widget_toolbook_page_append(otb, NULL, _("Hardware"), o, 0, 0, 0, 0, 0.5, 0.0);
|
e_widget_toolbook_page_append(otb, NULL, _("Hardware"), o, 0, 0, 0, 0,
|
||||||
|
0.5, 0.0);
|
||||||
|
|
||||||
e_widget_toolbook_page_show(otb, 0);
|
e_widget_toolbook_page_show(otb, 0);
|
||||||
return otb;
|
return otb;
|
||||||
|
|
Loading…
Reference in New Issue