Exemplo n.º 1
0
void utils_edit_object_delete(void *data, Evas_Object *obj, void *event_info)
{
    Evas_Object *lbl, *tb, *bt;

    _inwin_delete_slide = elm_win_inwin_add(win);
    evas_object_show(_inwin_delete_slide);
    elm_object_style_set(_inwin_delete_slide, "minimal");

    tb = elm_table_add(win);
    elm_win_inwin_content_set(_inwin_delete_slide, tb);

    lbl = elm_label_add(win);
    elm_object_text_set(lbl, D_("Are you sure you want to delete this object ?"));
    elm_table_pack(tb, lbl, 0, 2, 2, 1);
    evas_object_show(lbl);

    bt= elm_button_add(win);
    elm_object_text_set(bt, "Invisible button to add a vertical space");
    elm_table_pack(tb, bt, 0, 3, 1, 1);

    bt= elm_button_add(win);
    elm_object_text_set(bt, D_("Yes, Delete the object"));
    evas_object_smart_callback_add(bt, "clicked", _utils_object_delete_cb, NULL);
    evas_object_color_set(bt, 255, 0, 0, 255);
    elm_table_pack(tb, bt, 0, 4, 1, 1);
    evas_object_show(bt);

    bt= elm_button_add(win);
    elm_object_text_set(bt, D_("No, do not delete the object"));
    evas_object_smart_callback_add(bt, "clicked", _utils_object_delete_cancel_cb, NULL);
    elm_table_pack(tb, bt, 1, 4, 1, 1);
    evas_object_show(bt);
}
void GenlistItemScenarioSchedule::scenarioDelete(void *data)
{
    if (!scenario) return;

    Evas_Object *table = createPaddingTable(evas, parent, 280, 260);

    Evas_Object *glist = elm_genlist_add(table);
    elm_object_style_set(glist, "calaos");
    elm_genlist_select_mode_set(glist, ELM_OBJECT_SELECT_MODE_ALWAYS);
    evas_object_size_hint_fill_set(glist, EVAS_HINT_FILL, EVAS_HINT_FILL);
    evas_object_size_hint_weight_set(glist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_show(glist);

    string title_label = _("Confirmation<br><small><light_blue>Are you sure you want to delete this scenarios?</light_blue></small>");
    GenlistItemBase *header = new GenlistItemSimpleHeader(evas, glist, title_label);
    header->Append(glist);

    GenlistItemSimple *_item = new GenlistItemSimple(evas, parent, _("Yes, delete the scenario"), true);
    _item->Append(glist, header);
    _item->item_selected.connect(sigc::mem_fun(*this, &GenlistItemScenarioSchedule::deleteScenarioValid));

    _item = new GenlistItemSimple(evas, parent, _("No"), true);
    _item->Append(glist, header);
    _item->item_selected.connect(sigc::bind(sigc::mem_fun(*this, &GenlistItemScenarioSchedule::deleteScenarioCancel), _item));

    elm_table_pack(table, glist, 1, 1, 1, 1);

    elm_naviframe_item_push(pager_popup, NULL, NULL, NULL, table, "calaos");
}
Exemplo n.º 3
0
Evas_Object *
flickr_sync_new(Evas_Object *win, Enlil_Album *album)
{
   Evas_Object *inwin, *pb, *bt, *tb;
   Enlil_Album_Data *album_data = enlil_album_user_data_get(album);

   //create inwin & file selector
   inwin = elm_win_inwin_add(win);
   album_data->netsync.inwin.win = inwin;
   elm_object_style_set(inwin, "minimal");
   evas_object_show(inwin);

   tb = elm_table_add(inwin);
   album_data->netsync.inwin.tb = tb;
   evas_object_size_hint_weight_set(tb, 1.0, 1.0);
   evas_object_size_hint_align_set(tb, 1.0, 1.0);
   evas_object_show(tb);
   elm_win_inwin_content_set(inwin, tb);

   bt = elm_button_add(inwin);
   elm_object_text_set(bt, D_("Close"));
   evas_object_size_hint_align_set(bt, 1.0, 0.5);
   evas_object_smart_callback_add(bt, "clicked", _close_cb, album);
   evas_object_show(bt);
   elm_table_pack(tb, bt, 1, 1, 1, 1);

   pb = elm_progressbar_add(inwin);
   album_data->netsync.inwin.pb = pb;
   evas_object_size_hint_align_set(pb, 0.5, 0.5);
   evas_object_size_hint_weight_set(pb, 1.0, 0.0);
   elm_progressbar_pulse_set(pb, EINA_TRUE);
   elm_object_text_set(pb, D_("Synchronising ..."));
   evas_object_hide(pb);
   elm_table_pack(tb, pb, 0, 1, 1, 1);

   flickr_sync_update(album);

   return inwin;
}
Exemplo n.º 4
0
void utils_edit_area_delete(void *data, Evas_Object *obj, void *event_info)
{
    Evas_Object *lbl, *tb, *bt;

    if(eyelight_edit_name_get(_current_obj) != EYELIGHT_NAME_CUSTOM_AREA
            && eyelight_edit_name_get(_current_obj) != EYELIGHT_NAME_THEME_AREA)
        return ;

    _inwin_delete_slide = elm_win_inwin_add(win);
    evas_object_show(_inwin_delete_slide);
    elm_object_style_set(_inwin_delete_slide, "minimal");

    tb = elm_table_add(win);
    elm_win_inwin_content_set(_inwin_delete_slide, tb);

    lbl = elm_label_add(win);
    elm_object_text_set(lbl, D_("Are you sure you want to delete this area ?"));
    elm_table_pack(tb, lbl, 0, 2, 2, 1);
    evas_object_show(lbl);

    bt= elm_button_add(win);
    elm_object_text_set(bt, "Invisible button to add a vertical space");
    elm_table_pack(tb, bt, 0, 3, 1, 1);

    bt= elm_button_add(win);
    elm_object_text_set(bt, D_("Yes, Delete the area"));
    evas_object_smart_callback_add(bt, "clicked", _utils_area_delete_cb, NULL);
    evas_object_color_set(bt, 255, 0, 0, 255);
    elm_table_pack(tb, bt, 0, 4, 1, 1);
    evas_object_show(bt);

    bt= elm_button_add(win);
    elm_object_text_set(bt, D_("No, do not delete the area"));
    evas_object_smart_callback_add(bt, "clicked", _utils_area_delete_cancel_cb, NULL);
    elm_table_pack(tb, bt, 1, 4, 1, 1);
    evas_object_show(bt);
}
Exemplo n.º 5
0
void ApplicationController::onMenuRebootClick()
{
    Evas_Object *table = createPaddingTable(evas, layout, 260, 200);

    Evas_Object *glist = elm_genlist_add(layout);
    elm_object_style_set(glist, "calaos");
    elm_genlist_select_mode_set(glist, ELM_OBJECT_SELECT_MODE_ALWAYS);
    evas_object_size_hint_fill_set(glist, EVAS_HINT_FILL, EVAS_HINT_FILL);
    evas_object_size_hint_weight_set(glist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_show(glist);

    Evas_Object *popup = elm_ctxpopup_add(layout);
    elm_object_style_set(popup, "calaos");
    evas_object_size_hint_min_set(popup, 300, 240);

    GenlistItemSimple *item;

    item = new GenlistItemSimple(evas, glist, _("Restart application only"), true);
    item->Append(glist);
    item->item_selected.connect([this, popup](void *)
    {
        elm_ctxpopup_dismiss(popup);
        menuView->CloseLinkMenu();

        system("systemctl restart calaos-home");
    });

    item = new GenlistItemSimple(evas, glist, _("Reboot machine"), true);
    item->Append(glist);
    item->item_selected.connect([this, popup](void *)
    {
        elm_ctxpopup_dismiss(popup);
        menuView->CloseLinkMenu();

        system("sync");
        system("reboot");
    });

    elm_table_pack(table, glist, 1, 1, 1, 1);

    elm_object_content_set(popup, table);

    Evas_Coord x,y;
    evas_pointer_canvas_xy_get(evas, &x, &y);
    evas_object_move(popup, x, y);
    evas_object_show(popup);
}
Exemplo n.º 6
0
void ApplicationController::onMenuAddWidgetClick()
{
    Evas_Object *table = createPaddingTable(evas, layout, 260, 200);

    Evas_Object *glist = elm_genlist_add(layout);
    elm_object_style_set(glist, "calaos");
    elm_genlist_select_mode_set(glist, ELM_OBJECT_SELECT_MODE_ALWAYS);
    evas_object_size_hint_fill_set(glist, EVAS_HINT_FILL, EVAS_HINT_FILL);
    evas_object_size_hint_weight_set(glist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_show(glist);

    Evas_Object *popup = elm_ctxpopup_add(layout);
    elm_object_style_set(popup, "calaos");
    evas_object_size_hint_min_set(popup, 300, 240);

    vector<ModuleDef> mods = ModuleManager::Instance().getAvailableModules();

    for (uint i = 0;i < mods.size();i++)
    {
        ModuleDef def = mods[i];
        GenlistItemWidget *item = new GenlistItemWidget(evas, glist, def);
        item->Append(glist);
        item->item_selected.connect([this,i,popup](void *)
        {
            vector<ModuleDef> m = ModuleManager::Instance().getAvailableModules();
            widgetsController->AddWidget(m[i], 200, 200);
            elm_ctxpopup_dismiss(popup);
            menuView->CloseLinkMenu();
        });
    }

    elm_table_pack(table, glist, 1, 1, 1, 1);

    elm_object_content_set(popup, table);

    Evas_Coord x,y;
    evas_pointer_canvas_xy_get(evas, &x, &y);
    evas_object_move(popup, x, y);
    evas_object_show(popup);
}
Exemplo n.º 7
0
void ActivityScenariosView::buttonPressed(void *data, Evas_Object *_edje, std::string emission, std::string source)
{
    if (source == "button.calendar")
    {
        Evas_Object *table = createPaddingTable(evas, parent, 330, 300, 10, 10);

        calendar = elm_calendar_add(parent);
        elm_object_style_set(calendar, "calaos");

        elm_calendar_first_day_of_week_set(calendar, ELM_DAY_MONDAY);

        const char *weekdays[] = { "DIM", "LUN", "MAR", "MER", "JEU", "VEN", "SAM" };
        elm_calendar_weekdays_names_set(calendar, weekdays);

        evas_object_smart_callback_add(calendar, "changed", _calendar_cb, this);

        //Mark sundays
        struct tm sunday = { 0, 0, 12, 7, 0, 0, 6, 0, -1, 0, NULL };
        elm_calendar_mark_add(calendar, "checked", &sunday, ELM_CALENDAR_WEEKLY);
        elm_calendar_marks_draw(calendar);

        evas_object_size_hint_fill_set(calendar, EVAS_HINT_FILL, EVAS_HINT_FILL);
        evas_object_size_hint_weight_set(calendar, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
        evas_object_show(calendar);

        elm_table_pack(table, calendar, 1, 1, 1, 1);

        Evas_Object *popup = elm_ctxpopup_add(parent);
        elm_object_content_set(popup, table);
        elm_object_style_set(popup, "calaos");
        elm_ctxpopup_direction_priority_set(popup,
                                            ELM_CTXPOPUP_DIRECTION_DOWN,
                                            ELM_CTXPOPUP_DIRECTION_LEFT,
                                            ELM_CTXPOPUP_DIRECTION_RIGHT,
                                            ELM_CTXPOPUP_DIRECTION_UP);

        Evas_Coord x,y;
        evas_pointer_canvas_xy_get(evas, &x, &y);
        evas_object_move(popup, x, y);
        evas_object_show(popup);
    }
    else if (source == "button.calendar.today")
    {
        tzset(); //Force reload of timezone data
        time_t t = time(0);
        currDate = *localtime(&t);
        reloadCalendar();
    }
    else if (source == "button.create")
    {
        buttonCreatePressed.emit();
    }
    else if (source == "button.list.all")
    {
        view_mode = VIEW_MODE_ALL;
        loadScenarioList();
    }
    else if (source == "button.list.light")
    {
        view_mode = VIEW_MODE_LIGHT;
        loadScenarioList();
    }
    else if (source == "button.list.shutters")
    {
        view_mode = VIEW_MODE_SHUTTER;
        loadScenarioList();
    }
    else if (source == "button.list.schedule")
    {
        view_mode = VIEW_MODE_SCHEDULE;
        loadScenarioList();
    }
}
Exemplo n.º 8
0
/* ad-hoc network
  .-box-------------------------------------------------------------------.
  | .-scroller----------------------------------------------------------. |
  | | .-table---------------------------------------------------------. | |
  | | | Crate an Ad-Hoc Network                                       | | |
  | | | ESSID:                  [...................................] | | |
  | | | IP:                     [...................................] | | |
  | | | Channel:                [...................................] | | |
  | | | [] Activate Internet Connection Sharing                       | | |
  | | | [] Use Encryption (WEP only)                                  | | |
  | | | Key:                    [...................................] | | |
  | | `---------------------------------------------------------------' | |
  | `-------------------------------------------------------------------' |
  | .-box---------------------------------------------------------------. |
  | |                                                    [Cancel]  [OK] | |
  | `-------------------------------------------------------------------' |
  `-----------------------------------------------------------------------'
*/
void
wicd_adhoc(void)
{
    Evas_Object *bx, *sc, *tb, *ob, *bx2;

    bx = elm_box_add(wicdelm->win);
    elm_box_homogeneous_set(bx, EINA_FALSE);
    elm_box_horizontal_set(bx, EINA_FALSE);
    evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_show(bx);
    wicdelm->adhoc.page = bx;

    sc = elm_scroller_add(wicdelm->win);
    elm_scroller_content_min_limit(sc, EINA_TRUE, EINA_FALSE);
    elm_scroller_policy_set(sc
        , ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
    evas_object_size_hint_weight_set(sc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set(sc, EVAS_HINT_FILL, EVAS_HINT_FILL);
    elm_scroller_bounce_set(sc, EINA_FALSE, EINA_TRUE);
    elm_box_pack_end(bx, sc);
    evas_object_show(sc);

    // table
    tb = elm_table_add(wicdelm->win);
    elm_table_homogeneous_set(tb, EINA_FALSE);
    evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, 0.0);
    evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0);
    elm_object_content_set(sc, tb);
    evas_object_show(tb);

    ob = elm_label_add(wicdelm->win);
    elm_object_text_set(ob, "<b>Create an Ad-Hoc Network</b>");
    evas_object_size_hint_weight_set(ob, EVAS_HINT_EXPAND, 0.0);
    evas_object_size_hint_align_set(ob, EVAS_HINT_FILL, 0.5);
    elm_table_pack(tb, ob, 0, 0, 2, 1);
    evas_object_show(ob);

    ob = elm_label_add(wicdelm->win);
    elm_object_text_set(ob, "ESSID:");
    evas_object_size_hint_weight_set(ob, 0.0, 0.0);
    evas_object_size_hint_align_set(ob, 0.0, 0.5);
    elm_table_pack(tb, ob, 0, 1, 1, 1);
    evas_object_show(ob);
    ob = elm_entry_add(wicdelm->win);
    elm_entry_scrollable_set(ob, EINA_TRUE);
    elm_entry_single_line_set(ob, EINA_TRUE);
    evas_object_size_hint_align_set(ob, EVAS_HINT_FILL, 0.0);
    evas_object_size_hint_weight_set(ob, EVAS_HINT_EXPAND, 0.0);
    elm_table_pack(tb, ob, 1, 1, 1, 1);
    evas_object_show(ob);
    evas_object_smart_callback_add(ob, "changed", _changed_cb, NULL);
    wicdelm->adhoc.essid = ob;

    ob = elm_label_add(wicdelm->win);
    elm_object_text_set(ob, "IP:");
    evas_object_size_hint_weight_set(ob, 0.0, 0.0);
    evas_object_size_hint_align_set(ob, 0.0, 0.5);
    elm_table_pack(tb, ob, 0, 2, 1, 1);
    evas_object_show(ob);
    ob = elm_entry_add(wicdelm->win);
    elm_entry_scrollable_set(ob, EINA_TRUE);
    elm_entry_single_line_set(ob, EINA_TRUE);
    evas_object_size_hint_align_set(ob, EVAS_HINT_FILL, 0.0);
    evas_object_size_hint_weight_set(ob, EVAS_HINT_EXPAND, 0.0);
    elm_table_pack(tb, ob, 1, 2, 1, 1);
    evas_object_show(ob);
    evas_object_smart_callback_add(ob, "changed", _changed_cb, NULL);
    wicdelm->adhoc.ip = ob;

    ob = elm_label_add(wicdelm->win);
    elm_object_text_set(ob, "Channel:");
    evas_object_size_hint_weight_set(ob, 0.0, 0.0);
    evas_object_size_hint_align_set(ob, 0.0, 0.5);
    elm_table_pack(tb, ob, 0, 3, 1, 1);
    evas_object_show(ob);
    ob = elm_slider_add(wicdelm->win);
    elm_slider_min_max_set(ob, 1.0, 14.0);
    elm_slider_indicator_format_set(ob, "%02.0f");
    elm_slider_unit_format_set(ob, "%02.0f");
    evas_object_size_hint_align_set(ob, EVAS_HINT_FILL, 0.0);
    evas_object_size_hint_weight_set(ob, EVAS_HINT_EXPAND, 0.0);
    elm_table_pack(tb, ob, 1, 3, 1, 1);
    evas_object_show(ob);
    evas_object_smart_callback_add(ob, "delay,changed", _changed_cb, NULL);
    wicdelm->adhoc.channel = ob;

    ob = elm_check_add(wicdelm->win);
    elm_object_text_set(ob, "Share Internet");
    evas_object_size_hint_weight_set(ob, EVAS_HINT_EXPAND, 0.0);
    evas_object_size_hint_align_set(ob, EVAS_HINT_FILL, 0.5);
    elm_table_pack(tb, ob, 0, 4, 2, 1);
    evas_object_show(ob);
    evas_object_smart_callback_add(ob, "changed", _changed_cb, NULL);
    wicdelm->adhoc.shareInternet = ob;

    ob = elm_check_add(wicdelm->win);
    elm_object_text_set(ob, "WEP Encryption");
    evas_object_size_hint_weight_set(ob, EVAS_HINT_EXPAND, 0.0);
    evas_object_size_hint_align_set(ob, EVAS_HINT_FILL, 0.5);
    elm_table_pack(tb, ob, 0, 5, 2, 1);
    evas_object_show(ob);
    evas_object_smart_callback_add(ob, "changed", _changed_cb, NULL);
    wicdelm->adhoc.useEncryption = ob;

    ob = elm_label_add(wicdelm->win);
    elm_object_text_set(ob, "Key:");
    evas_object_size_hint_weight_set(ob, 0.0, 0.0);
    evas_object_size_hint_align_set(ob, 0.0, 0.5);
    elm_table_pack(tb, ob, 0, 6, 1, 1);
    evas_object_show(ob);
    ob = elm_entry_add(wicdelm->win);
    elm_entry_scrollable_set(ob, EINA_TRUE);
    elm_entry_single_line_set(ob, EINA_TRUE);
    evas_object_size_hint_align_set(ob, EVAS_HINT_FILL, 0.0);
    evas_object_size_hint_weight_set(ob, EVAS_HINT_EXPAND, 0.0);
    elm_table_pack(tb, ob, 1, 6, 1, 1);
    evas_object_show(ob);
    evas_object_smart_callback_add(ob, "changed", _changed_cb, NULL);
    wicdelm->adhoc.key = ob;

    bx2 = elm_box_add(wicdelm->win);
    elm_box_homogeneous_set(bx2, EINA_TRUE);
    elm_box_horizontal_set(bx2, EINA_TRUE);
    evas_object_size_hint_align_set(bx2, 1.0, 1.0);
    evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
    elm_box_pack_end(bx, bx2);
    evas_object_show(bx2);

    ob = elm_button_add(wicdelm->win);
    elm_object_text_set(ob, "Cancel");
    evas_object_size_hint_align_set(ob, EVAS_HINT_FILL, 0.0);
    evas_object_smart_callback_add(ob, "clicked", _cancel_cb, NULL);
    elm_box_pack_end(bx2, ob);
    evas_object_show(ob);

    ob = elm_button_add(wicdelm->win);
    elm_object_text_set(ob, "Ok");
    evas_object_size_hint_align_set(ob, EVAS_HINT_FILL, 0.0);
    evas_object_smart_callback_add(ob, "clicked", _ok_cb, NULL);
    elm_box_pack_end(bx2, ob);
    evas_object_show(ob);

    wicdelm->adhoc.item = elm_naviframe_item_simple_push(wicdelm->naviframe, bx);
}
void ActivityScheduleScenarioView::reloadTimeRanges()
{
    elm_genlist_clear(schedule_list);

    vector<TimeRange> trange_sorted;
    auto sortTimeRange = [&trange_sorted](vector<TimeRange> &range, int day)
    {
        for (TimeRange &t: range)
        {
            auto it = std::find(trange_sorted.begin(), trange_sorted.end(), t);
            if (it != trange_sorted.end())
            {
                //timerange already in trange_sorted, add the day of week flag
                it->dayOfWeek.set(day);
            }
            else
            {
                TimeRange newtr = t;
                newtr.dayOfWeek.reset();
                newtr.dayOfWeek.set(day);
                trange_sorted.push_back(newtr);
            }
        }
    };

    sortTimeRange(range_infos.range_monday, 0);
    sortTimeRange(range_infos.range_tuesday, 1);
    sortTimeRange(range_infos.range_wednesday, 2);
    sortTimeRange(range_infos.range_thursday, 3);
    sortTimeRange(range_infos.range_friday, 4);
    sortTimeRange(range_infos.range_saturday, 5);
    sortTimeRange(range_infos.range_sunday, 6);

    for (TimeRange &t: trange_sorted)
    {
        GenlistItemScenarioScheduleTime *item = new GenlistItemScenarioScheduleTime(evas, parent, t);
        item->Append(schedule_list);
        item->edit_click.connect([=]()
        {
            is_edit = true;
            old_range = t;
            edit_range = t;
            editState = EDIT_START_TYPE;
            showTimeRangePopup();
        });
        item->del_click.connect([=]()
        {
            Evas_Object *table = createPaddingTable(evas, parent, 280, 260);

            Evas_Object *glist = elm_genlist_add(table);
            elm_object_style_set(glist, "calaos");
            elm_genlist_select_mode_set(glist, ELM_OBJECT_SELECT_MODE_ALWAYS);
            evas_object_size_hint_fill_set(glist, EVAS_HINT_FILL, EVAS_HINT_FILL);
            evas_object_size_hint_weight_set(glist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            evas_object_show(glist);

            string title_label = _("Confirmation");
            title_label += "<br><small><light_blue>";
            title_label += _("Are you sure to delete this schedule?");
            title_label +=  "</light_blue></small>";
            GenlistItemBase *header = new GenlistItemSimpleHeader(evas, glist, title_label);
            header->Append(glist);

            Evas_Object *popup_del = elm_ctxpopup_add(parent);

            GenlistItemSimple *_item = new GenlistItemSimple(evas, parent, _("Yes, delete this schedule"), true);
            _item->Append(glist, header);
            _item->item_selected.connect([=](void *)
            {
                deleteTimeRange(t);
                elm_ctxpopup_dismiss(popup_del);
                reloadTimeRanges();
            });

            _item = new GenlistItemSimple(evas, parent, "Non", true);
            _item->Append(glist, header);
            _item->item_selected.connect([=](void *)
            {
                elm_ctxpopup_dismiss(popup_del);
            });

            elm_table_pack(table, glist, 1, 1, 1, 1);

            elm_object_content_set(popup_del, table);
            elm_object_style_set(popup_del, "calaos");
            elm_ctxpopup_direction_priority_set(popup_del,
                                                ELM_CTXPOPUP_DIRECTION_DOWN,
                                                ELM_CTXPOPUP_DIRECTION_UP,
                                                ELM_CTXPOPUP_DIRECTION_LEFT,
                                                ELM_CTXPOPUP_DIRECTION_RIGHT);

            Evas_Coord x,y;
            evas_pointer_canvas_xy_get(evas, &x, &y);
            evas_object_move(popup_del, x, y);
            evas_object_show(popup_del);
        });
    }

    //reload months
    if (range_infos.range_months.all())
    {
        //all months are selected

        item_all->setSelected(true);
        for (uint i = 0;i < items_months.size();i++)
            items_months[i]->setSelected(false);
    }
    else
    {
        item_all->setSelected(false);
        for (uint i = 0;i < items_months.size();i++)
            items_months[i]->setSelected(range_infos.range_months.test(i));
    }
}
void ActivityScheduleScenarioView::showWeekSelection(void *data, Evas_Object *edje_object, string emission, string source)
{
    if (cycle)
    {
        if (edit_range.end_type == TimeRange::HTYPE_NORMAL ||
            edit_range.end_offset != 0)
        {
            edit_range.ehour = Utils::to_string(elm_spinner_value_get(spin_end_hours));
            edit_range.emin = Utils::to_string(elm_spinner_value_get(spin_end_min));
            edit_range.esec = Utils::to_string(elm_spinner_value_get(spin_end_sec));
        }
    }
    else
    {
        if (edit_range.start_type == TimeRange::HTYPE_NORMAL ||
            edit_range.start_offset != 0)
        {
            edit_range.shour = Utils::to_string(elm_spinner_value_get(spin_start_hours));
            edit_range.smin = Utils::to_string(elm_spinner_value_get(spin_start_min));
            edit_range.ssec = Utils::to_string(elm_spinner_value_get(spin_start_sec));
        }

        edit_range.end_type = edit_range.start_type;
        edit_range.end_offset = edit_range.start_offset;
        edit_range.ehour = edit_range.shour;
        edit_range.emin = edit_range.smin;
        edit_range.esec = edit_range.ssec;
    }

    Evas_Object *table = createPaddingTable(evas, parent, 300, 300);

    Evas_Object *glist = elm_genlist_add(table);
    elm_object_style_set(glist, "calaos");
    elm_genlist_select_mode_set(glist, ELM_OBJECT_SELECT_MODE_ALWAYS);
    evas_object_size_hint_fill_set(glist, EVAS_HINT_FILL, EVAS_HINT_FILL);
    evas_object_size_hint_weight_set(glist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    elm_genlist_multi_select_set(glist, true);
    evas_object_show(glist);

    string title_label = _("Days of the week<br><small><light_blue>Days of the week when scenario is executed.</light_blue></small>");
    GenlistItemSimpleHeader *header = new GenlistItemSimpleHeader(evas, glist, title_label, "navigation");
    header->Append(glist);

    if (cycle)
        header->setButtonLabel("button.back", _("End"));
    else
        header->setButtonLabel("button.back", _("Beginning"));
    header->button_click.connect(sigc::mem_fun(*this, &ActivityScheduleScenarioView::headerWeekButtonClick));

    week_days.clear();
    week_days.reserve(8);
    GenlistItemSimple *item;

    for (int i = 0;i < 8;i++)
    {
        string label;
        switch (i)
        {
        case 0: label = _("Everyday"); break;
        case 1: label = _("Monday"); break;
        case 2: label = _("Tuesday"); break;
        case 3: label = _("Wednesday"); break;
        case 4: label = _("Thursday"); break;
        case 5: label = _("Friday"); break;
        case 6: label = _("Saturday"); break;
        case 7: label = _("Sunday"); break;
        default: label = _("ERROR");
        }

        item = new GenlistItemSimple(evas, glist, label, true, false, NULL, "check");
        item->Append(glist, header);
        week_days.push_back(item);

        if (i == 0)
        {
            item->item_selected.connect(sigc::mem_fun(*this, &ActivityScheduleScenarioView::unselectWeekDays));
            item->setSelected(true);
        }
        else
        {
            item->item_selected.connect(sigc::mem_fun(*this, &ActivityScheduleScenarioView::unselectAllWeekDays));
        }
    }

    elm_table_pack(table, glist, 1, 1, 1, 1);

    elm_naviframe_item_push(pager_popup, NULL, NULL, NULL, table, "calaos");
}
void ActivityScheduleScenarioView::selectTimeType(void *data)
{
    int *user_data = reinterpret_cast<int *>(data);

    if (editState == EDIT_START_TYPE)
    {
        editStatesHist.push(editState);
        edit_range.start_type = *user_data;
        if (edit_range.start_type == TimeRange::HTYPE_NORMAL)
            editState = EDIT_START_TIME;
        else
            editState = EDIT_START_OFFSET;
    }
    else if (editState == EDIT_END_TYPE)
    {
        edit_range.end_type = *user_data;
        editStatesHist.push(editState);
        if (edit_range.end_type == TimeRange::HTYPE_NORMAL)
            editState = EDIT_END_TIME;
        else
            editState = EDIT_END_OFFSET;
    }

    if (editState == EDIT_END_TIME ||
        editState == EDIT_START_TIME)
    {
        if (editState == EDIT_END_TIME)
            edit_range.end_type = TimeRange::HTYPE_NORMAL;
        else
            edit_range.start_type = TimeRange::HTYPE_NORMAL;
        showTimeSelection(NULL);
    }
    else
    {
        Evas_Object *table = createPaddingTable(evas, parent, 300, 300);

        Evas_Object *glist = elm_genlist_add(table);
        elm_object_style_set(glist, "calaos");
        elm_genlist_select_mode_set(glist, ELM_OBJECT_SELECT_MODE_ALWAYS);
        evas_object_size_hint_fill_set(glist, EVAS_HINT_FILL, EVAS_HINT_FILL);
        evas_object_size_hint_weight_set(glist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
        evas_object_show(glist);

        string title_label = _("<b>Offset time</b><br><light_blue><small>You can choose to shift the sun time</small></light_blue>");
        GenlistItemSimpleHeader *header = new GenlistItemSimpleHeader(evas, glist, title_label, "navigation_back");
        header->Append(glist);
        header->setButtonLabel("button.back", "Début");
        header->button_click.connect(sigc::mem_fun(*this, &ActivityScheduleScenarioView::buttonHeaderBackClick));

        GenlistItemSimple *item = NULL;

        for (int i = 0;i < 3;i++)
        {
            switch (i)
            {
            case 0: item = new GenlistItemSimple(evas, glist, _("Use the exact sun time"), true, false, new int(i)); break;
            case 1: item = new GenlistItemSimple(evas, glist, _("Add time"), true, false, new int(i)); break;
            case 2: item = new GenlistItemSimple(evas, glist, _("Substract time"), true, false, new int(i)); break;
            default: break;
            }

            item->Append(glist, header);
            item->setAutoDeleteUserData(new DeletorT<int *>);
            item->item_selected.connect(sigc::mem_fun(*this, &ActivityScheduleScenarioView::showTimeSelection));
        }

        elm_table_pack(table, glist, 1, 1, 1, 1);

        elm_naviframe_item_push(pager_popup, NULL, NULL, NULL, table, "calaos");
    }
}
Exemplo n.º 12
0
EAPI_MAIN int
elm_main(int argc, char **argv)
{
   Evas_Object *win, *bg, *bx, *hbx, *tg, *ck, *mb, *tb, *ic;
   unsigned int i, j;

   win = elm_win_add(NULL, "mapbuf", ELM_WIN_BASIC);
   elm_win_title_set(win, "Mapbuf Example");
   evas_object_smart_callback_add(win, "delete,request", _on_done, NULL);

   bg = elm_bg_add(win);
   elm_win_resize_object_add(win, bg);
   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_show(bg);

   bx = elm_box_add(win);
   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
   elm_win_resize_object_add(win, bx);
   evas_object_show(bx);

   mb = elm_mapbuf_add(win);
   evas_object_size_hint_weight_set(mb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(mb, EVAS_HINT_FILL, EVAS_HINT_FILL);
   elm_box_pack_end(bx, mb);

   tb = elm_table_add(win);
   evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
   evas_object_show(tb);

   for (i = 0; i < 8; i++)
     {
        for (j = 0; j < 8; j++)
          {
             ic = elm_icon_add(win);
             elm_icon_standard_set(ic, "home");
             elm_image_resizable_set(ic, EINA_FALSE, EINA_FALSE);
             evas_object_show(ic);
             elm_table_pack(tb, ic, i, j, 1, 1);
          }
     }

   elm_object_content_set(mb, tb);
   evas_object_show(mb);

   hbx = elm_box_add(win);
   elm_box_horizontal_set(hbx, EINA_TRUE);
   evas_object_size_hint_weight_set(hbx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(hbx, EVAS_HINT_FILL, EVAS_HINT_FILL);
   elm_box_pack_end(bx, hbx);
   evas_object_show(hbx);

   tg = elm_check_add(win);
   elm_object_style_set(tg, "toggle");
   elm_object_part_text_set(tg, "on", "Enabled");
   elm_object_part_text_set(tg, "off", "Disabled");
   elm_object_text_set(tg, "Map");
   evas_object_smart_callback_add(tg, "changed", _enabled_cb, mb);
   elm_box_pack_end(hbx, tg);
   evas_object_show(tg);

   ck = elm_check_add(win);
   elm_object_text_set(ck, "Alpha");
   elm_check_state_set(ck, EINA_TRUE);
   evas_object_smart_callback_add(ck, "changed", _alpha_cb, mb);
   elm_box_pack_end(hbx, ck);
   evas_object_show(ck);

   ck = elm_check_add(win);
   elm_object_text_set(ck, "Smooth");
   elm_check_state_set(ck, EINA_TRUE);
   evas_object_smart_callback_add(ck, "changed", _smooth_cb, mb);
   elm_box_pack_end(hbx, ck);
   evas_object_show(ck);

   evas_object_resize(win, 240, 320);
   evas_object_show(win);

   elm_run();
   elm_shutdown();

   return 0;
}
Exemplo n.º 13
0
void create_details_page(void *data, Evas_Object *obj, void *event_info)
{
	Evas_Object *bg, *tb, *lb, *bt;
	Evas_Object *det_hv, *bx, *c_date_hs, *c_date_bt, *fr1, *fr, *bt_done;
	int i;
	char no[2], dt[10];
	static Details det[15];
	time_t curtime, tm;
	struct tm *loctime;

	//get the time
	curtime = time (NULL);
	
	//check task selected - otherwise return
	Elm_Object_Item *item = (Elm_Object_Item *)elm_genlist_selected_item_get(list);
	if(!item) return;
	_Task *tsk = (_Task *)elm_object_item_data_get(item);
	det_page = elm_win_add(NULL, "inwin", ELM_WIN_BASIC);
	elm_win_title_set(det_page, "Task Details");
	elm_win_autodel_set(det_page, 1);

	bg = elm_bg_add(det_page);
	elm_win_resize_object_add(det_page, bg);
	evas_object_size_hint_weight_set(bg, 1.0, 1.0);
	evas_object_show(bg);
	
	tb = elm_table_add(det_page);
	elm_win_resize_object_add(det_page, tb);
	evas_object_size_hint_weight_set(tb, 1.0, 1.0);
	evas_object_size_hint_align_set(tb, -1.0, -1.0);
	evas_object_show(tb);
	
	//add a frame 
	fr = elm_frame_add(det_page);
	elm_object_style_set(fr, "outdent_top");
	evas_object_size_hint_align_set(fr, 0.5, -1.0);
 	elm_table_pack(tb, fr, 0, 0, 3, 1);
	evas_object_show(fr);

	//add a label to frame
	lb = elm_label_add(det_page);
	elm_object_text_set(lb,"Edit Task Details");
	evas_object_size_hint_align_set(lb, 0.5, -1.0);
	elm_object_content_set(fr, lb);
	evas_object_show(lb);

	//add a label 
	lb = elm_label_add(det_page);
	elm_object_text_set(lb,"Task:");
	evas_object_size_hint_align_set(lb, 1.0, 0.5);
 	elm_table_pack(tb, lb, 0, 1, 1, 1);
	evas_object_show(lb);

	//add an entry 
	entry = elm_entry_add(det_page);
	elm_entry_single_line_set(entry, 1);
	elm_entry_editable_set(entry, 1);
	elm_entry_entry_set(entry, tsk->text);
	elm_entry_line_wrap_set(entry, 0);
 	elm_table_pack(tb, entry, 1, 1, 2, 1);
	evas_object_show(entry);

	//add a label to hbox
	lb = elm_label_add(det_page);
	elm_object_text_set(lb,"Priority:");
	evas_object_size_hint_align_set(lb, 1.0, 0.5);
 	elm_table_pack(tb, lb, 0, 2, 1, 1);
	evas_object_show(lb);

	//add hover for priority
	det_hv = elm_hover_add(det_page);
	//add box for hover
	bx = elm_box_add(det_page);
 	elm_table_pack(tb, bx, 1, 2, 2, 1);
	evas_object_show(bx);

	c_pr_bt = elm_button_add(det_page);
	sprintf(no, "%d", tsk->pr);
	elm_object_text_set(c_pr_bt, no);
	evas_object_smart_callback_add(c_pr_bt, "clicked", my_hover_bt_1, det_hv);
	elm_box_pack_end(bx, c_pr_bt);
	evas_object_show(c_pr_bt);
	elm_hover_parent_set(det_hv, det_page);
	elm_hover_target_set(det_hv, c_pr_bt);

	bt = elm_button_add(det_page);
	elm_object_text_set(bt, "Pr");
	elm_object_part_content_set(det_hv, "middle", bt);
	evas_object_show(bt);

	bx = elm_box_add(det_page);
	//add 5 buttons
	for (i=1; i<6; i++) {
		det[i].item = item;
		det[i].hover = det_hv;
		det[i].button = c_pr_bt;
		bt = elm_button_add(det_page);
		sprintf(no, "%d", i);
		elm_object_text_set(bt, no);
		elm_box_pack_end(bx, bt);
		det[i].data = strdup(no);
		evas_object_smart_callback_add(bt, "clicked", set_create_priority, &det[i]);
		evas_object_show(bt);
	}	
	evas_object_show(bx);
	elm_object_part_content_set(det_hv, "bottom", bx);

	//add a label to hbox
	lb = elm_label_add(det_page);
	elm_object_text_set(lb,"Category:");
	evas_object_size_hint_align_set(lb, 1.0, 0.5);
 	elm_table_pack(tb, lb, 0, 3, 1, 1);
	evas_object_show(lb);

	hs = elm_hover_add(det_page);
	//add box for hover
	bx = elm_box_add(det_page);
 	elm_table_pack(tb, bx, 1, 3, 2, 1);
	evas_object_show(bx);

	cat_bt = elm_button_add(det_page);
	elm_object_text_set(cat_bt, tsk->cat);
	evas_object_smart_callback_add(cat_bt, "clicked", my_hover_bt_1, hs);
	elm_box_pack_end(bx, cat_bt);
	evas_object_show(cat_bt);
	elm_hover_parent_set(hs, det_page);
	elm_hover_target_set(hs, cat_bt);

	bt = elm_button_add(det_page);
	elm_object_text_set(bt, "Category");
	elm_object_part_content_set(hs, "middle", bt);
	evas_object_show(bt);

	bx = elm_box_add(det_page);
	//add categories
	add_hs_items (det_page, bx, bt, 0);
	evas_object_show(bx);
	elm_object_part_content_set(hs, "bottom", bx); 

	//add a label to hbox
	lb = elm_label_add(det_page);
	elm_object_text_set(lb, "Date:");
	evas_object_size_hint_align_set(lb, 1.0, 0.5);
 	elm_table_pack(tb, lb, 0, 4, 1, 1);
	evas_object_show(lb);

	//add hover for date
	c_date_hs = elm_hover_add(det_page);
	//add box for hover
	bx = elm_box_add(det_page);
 	elm_table_pack(tb, bx, 1, 4, 2, 1);
	evas_object_show(bx);

	c_date_bt = elm_button_add(det_page);
	elm_object_text_set(c_date_bt, tsk->date);
	evas_object_smart_callback_add(c_date_bt, "clicked", my_hover_bt_1, c_date_hs);
	elm_box_pack_end(bx, c_date_bt);
	evas_object_show(c_date_bt);
	elm_hover_parent_set(c_date_hs, det_page);
	elm_hover_target_set(c_date_hs, c_date_bt);

	bt = elm_button_add(det_page);
	elm_object_text_set(bt, "Date");
	elm_object_part_content_set(c_date_hs, "middle", bt);
	evas_object_show(bt);

	bx = elm_box_add(det_page);
	
	//add dates
	det[6].item = item;
	det[6].hover = c_date_hs;
	det[6].button = c_date_bt;
	sprintf(dt, "No Date");
	bt = elm_button_add(det_page);
	elm_object_text_set(bt,dt);
	elm_box_pack_end(bx, bt);
	det[6].data = strdup(dt);
	evas_object_smart_callback_add(bt, "clicked", set_create_date, &det[6]);
	evas_object_show(bt);

	for(i=0; i<7; i++) {
		det[7+i].item = item;
		det[7+i].hover = c_date_hs;
		det[7+i].button = c_date_bt;
		tm = curtime + (i * 86400);
		loctime = localtime (&tm);
		strftime(dt, 7, "%d-%m", loctime);
		bt = elm_button_add(det_page);
		elm_object_text_set(bt,dt);
		elm_box_pack_end(bx, bt);
		det[7+i].data = strdup(dt);
		evas_object_smart_callback_add(bt, "clicked", set_create_date, &det[7+i]);
		evas_object_show(bt);
	}

	det[14].item = item;
	det[14].hover = c_date_hs;
	det[14].button = c_date_bt;
	sprintf(dt, "Calendar");
	bt = elm_button_add(det_page);
	elm_object_text_set(bt,dt);
	elm_box_pack_end(bx, bt);
	det[14].data = strdup(dt);
	evas_object_smart_callback_add(bt, "clicked", set_create_date, &det[14]);
	evas_object_show(bt);
	
	evas_object_show(bx);
	elm_object_part_content_set(c_date_hs, "bottom", bx);

	//add a label 
	lb = elm_label_add(det_page);
	elm_object_text_set(lb,"Note:");
	evas_object_size_hint_align_set(lb, 1.0, 0.5);
 	elm_table_pack(tb, lb, 0, 5, 1, 1);
	evas_object_show(lb);

	//add an entry 
	note_entry = elm_entry_add(det_page);
	elm_entry_single_line_set(note_entry, 1);
	elm_entry_editable_set(note_entry, 1);
	if(strcmp(tsk->note, "") != 0) elm_entry_entry_set(note_entry, tsk->note);
	else {
		elm_entry_entry_set(note_entry, "Note"); 
		   elm_entry_select_all(note_entry);
	}
	elm_entry_line_wrap_set(note_entry, 0);
 	elm_table_pack(tb, note_entry, 1, 5, 2, 1);
	evas_object_show(note_entry);

	/*lb = elm_label_add(det_page);
	elm_object_text_set(lb,"Note:");
 	elm_table_pack(tb, lb, 1, 5, 2, 1);
	evas_object_show(lb);*/
	
	//add a frame 
	fr1 = elm_frame_add(det_page);
	elm_object_style_set(fr1, "outdent_bottom");
	evas_object_size_hint_weight_set(fr1, -1.0, 0.0);
	evas_object_size_hint_align_set(fr1, -1.0, -1.0);
 	elm_table_pack(tb, fr1, 0, 6, 3, 1);
	evas_object_show(fr1);
	
	//add done button
	bt_done = elm_button_add(det_page);
	elm_object_text_set(bt_done, "Done");
	evas_object_size_hint_weight_set(bt_done, 1.0, 0.0);
	evas_object_size_hint_align_set(bt_done, -1.0, -1.0);
 	elm_table_pack(tb, bt_done, 0, 7, 1, 1);
	evas_object_show(bt_done);
	evas_object_smart_callback_add(bt_done, "clicked", det_page_done, (_Task *)tsk);
	
	//add del button
	bt = elm_button_add(det_page);
	elm_object_text_set(bt, "Delete");
	evas_object_size_hint_weight_set(bt, 1.0, 0.0);
	evas_object_size_hint_align_set(bt, -1.0, -1.0);
 	elm_table_pack(tb, bt, 1, 7, 1, 1);
	evas_object_show(bt);
	evas_object_smart_callback_add(bt, "clicked", det_page_del, (_Task *)tsk);

	//add yes button
	//bt = elm_button_add(det_page);
	//evas_object_size_hint_weight_set(bt, 1.0, 1.0);
	//evas_object_size_hint_align_set(bt, -1.0, -1.0);
	//elm_object_text_set(bt, "Note");
	//elm_box_pack_end(hbox1, bt);
	//evas_object_show(bt);
	//evas_object_smart_callback_add(bt, "clicked", det_page_add, entry);
	
	//add close button
	bt = elm_button_add(det_page);
	evas_object_size_hint_weight_set(bt, 1.0, 0.0);
	evas_object_size_hint_align_set(bt, -1.0, -1.0);
	elm_object_text_set(bt, "Cancel");
 	elm_table_pack(tb, bt, 2, 7, 1, 1);
	evas_object_show(bt);
	evas_object_smart_callback_add(bt, "clicked", cat_win_del, det_page);
	
	evas_object_resize(det_page, 480, 640);
	evas_object_show(det_page);
}             
Exemplo n.º 14
0
static void
_account_set_cb(void *data, Evas_Object *obj, void *event_info)
{
   Evas_Object *fr, *tb, *inwin, *lbl, *sc, *text, *bt, *hbox, *img, *entry;
   char buf[PATH_MAX];

   inwin = elm_win_inwin_add(enlil_data->win->win);
   set_account.inwin = inwin;
   evas_object_show(inwin);

   fr = elm_frame_add(enlil_data->win->win);
   elm_frame_label_set(fr, D_("Set the Flick account."));
   evas_object_size_hint_weight_set(fr, 1.0, 1.0);
   evas_object_size_hint_align_set(fr, 0.0, 0.0);
   evas_object_show(fr);

   tb = elm_table_add(enlil_data->win->win);
   elm_table_padding_set(tb, 10, 10);
   evas_object_size_hint_weight_set(tb, 1.0, 1.0);
   evas_object_size_hint_align_set(tb, -1.0, -1.0);
   evas_object_show(tb);

   //steps
   lbl = elm_label_add(enlil_data->win->win);
   elm_label_label_set(
                       lbl,
                       D_("<b>STEP 1 :</b> Open the web page in your favorite web browser."));
   evas_object_size_hint_weight_set(lbl, 0.0, 0.0);
   evas_object_size_hint_align_set(lbl, -1.0, 0.0);
   evas_object_show(lbl);
   elm_table_pack(tb, lbl, 0, 0, 2, 1);

   entry = elm_scrolled_entry_add(enlil_data->win->win);
   elm_scrolled_entry_single_line_set(entry, EINA_TRUE);
   elm_scrolled_entry_entry_set(entry, enlil_flickr_auth_url_get());
   evas_object_size_hint_weight_set(entry, 1.0, 0.0);
   evas_object_size_hint_align_set(entry, -1.0, 0.0);
   evas_object_show(entry);
   elm_table_pack(tb, entry, 0, 1, 2, 1);

   img = elm_image_add(obj);
   elm_image_file_set(img, Theme, "flickr/set_account_0");
   evas_object_size_hint_weight_set(img, 1.0, 1.0);
   evas_object_size_hint_align_set(img, -1.0, -1.0);
   evas_object_show(img);
   elm_table_pack(tb, img, 0, 2, 2, 1);

   snprintf(
            buf,
            PATH_MAX,
            D_("<b>STEP 2 :</b> Authorize Enki to access to your account."));
   lbl = elm_label_add(enlil_data->win->win);
   elm_label_label_set(lbl, buf);
   evas_object_size_hint_weight_set(lbl, 0.0, 0.0);
   evas_object_size_hint_align_set(lbl, -1.0, 0.0);
   evas_object_show(lbl);
   elm_table_pack(tb, lbl, 0, 3, 2, 1);

   img = elm_image_add(obj);
   elm_image_file_set(img, Theme, "flickr/set_account_1");
   evas_object_size_hint_weight_set(img, 0.0, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(img, -1.0, -1.0);
   evas_object_show(img);
   elm_table_pack(tb, img, 0, 4, 2, 1);

   snprintf(
            buf,
            PATH_MAX,
            D_("<b>STEP 3 :</b> Copy the code in the followed text area."));
   lbl = elm_label_add(enlil_data->win->win);
   elm_label_label_set(lbl, buf);
   evas_object_size_hint_weight_set(lbl, 0.0, 0.0);
   evas_object_size_hint_align_set(lbl, -1.0, 0.0);
   evas_object_show(lbl);
   elm_table_pack(tb, lbl, 0, 5, 2, 1);
   //

   lbl = elm_label_add(enlil_data->win->win);
   elm_label_label_set(lbl, D_("The 9-digit code : "));
   evas_object_size_hint_weight_set(lbl, 0.0, 0.0);
   evas_object_size_hint_align_set(lbl, -1.0, 0.0);
   evas_object_show(lbl);
   elm_table_pack(tb, lbl, 0, 6, 1, 1);

   sc = elm_scroller_add(enlil_data->win->win);
   evas_object_size_hint_weight_set(sc, 1.0, 0.0);
   evas_object_size_hint_align_set(sc, EVAS_HINT_FILL, EVAS_HINT_FILL);
   elm_scroller_content_min_limit(sc, EINA_FALSE, EINA_TRUE);
   elm_scroller_policy_set(sc, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
   elm_scroller_bounce_set(sc, 0, 0);
   evas_object_show(sc);
   elm_table_pack(tb, sc, 1, 6, 1, 1);

   text = elm_entry_add(enlil_data->win->win);
   set_account.entry = text;
   elm_entry_entry_set(text, "");
   elm_entry_single_line_set(text, 1);
   evas_object_size_hint_weight_set(text, EVAS_HINT_EXPAND, 1.0);
   evas_object_size_hint_align_set(text, 1.0, 0.5);
   elm_scroller_content_set(sc, text);
   evas_object_show(text);

   hbox = elm_box_add(enlil_data->win->win);
   elm_box_horizontal_set(hbox, 1);
   evas_object_size_hint_weight_set(hbox, EVAS_HINT_EXPAND, 0.0);
   evas_object_size_hint_align_set(hbox, 1.0, 0.0);
   evas_object_show(hbox);
   elm_table_pack(tb, hbox, 1, 7, 1, 1);

   bt = elm_button_add(enlil_data->win->win);
   elm_button_label_set(bt, D_("Cancel"));
   evas_object_smart_callback_add(bt, "clicked", _account_set_cancel_cb, NULL);
   evas_object_size_hint_align_set(bt, 1.0, 0.0);
   evas_object_show(bt);
   elm_box_pack_end(hbox, bt);

   bt = elm_button_add(enlil_data->win->win);
   elm_button_label_set(bt, D_("Apply"));
   evas_object_smart_callback_add(bt, "clicked", _account_set_apply_cb, text);
   evas_object_size_hint_align_set(bt, 1.0, 0.0);
   evas_object_show(bt);
   elm_box_pack_end(hbox, bt);
   elm_object_disabled_set(bt, EINA_TRUE);

   evas_object_smart_callback_add(text, "changed",
                                  _account_set_entry_changed_cb, bt);

   elm_frame_content_set(fr, tb);
   elm_win_inwin_content_set(inwin, fr);
}
void GenlistItemScenarioSchedule::buttonClickMore()
{
    if (!scenario) return;

    Evas_Object *table = createPaddingTable(evas, parent, 280, 260);

    Evas_Object *glist = elm_genlist_add(table);
    elm_object_style_set(glist, "calaos");
    elm_genlist_select_mode_set(glist, ELM_OBJECT_SELECT_MODE_ALWAYS);
    evas_object_size_hint_fill_set(glist, EVAS_HINT_FILL, EVAS_HINT_FILL);
    evas_object_size_hint_weight_set(glist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_show(glist);

    string title_label = _("Scenario parameters<br><small><light_blue>Modify, add or delete a schedule.</light_blue></small>");
    GenlistItemBase *header = new GenlistItemSimpleHeader(evas, glist, title_label);
    header->Append(glist);

    GenlistItemSimple *_item;

    _item = new GenlistItemSimple(evas, glist, _("Modify the scenario"), true);
    _item->setIcon("calaos/icons/genlist/edit");
    _item->Append(glist, header);
    _item->item_selected.connect(sigc::mem_fun(*this, &GenlistItemScenarioSchedule::scenarioModify));

    _item = new GenlistItemSimple(evas, glist, _("Delete the scenario"), true);
    _item->setIcon("calaos/icons/genlist/trash");
    _item->Append(glist, header);
    _item->item_selected.connect(sigc::mem_fun(*this, &GenlistItemScenarioSchedule::scenarioDelete));

    _item = new GenlistItemSimple(evas, glist, _("Run the scenario now"), true);
    _item->setIcon("calaos/icons/genlist/play");
    _item->Append(glist, header);
    _item->item_selected.connect(sigc::mem_fun(*this, &GenlistItemScenarioSchedule::scenarioPlay));

    if (scenario->scenario_data.params["schedule"] == "false")
    {
        _item = new GenlistItemSimple(evas, glist, _("Add a schedule"), true);
        _item->setIcon("calaos/icons/genlist/plus");
        _item->Append(glist, header);
        _item->item_selected.connect(sigc::mem_fun(*this, &GenlistItemScenarioSchedule::scheduleAdd));
    }
    else
    {
        _item = new GenlistItemSimple(evas, glist, _("Schedule modification"), true);
        _item->setIcon("calaos/icons/genlist/clock");
        _item->Append(glist, header);
        _item->item_selected.connect(sigc::mem_fun(*this, &GenlistItemScenarioSchedule::scheduleModify));

        _item = new GenlistItemSimple(evas, glist, _("Delete schedule"), true);
        _item->setIcon("calaos/icons/genlist/trash");
        _item->Append(glist, header);
        _item->item_selected.connect(sigc::mem_fun(*this, &GenlistItemScenarioSchedule::scheduleDelete));
    }

    elm_table_pack(table, glist, 1, 1, 1, 1);

    pager_popup = elm_naviframe_add(parent);
    evas_object_show(pager_popup);

    popup = elm_ctxpopup_add(parent);
    elm_object_content_set(popup, pager_popup);
    elm_object_style_set(popup, "calaos");
    elm_ctxpopup_direction_priority_set(popup,
                                        ELM_CTXPOPUP_DIRECTION_DOWN,
                                        ELM_CTXPOPUP_DIRECTION_UP,
                                        ELM_CTXPOPUP_DIRECTION_LEFT,
                                        ELM_CTXPOPUP_DIRECTION_RIGHT);

    Evas_Coord x,y;
    evas_pointer_canvas_xy_get(evas, &x, &y);
    evas_object_move(popup, x, y);
    evas_object_show(popup);

    elm_naviframe_item_push(pager_popup, NULL, NULL, NULL, table, "calaos");
}
Exemplo n.º 16
0
void
flickr_sync_update(Enlil_Album *album)
{
   Enlil_Album_Data *album_data = enlil_album_user_data_get(album);
   Evas_Object *fr, *tb2, *lbl, *bt, *sep, *pb, *pager;
   Evas_Object *inwin = album_data->netsync.inwin.win;
   Evas_Object *tb = album_data->netsync.inwin.tb;
   int i = 0;
   Eina_List *l;
   Enlil_Photo *photo;
   int nb_photos;
   char buf[1024];

   if (album_data->netsync.inwin.fr) evas_object_del(
                                                     album_data->netsync.inwin.fr);

   //
   fr = elm_frame_add(inwin);
   album_data->netsync.inwin.fr = fr;
   elm_object_text_set(fr, D_("Synchronise an album with flickr"));
   evas_object_size_hint_weight_set(fr, 1.0, 1.0);
   evas_object_size_hint_align_set(fr, -1.0, -1.0);
   evas_object_show(fr);
   elm_table_padding_set(tb, 1, 1);
   elm_table_pack(tb, fr, 0, 0, 3, 1);

   tb2 = elm_table_add(inwin);
   evas_object_size_hint_weight_set(tb2, 1.0, 0.0);
   evas_object_size_hint_align_set(tb2, -1.0, 1.0);
   elm_table_padding_set(tb2, 15, 5);
   evas_object_show(tb2);
   elm_object_content_set(fr, tb2);
   //

   if (album_data->netsync.album_netsync_notuptodate)
   {
      lbl = elm_label_add(inwin);
      elm_object_text_set(lbl, D_("Update the flickr album header."));
      evas_object_show(lbl);
      elm_table_pack(tb2, lbl, 0, i, 1, 1);

      bt = elm_button_add(inwin);
      album_data->netsync.inwin.bt1 = bt;
      elm_object_text_set(bt, D_("Update"));
      evas_object_smart_callback_add(bt, "clicked", _netsync_notuptodate_cb,
                                     album);
      evas_object_size_hint_align_set(bt, 0.5, 0.5);
      evas_object_size_hint_weight_set(bt, 1.0, 0.0);

      evas_object_show(bt);
      elm_table_pack(tb2, bt, 1, i, 1, 1);

      i++;

      sep = elm_separator_add(inwin);
      evas_object_show(sep);
      elm_table_pack(tb2, sep, 0, i, 2, 1);
      i++;
   }

   if (album_data->netsync.album_notinnetsync)
   {
      lbl = elm_label_add(inwin);
      elm_object_text_set(lbl, D_("The album is not in Flickr."));
      evas_object_show(lbl);
      elm_table_pack(tb2, lbl, 0, i, 1, 1);

      bt = elm_button_add(inwin);
      album_data->netsync.inwin.bt2 = bt;
      elm_object_text_set(bt, D_("Add the album in Flickr"));
      evas_object_size_hint_align_set(bt, 0.5, 0.5);
      evas_object_size_hint_weight_set(bt, 1.0, 0.0);

      evas_object_smart_callback_add(bt, "clicked", _album_notinnetsync_cb,
                                     album);
      evas_object_show(bt);
      elm_table_pack(tb2, bt, 1, i, 1, 1);

      i++;

      sep = elm_separator_add(inwin);
      evas_object_show(sep);
      elm_table_pack(tb2, sep, 0, i, 2, 1);
      i++;
   }

   if (album_data->netsync.album_local_notuptodate)
   {
      lbl = elm_label_add(inwin);
      elm_object_text_set(lbl, D_("Update the local album header."));
      evas_object_show(lbl);
      elm_table_pack(tb2, lbl, 0, i, 1, 1);

      bt = elm_button_add(inwin);
      album_data->netsync.inwin.bt3 = bt;
      evas_object_size_hint_align_set(bt, 0.5, 0.5);
      evas_object_size_hint_weight_set(bt, 1.0, 0.0);

      evas_object_smart_callback_add(bt, "clicked", _local_notuptodate_cb,
                                     album);
      elm_object_text_set(bt, D_("Update"));
      evas_object_show(bt);
      elm_table_pack(tb2, bt, 1, i, 1, 1);

      i++;

      sep = elm_separator_add(inwin);
      evas_object_show(sep);
      elm_table_pack(tb2, sep, 0, i, 2, 1);
      i++;
   }

   if (album_data->netsync.photos_notinlocal)
   {
      lbl = elm_label_add(inwin);
      elm_object_text_set(lbl, D_("Some photos are not in the local album."));
      evas_object_show(lbl);
      elm_table_pack(tb2, lbl, 0, i, 1, 1);

      pager = elm_naviframe_add(inwin);
      album_data->netsync.inwin.notinlocal.pager = pager;
      evas_object_size_hint_align_set(pager, 0.5, 0.5);
      evas_object_size_hint_weight_set(pager, 1.0, 0.0);
      evas_object_show(pager);
      elm_table_pack(tb2, pager, 1, i, 1, 1);
      elm_object_style_set(pager, "fade_invisible");

      bt = elm_button_add(inwin);
      album_data->netsync.inwin.notinlocal.bt = bt;
      album_data->netsync.inwin.bt4 = bt;
      evas_object_size_hint_align_set(bt, -1.0, 0.5);
      evas_object_size_hint_weight_set(bt, 1.0, 0.0);
      elm_object_text_set(bt, D_("Download Them All"));
      evas_object_smart_callback_add(bt, "clicked", _photos_notinlocal_cb,
                                     album);
      evas_object_show(bt);
      elm_naviframe_item_simple_push(pager, bt);

      pb = elm_progressbar_add(inwin);
      album_data->netsync.inwin.notinlocal.pb = pb;
      evas_object_size_hint_align_set(pb, -1.0, 0.5);
      evas_object_size_hint_weight_set(pb, 1.0, 0.0);
      elm_progressbar_pulse_set(pb, EINA_TRUE);
      elm_object_text_set(pb, D_("Downloads in progress ..."));
      evas_object_show(pb);
      elm_naviframe_item_simple_push(pager, pb);
      evas_object_size_hint_max_set(pb, 0, 0);

      if (album_data->netsync.inwin.notinlocal.is_updating)
      {
         elm_progressbar_pulse(pb, EINA_TRUE);
         elm_naviframe_item_simple_promote(pager, pb);
      }
      else
         elm_naviframe_item_simple_promote(pager, bt);

      i++;

      sep = elm_separator_add(inwin);
      evas_object_show(sep);
      elm_table_pack(tb2, sep, 0, i, 2, 1);
      i++;
   }

   nb_photos = 0;
   EINA_LIST_FOREACH(enlil_album_photos_get(album), l, photo)
   {
      Enlil_Photo_Data *photo_data = enlil_photo_user_data_get(photo);
      if (photo_data && photo_data->netsync.state == PHOTO_FLICKR_NOTINFLICKR)
      {
         nb_photos++;
      }
   }
Exemplo n.º 17
0
void utils_slide_delete(List_Item *item)
{
    int i = 0;
    Eina_List *l;
    List_Item *_item;

    EINA_LIST_FOREACH(l_slides, l, _item)
    {
        if(item == _item)
            break;
        else
            i++;
    }


    Evas_Object *lbl, *tb, *bt, *icon;
    char buf[PATH_MAX];
    snprintf(buf, sizeof(buf), "%s/theme.edj", PACKAGE_DATA_DIR);

    _inwin_delete_slide = elm_win_inwin_add(win);
    evas_object_show(_inwin_delete_slide);
    elm_object_style_set(_inwin_delete_slide, "minimal");

    tb = elm_table_add(win);
    elm_win_inwin_content_set(_inwin_delete_slide, tb);

    //icon
    icon = edje_object_add(evas_object_evas_get(win));
    edje_object_file_set(icon, buf, "list/slides/icon");

    evas_object_size_hint_min_set(icon,1024*0.20,768*0.20);
    evas_object_size_hint_max_set(icon,1024*0.20,768*0.20);

    if(item->thumb)
    {
        int w = item->thumb->w;
        int h = item->thumb->h;
        int *image = calloc(w*h, sizeof(int));
        memcpy(image, item->thumb->thumb, sizeof(int)*w*h);

        const Evas_Object *o_image = edje_object_part_object_get(icon, "object.icon");
        evas_object_image_filled_set((Evas_Object*)o_image,1);
        evas_object_color_set((Evas_Object*)o_image,255,255,255,255);
        evas_object_image_size_set((Evas_Object*)o_image, w, h);
        evas_object_image_data_set((Evas_Object*)o_image, image);

        edje_object_signal_emit(icon, "icon,show", "eyelight");
    }
    evas_object_show(icon);
    elm_table_pack(tb, icon, 0, 0, 2, 1);
    //

    bt= elm_button_add(win);
    elm_object_text_set(bt, "Invisible button to add a vertical space");
    elm_table_pack(tb, bt, 0, 1, 1, 1);

    lbl = elm_label_add(win);
    elm_object_text_set(lbl, D_("Are you sure you want to delete this slide ?"));
    elm_table_pack(tb, lbl, 0, 2, 2, 1);
    evas_object_show(lbl);

    bt= elm_button_add(win);
    elm_object_text_set(bt, "Invisible button to add a vertical space");
    elm_table_pack(tb, bt, 0, 3, 1, 1);

    bt= elm_button_add(win);
    elm_object_text_set(bt, D_("Yes, Delete the slide"));
    evas_object_smart_callback_add(bt, "clicked", _utils_slide_delete_cb, item);
    evas_object_color_set(bt, 255, 0, 0, 255);
    elm_table_pack(tb, bt, 0, 4, 1, 1);
    evas_object_show(bt);

    bt= elm_button_add(win);
    elm_object_text_set(bt, D_("No, do not delete the slide"));
    evas_object_smart_callback_add(bt, "clicked", _utils_slide_delete_cancel_cb, item);
    elm_table_pack(tb, bt, 1, 4, 1, 1);
    evas_object_show(bt);
}
void ActivityScheduleScenarioView::createTimeSelectTypeList(void *data, Evas_Object *edje_object, string emission, string source)
{
    if ((editState == EDIT_START_TIME || editState == EDIT_START_TIME_OFFSET) && cycle)
    {
        editStatesHist.push(editState);
        editState = EDIT_END_TYPE;
    }

    if (editState == EDIT_END_TYPE)
    {
        if (edit_range.start_type == TimeRange::HTYPE_NORMAL ||
            edit_range.start_offset != 0)
        {
            edit_range.shour = Utils::to_string(elm_spinner_value_get(spin_start_hours));
            edit_range.smin = Utils::to_string(elm_spinner_value_get(spin_start_min));
            edit_range.ssec = Utils::to_string(elm_spinner_value_get(spin_start_sec));
        }
        else
        {
            edit_range.shour = "0";
            edit_range.smin = "0";
            edit_range.ssec = "0";
        }
    }

    Evas_Object *table = createPaddingTable(evas, parent, 320, 300);

    Evas_Object *glist = elm_genlist_add(table);
    elm_object_style_set(glist, "calaos");
    elm_genlist_select_mode_set(glist, ELM_OBJECT_SELECT_MODE_ALWAYS);
    evas_object_size_hint_fill_set(glist, EVAS_HINT_FILL, EVAS_HINT_FILL);
    evas_object_size_hint_weight_set(glist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_show(glist);

    string title_label;
    GenlistItemSimpleHeader *header = NULL;
    if (editState == EDIT_START_TYPE)
    {
        title_label = _("Start of schedulling<br><small><light_blue>Start time of the scenario</light_blue></small>");
        header = new GenlistItemSimpleHeader(evas, glist, title_label);
        header->Append(glist);
    }
    else
    {
        title_label = _("End of schedulling<br><small><light_blue>End time of the scenario</light_blue></small>");
        header = new GenlistItemSimpleHeader(evas, glist, title_label, "navigation_back");
        header->Append(glist);
        header->setButtonLabel("button.back", _("Start"));
        header->button_click.connect(sigc::mem_fun(*this, &ActivityScheduleScenarioView::buttonHeaderBackClick));
    }

    GenlistItemSimple *item = nullptr;

    for (int i = 0;i < 4;i++)
    {
        switch (i)
        {
        case 0: item = new GenlistItemSimple(evas, glist, _("Use a fixed time"), true, false, new int(TimeRange::HTYPE_NORMAL)); break;
        case 1: item = new GenlistItemSimple(evas, glist, _("Use the sunrise"), true, false, new int(TimeRange::HTYPE_SUNRISE)); break;
        case 2: item = new GenlistItemSimple(evas, glist, _("Use the sunset"), true, false, new int(TimeRange::HTYPE_SUNSET)); break;
        case 3: item = new GenlistItemSimple(evas, glist, _("Use the midday sun"), true, false, new int(TimeRange::HTYPE_NOON)); break;
        default: break;
        }

        item->Append(glist, header);
        item->setAutoDeleteUserData(new DeletorT<int *>);
        item->item_selected.connect(sigc::mem_fun(*this, &ActivityScheduleScenarioView::selectTimeType));
    }

    elm_table_pack(table, glist, 1, 1, 1, 1);

    elm_naviframe_item_push(pager_popup, NULL, NULL, NULL, table, "calaos");
}
Exemplo n.º 19
0
void GenlistItemTrack::buttonClickMore()
{
        Evas_Object *table = createPaddingTable(evas, parent, 260, 200);

        Evas_Object *glist = elm_genlist_add(parent);
        elm_object_style_set(glist, "calaos");
        elm_genlist_select_mode_set(glist, ELM_OBJECT_SELECT_MODE_ALWAYS);
        evas_object_size_hint_fill_set(glist, EVAS_HINT_FILL, EVAS_HINT_FILL);
        evas_object_size_hint_weight_set(glist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
        evas_object_show(glist);

        string title_label = "Info de la <light_blue>piste #" + Utils::to_string(item_id + 1) + "</light_blue><br><small>Détails de la piste.</small>";
        GenlistItemBase *header = new GenlistItemSimpleHeader(evas, glist, title_label);
        header->Append(glist);

        string infolabel;
        if (item_infos["artist"] != "")
        {
                infolabel = item_infos["artist"];
                GenlistItemSimpleKeyValue *it = new GenlistItemSimpleKeyValue(evas, glist, "Artiste :", infolabel);
                it->Append(glist, header);
        }
        if (item_infos["album"] != "")
        {
                infolabel = item_infos["album"];
                GenlistItemSimpleKeyValue *it = new GenlistItemSimpleKeyValue(evas, glist, "Album :", infolabel);
                it->Append(glist, header);
        }
        if (item_infos["title"] != "")
        {
                infolabel = item_infos["title"];
                GenlistItemSimpleKeyValue *it = new GenlistItemSimpleKeyValue(evas, glist, "Titre :", infolabel);
                it->Append(glist, header);
        }
        if (item_infos["duration"] != "")
        {
                double dur;
                from_string(item_infos["duration"], dur);
                infolabel = Utils::time2string_digit((long)dur);
                GenlistItemSimpleKeyValue *it = new GenlistItemSimpleKeyValue(evas, glist, "Durée :", infolabel);
                it->Append(glist, header);
        }
        if (item_infos["genre"] != "")
        {
                infolabel = item_infos["genre"];
                GenlistItemSimpleKeyValue *it = new GenlistItemSimpleKeyValue(evas, glist, "Genre :", infolabel);
                it->Append(glist, header);
        }
        if (item_infos["type"] != "")
        {
                infolabel = item_infos["type"];
                GenlistItemSimpleKeyValue *it = new GenlistItemSimpleKeyValue(evas, glist, "Type de flux :", infolabel);
                it->Append(glist, header);
        }
        if (item_infos["bitrate"] != "")
        {
                infolabel = item_infos["bitrate"];
                GenlistItemSimpleKeyValue *it = new GenlistItemSimpleKeyValue(evas, glist, "Débit :", infolabel);
                it->Append(glist, header);
        }
        if (item_infos["filesize"] != "")
        {
                long int s;
                from_string(item_infos["filesize"], s);
                s /= 1024;
                s /= 1024;
                infolabel = Utils::to_string(s) + " Mo";
                GenlistItemSimpleKeyValue *it = new GenlistItemSimpleKeyValue(evas, glist, "Taille :", infolabel);
                it->Append(glist, header);
        }
        if (item_infos["samplerate"] != "")
        {
                infolabel = item_infos["samplerate"] + " Hz";
                GenlistItemSimpleKeyValue *it = new GenlistItemSimpleKeyValue(evas, glist, "Echantillonage :", infolabel);
                it->Append(glist, header);
        }
        if (item_infos["tagversion"] != "")
        {
                infolabel = item_infos["tagversion"];
                GenlistItemSimpleKeyValue *it = new GenlistItemSimpleKeyValue(evas, glist, "Version du tag :", infolabel);
                it->Append(glist, header);
        }
        if (item_infos["comment"] != "")
        {
                infolabel = item_infos["comment"];
                GenlistItemSimpleKeyValue *it = new GenlistItemSimpleKeyValue(evas, glist, "Commentaire :", infolabel);
                it->Append(glist, header);
        }

        elm_table_pack(table, glist, 1, 1, 1, 1);

        Evas_Object *popup_position = elm_ctxpopup_add(parent);
        elm_object_style_set(popup_position, "calaos");
        evas_object_size_hint_min_set(popup_position, 300, 240);

        elm_object_content_set(popup_position, table);

        Evas_Coord x,y;
        evas_pointer_canvas_xy_get(evas, &x, &y);
        evas_object_move(popup_position, x, y);
        evas_object_show(popup_position);
}