static void _basic_create_general(E_Config_Dialog *dialog, Evas *evas, E_Config_Dialog_Data *cfdata) { struct mixer_config_ui_general *ui = &cfdata->ui.general; E_Mixer_Module_Context *ctxt = dialog->data; Evas_Object *label, *chk; Eina_List *l; int i; ui->frame = e_widget_framelist_add(evas, _("General Settings"), 0); label = e_widget_label_add(evas, _("Mixer to use for global actions:")); e_widget_framelist_object_append(ui->frame, label); ui->radio = e_widget_radio_group_new(&cfdata->default_instance); for (i = 0, l = ctxt->instances; l; l = l->next, i++) { E_Mixer_Instance *inst; E_Mixer_Gadget_Config *conf; Evas_Object *o; char name[128]; const char *card_name; inst = l->data; conf = inst->conf; card_name = e_mixer_system_get_card_name(conf->card); snprintf(name, sizeof(name), "%s: %s", card_name, conf->channel_name); eina_stringshare_del(card_name); o = e_widget_radio_add(evas, name, i, ui->radio); e_widget_framelist_object_append(ui->frame, o); } e_widget_list_object_append(cfdata->ui.list, ui->frame, 1, 1, 0.5); chk = e_widget_check_add(evas, _("Display desktop notifications on volume change"), &ctxt->desktop_notification); e_widget_check_checked_set(chk, ctxt->conf->desktop_notification); #ifndef HAVE_ENOTIFY e_widget_disabled_set(chk, EINA_TRUE); #endif e_widget_list_object_append(cfdata->ui.list, chk, 1, 1, 0.5); chk = e_widget_check_add(evas, _("Disable PulseAudio"), &ctxt->disable_pulse); e_widget_check_checked_set(chk, ctxt->conf->disable_pulse); e_widget_list_object_append(cfdata->ui.list, chk, 1, 1, 0.5); }
static Evas_Object * _basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata) { Evas_Object *o = NULL, *of = NULL, *ow = NULL; o = e_widget_list_add(evas, 0, 0); //General frame of = e_widget_framelist_add(evas, D_("General"), 0); e_widget_framelist_content_align_set(of, 0.0, 0.0); ow = e_widget_check_add(evas, D_("Show in main menu"), &(cfdata->show_menu)); e_widget_framelist_object_append(of, ow); ow = e_widget_check_add(evas, D_("Hide the gadget header"), &(cfdata->hide_header)); e_widget_framelist_object_append(of, ow); ow = e_widget_check_add(evas, D_("Mount volumes on insert"), &(cfdata->auto_mount)); e_widget_framelist_object_append(of, ow); ow = e_widget_check_add(evas, D_("Open filemanager on insert"), &(cfdata->auto_open)); e_widget_framelist_object_append(of, ow); ow = e_widget_check_add(evas, D_("Use a custom file manager"), &(cfdata->fm_chk)); e_widget_check_checked_set(ow, strlen(cfdata->fm) > 0 ? 1 : 0); e_widget_on_change_hook_set(ow, _custom_fm_click, cfdata); e_widget_framelist_object_append(of, ow); ow = e_widget_entry_add(evas, &(cfdata->fm), NULL, NULL, NULL); e_widget_disabled_set(ow, strlen(cfdata->fm) > 0 ? 0 : 1); cfdata->entry = ow; e_widget_framelist_object_append(of, ow); e_widget_list_object_append(o, of, 1, 1, 0.5); //Display frame of = e_widget_framelist_add(evas, D_("Show in menu"), 0); e_widget_framelist_content_align_set(of, 0.0, 0.0); ow = e_widget_check_add(evas, D_("Home"), &(cfdata->show_home)); e_widget_framelist_object_append(of, ow); ow = e_widget_check_add(evas, D_("Desktop"), &(cfdata->show_desk)); e_widget_framelist_object_append(of, ow); ow = e_widget_check_add(evas, D_("Trash"), &(cfdata->show_trash)); e_widget_framelist_object_append(of, ow); ow = e_widget_check_add(evas, D_("Filesystem"), &(cfdata->show_root)); e_widget_framelist_object_append(of, ow); ow = e_widget_check_add(evas, D_("Temp"), &(cfdata->show_temp)); e_widget_framelist_object_append(of, ow); ow = e_widget_check_add(evas, D_("Favorites"), &(cfdata->show_bookm)); e_widget_framelist_object_append(of, ow); e_widget_list_object_append(o, of, 1, 1, 0.5); return o; }
/* * Load the data for the XPlanet tab. * Currently there's only one config allowed, but this will * be increased in future. */ static void _populate_xplanet_page(E_Config_Dialog_Data *cfdata, int config_index) { Xplanet_Config *xplanet_config; char text_value[256]; xplanet_config = eina_list_nth(eplanet_conf->xplanet_configs, config_index); if (xplanet_config) { cfdata->local_xplanet.body = xplanet_config->body; cfdata->local_xplanet.origin = xplanet_config->origin; cfdata->local_xplanet.source_type = xplanet_config->source_type; cfdata->local_xplanet.projection = xplanet_config->projection; cfdata->local_xplanet.viewpos_type = xplanet_config->viewpos_type; cfdata->local_xplanet.viewpos_lat = xplanet_config->viewpos_lat; cfdata->local_xplanet.viewpos_lon = xplanet_config->viewpos_lon; cfdata->local_xplanet.use_localtime = xplanet_config->use_localtime; cfdata->local_xplanet.localtime = xplanet_config->localtime; cfdata->local_xplanet.viewpos_file = xplanet_config->viewpos_file; cfdata->local_xplanet.show_label = xplanet_config->show_label; cfdata->local_xplanet.label_text = xplanet_config->label_text; cfdata->local_xplanet.label_time = xplanet_config->label_time; cfdata->local_xplanet.label_pos = xplanet_config->label_pos; cfdata->local_xplanet.label_pos_other = xplanet_config->label_pos_other; cfdata->local_xplanet.use_config = xplanet_config->use_config; cfdata->local_xplanet.config_name = xplanet_config->config_name; cfdata->local_xplanet.extra_options = xplanet_config->extra_options; if (cfdata->local_xplanet.localtime > 23) cfdata->local_xplanet.localtime = 12; _fill_planet_ilist(cfdata->gui.o_body_ilist, cfdata->local_xplanet.body, _cb_target, cfdata, &(cfdata->body_item)); if (cfdata->local_xplanet.source_type == SOURCE_ORIGIN) { _fill_planet_ilist(cfdata->gui.o_source_ilist, cfdata->local_xplanet.origin, _cb_source, cfdata, &(cfdata->source_item)); e_widget_radio_toggle_set(cfdata->gui.o_origin_toggle, 1); e_widget_radio_toggle_set(cfdata->gui.o_projection_toggle, 0); } else { _fill_projection_ilist(cfdata->gui.o_source_ilist, cfdata->local_xplanet.projection, cfdata, &(cfdata->source_item)); e_widget_radio_toggle_set(cfdata->gui.o_origin_toggle, 0); e_widget_radio_toggle_set(cfdata->gui.o_projection_toggle, 1); } e_widget_radio_toggle_set(cfdata->gui.o_viewpos_latlon, (cfdata->local_xplanet.viewpos_type == VIEWPOS_LATLON)); e_widget_radio_toggle_set(cfdata->gui.o_viewpos_random, (cfdata->local_xplanet.viewpos_type == VIEWPOS_RANDOM)); e_widget_radio_toggle_set(cfdata->gui.o_viewpos_file, (cfdata->local_xplanet.viewpos_type == VIEWPOS_FILE)); sprintf(text_value, "%1g", cfdata->local_xplanet.viewpos_lat); e_widget_entry_text_set(cfdata->gui.o_viewpos_lat, text_value); sprintf(text_value, "%1g", cfdata->local_xplanet.viewpos_lon); e_widget_entry_text_set(cfdata->gui.o_viewpos_lon, text_value); sprintf(text_value, "%s", cfdata->local_xplanet.viewpos_file); e_widget_entry_text_set(cfdata->gui.o_viewpos_file_val, text_value); e_widget_check_checked_set(cfdata->gui.o_use_localtime, cfdata->local_xplanet.use_localtime); e_widget_slider_value_int_set(cfdata->gui.o_localtime, cfdata->local_xplanet.localtime); cfdata->gui.show_label = cfdata->local_xplanet.show_label; e_widget_check_checked_set(cfdata->gui.o_show_label, cfdata->gui.show_label); if (cfdata->local_xplanet.label_text) sprintf(text_value, "%s", cfdata->local_xplanet.label_text); else sprintf(text_value, "%s", ""); e_widget_entry_text_set(cfdata->gui.o_label_text, text_value); e_widget_radio_toggle_set(cfdata->gui.o_label_time_local_toggle, (cfdata->local_xplanet.label_time == LABEL_TIME_LOCAL)); e_widget_radio_toggle_set(cfdata->gui.o_label_time_gmt_toggle, (cfdata->local_xplanet.label_time == LABEL_TIME_GMT)); e_widget_radio_toggle_set(cfdata->gui.o_label_pos_tl_toggle, (cfdata->local_xplanet.label_pos == LABEL_POS_TL)); e_widget_radio_toggle_set(cfdata->gui.o_label_pos_tr_toggle, (cfdata->local_xplanet.label_pos == LABEL_POS_TR)); e_widget_radio_toggle_set(cfdata->gui.o_label_pos_bl_toggle, (cfdata->local_xplanet.label_pos == LABEL_POS_BL)); e_widget_radio_toggle_set(cfdata->gui.o_label_pos_br_toggle, (cfdata->local_xplanet.label_pos == LABEL_POS_BR)); e_widget_radio_toggle_set(cfdata->gui.o_label_pos_other_toggle, (cfdata->local_xplanet.label_pos == LABEL_POS_OTHER)); if (cfdata->local_xplanet.label_pos_other) sprintf(text_value, "%s", cfdata->local_xplanet.label_pos_other); else sprintf(text_value, "%s", ""); e_widget_entry_text_set(cfdata->gui.o_label_pos_other_text, text_value); e_widget_check_checked_set(cfdata->gui.o_config_check, cfdata->local_xplanet.use_config); if (cfdata->local_xplanet.config_name) sprintf(text_value, "%s", cfdata->local_xplanet.config_name); else sprintf(text_value, "%s", ""); e_widget_entry_text_set(cfdata->gui.o_config_name, text_value); if (cfdata->local_xplanet.extra_options) sprintf(text_value, "%s", cfdata->local_xplanet.extra_options); else sprintf(text_value, "%s", ""); e_widget_entry_text_set(cfdata->gui.o_extra_options, text_value); _cb_source_type(cfdata, NULL, NULL); _cb_show_label(cfdata, NULL, NULL); _cb_label_pos(cfdata, NULL, NULL); _cb_set_localtime(cfdata, NULL, NULL); } }