static Evas_Object * _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata) { Evas_Object *o, *of, *ob; o = e_widget_list_add(evas, 0, 0); of = e_widget_frametable_add(evas, D_("Feeds"), 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(o, of, 1, 1, 0.5); of = e_widget_frametable_add(evas, D_("News Viewer"), 0); ob = e_widget_label_add(evas, D_("Font size")); e_widget_frametable_object_append(of, ob, 0, 0, 1, 1, 1, 1, 1, 1); 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), 50); e_widget_frametable_object_append(of, ob, 0, 1, 1, 1, 1, 0, 1, 0); ob = e_widget_label_add(evas, D_("Font color")); e_widget_frametable_object_append(of, ob, 1, 0, 1, 1, 1, 1, 1, 1); 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(of, ob, 1, 1, 1, 1, 1, 1, 1, 1); e_widget_list_object_append(o, of, 1, 1, 1.0); return o; }
static Evas_Object * _basic_create_widgets (E_Config_Dialog * cfd, Evas * evas, E_Config_Dialog_Data * cfdata) { Evas_Object *o, *of, *ob, *hostname_entry, *port_entry; o = e_widget_list_add (evas, 0, 0); of = e_widget_frametable_add (evas, D_ ("Configuration"), 1); ob = e_widget_label_add (evas, D_ ("Poll Time:")); e_widget_frametable_object_append (of, ob, 0, 0, 1, 1, 1, 0, 1, 0); ob = e_widget_slider_add (evas, 1, 0, D_ ("%1.0f seconds"), 1, 60, 1, 0, NULL, &(cfdata->poll_time), 100); e_widget_frametable_object_append (of, ob, 0, 1, 1, 1, 1, 0, 1, 0); ob = e_widget_label_add (evas, D_ ("Hostname:")); e_widget_frametable_object_append (of, ob, 0, 2, 1, 1, 1, 0, 1, 0); hostname_entry = e_widget_entry_add (evas, &cfdata->hostname, NULL, NULL, NULL); e_widget_size_min_set (hostname_entry, 150, 1); e_widget_frametable_object_append (of, hostname_entry, 0, 3, 1, 1, 1, 0, 1, 0); ob = e_widget_label_add (evas, D_ ("Port:")); e_widget_frametable_object_append (of, ob, 0, 4, 1, 1, 1, 0, 1, 0); port_entry = e_widget_entry_add (evas, &cfdata->port, NULL, NULL, NULL); e_widget_size_min_set (hostname_entry, 150, 1); e_widget_frametable_object_append (of, port_entry, 0, 5, 1, 1, 1, 0, 1, 0); e_widget_list_object_append (o, of, 1, 1, 0.5); ob = e_widget_check_add(evas, D_("Show Popup"), &(cfdata->show_popup)); e_widget_frametable_object_append(of, ob, 0, 6, 1, 1, 1, 0, 1, 0); return o; }
static Evas_Object * _basic_create_widgets (E_Config_Dialog * cfd, Evas * evas, E_Config_Dialog_Data * cfdata) { Evas_Object *o, *of, *ob; o = e_widget_list_add (evas, 0, 0); of = e_widget_framelist_add (evas, D_ ("Uptime Settings"), 0); ob = e_widget_label_add (evas, D_ ("Update Interval:")); e_widget_framelist_object_append (of, ob); ob = e_widget_slider_add (evas, 1, 0, D_ ("%1.0f seconds"), 1.0, 60.0, 1.0, 0, &(cfdata->update_interval), NULL, 100); e_widget_framelist_object_append (of, ob); ob = e_widget_label_add (evas, D_ ("Check Interval:")); e_widget_framelist_object_append (of, ob); ob = e_widget_slider_add (evas, 1, 0, D_ ("%1.0f seconds"), 1.0, 60.0, 1.0, 0, &(cfdata->check_interval), NULL, 100); e_widget_framelist_object_append (of, ob); e_widget_list_object_append (o, of, 1, 1, 0.5); return o; }
/* Externally accesible functions */ EAPI E_Entry_Dialog * e_entry_dialog_show(const char *title, const char *icon, const char *text, const char *initial_text, const char *button_text, const char *button2_text, void (*ok_func)(void *data, char *text), void (*cancel_func)(void *data), void *data) { E_Entry_Dialog *ed; E_Dialog *dia; Evas_Object *o, *ob; Evas_Modifier_Mask mask; int w, h; ed = E_OBJECT_ALLOC(E_Entry_Dialog, E_ENTRY_DIALOG_TYPE, _e_entry_dialog_free); ed->ok.func = ok_func; ed->ok.data = data; ed->cancel.func = cancel_func; ed->cancel.data = data; if (initial_text) ed->text = strdup(initial_text); dia = e_dialog_new(e_container_current_get(e_manager_current_get()), "E", "_entry_dialog"); if (!dia) { e_object_del(E_OBJECT(ed)); return NULL; } dia->data = ed; ed->dia = dia; mask = 0; evas_object_key_ungrab(dia->event_object, "space", mask, ~mask); e_object_del_attach_func_set(E_OBJECT(dia), _e_entry_dia_del); e_win_delete_callback_set(dia->win, _e_entry_dialog_delete); if (title) e_dialog_title_set(dia, title); if (icon) e_dialog_icon_set(dia, icon, 64); o = e_widget_list_add(dia->win->evas, 0, 0); if (text) { ob = e_widget_label_add(dia->win->evas, text); e_widget_list_object_append(o, ob, 1, 0, 0.5); } ed->entry = e_widget_entry_add(dia->win->evas, &(ed->text), NULL, NULL, NULL); evas_object_smart_callback_add(ed->entry, "key_down", _e_entry_cb_key_down, ed); e_widget_list_object_append(o, ed->entry, 1, 1, 0.5); e_widget_size_min_get(o, &w, &h); e_dialog_content_set(dia, o, w, h); e_dialog_button_add(dia, !button_text ? _("OK") : button_text, NULL, _e_entry_dialog_ok, ed); e_dialog_button_add(dia, !button2_text ? _("Cancel") : button2_text, NULL, _e_entry_dialog_cancel, ed); e_win_centered_set(dia->win, 1); e_dialog_show(dia); e_widget_focus_set(ed->entry, 1); e_editable_select_all(e_widget_entry_editable_object_get(ed->entry)); return ed; }
static void _tclock_cb_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info) { Instance *inst = NULL; char buf[1024]; time_t current_time; struct tm *local_time; if (!(inst = data)) return; if (!inst->ci->show_tip) return; if (inst->tip) return; inst->tip = e_gadcon_popup_new(inst->gcc); current_time = time(NULL); local_time = localtime(¤t_time); memset(buf, 0, sizeof(buf)); strftime(buf, 1024, inst->ci->tip_format, local_time); inst->o_tip = e_widget_label_add(inst->tip->win->evas, buf); e_gadcon_popup_content_set(inst->tip, inst->o_tip); e_gadcon_popup_show(inst->tip); }
Evas_Object * e_mod_config_schedule_new_v2(Evas_Object *otb, Evas *evas, E_Config_Dialog_Data *cfdata) { Evas_Object *ot, *ol; Evas_Object *label; ol = e_widget_list_add(evas, 0, 0); #define S cfdata->schedule S.oburgent = e_widget_check_add(evas, D_("Satisfy urgent windows instantly"), &S.urgent); evas_object_smart_callback_add(S.oburgent, "changed", _e_mod_config_schedule_urgent_cb, cfdata); e_widget_list_object_append(ol, S.oburgent, 0, 0, 0.5); S.oblabel = e_widget_label_add(evas, NULL); _e_mod_config_schedule_label_update(&S); e_widget_list_object_append(ol, S.oblabel, 0, 0, 0.5); label = e_widget_label_add(evas, D_("Break Time")); e_widget_list_object_append(ol, label, 1, 0, 0.5); S.obbreak = e_widget_slider_add(evas, 1, 0, D_("%1.0f Minutes"), 0.0, 20.0, 1.00, 0, &(S.break_min), NULL, 100); evas_object_smart_callback_add(S.obbreak, "changed", _e_mod_config_schedule_obbreak_time_cb, &S); e_widget_list_object_append(ol, S.obbreak, 1, 0, 0.5); label = e_widget_label_add(evas, D_("Time to Work before Break")); e_widget_list_object_append(ol, label, 1, 0, 0.5); S.obwork = e_widget_slider_add(evas, 1, 0, D_("%1.0f Minutes"), 0.0, 90.0, 1.00, 0, &(S.work_min), NULL, 100); evas_object_smart_callback_add(S.obwork, "changed", _e_mod_config_schedule_obwork_time_cb, &S); e_widget_list_object_append(ol, S.obwork, 1, 0, 0.5); ot = e_widget_table_add(evas, EINA_FALSE); S.obstart = e_widget_button_add(evas, D_("Start Working"), "list-add", _e_mod_config_schedule_start_working_cb, &S, cfdata); e_widget_table_object_append(ot, S.obstart, 0, 1, 1, 1, 1, 1, 1, 0); S.obstop = e_widget_button_add(evas, D_("Stop Working"), "list-remove", _e_mod_config_schedule_stop_working_cb, &S, cfdata); e_widget_table_object_append(ot, S.obstop, 1, 1, 1, 1, 1, 1, 1, 0); e_widget_list_object_append(ol, ot, 1, 1, 0.5); _e_mod_config_schedule_lock_update(&S); #undef S e_widget_toolbook_page_append(otb, NULL, D_("Schedule"), ol, 1, 1, 1, 1, 0.5, 0.0); return otb; }
static Evas_Object * _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata) { Evas_Object *o; Evas_Object *of, *ob; E_Radio_Group *rg; o = e_widget_list_add(evas, 0, 0); of = e_widget_framelist_add(evas, D_("View Mode"), 0); rg = e_widget_radio_group_new(&(cfdata->view_mode)); ob = e_widget_radio_add(evas, D_("Show one icon for all feeds"), NEWS_ITEM_VIEW_MODE_ONE, rg); e_widget_framelist_object_append(of, ob); ob = e_widget_radio_add(evas, D_("Show all feeds"), NEWS_ITEM_VIEW_MODE_FEED, rg); e_widget_framelist_object_append(of, ob); ob = e_widget_radio_add(evas, D_("Show unread feeds"), NEWS_ITEM_VIEW_MODE_FEED_UNREAD, rg); e_widget_framelist_object_append(of, ob); ob = e_widget_radio_add(evas, D_("Show all feeds marked as important"), NEWS_ITEM_VIEW_MODE_FEED_IMPORTANT, rg); e_widget_framelist_object_append(of, ob); ob = e_widget_radio_add(evas, D_("Show unread feeds marked as important"), NEWS_ITEM_VIEW_MODE_FEED_IMPORTANT_UNREAD, rg); e_widget_framelist_object_append(of, ob); e_widget_list_object_append(o, of, 1, 1, 0.0); of = e_widget_framelist_add(evas, D_("Feed open in"), 0); rg = e_widget_radio_group_new(&(cfdata->openmethod)); ob = e_widget_radio_add(evas, D_("the feed viewer"), NEWS_ITEM_OPENMETHOD_VIEWER, rg); e_widget_framelist_object_append(of, ob); ob = e_widget_radio_add(evas, D_("my favorite browser"), NEWS_ITEM_OPENMETHOD_BROWSER, rg); e_widget_framelist_object_append(of, ob); ob = e_widget_check_add(evas, D_("Browser opens home url"), &(cfdata->browser_open_home)); e_widget_framelist_object_append(of, ob); ob = e_widget_label_add(evas, D_("instead of feed url")); e_widget_framelist_object_append(of, ob); e_widget_list_object_append(o, of, 1, 1, 0.0); ob = e_widget_label_add(evas, ""); e_widget_list_object_append(o, ob, 1, 1, 0.0); ob = e_widget_check_add(evas, D_("Apply this to all News gadgets"), &(cfdata->apply_to_all)); e_widget_list_object_append(o, ob, 1, 1, 0.0); return o; }
static Evas_Object * _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata) { Evas_Object *o, *of, *ob; E_Radio_Group *dg; char buf[4096]; o = e_widget_list_add(evas, 0, 0); of = e_widget_framelist_add(evas, D_("Display Settings"), 0); ob = e_widget_label_add(evas, D_("Poll Time")); e_widget_framelist_object_append(of, ob); ob = e_widget_slider_add(evas, 1, 0, D_("%2.0f minutes"), 15.0, 60.0, 1.0, 0, &(cfdata->poll_time), NULL, 40); e_widget_framelist_object_append(of, ob); ob = e_widget_check_add(evas, D_("Show Description"), &(cfdata->show_text)); e_widget_framelist_object_append(of, ob); ob = e_widget_check_add(evas, D_("Popup on mouse over"), &(cfdata->popup_on_hover)); e_widget_framelist_object_append(of, ob); e_widget_list_object_append(o, of, 1, 1, 0.5); of = e_widget_framelist_add(evas, D_("Unit Settings"), 0); dg = e_widget_radio_group_new(&(cfdata->degrees)); ob = e_widget_radio_add(evas, D_("Celsius"), DEGREES_C, dg); e_widget_framelist_object_append(of, ob); ob = e_widget_radio_add(evas, D_("Fahrenheit"), DEGREES_F, dg); e_widget_framelist_object_append(of, ob); e_widget_list_object_append(o, of, 1, 1, 0.5); of = e_widget_frametable_add(evas, D_("Weather.com Forecasts Code"), 0); ob = e_widget_label_add(evas, D_("Forecasts Code/US Zip Code")); e_widget_frametable_object_append(of, ob, 0, 0, 1, 1, 1, 0, 1, 0); ob = e_widget_entry_add(evas, &cfdata->code, NULL, NULL, NULL); e_widget_size_min_set(ob, 100, 20); e_widget_frametable_object_append(of, ob, 1, 0, 1, 1, 1, 0, 1, 0); ob = e_widget_label_add(evas, D_("To find the code for your area, go to:")); e_widget_frametable_object_append(of, ob, 0, 1, 1, 1, 1, 0, 1, 0); snprintf(buf, sizeof(buf), D_("%s, find your area, and look at the URL"), "http://www.weather.com"); ob = e_widget_label_add(evas, buf); e_widget_frametable_object_append(of, ob, 0, 2, 2, 1, 1, 0, 1, 0); e_widget_list_object_append(o, of, 1, 1, 0.5); return o; }
static void _fill_zone_config(E_Zone *zone, E_Config_Dialog_Data *cfdata) { E_Radio_Group *rg; Evas *evas = cfdata->evas; int i; /* Clear old entries first */ evas_object_del(cfdata->o_desklist); cfdata->o_desklist = e_widget_list_add(evas, 1, 0); e_scrollframe_child_set(e_widget_scrollframe_object_get(cfdata->o_deskscroll), cfdata->o_desklist); e_widget_sub_object_add(cfdata->o_deskscroll, cfdata->o_desklist); for (i = 0; i < zone->desk_y_count * zone->desk_x_count; i++) { E_Desk *desk = zone->desks[i]; if (!desk) continue; struct _E_Config_vdesk *vd = get_vdesk(cfdata, desk->x, desk->y, zone->num); if (!vd) { vd = malloc(sizeof(struct _E_Config_vdesk)); vd->x = desk->x; vd->y = desk->y; vd->zone_num = zone->num; vd->layout = TILE_NONE; cfdata->vdesks = eina_list_append(cfdata->vdesks, vd); } rg = e_widget_radio_group_new(&(vd->layout)); Evas_Object *radiolist = e_widget_list_add(evas, 0, 1); LIST_ADD(radiolist, e_widget_label_add(evas, desk->name)); LIST_ADD(radiolist, RADIO("None", TILE_NONE, rg)); LIST_ADD(radiolist, RADIO("Bigmain", TILE_BIGMAIN, rg)); LIST_ADD(radiolist, RADIO("Grid", TILE_GRID, rg)); LIST_ADD(cfdata->o_desklist, radiolist); } /* Get the correct sizes of desklist and scrollframe */ int mw, mh; e_widget_size_min_get(cfdata->o_desklist, &mw, &mh); evas_object_resize(cfdata->o_desklist, mw, mh); if (mh > 150) mh = 150; mw += 32; mh += 32; e_widget_size_min_set(cfdata->o_deskscroll, mw, mh); }
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_widgets (E_Config_Dialog * cfd, Evas * evas, E_Config_Dialog_Data * cfdata) { Evas_Object *o, *of, *ob; E_Radio_Group *rg; o = e_widget_list_add (evas, 0, 0); of = e_widget_framelist_add (evas, D_ ("General Settings"), 0); rg = e_widget_radio_group_new (&(cfdata->always_text)); ob = e_widget_radio_add (evas, D_ ("Always Show Text"), 1, rg); e_widget_framelist_object_append (of, ob); ob = e_widget_radio_add (evas, D_ ("Show Text On Mouse Over"), 0, rg); e_widget_framelist_object_append (of, ob); ob = e_widget_check_add (evas, D_ ("Show Text As Percent"), &(cfdata->show_percent)); e_widget_framelist_object_append (of, ob); #ifdef __linux__ ob = e_widget_check_add (evas, D_ ("Ignore Buffers"), &(cfdata->real_ignore_buffers)); e_widget_framelist_object_append (of, ob); ob = e_widget_check_add (evas, D_ ("Ignore Cached"), &(cfdata->real_ignore_cached)); e_widget_framelist_object_append (of, ob); #endif ob = e_widget_label_add (evas, D_ ("Check Interval:")); e_widget_framelist_object_append (of, ob); ob = e_widget_slider_add (evas, 1, 0, D_ ("%1.0f seconds"), 1.0, 60.0, 1.0, 0, &(cfdata->poll_time), NULL, 150); e_widget_framelist_object_append (of, ob); e_widget_list_object_append (o, of, 1, 1, 0.5); return o; }
static Evas_Object * _basic_create_widgets (E_Config_Dialog * cfd, Evas * evas, E_Config_Dialog_Data * cfdata) { Evas_Object *o, *of, *ob, *player_entry; o = e_widget_list_add (evas, 0, 0); of = e_widget_frametable_add (evas, D_ ("Configuration"), 1); ob = e_widget_label_add (evas, D_ ("Player:")); e_widget_frametable_object_append (of, ob, 0, 0, 1, 1, 1, 0, 1, 0); player_entry = e_widget_entry_add (evas, &cfdata->player, NULL, NULL, NULL); e_widget_frametable_object_append (of, player_entry, 0, 1, 1, 1, 1, 0, 1, 0); e_widget_size_min_set (player_entry, 150, 1); ob = e_widget_check_add(evas, D_("Show Popup:"), &(cfdata->show_popup)); e_widget_frametable_object_append(of, ob, 0, 4, 1, 1, 1, 0, 1, 0); e_widget_list_object_append (o, of, 1, 1, 0.5); return o; }
static Evas_Object * _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata) { Evas_Object *o, *ob, *ol; Population *pop; pop = cfd->data; o = e_widget_list_add(evas, 0, 0); ob = e_widget_label_add(evas, D_("Number of penguins:")); e_widget_list_object_append(o, ob, 1, 1, 0.5); ob = e_widget_slider_add(evas, 1, 0, D_("%1.0f"), 1, 200, 1, 0, NULL, &(cfdata->penguins_count), 200); e_widget_list_object_append(o, ob, 1, 1, 0.5); ob = e_widget_label_add(evas, D_("Zoom factor:")); e_widget_list_object_append(o, ob, 1, 1, 0.5); ob = e_widget_slider_add(evas, 1, 0, D_("%1.1f X"), 0.2, 3, 0.2, 0, &(cfdata->zoom), NULL, 200); e_widget_list_object_append(o, ob, 1, 1, 0.5); ob = e_widget_label_add(evas, D_("Transparency:")); e_widget_list_object_append(o, ob, 1, 1, 0.5); ob = e_widget_slider_add(evas, 1, 0, D_("%1.0f"), 50, 255, 1, 0, NULL, &(cfdata->alpha), 200); e_widget_list_object_append(o, ob, 1, 1, 0.5); //Lista ob = e_widget_label_add(evas, D_("Select population:")); e_widget_list_object_append(o, ob, 1, 1, 0.5); ol = e_widget_ilist_add(evas, 24, 24, &(cfdata->theme)); e_widget_ilist_clear(ol); Eina_List *l; int count; l = pop->themes; count = 0; while (l) { char *theme; char *name; Evas_Object *oi; theme = l->data; name = edje_file_data_get(theme, "PopulationName"); if (name) { oi = edje_object_add(evas); edje_object_file_set(oi, theme, "icon"); //printf("TEMA: %s (%s)\n", name, cfdata->theme); e_widget_ilist_append(ol, oi, name, NULL, theme, theme); if (strcmp(theme, cfdata->theme) == 0) { e_widget_ilist_selected_set(ol, count); } count++; } l = eina_list_next(l); } e_widget_ilist_go(ol); e_widget_size_min_set(ol, 155, 250); e_widget_list_object_append(o, ol, 1, 1, 0.5); return o; }
static void _forecasts_popup_content_create(Instance *inst) { Evas_Object *o, *ol, *of, *ob, *oi; Evas *evas; char buf[4096]; int row = 0, i; Evas_Coord w, h, mw, mh; if (!inst->location) return; inst->popup = e_gadcon_popup_new(inst->gcc); evas = inst->popup->win->evas; o = e_widget_list_add(evas, 0, 0); snprintf(buf, sizeof(buf), D_("%s: Current Conditions"), inst->location); of = e_widget_frametable_add(evas, buf, 0); snprintf(buf, sizeof(buf), "%s: %d°%c", inst->condition.desc, inst->condition.temp, inst->units.temp); ob = e_widget_label_add(evas, buf); e_widget_frametable_object_append(of, ob, 0, row, 2, 1, 0, 1, 1, 0); oi = _forecasts_popup_icon_create(inst->popup->win->evas, inst->condition.code); edje_object_size_max_get(oi, &w, &h); DEBUG("Icon size %dx%d", w, h); if (w > 160) w = 160; /* For now there is a limit to how big the icon should be */ if (h > 160) h = 160; /* In the future, the icon should be set from the theme, not part of the table */ ob = e_widget_image_add_from_object(evas, oi, w, h); e_widget_frametable_object_append(of, ob, 2, row, 1, 2, 1, 0, 1, 1); ob = e_widget_label_add(evas, D_("Wind Chill")); e_widget_frametable_object_append(of, ob, 0, ++row, 1, 1, 1, 0, 0, 0); snprintf(buf, sizeof(buf), "%d°%c", inst->details.wind.chill, inst->units.temp); ob = e_widget_label_add(evas, buf); e_widget_frametable_object_append(of, ob, 1, row, 1, 1, 1, 0, 0, 0); ob = e_widget_label_add(evas, D_("Wind Speed")); e_widget_frametable_object_append(of, ob, 0, ++row, 1, 1, 1, 0, 0, 0); snprintf(buf, sizeof(buf), "%d %s", inst->details.wind.speed, inst->units.speed); ob = e_widget_label_add(evas, buf); e_widget_frametable_object_append(of, ob, 1, row, 1, 1, 1, 0, 0, 0); ob = e_widget_label_add(evas, D_("Humidity")); e_widget_frametable_object_append(of, ob, 0, ++row, 1, 1, 1, 0, 0, 0); snprintf(buf, sizeof(buf), "%d %%", inst->details.atmosphere.humidity); ob = e_widget_label_add(evas, buf); e_widget_frametable_object_append(of, ob, 1, row, 1, 1, 1, 0, 0, 0); ob = e_widget_label_add(evas, D_("Visibility")); e_widget_frametable_object_append(of, ob, 0, ++row, 1, 1, 1, 0, 0, 0); snprintf(buf, sizeof(buf), "%.2f %s", inst->details.atmosphere.visibility, inst->units.distance); ob = e_widget_label_add(evas, buf); e_widget_frametable_object_append(of, ob, 1, row, 1, 1, 1, 0, 0, 0); ob = e_widget_label_add(evas, D_("Pressure")); e_widget_frametable_object_append(of, ob, 0, ++row, 1, 1, 1, 0, 0, 0); snprintf(buf, sizeof(buf), "%.2f %s", inst->details.atmosphere.pressure, inst->units.pressure); ob = e_widget_label_add(evas, buf); e_widget_frametable_object_append(of, ob, 1, row, 1, 1, 1, 0, 0, 0); if (inst->details.atmosphere.rising == 1) snprintf(buf, sizeof(buf), D_("Rising")); else if (inst->details.atmosphere.rising == 2) snprintf(buf, sizeof(buf), D_("Falling")); else snprintf(buf, sizeof(buf), D_("Steady")); ob = e_widget_label_add(evas, buf); e_widget_frametable_object_append(of, ob, 2, row, 1, 1, 1, 0, 1, 0); ob = e_widget_label_add(evas, D_("Sunrise / Sunset")); e_widget_frametable_object_append(of, ob, 0, ++row, 1, 1, 1, 0, 0, 0); snprintf(buf, sizeof(buf), "%s", inst->details.astronomy.sunrise); ob = e_widget_label_add(evas, buf); e_widget_frametable_object_append(of, ob, 1, row, 1, 1, 1, 0, 1, 0); snprintf(buf, sizeof(buf), "%s", inst->details.astronomy.sunset); ob = e_widget_label_add(evas, buf); e_widget_frametable_object_append(of, ob, 2, row, 1, 1, 1, 0, 1, 0); e_widget_list_object_append(o, of, 1, 1, 0.5); ol = e_widget_list_add(evas, 1, 1); for (i = 0; i < inst->ci->days / 5; i++) { int row = 0; if (!i) snprintf(buf, sizeof(buf), D_("Today")); else if (i == 1) snprintf(buf, sizeof(buf), D_("Tomorrow")); else snprintf(buf, sizeof(buf), "%s", inst->forecast[i].date); of = e_widget_frametable_add(evas, buf, 0); ob = e_widget_label_add(evas, inst->forecast[i].desc); e_widget_frametable_object_append(of, ob, 0, row, 3, 1, 0, 1, 1, 1); ob = e_widget_label_add(evas, D_("High")); e_widget_frametable_object_append(of, ob, 0, ++row, 1, 1, 1, 0, 1, 0); snprintf(buf, sizeof(buf), "%d°%c", inst->forecast[i].high, inst->units.temp); ob = e_widget_label_add(evas, buf); e_widget_frametable_object_append(of, ob, 1, row, 1, 1, 1, 0, 1, 0); ob = e_widget_image_add_from_object(evas, _forecasts_popup_icon_create(inst->popup->win->evas, inst->forecast[i].code), 0, 0); e_widget_frametable_object_append(of, ob, 2, row, 1, 2, 1, 1, 0, 0); ob = e_widget_label_add(evas, D_("Low")); e_widget_frametable_object_append(of, ob, 0, ++row, 1, 1, 1, 0, 1, 0); snprintf(buf, sizeof(buf), "%d°%c", inst->forecast[i].low, inst->units.temp); ob = e_widget_label_add(evas, buf); e_widget_frametable_object_append(of, ob, 1, row, 1, 1, 1, 0, 1, 0); e_widget_list_object_append(ol, of, 1, 1, 0.5); } e_widget_list_object_append(o, ol, 1, 1, 0.5); e_widget_size_min_get(o, &mw, &mh); if ((double)mw / mh > GOLDEN_RATIO) mh = mw / GOLDEN_RATIO; else if ((double)mw / mh < GOLDEN_RATIO - (double)1) mw = mh * (GOLDEN_RATIO - (double)1); e_widget_size_min_set(o, mw, mh); e_gadcon_popup_content_set(inst->popup, 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; }
/* * Build the config dialog */ static Evas_Object * _basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata) { Evas_Object *list = NULL, *table = NULL, *subtable = NULL, *framelist = NULL, *widget = NULL, *toolbook = NULL; E_Radio_Group *rg; struct sysinfo meminfo; long long memSize; // Remove the update timer - has the effect of // aborting any current updates if (eplanet_conf->bg_set_timer) { ecore_timer_del(eplanet_conf->bg_set_timer); } // Get total physical RAM for free mem slider // Limit to 1024Mb sysinfo(&meminfo); memSize = meminfo.totalram; memSize = memSize / 1024 / 1024; if (memSize > 1024) memSize = 1024; toolbook = e_widget_toolbook_add(evas, 48 * e_scale, 48 * e_scale); /* Behaviour Tab */ list = e_widget_list_add(evas, 0, 0); widget = e_widget_label_add(evas, D_("Update background every")); e_widget_list_object_append(list, widget, 1, 1, 0.5); widget = e_widget_slider_add(evas, 1, 0, ("%2.0f minutes"), 1, 60, 1, 0, NULL, &(cfdata->delay), 200); e_widget_list_object_append(list, widget, 1, 1, 0.5); widget = e_widget_label_add(evas, D_("Delay first background change for")); e_widget_list_object_append(list, widget, 1, 1, 0.5); widget = e_widget_slider_add(evas, 1, 0, ("%3.0f seconds"), 1, 120, 1, 0, NULL, &(cfdata->startDelay), 200); e_widget_list_object_append(list, widget, 1, 1, 0.5); widget = e_widget_label_add(evas, D_("Run XPlanet using priority")); e_widget_list_object_append(list, widget, 1, 1, 0.5); widget = e_widget_slider_add(evas, 1, 0, ("%1.0f"), ecore_exe_run_priority_get(), 19, 1, 0, NULL, &(cfdata->taskPriority), 200); e_widget_list_object_append(list, widget, 1, 1, 0.5); widget = e_widget_label_add(evas, D_("Don't run if system load is greater than")); e_widget_list_object_append(list, widget, 1, 1, 0.5); widget = e_widget_slider_add(evas, 1, 0, ("%3.1f"), 1, 32, 0.5, 0, &(cfdata->loadLimit), NULL, 200); e_widget_list_object_append(list, widget, 1, 1, 0.5); widget = e_widget_label_add(evas, D_("Don't run if available RAM is less than")); e_widget_list_object_append(list, widget, 1, 1, 0.5); widget = e_widget_slider_add(evas, 1, 0, ("%3.0f Mb"), 0, memSize, 16, 0, NULL, &(cfdata->minRamLimit), 200); e_widget_list_object_append(list, widget, 1, 1, 0.5); /* widget = e_widget_check_add(evas, D_("Do not change background if on battery power"), &(cfdata->disableOnBattery)); e_widget_list_object_append(list, widget, 1, 1, 0.5); */ // Add behaviour tab to dialog e_widget_toolbook_page_append(toolbook, NULL, D_("Behaviour"), list, 0, 0, 0, 0, 0.5, 0.0); /* XPlanet Tab */ table = e_widget_table_add(evas, 0); // Target framelist = e_widget_framelist_add(evas, D_("Target"), 0); widget = e_widget_ilist_add(evas, 16, 16, NULL); cfdata->gui.o_body_ilist = widget; e_widget_ilist_multi_select_set(widget, 0); e_widget_size_min_set(widget, 160, 150); e_widget_framelist_object_append(framelist, widget); e_widget_table_object_append(table, framelist, 0, 0, 1, 1, 1, 1, 0, 1); // View Type framelist = e_widget_framelist_add(evas, D_("View Type"), 0); rg = e_widget_radio_group_new(&(cfdata->local_xplanet.source_type)); widget = e_widget_radio_add(evas, D_("Origin"), SOURCE_ORIGIN, rg); cfdata->gui.o_origin_toggle = widget; evas_object_smart_callback_add(widget, "changed", _cb_source_type, cfdata); e_widget_framelist_object_append(framelist, widget); widget = e_widget_radio_add(evas, D_("Projection"), SOURCE_PROJECTION, rg); cfdata->gui.o_projection_toggle = widget; evas_object_smart_callback_add(widget, "changed", _cb_source_type, cfdata); e_widget_framelist_object_append(framelist, widget); widget = e_widget_ilist_add(evas, 16, 16, NULL); cfdata->gui.o_source_ilist = widget; e_widget_ilist_multi_select_set(widget, 0); e_widget_size_min_set(widget, 160, 150); e_widget_framelist_object_append(framelist, widget); e_widget_table_object_append(table, framelist, 1, 0, 1, 1, 1, 1, 0, 1); // Label framelist = e_widget_framelist_add(evas, D_("Label"), 0); subtable = e_widget_table_add(evas, 0); widget = e_widget_check_add(evas, D_("Show label"), &(cfdata->gui.show_label)); evas_object_smart_callback_add(widget, "changed", _cb_show_label, cfdata); cfdata->gui.o_show_label = widget; e_widget_table_object_append(subtable, widget, 0, 0, 3, 1, 1, 1, 0, 1); widget = e_widget_label_add(evas, D_("Label text:")); e_widget_table_object_append(subtable, widget, 0, 1, 1, 1, 1, 1, 0, 1); widget = e_widget_entry_add(evas, NULL, NULL, NULL, NULL); cfdata->gui.o_label_text = widget; e_widget_table_object_append(subtable, widget, 1, 1, 2, 1, 1, 1, 0, 1); widget = e_widget_label_add(evas, D_("Time:")); e_widget_table_object_append(subtable, widget, 0, 2, 1, 1, 1, 1, 0, 1); rg = e_widget_radio_group_new(&(cfdata->local_xplanet.label_time)); widget = e_widget_radio_add(evas, D_("Local"), LABEL_TIME_LOCAL, rg); cfdata->gui.o_label_time_local_toggle = widget; e_widget_table_object_append(subtable, widget, 1, 2, 1, 1, 1, 1, 0, 1); widget = e_widget_radio_add(evas, D_("GMT"), LABEL_TIME_GMT, rg); cfdata->gui.o_label_time_gmt_toggle = widget; e_widget_table_object_append(subtable, widget, 2, 2, 1, 1, 1, 1, 0, 1); widget = e_widget_label_add(evas, D_("Position:")); e_widget_table_object_append(subtable, widget, 0, 3, 1, 1, 1, 1, 0, 1); rg = e_widget_radio_group_new(&(cfdata->local_xplanet.label_pos)); widget = e_widget_radio_add(evas, D_("Top left"), LABEL_POS_TL, rg); evas_object_smart_callback_add(widget, "changed", _cb_label_pos, cfdata); cfdata->gui.o_label_pos_tl_toggle = widget; e_widget_table_object_append(subtable, widget, 1, 3, 1, 1, 1, 1, 0, 1); widget = e_widget_radio_add(evas, D_("Top right"), LABEL_POS_TR, rg); evas_object_smart_callback_add(widget, "changed", _cb_label_pos, cfdata); cfdata->gui.o_label_pos_tr_toggle = widget; e_widget_table_object_append(subtable, widget, 2, 3, 1, 1, 1, 1, 0, 1); widget = e_widget_radio_add(evas, D_("Bottom left"), LABEL_POS_BL, rg); evas_object_smart_callback_add(widget, "changed", _cb_label_pos, cfdata); cfdata->gui.o_label_pos_bl_toggle = widget; e_widget_table_object_append(subtable, widget, 1, 4, 1, 1, 1, 1, 0, 1); widget = e_widget_radio_add(evas, D_("Bottom right"), LABEL_POS_BR, rg); evas_object_smart_callback_add(widget, "changed", _cb_label_pos, cfdata); cfdata->gui.o_label_pos_br_toggle = widget; e_widget_table_object_append(subtable, widget, 2, 4, 1, 1, 1, 1, 0, 1); widget = e_widget_radio_add(evas, D_("Other"), LABEL_POS_OTHER, rg); evas_object_smart_callback_add(widget, "changed", _cb_label_pos, cfdata); cfdata->gui.o_label_pos_other_toggle = widget; e_widget_table_object_append(subtable, widget, 1, 5, 1, 1, 1, 1, 0, 1); widget = e_widget_entry_add(evas, NULL, NULL, NULL, NULL); cfdata->gui.o_label_pos_other_text = widget; e_widget_table_object_append(subtable, widget, 2, 5, 2, 1, 1, 1, 0, 1); widget = e_widget_label_add(evas, D_("Font:")); e_widget_table_object_append(subtable, widget, 0, 6, 1, 1, 1, 1, 0, 1); widget = e_widget_label_add(evas, D_("Not yet implemented")); e_widget_table_object_append(subtable, widget, 1, 6, 2, 1, 1, 1, 0, 1); e_widget_framelist_object_append(framelist, subtable); e_widget_table_object_append(table, framelist, 2, 0, 1, 1, 1, 1, 1, 1); // Viewing Position framelist = e_widget_framelist_add(evas, D_("Viewing Position"), 0); subtable = e_widget_table_add(evas, 0); rg = e_widget_radio_group_new(&(cfdata->local_xplanet.viewpos_type)); widget = e_widget_radio_add(evas, D_("Random"), VIEWPOS_RANDOM, rg); cfdata->gui.o_viewpos_random = widget; evas_object_smart_callback_add(widget, "changed", _cb_viewpos, cfdata); e_widget_table_object_append(subtable, widget, 0, 0, 1, 1, 1, 1, 0, 1); widget = e_widget_radio_add(evas, D_("Fixed"), VIEWPOS_LATLON, rg); cfdata->gui.o_viewpos_latlon = widget; evas_object_smart_callback_add(widget, "changed", _cb_viewpos, cfdata); e_widget_table_object_append(subtable, widget, 0, 1, 1, 1, 1, 1, 0, 1); widget = e_widget_label_add(evas, D_("Latitude:")); cfdata->gui.o_viewpos_lat_label = widget; e_widget_table_object_append(subtable, widget, 1, 1, 1, 1, 1, 1, 0, 1); widget = e_widget_entry_add(evas, NULL, NULL, NULL, NULL); cfdata->gui.o_viewpos_lat = widget; e_widget_table_object_append(subtable, widget, 2, 1, 1, 1, 1, 1, 1, 1); widget = e_widget_label_add(evas, D_("Longitude:")); cfdata->gui.o_viewpos_lon_label = widget; e_widget_table_object_append(subtable, widget, 3, 1, 1, 1, 1, 1, 0, 1); widget = e_widget_entry_add(evas, NULL, NULL, NULL, NULL); cfdata->gui.o_viewpos_lon = widget; e_widget_table_object_append(subtable, widget, 4, 1, 1, 1, 1, 1, 1, 1); widget = e_widget_radio_add(evas, D_("From file"), VIEWPOS_FILE, rg); cfdata->gui.o_viewpos_file = widget; evas_object_smart_callback_add(widget, "changed", _cb_viewpos, cfdata); e_widget_table_object_append(subtable, widget, 0, 2, 1, 1, 1, 1, 0, 1); widget = e_widget_entry_add(evas, NULL, NULL, NULL, NULL); cfdata->gui.o_viewpos_file_val = widget; e_widget_table_object_append(subtable, widget, 1, 2, 4, 1, 1, 1, 0, 1); widget = e_widget_button_add(evas, D_("..."), NULL, _select_viewpos_file, cfd, cfdata); cfdata->gui.o_viewpos_file_button = widget; e_widget_table_object_append(subtable, widget, 5, 2, 1, 1, 1, 1, 0, 1); widget = e_widget_check_add(evas, D_("Set local time:"), &(cfdata->local_xplanet.use_localtime)); evas_object_smart_callback_add(widget, "changed", _cb_set_localtime, cfdata); cfdata->gui.o_use_localtime = widget; e_widget_table_object_append(subtable, widget, 0, 3, 2, 1, 1, 1, 0, 1); widget = e_widget_slider_add(evas, 1, 0, ("%02.0f:00"), 0, 23, 1, 0, NULL, &(cfdata->gui.localtime), NULL); cfdata->gui.o_localtime = widget; e_widget_table_object_append(subtable, widget, 2, 3, 3, 1, 1, 1, 0, 1); e_widget_framelist_object_append(framelist, subtable); e_widget_table_object_append(table, framelist, 0, 1, 2, 1, 1, 1, 0, 1); // Other settings framelist = e_widget_framelist_add(evas, D_("Other Settings"), 0); subtable = e_widget_table_add(evas, 0); widget = e_widget_check_add(evas, D_("Use config file:"), &(cfdata->gui.use_config)); cfdata->gui.o_config_check = widget; e_widget_table_object_append(subtable, widget, 0, 0, 1, 1, 1, 1, 0, 1); widget = e_widget_entry_add(evas, NULL, NULL, NULL, NULL); cfdata->gui.o_config_name = widget; e_widget_table_object_append(subtable, widget, 1, 0, 1, 1, 1, 1, 1, 1); widget = e_widget_label_add(evas, D_("Other command line parameters:")); e_widget_table_object_append(subtable, widget, 0, 1, 2, 1, 1, 1, 0, 1); widget = e_widget_entry_add(evas, NULL, NULL, NULL, NULL); cfdata->gui.o_extra_options = widget; e_widget_table_object_append(subtable, widget, 0, 2, 2, 1, 1, 1, 0, 1); e_widget_framelist_object_append(framelist, subtable); e_widget_table_object_append(table, framelist, 2, 1, 1, 1, 1, 1, 0, 1); // Preview button // widget = e_widget_button_add(evas, D_("Preview"), NULL, _show_preview, // cfd, cfdata); // e_widget_table_object_append(table, widget, 0, 2, 3, 1, 1, 1, 0, 1); e_widget_toolbook_page_append(toolbook, NULL, D_("XPlanet"), table, 0, 0, 0, 0, 0.5, 0.0); e_widget_toolbook_page_show(toolbook, 0); _populate_xplanet_page(cfdata, 0); return toolbook; }
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; }
static Evas_Object * _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata) { Evas_Object *o, *ob, *of, *osf, *ossf, *ot; E_Radio_Group *rg; E_Container *con = e_container_current_get(e_manager_current_get()); E_Zone *zone; Eina_List *l; o = e_widget_list_add(evas, 0, 0); ot = e_widget_table_add(evas, 0); { /* General settings */ of = e_widget_framelist_add(evas, D_("General"), 0); FRAME_ADD(of, CHECK("Enable tiling", cfdata->tiling_enabled)); FRAME_ADD(of, CHECK("Don't change window borders", cfdata->dont_touch_borders)); FRAME_ADD(of, CHECK("Tile dialog windows aswell", cfdata->tile_dialogs)); FRAME_ADD(of, CHECK("Set too big windows floating automatically", cfdata->float_too_big_windows)); osf = e_widget_list_add(evas, 0, 0); ob = CHECK("Leave space between windows:", cfdata->space_between); e_widget_on_change_hook_set(ob, _cb_leave_space_change, cfdata); FRAME_ADD(of, ob); ossf = e_widget_list_add(evas, 0, 1); LIST_ADD(ossf, e_widget_label_add(evas, D_("Horizontal:"))); LIST_ADD(ossf, e_widget_slider_add(evas, 1, 0, D_("%1.0f px"), 0.0, 50.0, 1.0, 0, NULL, &(cfdata->between_x), 200)); LIST_ADD(osf, ossf); ossf = e_widget_list_add(evas, 0, 1); LIST_ADD(ossf, e_widget_label_add(evas, D_("Vertical:"))); LIST_ADD(ossf, e_widget_slider_add(evas, 1, 0, D_("%1.0f px"), 0.0, 50.0, 1.0, 0, NULL, &(cfdata->between_y), 200)); LIST_ADD(osf, ossf); cfdata->o_space_between = osf; recursively_set_disabled(osf, !cfdata->space_between); FRAME_ADD(of, osf); e_widget_table_object_append(ot, of, 0, 0, 1, 2, 1, 1, 1, 1); } { /* Virtual desktop settings */ of = e_widget_framelist_add(evas, D_("Virtual Desktops"), 0); rg = e_widget_radio_group_new(&(cfdata->tiling_mode)); FRAME_ADD(of, RADIO("Don't tile by default", TILE_NONE, rg)); FRAME_ADD(of, RADIO("Bigmain: Main window left, small windows right", TILE_BIGMAIN, rg)); FRAME_ADD(of, RADIO("Grid: Distribute windows equally", TILE_GRID, rg)); FRAME_ADD(of, RADIO("Individual modes:", TILE_INDIVIDUAL, rg)); osf = e_widget_list_add(evas, 0, 1); { /* Zone list */ ILIST(100, 100); cfdata->o_zonelist = ob; e_widget_on_change_hook_set(ob, _cb_zone_change, cfdata); for (l = con->zones; l; l = l->next) { if (!(zone = l->data)) continue; e_widget_ilist_append(ob, NULL, zone->name, NULL, zone, NULL); } ILIST_GO(0); LIST_ADD(osf, ob); } { /* List of individual tiling modes */ /* Order is important here: Firstly create the list, then add it to the * scrollframe before any objects get added to the list */ cfdata->o_desklist = e_widget_list_add(evas, 1, 0); cfdata->o_deskscroll = e_widget_scrollframe_simple_add(evas, cfdata->o_desklist); cfdata->evas = evas; _fill_zone_config(con->zones->data, cfdata); LIST_ADD(osf, cfdata->o_deskscroll); } FRAME_ADD(of, osf); e_widget_table_object_append(ot, of, 0, 2, 1, 1, 1, 1, 1, 1); } { /* Grid mode settings */ of = e_widget_framelist_add(evas, D_("Grid mode settings"), 0); rg = e_widget_radio_group_new(&(cfdata->grid_distribute_equally)); FRAME_ADD(of, RADIO("Distribute space equally", 1, rg)); FRAME_ADD(of, RADIO("Use this number of rows:", 0, rg)); FRAME_ADD(of, e_widget_slider_add(evas, 1, 0, D_("%1.0f"), 1.0, 12.0, 1.0, 0, NULL, &(cfdata->grid_rows), 100)); e_widget_table_object_append(ot, of, 1, 0, 1, 1, 1, 1, 1, 1); } { /* Bigmain settings */ of = e_widget_framelist_add(evas, D_("Bigmain settings"), 0); FRAME_ADD(of, e_widget_label_add(evas, D_("Big win takes percent of screen:"))); FRAME_ADD(of, e_widget_slider_add(evas, 1, 0, D_("%.2f"), 0.1, 1.0, 0.01, 0, &(cfdata->big_perc), NULL, 100)); e_widget_table_object_append(ot, of, 1, 1, 1, 1, 1, 1, 1, 1); } { /* Tiling mode border style */ osf = e_widget_list_add(evas, 0, 0); of = e_widget_framelist_add(evas, D_("Tiling border"), 0); ILIST(100, 75); e_widget_on_change_hook_set(ob, _cb_tiling_border_change, cfdata); int sel = -1, c = 0; for (l = e_theme_border_list(); l; l = l->next, c++) { e_widget_ilist_append(ob, NULL, l->data, NULL, NULL, NULL); if (cfdata->tiling_border && !strcmp(l->data, cfdata->tiling_border)) sel = c; } ILIST_GO(sel); FRAME_ADD(of, ob); LIST_ADD(osf, of); of = e_widget_framelist_add(evas, D_("Floating border"), 0); ILIST(100, 75); e_widget_on_change_hook_set(ob, _cb_floating_border_change, cfdata); for (sel = -1, c = 0, l = e_theme_border_list(); l; l = l->next, c++) { e_widget_ilist_append(ob, NULL, l->data, NULL, NULL, NULL); if (cfdata->floating_border && !strcmp(l->data, cfdata->floating_border)) sel = c; } ILIST_GO(sel); FRAME_ADD(of, ob); LIST_ADD(osf, of); } e_widget_table_object_append(ot, osf, 1, 2, 1, 1, 1, 1, 1, 1); LIST_ADD(o, ot); return o; }
/* 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; }
static Evas_Object * _basic_create_widgets(E_Config_Dialog * cfd, Evas * evas, E_Config_Dialog_Data * cfdata) { Evas_Object *o, *ob, *otb; E_Radio_Group *rg; otb = e_widget_toolbook_add(evas, (48 * e_scale), (48 * e_scale)); o = e_widget_table_add(evas, 0); ob = e_widget_label_add(evas, D_("Command")); e_widget_table_object_append(o, ob, 0, 0, 1, 1, 1, 0, 1, 0); ob = e_widget_entry_add(evas, &cfdata->status_cmd, NULL, NULL, NULL); e_widget_size_min_set(ob, 150, 1); e_widget_table_object_append(o, ob, 1, 0, 1, 1, 1, 0, 1, 0); ob = e_widget_label_add(evas, D_("(Example: ping -c 5 127.0.0.1)")); e_widget_table_object_append(o, ob, 1, 1, 2, 1, 1, 0, 1, 0); ob = e_widget_label_add(evas, D_("Poll Time")); e_widget_table_object_append(o, ob, 0, 2, 2, 1, 1, 0, 1, 0); ob = e_widget_slider_add(evas, 1, 0, D_("%2.0f hours"), 0.0, 24.0, 1.0, 0, &(cfdata->poll_time_hours), NULL, 40); e_widget_table_object_append(o, ob, 1, 2, 2, 1, 1, 0, 1, 0); ob = e_widget_slider_add(evas, 1, 0, D_("%2.0f mins"), 0.0, 59.0, 1.0, 0, &(cfdata->poll_time_mins), NULL, 40); e_widget_table_object_append(o, ob, 1, 3, 2, 1, 1, 0, 1, 0); ob = e_widget_slider_add(evas, 1, 0, D_("%2.0f secs"), 0.0, 59.0, 1.0, 0, &(cfdata->poll_time_secs), NULL, 40); e_widget_table_object_append(o, ob, 1, 4, 2, 1, 1, 0, 1, 0); ob = e_widget_label_add(evas, D_("Doubleclick Command")); e_widget_table_object_append(o, ob, 0, 5, 1, 1, 1, 0, 1, 0); ob = e_widget_entry_add(evas, &cfdata->dblclk_cmd, NULL, NULL, NULL); e_widget_size_min_set(ob, 150, 1); e_widget_table_object_append(o, ob, 1, 5, 1, 1, 1, 0, 1, 0); ob = e_widget_check_add(evas, D_("Refresh after Execution"), &(cfdata->refresh_after_dblclk_cmd)); e_widget_table_object_append(o, ob, 1, 6, 1, 1, 1, 0, 1, 0); e_widget_toolbook_page_append(otb, NULL, D_("Command"), o, 1, 0, 1, 0, 0.5, 0.0); o = e_widget_table_add(evas, 0); ob = e_widget_label_add(evas, D_("Title")); e_widget_table_object_append(o, ob, 0, 0, 1, 1, 1, 0, 1, 0); ob = e_widget_entry_add(evas, &cfdata->display_name, NULL, NULL, NULL); e_widget_size_min_set(ob, 150, 1); e_widget_table_object_append(o, ob, 1, 0, 1, 1, 1, 0, 1, 0); ob = e_widget_label_add(evas, D_("Mode")); e_widget_table_object_append(o, ob, 0, 1, 1, 1, 1, 0, 1, 0); rg = e_widget_radio_group_new (&(cfdata->display_mode)); ob = e_widget_radio_add (evas, D_("Evaluate Command Result"), 0, rg); e_widget_table_object_append(o, ob, 1, 1, 1, 1, 1, 0, 1, 0); ob = e_widget_radio_add (evas, D_("Show Command Output"), 1, rg); e_widget_table_object_append(o, ob, 1, 2, 1, 1, 1, 0, 1, 0); ob = e_widget_label_add(evas, D_("Custom Icon")); e_widget_table_object_append(o, ob, 0, 3, 1, 1, 1, 0, 1, 0); ob = e_widget_entry_add(evas, &cfdata->icon_path, NULL, NULL, NULL); e_widget_size_min_set(ob, 150, 1); e_widget_table_object_append(o, ob, 1, 3, 1, 1, 1, 0, 1, 0); e_widget_toolbook_page_append(otb, NULL, D_("Display"), o, 1, 0, 1, 0, 0.5, 0.0); o = e_widget_table_add(evas, 0); rg = e_widget_radio_group_new (&(cfdata->okstate_mode)); ob = e_widget_radio_add (evas, D_("Expected Exitcode"), 0, rg); e_widget_table_object_append(o, ob, 0, 0, 1, 1, 1, 0, 1, 0); ob = e_widget_entry_add(evas, &cfdata->okstate_exitcode, NULL, NULL, NULL); e_widget_size_min_set(ob, 150, 1); e_widget_table_object_append(o, ob, 1, 0, 1, 1, 1, 0, 1, 0); ob = e_widget_radio_add (evas, D_("Expected String"), 1, rg); e_widget_table_object_append(o, ob, 0, 1, 1, 1, 1, 0, 1, 0); ob = e_widget_entry_add(evas, &cfdata->okstate_string, NULL, NULL, NULL); e_widget_size_min_set(ob, 150, 1); e_widget_table_object_append(o, ob, 1, 1, 1, 1, 1, 0, 1, 0); ob = e_widget_radio_add (evas, D_("Expected Lines"), 2, rg); e_widget_table_object_append(o, ob, 0, 2, 1, 1, 1, 0, 1, 0); ob = e_widget_entry_add(evas, &cfdata->okstate_lines, NULL, NULL, NULL); e_widget_size_min_set(ob, 150, 1); e_widget_table_object_append(o, ob, 1, 2, 1, 1, 1, 0, 1, 0); e_widget_toolbook_page_append(otb, NULL, D_("Evaluation"), o, 1, 0, 1, 0, 0.5, 0.0); e_widget_toolbook_page_show(otb, 0); return otb; }