static void _cb_feed_change(void *data, Evas_Object *obj) { E_Config_Dialog_Data *cfdata; E_Ilist_Item *item; News_Feed *feed; Eina_List *sel, *items, *l; int i; cfdata = data; if (cfdata->ilist_feeds_sel) eina_list_free(cfdata->ilist_feeds_sel); sel = NULL; items = e_widget_ilist_items_get(cfdata->ilist_feeds); for (l=items, i=0; l; l=eina_list_next(l), i++) { item = l->data; if (item->header) continue; if (!item->selected) continue; feed = e_widget_ilist_nth_data_get(cfdata->ilist_feeds, i); sel = eina_list_append(sel, feed); } cfdata->ilist_feeds_sel = sel; if (e_widget_ilist_selected_get(cfdata->ilist_feeds) >= 0) { if (cfdata->button_add) e_widget_disabled_set(cfdata->button_add, 0); } else { if (cfdata->button_add) e_widget_disabled_set(cfdata->button_add, 1); } }
static void _e_mod_config_schedule_start_working_cb(void *data, void *data2) { E_Config_Schedule_Data *csd; E_Config_Dialog_Data *cfdata; if(!(csd = data)) return; if(!(cfdata = data2)) return; if(e_widget_disabled_get(csd->obstop) == EINA_TRUE) { e_widget_disabled_set(csd->obbreak, EINA_TRUE); e_widget_disabled_set(csd->obwork, EINA_TRUE); if(csd->lock == EINA_FALSE) { csd->lock = EINA_TRUE; } if(productivity_conf->secs_to_break) productivity_conf->secs_to_break = 0; } _e_mod_config_schedule_lock_update(csd); e_mod_config_schedule_save_config(cfdata); e_mod_config_worktools_save(cfdata); productivity_conf->init = E_MOD_PROD_INIT_START; ecore_timer_freeze(productivity_conf->wm); e_mod_config_window_manager_v2(productivity_conf->cwl); ecore_timer_thaw(productivity_conf->wm); e_config_save(); }
void news_config_dialog_item_content_refresh_selected_feeds(News_Item *ni) { E_Config_Dialog_Data *cfdata; Evas_Object *ilist; int pos, iw, ih; if (!ni->config_dialog_content) return; cfdata = ni->config_dialog_content->cfdata; ilist = cfdata->ilist_selected_feeds; e_widget_ilist_freeze(ilist); /* disable the callback until we finish to refresh the list */ e_widget_on_change_hook_set(ilist, NULL, NULL); e_widget_ilist_clear(ilist); if (cfdata->button_rem) { e_widget_disabled_set(cfdata->button_rem, 1); e_widget_disabled_set(cfdata->button_up, 1); e_widget_disabled_set(cfdata->button_down, 1); } cfdata->ilist_selected_feeds_inrefresh = 1; pos = -1; NEWS_ITEM_FEEDS_FOREACH_BEG(ni); { Evas_Object *ic = NULL; char buf[1024]; if (_feed->icon && _feed->icon[0]) { ic = e_icon_add(evas_object_evas_get(ilist)); e_icon_file_set(ic, _feed->icon); } snprintf(buf, sizeof(buf), "%s%s", (_feed->important) ? "[i] " : "", _feed->name); e_widget_ilist_append(ilist, ic, buf, NULL, _feed, NULL); pos++; if (eina_list_data_find(cfdata->ilist_selected_feeds_sel, _feed)) e_widget_ilist_multi_select(ilist, pos); } NEWS_ITEM_FEEDS_FOREACH_END(); cfdata->ilist_selected_feeds_inrefresh = 0; e_widget_size_min_get(ilist, &iw, &ih); if (iw < 200) iw = 200; e_widget_size_min_set(ilist, iw, 250); e_widget_ilist_go(ilist); e_widget_ilist_thaw(ilist); _cb_selected_feed_change(cfdata, NULL); /* restore the callback */ e_widget_on_change_hook_set(ilist, _cb_selected_feed_change, cfdata); }
/* * Handle toggle of Show Label checkbox. Disable/enable * config options as appropriate. */ static void _cb_show_label(void *data, Evas_Object *obj, void *event_info) { E_Config_Dialog_Data *cfdata; cfdata = data; e_widget_disabled_set(cfdata->gui.o_label_text, !e_widget_check_checked_get( cfdata->gui.o_show_label)); e_widget_disabled_set(cfdata->gui.o_label_time_local_toggle, !e_widget_check_checked_get(cfdata->gui.o_show_label)); e_widget_disabled_set(cfdata->gui.o_label_time_gmt_toggle, !e_widget_check_checked_get(cfdata->gui.o_show_label)); e_widget_disabled_set(cfdata->gui.o_label_pos_tl_toggle, !e_widget_check_checked_get(cfdata->gui.o_show_label)); e_widget_disabled_set(cfdata->gui.o_label_pos_tr_toggle, !e_widget_check_checked_get(cfdata->gui.o_show_label)); e_widget_disabled_set(cfdata->gui.o_label_pos_bl_toggle, !e_widget_check_checked_get(cfdata->gui.o_show_label)); e_widget_disabled_set(cfdata->gui.o_label_pos_br_toggle, !e_widget_check_checked_get(cfdata->gui.o_show_label)); e_widget_disabled_set(cfdata->gui.o_label_pos_other_toggle, !e_widget_check_checked_get(cfdata->gui.o_show_label)); if (!e_widget_check_checked_get(cfdata->gui.o_show_label)) e_widget_disabled_set(cfdata->gui.o_label_pos_other_text, 1); else _cb_label_pos(cfdata, NULL, NULL); }
static Evas_Object * _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata) { Evas_Object *o; Evas_Object *of, *ob; o = e_widget_list_add(evas, 0, 1); of = e_widget_frametable_add(evas, D_("Avalaible Feeds"), 0); ob = e_widget_ilist_add(evas, 16, 16, NULL); e_widget_ilist_multi_select_set(ob, 1); cfdata->ilist_feeds = ob; news_config_dialog_item_content_refresh_feeds(cfdata->ni); e_widget_on_change_hook_set(ob, _cb_feed_change, cfdata); e_widget_frametable_object_append(of, ob, 0, 0, 1, 1, 1, 1, 1, 1); ob = e_widget_button_add(evas, D_("Add this Feed"), NULL, _cb_feed_add, cfdata, NULL); e_widget_disabled_set(ob, 1); cfdata->button_add = ob; e_widget_frametable_object_append(of, ob, 0, 1, 1, 1, 1, 1, 1, 0); e_widget_list_object_append(o, of, 1, 1, 0.0); of = e_widget_frametable_add(evas, D_("Selected Feeds"), 0); ob = e_widget_ilist_add(evas, 16, 16, NULL); e_widget_ilist_multi_select_set(ob, 1); cfdata->ilist_selected_feeds = ob; news_config_dialog_item_content_refresh_selected_feeds(cfdata->ni); e_widget_on_change_hook_set(ob, _cb_selected_feed_change, cfdata); e_widget_frametable_object_append(of, ob, 0, 0, 1, 4, 1, 1, 1, 1); ob = e_widget_button_add(evas, "Move", "go-up", _cb_feed_up, cfdata, NULL); e_widget_disabled_set(ob, 1); cfdata->button_up = ob; e_widget_frametable_object_append(of, ob, 1, 1, 1, 1, 0, 0, 0, 0); ob = e_widget_button_add(evas, "Move", "go-down", _cb_feed_down, cfdata, NULL); e_widget_disabled_set(ob, 1); cfdata->button_down = ob; e_widget_frametable_object_append(of, ob, 1, 2, 1, 1, 0, 0, 0, 0); ob = e_widget_button_add(evas, D_("Remove this Feed"), NULL, _cb_feed_remove, cfdata, NULL); cfdata->button_rem = ob; e_widget_disabled_set(ob, 1); e_widget_frametable_object_append(of, ob, 0, 5, 1, 4, 1, 1, 1, 0); e_widget_list_object_append(o, of, 1, 1, 1.0); e_dialog_resizable_set(cfd->dia, 1); return o; }
void _custom_fm_click(void *data, Evas_Object *obj) { E_Config_Dialog_Data *cfdata = data; if (e_widget_check_checked_get(obj)) e_widget_disabled_set(cfdata->entry, 0); else { e_widget_disabled_set(cfdata->entry, 1); e_widget_entry_text_set(cfdata->entry, ""); } }
static void _eco_match_add(void *data, void *data2) { Eco_Option *opt; e_widget_ilist_append(o_matches, NULL, default_match, _eco_match_click_cb, NULL, NULL); opt = eco_config_option_list_add(cfg_screen, str_matches); opt->stringValue = strdup(default_match); opt = eco_config_option_list_add(cfg_screen, str_effects); opt->intValue = 11; opt = eco_config_option_list_add(cfg_screen, str_durations); opt->intValue = 300; e_widget_slider_value_int_set(o_duration, opt->intValue); opt = eco_config_option_list_add(cfg_screen, str_randoms); /* opt = eco_config_option_list_add(cfg_screen, str_options); */ e_widget_disabled_set(o_duration, 0); e_widget_ilist_selected_set(o_matches, e_widget_ilist_count(o_matches)); }
/* * Handle toggle of Set local time checkbox. Disable/enable * config options as appropriate. */ static void _cb_set_localtime(void *data, Evas_Object *obj, void *event_info) { E_Config_Dialog_Data *cfdata; cfdata = data; e_widget_disabled_set(cfdata->gui.o_localtime, !e_widget_check_checked_get(cfdata->gui.o_use_localtime)); }
EAPI void e_toolbar_button_enable(Evas_Object *obj, int enable) { E_Toolbar_Smart_Data *sd; if ((!obj) || !(sd = evas_object_smart_data_get(obj))) return; e_widget_disabled_set(sd->o_btn, !(enable)); }
/* * Handle change of label position radio group */ static void _cb_label_pos(void *data, Evas_Object *obj, void *event_info) { E_Config_Dialog_Data *cfdata; cfdata = data; // Disable/enable 'Other' text entry box e_widget_disabled_set(cfdata->gui.o_label_pos_other_text, !e_widget_check_checked_get(cfdata->gui.o_show_label) || cfdata->local_xplanet.label_pos != LABEL_POS_OTHER); }
static void _eco_match_click_cb(void *data) { int sel = e_widget_ilist_selected_get(o_matches); Eco_Option *value = eco_config_option_list_nth(cfg_screen, "opacity_values", sel); if (value) { e_widget_slider_value_int_set(o_opacity, value->intValue); e_widget_disabled_set(o_opacity, 0); } }
static void _e_mod_config_schedule_lock_update(E_Config_Schedule_Data *csd) { if(csd->lock == EINA_TRUE) { e_widget_disabled_set(csd->obstop, EINA_FALSE); e_widget_disabled_set(csd->obbreak, EINA_TRUE); e_widget_disabled_set(csd->obwork, EINA_TRUE); e_widget_disabled_set(csd->oburgent, EINA_TRUE); if(e_widget_disabled_get(csd->obstart) == EINA_FALSE) e_widget_disabled_set(csd->obstart, EINA_TRUE); } else if (csd->lock == EINA_FALSE) { e_widget_disabled_set(csd->obstop, EINA_TRUE); e_widget_disabled_set(csd->obbreak, EINA_FALSE); e_widget_disabled_set(csd->obwork, EINA_FALSE); e_widget_disabled_set(csd->oburgent, EINA_FALSE); if(e_widget_disabled_get(csd->obstart) == EINA_TRUE) e_widget_disabled_set(csd->obstart, EINA_FALSE); } }
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 void _eco_match_add(void *data, void *data2) { Eco_Option *match, *value; e_widget_ilist_append(o_matches, NULL, "class=XTerm", _eco_match_click_cb, NULL, NULL); match = eco_config_option_list_add(cfg_screen, "opacity_matches"); match->stringValue = eina_stringshare_add("class=XTerm"); value = eco_config_option_list_add(cfg_screen, "opacity_values"); value->intValue = 100; e_widget_slider_value_int_set(o_opacity, value->intValue); e_widget_disabled_set(o_opacity, 0); e_widget_ilist_selected_set(o_matches, e_widget_ilist_count(o_matches)); }
static void _eco_match_click_cb(void *data) { Eco_Option *opt; int sel; const char *match; /* remember changes to the last selected item */ opt = eco_config_option_list_nth(cfg_screen, str_effects, selected); if (opt) opt->intValue = effect; opt = eco_config_option_list_nth(cfg_screen, str_durations, selected); if (opt) opt->intValue = duration; opt = eco_config_option_list_nth(cfg_screen, str_matches, selected); match = e_widget_ilist_nth_label_get(o_matches, selected); if (opt && match) { eco_string_free(opt->stringValue); opt->stringValue = eina_stringshare_add(match); } /* set stored values for selected match */ sel = e_widget_ilist_selected_get(o_matches); opt = eco_config_option_list_nth(cfg_screen, str_durations, sel); if (opt) { e_widget_slider_value_int_set(o_duration, opt->intValue); e_widget_disabled_set(o_duration, 0); } opt = eco_config_option_list_nth(cfg_screen, str_effects, sel); if (opt) { e_widget_radio_toggle_set(o_effect[opt->intValue], 1); } selected = sel; }
/* * Handle change of viewing position */ static void _cb_viewpos(void *data, Evas_Object *obj, void *event_info) { E_Config_Dialog_Data *cfdata; // Enable/disable controls according to the selection cfdata = data; e_widget_disabled_set(cfdata->gui.o_viewpos_lat, !(cfdata->local_xplanet.viewpos_type == VIEWPOS_LATLON)); e_widget_disabled_set(cfdata->gui.o_viewpos_lat_label, !(cfdata->local_xplanet.viewpos_type == VIEWPOS_LATLON)); e_widget_disabled_set(cfdata->gui.o_viewpos_lon, !(cfdata->local_xplanet.viewpos_type == VIEWPOS_LATLON)); e_widget_disabled_set(cfdata->gui.o_viewpos_lon_label, !(cfdata->local_xplanet.viewpos_type == VIEWPOS_LATLON)); e_widget_disabled_set(cfdata->gui.o_viewpos_file_val, !(cfdata->local_xplanet.viewpos_type == VIEWPOS_FILE)); e_widget_disabled_set(cfdata->gui.o_viewpos_file_button, !(cfdata->local_xplanet.viewpos_type == VIEWPOS_FILE)); }
static Evas_Object * _advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata) { Evas_Object *o, *o2, *of, *of2, *ob; E_Radio_Group *rg; o = e_widget_table_add(evas, 0); o2 = e_widget_list_add(evas, 0, 0); of = e_widget_frametable_add(evas, D_("Feeds"), 0); ob = e_widget_label_add(evas, D_("Timer")); e_widget_frametable_object_append(of, ob, 0, 0, 1, 1, 1, 1, 1, 0); ob = e_widget_slider_add(evas, 1, 0, D_("%1.0f min"), (float)NEWS_FEED_TIMER_MIN, (float)NEWS_FEED_TIMER_MAX, 1.0, 0, NULL, &(cfdata->feed.timer_m), 70); e_widget_frametable_object_append(of, ob, 1, 0, 1, 1, 1, 1, 1, 0); ob = e_widget_check_add(evas, D_("Sort lists by name (disable Move action)"), &(cfdata->feed.sort_name)); e_widget_frametable_object_append(of, ob, 0, 1, 2, 1, 1, 1, 1, 0); e_widget_list_object_append(o2, of, 1, 1, 0.5); of = e_widget_framelist_add(evas, D_("Browser"), 0); ob = e_widget_label_add(evas, D_("Uses xdg-open script, from freedesktop.org")); e_widget_framelist_object_append(of, ob); e_widget_list_object_append(o2, of, 1, 1, 0.5); of = e_widget_frametable_add(evas, D_("Popup On News"), 0); rg = e_widget_radio_group_new(&(cfdata->popup_news.active)); ob = e_widget_radio_add(evas, D_("Never"), NEWS_FEED_POPUP_NEWS_ACTIVE_NO, rg); //TODO: NOT IMPLEMENTED YET e_widget_radio_toggle_set(ob, 0); e_widget_disabled_set(ob, 1); e_widget_frametable_object_append(of, ob, 0, 0, 1, 1, 1, 1, 1, 0); ob = e_widget_radio_add(evas, D_("Only on urgent feeds"), NEWS_FEED_POPUP_NEWS_ACTIVE_URGENT, rg); //TODO: NOT IMPLEMENTED YET e_widget_radio_toggle_set(ob, 0); e_widget_disabled_set(ob, 1); e_widget_frametable_object_append(of, ob, 1, 0, 1, 1, 1, 1, 1, 0); ob = e_widget_radio_add(evas, D_("On all feeds"), NEWS_FEED_POPUP_NEWS_ACTIVE_ALL, rg); //TODO: NOT IMPLEMENTED YET e_widget_radio_toggle_set(ob, 0); e_widget_disabled_set(ob, 1); e_widget_frametable_object_append(of, ob, 1, 1, 1, 1, 1, 1, 1, 0); ob = e_widget_label_add(evas, D_("Timer")); e_widget_frametable_object_append(of, ob, 0, 2, 1, 1, 1, 1, 1, 0); ob = e_widget_slider_add(evas, 1, 0, D_("%1.0f s"), (float)NEWS_POPUP_TIMER_S_MIN, (float)NEWS_POPUP_TIMER_S_MAX, 1.0, 0, NULL, &(cfdata->popup_news.timer_s), 70); e_widget_frametable_object_append(of, ob, 1, 2, 1, 1, 1, 1, 1, 0); e_widget_list_object_append(o2, of, 1, 1, 0.5); of = e_widget_frametable_add(evas, D_("Popup On Warning / Error"), 0); //TODO: NOT IMPLEMENTED YET news->config->popup_other.on_timeout = 0; cfdata->popup_other.on_timeout = 0; ob = e_widget_check_add(evas, D_("Show on timeout ?"), &(cfdata->popup_other.on_timeout)); //TODO: NOT IMPLEMENTED YET e_widget_disabled_set(ob, 1); e_widget_frametable_object_append(of, ob, 0, 0, 2, 1, 1, 0, 1, 0); ob = e_widget_label_add(evas, D_("Timer")); e_widget_frametable_object_append(of, ob, 0, 1, 1, 1, 1, 1, 1, 0); ob = e_widget_slider_add(evas, 1, 0, D_("%1.0f s"), (float)NEWS_POPUP_TIMER_S_MIN, (float)NEWS_POPUP_TIMER_S_MAX, 1.0, 0, NULL, &(cfdata->popup_other.timer_s), 70); e_widget_frametable_object_append(of, ob, 1, 1, 1, 1, 1, 1, 1, 0); e_widget_list_object_append(o2, of, 1, 1, 0.5); e_widget_table_object_append(o, o2, 0, 0, 1, 1, 1, 1, 1, 1); o2 = e_widget_list_add(evas, 0, 0); of = e_widget_frametable_add(evas, D_("News Viewer"), 0); ob = e_widget_check_add(evas, D_("Unread feeds first"), &(cfdata->viewer.vfeeds.unread_first)); e_widget_frametable_object_append(of, ob, 0, 0, 1, 1, 1, 0, 1, 0); ob = e_widget_check_add(evas, D_("Unread articles first"), &(cfdata->viewer.varticles.unread_first)); e_widget_frametable_object_append(of, ob, 1, 0, 1, 1, 1, 0, 1, 0); ob = e_widget_check_add(evas, D_("Sort articles by date"), &(cfdata->viewer.varticles.sort_date)); e_widget_frametable_object_append(of, ob, 1, 1, 1, 1, 1, 0, 1, 0); of2 = e_widget_frametable_add(evas, D_("Font"), 0); ob = e_widget_slider_add(evas, 1, 0, D_("%1.0f"), NEWS_VIEWER_VCONTENT_FONT_SIZE_MIN, NEWS_VIEWER_VCONTENT_FONT_SIZE_MAX, 1.0, 0, NULL, &(cfdata->viewer.vcontent.font_size), 70); e_widget_frametable_object_append(of2, ob, 0, 0, 1, 1, 1, 0, 1, 0); ob = e_widget_color_well_add(evas, cfdata->viewer.vcontent.font_color, 1); cfdata->color_viewer_font = ob; e_widget_on_change_hook_set(ob, _cb_color_viewer_font_change, cfdata); e_widget_frametable_object_append(of2, ob, 0, 1, 1, 1, 1, 0, 1, 0); ob = e_widget_check_add(evas, D_("Font Shadow"), &cfdata->viewer.vcontent.font_shadow); e_widget_frametable_object_append(of2, ob, 1, 0, 1, 1, 1, 0, 1, 0); ob = e_widget_color_well_add(evas, cfdata->viewer.vcontent.font_shadow_color, 1); cfdata->color_viewer_font_shadow = ob; e_widget_on_change_hook_set(ob, _cb_color_viewer_font_shadow_change, cfdata); e_widget_frametable_object_append(of2, ob, 1, 1, 1, 1, 1, 0, 1, 0); e_widget_frametable_object_append(of, of2, 0, 2, 2, 1, 1, 0, 1, 0); e_widget_list_object_append(o2, of, 1, 1, 0.0); of = e_widget_frametable_add(evas, D_("Proxy"), 0); ob = e_widget_check_add(evas, D_("Enable"), &(cfdata->proxy.enable)); e_widget_frametable_object_append(of, ob, 0, 0, 2, 1, 1, 0, 0, 0); ob = e_widget_label_add(evas, D_("Host")); e_widget_frametable_object_append(of, ob, 0, 1, 1, 1, 1, 0, 0, 0); ob = e_widget_entry_add(evas, &(cfdata->proxy.host), NULL, NULL, NULL); e_widget_frametable_object_append(of, ob, 1, 1, 1, 1, 1, 0, 1, 0); ob = e_widget_label_add(evas, D_("Port")); e_widget_frametable_object_append(of, ob, 0, 2, 1, 1, 1, 0, 0, 0); ob = e_widget_entry_add(evas, &(cfdata->proxy.port), NULL, NULL, NULL); e_widget_frametable_object_append(of, ob, 1, 2, 1, 1, 1, 0, 1, 0); e_widget_list_object_append(o2, of, 1, 1, 1.0); e_widget_table_object_append(o, o2, 1, 0, 1, 1, 1, 1, 1, 1); return o; }
E_Win * e_int_config_theme_import(E_Config_Dialog *parent) { Evas *evas; E_Win *win; Evas_Object *o, *ofm; Import *import; E_Config_Dialog_Data *cfdata; Evas_Modifier_Mask mask; Evas_Coord w, h; Eina_Bool kg; import = E_NEW(Import, 1); if (!import) return NULL; win = e_win_new(parent->con); if (!win) { E_FREE(import); return NULL; } evas = e_win_evas_get(win); cfdata = E_NEW(E_Config_Dialog_Data, 1); import->cfdata = cfdata; import->win = win; import->parent = parent; e_win_title_set(win, _("Select a Theme...")); e_win_delete_callback_set(win, _theme_import_cb_delete); e_win_resize_callback_set(win, _theme_import_cb_resize); e_win_dialog_set(win, 1); e_win_name_class_set(win, "E", "_theme_import_dialog"); o = edje_object_add(evas); import->bg_obj = o; e_theme_edje_object_set(o, "base/theme/dialog", "e/widgets/dialog/main"); evas_object_move(o, 0, 0); evas_object_show(o); o = e_widget_list_add(evas, 1, 1); e_widget_on_focus_hook_set(o, _theme_import_cb_wid_focus, import); import->box_obj = o; edje_object_part_swallow(import->bg_obj, "e.swallow.buttons", o); o = evas_object_rectangle_add(evas); import->event_obj = o; mask = 0; kg = evas_object_key_grab(o, "Tab", mask, ~mask, 0); if (!kg) fprintf(stderr, "ERROR: Unable to redirect \"Tab\" key events to object %p.\n", o); mask = evas_key_modifier_mask_get(evas, "Shift"); kg = evas_object_key_grab(o, "Tab", mask, ~mask, 0); if (!kg) fprintf(stderr, "ERROR: unable to redirect \"Tab\" key events to object %p.\n", o); mask = 0; kg = evas_object_key_grab(o, "Return", mask, ~mask, 0); if (!kg) fprintf(stderr, "ERROR: unable to redirect \"Return\" key events to object %p.\n", o); mask = 0; kg = evas_object_key_grab(o, "KP_Enter", mask, ~mask, 0); if (!kg) fprintf(stderr, "ERROR: unable to redirect \"KP_Enter\" key events to object %p.\n", o); evas_object_event_callback_add(o, EVAS_CALLBACK_KEY_DOWN, _theme_import_cb_key_down, import); o = e_widget_list_add(evas, 0, 0); import->content_obj = o; ofm = e_widget_fsel_add(evas, e_user_homedir_get(), "/", NULL, NULL, _theme_import_cb_selected, import, _theme_import_cb_changed, import, 1); import->fsel_obj = ofm; e_widget_list_object_append(o, ofm, 1, 1, 0.5); e_widget_size_min_get(o, &w, &h); evas_object_size_hint_min_set(o, w, h); edje_object_part_swallow(import->bg_obj, "e.swallow.content", o); evas_object_show(o); import->ok_obj = e_widget_button_add(evas, _("OK"), NULL, _theme_import_cb_ok, win, cfdata); e_widget_list_object_append(import->box_obj, import->ok_obj, 1, 0, 0.5); import->cancel_obj = e_widget_button_add(evas, _("Cancel"), NULL, _theme_import_cb_close, win, cfdata); e_widget_list_object_append(import->box_obj, import->cancel_obj, 1, 0, 0.5); e_widget_disabled_set(import->ok_obj, 1); e_win_centered_set(win, 1); o = import->box_obj; e_widget_size_min_get(o, &w, &h); evas_object_size_hint_min_set(o, w, h); edje_object_part_swallow(import->bg_obj, "e.swallow.buttons", o); edje_object_size_min_calc(import->bg_obj, &w, &h); evas_object_resize(import->bg_obj, w, h); e_win_resize(win, w, h); e_win_size_min_set(win, w, h); e_win_size_max_set(win, 99999, 99999); e_win_show(win); e_win_border_icon_set(win, "preferences-desktop-theme"); win->data = import; return win; }
/* * Handler for changing the view source type */ static void _cb_source_type(void *data, Evas_Object *obj, void *event_info) { E_Config_Dialog_Data *cfdata; cfdata = data; // If the source type is another planet, populate the list with // planets and disable the viewing position stuff. if (cfdata->local_xplanet.source_type == SOURCE_ORIGIN) { if (e_widget_ilist_count(cfdata->gui.o_source_ilist) > 0) cfdata->local_xplanet.projection = eina_stringshare_add(e_widget_ilist_selected_value_get( cfdata->gui.o_source_ilist)); _fill_planet_ilist(cfdata->gui.o_source_ilist, cfdata->local_xplanet.origin, _cb_source, cfdata, &(cfdata->source_item)); e_widget_disabled_set(cfdata->gui.o_viewpos_default, 1); e_widget_disabled_set(cfdata->gui.o_viewpos_latlon, 1); e_widget_disabled_set(cfdata->gui.o_viewpos_random, 1); e_widget_disabled_set(cfdata->gui.o_viewpos_lat_label, 1); e_widget_disabled_set(cfdata->gui.o_viewpos_lat, 1); e_widget_disabled_set(cfdata->gui.o_viewpos_lon_label, 1); e_widget_disabled_set(cfdata->gui.o_viewpos_lon, 1); e_widget_disabled_set(cfdata->gui.o_viewpos_file, 1); e_widget_disabled_set(cfdata->gui.o_viewpos_file_val, 1); e_widget_disabled_set(cfdata->gui.o_viewpos_file_button, 1); e_widget_disabled_set(cfdata->gui.o_use_localtime, 1); e_widget_disabled_set(cfdata->gui.o_localtime, 1); } else { // Populate the list with projections and enable the viewing position stuff. if (e_widget_ilist_count(cfdata->gui.o_source_ilist) > 0) cfdata->local_xplanet.origin = eina_stringshare_add(e_widget_ilist_selected_value_get( cfdata->gui.o_source_ilist)); _fill_projection_ilist(cfdata->gui.o_source_ilist, cfdata->local_xplanet.projection, cfdata, &(cfdata->source_item)); e_widget_disabled_set(cfdata->gui.o_viewpos_latlon, 0); e_widget_disabled_set(cfdata->gui.o_viewpos_random, 0); e_widget_disabled_set(cfdata->gui.o_viewpos_file, 0); _cb_viewpos(cfdata, NULL, NULL); e_widget_disabled_set(cfdata->gui.o_use_localtime, 0); e_widget_disabled_set(cfdata->gui.o_localtime, 0); } _select_list_items(cfdata); }
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; }
/* Page creation functions */ static void eco_config_animation_page(void *data) { int val = 0; int max = 6; selected = -1; ECO_PAGE_BEGIN("animation"); ECO_PAGE_TABLE(_("Window Match")); ECO_CREATE_LIST_MATCH(0, str_matches, 0, 0); /* to remember previously selected item */ if (e_widget_ilist_count(o_matches) > 0) selected = 0; ECO_PAGE_TABLE_END; ECO_PAGE_TABLE(_("Animation duration")); o = e_widget_label_add(cfdata->evas, _("Duration")); e_widget_frametable_object_append(ta, o, 0, 0, 1, 1, 1, 0, 0, 0); o_duration = e_widget_slider_add(cfdata->evas, 1, 0, "%1.0f ms", 50, 2000, 1.0, 0, NULL, &duration, 0); e_widget_disabled_set(o_duration, 1); \ e_widget_frametable_object_append(ta, o_duration, 1, 0, 1, 1, 1, 0, 1, 0); opt = eco_config_option_list_nth(cfg_screen, str_durations, 0); if (opt) { e_widget_slider_value_int_set(o_duration, opt->intValue); e_widget_disabled_set(o_duration, 0); } ECO_PAGE_TABLE_END; ECO_PAGE_TABLE( _("Animation for selected match")); opt = eco_config_option_list_nth(cfg_screen, str_effects, 0); if (opt) effect = opt->intValue; group = e_widget_radio_group_new(&effect); for (i = 0; i < effect_cnt; i++) { o_effect[i] = e_widget_radio_add(cfdata->evas, effect_names[i], i, group); e_widget_frametable_object_append(ta, o_effect[i], (i/max), (i%max), 1, 1, 1, 0, 1, 0); if (effect == i) e_widget_radio_toggle_set(o_effect[i], 1); } ECO_PAGE_TABLE_END; ECO_PAGE_TABLE( _("Animation random pool")); opt = eco_config_option_get(cfg_screen, str_randoms); for (i = 0; i < effect_cnt; i++) random_effect[i] = 0; for (l = opt->listValue; l; l = l->next) { item = l->data; random_effect[item->intValue] = 1; } for (i = 0; i < effect_cnt; i++) { o = e_widget_check_add(cfdata->evas, effect_names[i], &random_effect[i]); e_widget_frametable_object_append(ta, o, (i/max), (i%max), 1, 1, 1, 0, 1, 0); } ECO_PAGE_TABLE_END; ECO_PAGE_END; }
/* Externally accessible functions */ EAPI Evas_Object * e_widget_config_list_add(Evas *evas, Evas_Object * (*func_entry_add)(Evas * evas, char **val, void (*func)(void *data, void *data2), void *data, void *data2), const char *label, int listspan __UNUSED__) { Evas_Object *obj, *o; E_Widget_Data *wd; Evas_Coord mw, mh; obj = e_widget_add(evas); e_widget_del_hook_set(obj, _e_wid_del_hook); e_widget_disable_hook_set(obj, _e_wid_disable_hook); wd = E_NEW(E_Widget_Data, 1); e_widget_data_set(obj, wd); o = e_widget_table_add(evas, 0); wd->gui.table = o; e_widget_sub_object_add(obj, o); o = e_widget_label_add(evas, label); e_widget_table_object_append(wd->gui.table, o, 0, 1, 2, 1, 1, 0, 1, 0); o = func_entry_add(evas, &(wd->cur_entry), NULL, NULL, NULL); wd->gui.entry = o; e_widget_disabled_set(o, 1); e_widget_size_min_set(o, 100, 25); e_widget_table_object_append(wd->gui.table, o, 0, 2, 2, 1, 1, 0, 1, 0); o = e_widget_button_add(evas, _("Add"), "list-add", _button_cb_add, wd, obj); wd->gui.add = o; e_widget_disabled_set(o, 1); e_widget_table_object_append(wd->gui.table, o, 0, 3, 1, 1, 1, 0, 1, 0); o = e_widget_button_add(evas, _("Remove"), "list-remove", _button_cb_remove, wd, obj); wd->gui.remove = o; e_widget_disabled_set(o, 1); e_widget_table_object_append(wd->gui.table, o, 1, 3, 1, 1, 1, 0, 1, 0); o = e_widget_ilist_add(evas, 0, 0, NULL); wd->gui.list = o; e_widget_disabled_set(o, 1); e_widget_size_min_set(o, 80, 40); e_widget_on_change_hook_set(o, _list_cb_change, wd); e_widget_ilist_go(o); e_widget_table_object_append(wd->gui.table, o, 0, 4, 2, 1, 1, 1, 1, 1); o = e_widget_button_add(evas, _("Up"), "go-up", _button_cb_up, wd, NULL); wd->gui.up = o; e_widget_disabled_set(o, 1); e_widget_table_object_append(wd->gui.table, o, 0, 5, 1, 1, 1, 0, 1, 0); o = e_widget_button_add(evas, _("Down"), "go-down", _button_cb_down, wd, NULL); wd->gui.down = o; e_widget_disabled_set(o, 1); e_widget_table_object_append(wd->gui.table, o, 1, 5, 1, 1, 1, 0, 1, 0); e_widget_size_min_get(wd->gui.table, &mw, &mh); e_widget_size_min_set(obj, mw, mh); e_widget_resize_object_set(obj, wd->gui.table); return obj; }
void news_config_dialog_item_content_refresh_feeds(News_Item *ni) { E_Config_Dialog_Data *cfdata; Eina_List *l, *l2; Evas_Object *ilist; int pos; int iw, ih; if (!ni->config_dialog_content) return; cfdata = ni->config_dialog_content->cfdata; ilist = cfdata->ilist_feeds; e_widget_ilist_freeze(ilist); /* disable the callback until we finish to refresh the list */ e_widget_on_change_hook_set(ilist, NULL, NULL); e_widget_ilist_clear(ilist); if (cfdata->button_add) e_widget_disabled_set(cfdata->button_add, 1); pos = -1; for(l=news->config->feed.categories; l; l=eina_list_next(l)) { News_Feed_Category *cat; Evas_Object *iccat = NULL; cat = eina_list_data_get(l); if (!cat->feeds_visible) continue; if (cat->icon) { iccat = e_icon_add(evas_object_evas_get(ilist)); e_icon_file_set(iccat, cat->icon); } e_widget_ilist_header_append(ilist, iccat, cat->name); pos++; for(l2=cat->feeds_visible; l2; l2=eina_list_next(l2)) { Evas_Object *ic = NULL; News_Feed *f; char buf[1024]; f = eina_list_data_get(l2); if (f->icon && f->icon[0]) { ic = e_icon_add(evas_object_evas_get(ilist)); e_icon_file_set(ic, f->icon); } snprintf(buf, sizeof(buf), "%s%s", (f->important) ? "[i] " : "", f->name); e_widget_ilist_append(ilist, ic, buf, NULL, f, NULL); pos++; if (eina_list_data_find(cfdata->ilist_feeds_sel, f)) e_widget_ilist_multi_select(ilist, pos); } } e_widget_ilist_thaw(ilist); e_widget_size_min_get(ilist, &iw, &ih); if (iw < 200) iw = 200; e_widget_size_min_set(ilist, iw, 250); e_widget_ilist_go(ilist); _cb_feed_change(cfdata, NULL); /* restore the callback */ e_widget_on_change_hook_set(ilist, _cb_feed_change, cfdata); }