2014-01-12 20:00:02 -08:00
|
|
|
#include "private.h"
|
|
|
|
|
|
|
|
static void
|
|
|
|
_cb_name_changed(void *data, Evas_Object *obj, void *event EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Config_Network *cfg_net;
|
|
|
|
const char *txt;
|
|
|
|
|
|
|
|
if (!(cfg_net = data)) return;
|
|
|
|
txt = elm_entry_entry_get(obj);
|
|
|
|
eina_stringshare_replace(&cfg_net->name, txt);
|
|
|
|
_config_save();
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_cb_nick_pass_changed(void *data, Evas_Object *obj, void *event EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Config_Network *cfg_net;
|
|
|
|
const char *txt;
|
|
|
|
|
|
|
|
if (!(cfg_net = data)) return;
|
|
|
|
txt = elm_entry_entry_get(obj);
|
|
|
|
eina_stringshare_replace(&cfg_net->nick_passwd, txt);
|
|
|
|
_config_save();
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_cb_srv_pass_changed(void *data, Evas_Object *obj, void *event EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Config_Network *cfg_net;
|
|
|
|
const char *txt;
|
|
|
|
|
|
|
|
if (!(cfg_net = data)) return;
|
|
|
|
txt = elm_entry_entry_get(obj);
|
|
|
|
eina_stringshare_replace(&cfg_net->server_passwd, txt);
|
|
|
|
_config_save();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2014-01-13 04:47:27 -08:00
|
|
|
_options_network(Evas_Object *box, Evas_Object *base EINA_UNUSED, Config_Network *cfg_net)
|
2014-01-12 20:00:02 -08:00
|
|
|
{
|
2014-01-12 21:25:12 -08:00
|
|
|
Evas_Object *vbox, *fr, *tb, *o, *hbox;
|
2014-01-12 20:00:02 -08:00
|
|
|
|
|
|
|
fr = elm_frame_add(box);
|
|
|
|
elm_object_text_set(fr, "Network");
|
|
|
|
evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
|
|
elm_box_pack_end(box, fr);
|
|
|
|
evas_object_show(fr);
|
|
|
|
|
2014-01-12 21:25:12 -08:00
|
|
|
vbox = elm_box_add(box);
|
|
|
|
elm_box_horizontal_set(vbox, EINA_FALSE);
|
|
|
|
elm_box_align_set(vbox, 0.0, 0.0);
|
|
|
|
evas_object_size_hint_weight_set(vbox, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_size_hint_align_set(vbox, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
|
|
elm_object_content_set(fr, vbox);
|
|
|
|
evas_object_show(vbox);
|
|
|
|
|
2014-01-12 20:00:02 -08:00
|
|
|
tb = elm_table_add(box);
|
|
|
|
elm_table_homogeneous_set(tb, EINA_FALSE);
|
|
|
|
elm_table_padding_set(tb, 4, 2);
|
2014-01-13 04:47:27 -08:00
|
|
|
evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, 0.0);
|
2014-01-12 20:00:02 -08:00
|
|
|
evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0);
|
2014-01-12 21:25:12 -08:00
|
|
|
elm_box_pack_end(vbox, tb);
|
2014-01-12 20:00:02 -08:00
|
|
|
evas_object_show(tb);
|
|
|
|
|
|
|
|
o = elm_label_add(box);
|
|
|
|
elm_object_text_set(o, "Name");
|
|
|
|
evas_object_size_hint_weight_set(o, EVAS_HINT_FILL, 0.0);
|
|
|
|
evas_object_size_hint_align_set(o, 0.0, EVAS_HINT_FILL);
|
|
|
|
elm_table_pack(tb, o, 0, 0, 1, 1);
|
|
|
|
evas_object_show(o);
|
|
|
|
|
|
|
|
o = elm_entry_add(box);
|
|
|
|
elm_entry_entry_set(o, cfg_net->name);
|
|
|
|
elm_entry_single_line_set(o, EINA_TRUE);
|
|
|
|
elm_entry_scrollable_set(o, EINA_TRUE);
|
|
|
|
elm_entry_input_panel_layout_set(o, ELM_INPUT_PANEL_LAYOUT_PASSWORD);
|
|
|
|
elm_scroller_policy_set(o, ELM_SCROLLER_POLICY_OFF,
|
|
|
|
ELM_SCROLLER_POLICY_OFF);
|
|
|
|
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
|
|
evas_object_smart_callback_add(o, "changed", _cb_name_changed, cfg_net);
|
2014-01-12 21:25:12 -08:00
|
|
|
elm_table_pack(tb, o, 1, 0, 2, 1);
|
2014-01-12 20:00:02 -08:00
|
|
|
evas_object_show(o);
|
|
|
|
|
|
|
|
o = elm_label_add(box);
|
|
|
|
elm_object_text_set(o, "Nickserv Password");
|
|
|
|
evas_object_size_hint_weight_set(o, EVAS_HINT_FILL, 0.0);
|
|
|
|
evas_object_size_hint_align_set(o, 0.0, EVAS_HINT_FILL);
|
|
|
|
elm_table_pack(tb, o, 0, 1, 1, 1);
|
|
|
|
evas_object_show(o);
|
|
|
|
|
|
|
|
o = elm_entry_add(box);
|
|
|
|
elm_entry_entry_set(o, cfg_net->nick_passwd);
|
|
|
|
elm_entry_single_line_set(o, EINA_TRUE);
|
|
|
|
elm_entry_password_set(o, EINA_TRUE);
|
|
|
|
elm_entry_scrollable_set(o, EINA_TRUE);
|
|
|
|
elm_entry_input_panel_layout_set(o, ELM_INPUT_PANEL_LAYOUT_PASSWORD);
|
|
|
|
elm_scroller_policy_set(o, ELM_SCROLLER_POLICY_OFF,
|
|
|
|
ELM_SCROLLER_POLICY_OFF);
|
|
|
|
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
|
|
evas_object_smart_callback_add(o, "changed",
|
|
|
|
_cb_nick_pass_changed, cfg_net);
|
2014-01-12 21:25:12 -08:00
|
|
|
elm_table_pack(tb, o, 1, 1, 2, 1);
|
2014-01-12 20:00:02 -08:00
|
|
|
evas_object_show(o);
|
|
|
|
|
|
|
|
o = elm_label_add(box);
|
|
|
|
elm_object_text_set(o, "Server Password");
|
|
|
|
evas_object_size_hint_weight_set(o, EVAS_HINT_FILL, 0.0);
|
|
|
|
evas_object_size_hint_align_set(o, 0.0, EVAS_HINT_FILL);
|
|
|
|
elm_table_pack(tb, o, 0, 2, 1, 1);
|
|
|
|
evas_object_show(o);
|
|
|
|
|
|
|
|
o = elm_entry_add(box);
|
|
|
|
elm_entry_entry_set(o, cfg_net->server_passwd);
|
|
|
|
elm_entry_single_line_set(o, EINA_TRUE);
|
|
|
|
elm_entry_password_set(o, EINA_TRUE);
|
|
|
|
elm_entry_scrollable_set(o, EINA_TRUE);
|
|
|
|
elm_entry_input_panel_layout_set(o, ELM_INPUT_PANEL_LAYOUT_PASSWORD);
|
|
|
|
elm_scroller_policy_set(o, ELM_SCROLLER_POLICY_OFF,
|
|
|
|
ELM_SCROLLER_POLICY_OFF);
|
|
|
|
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
|
|
evas_object_smart_callback_add(o, "changed",
|
|
|
|
_cb_srv_pass_changed, cfg_net);
|
2014-01-12 21:25:12 -08:00
|
|
|
elm_table_pack(tb, o, 1, 2, 2, 1);
|
|
|
|
evas_object_show(o);
|
|
|
|
|
|
|
|
o = elm_separator_add(box);
|
|
|
|
elm_separator_horizontal_set(o, EINA_TRUE);
|
|
|
|
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
|
|
|
|
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
|
|
elm_box_pack_end(vbox, o);
|
|
|
|
evas_object_show(o);
|
|
|
|
|
|
|
|
hbox = elm_box_add(box);
|
|
|
|
elm_box_horizontal_set(hbox, EINA_TRUE);
|
|
|
|
elm_box_align_set(hbox, 0.5, 0.0);
|
|
|
|
evas_object_size_hint_weight_set(hbox, EVAS_HINT_EXPAND, 0.0);
|
|
|
|
evas_object_size_hint_align_set(hbox, 0.5, EVAS_HINT_FILL);
|
|
|
|
elm_box_pack_end(vbox, hbox);
|
|
|
|
evas_object_show(hbox);
|
|
|
|
|
|
|
|
o = elm_check_add(box);
|
|
|
|
elm_object_text_set(o, "Autoconnect");
|
|
|
|
elm_check_state_set(o, cfg_net->autoconnect);
|
|
|
|
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
|
|
|
|
evas_object_size_hint_align_set(o, 0.0, EVAS_HINT_FILL);
|
|
|
|
elm_box_pack_end(hbox, o);
|
|
|
|
evas_object_show(o);
|
|
|
|
|
|
|
|
o = elm_check_add(box);
|
|
|
|
elm_object_text_set(o, "Use SSL");
|
|
|
|
elm_check_state_set(o, cfg_net->use_ssl);
|
|
|
|
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
|
|
|
|
evas_object_size_hint_align_set(o, 0.0, EVAS_HINT_FILL);
|
|
|
|
elm_box_pack_end(hbox, o);
|
|
|
|
evas_object_show(o);
|
|
|
|
|
|
|
|
o = elm_check_add(box);
|
|
|
|
elm_object_text_set(o, "Bypass Proxy");
|
|
|
|
elm_check_state_set(o, cfg_net->bypass_proxy);
|
|
|
|
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
|
|
|
|
evas_object_size_hint_align_set(o, 0.0, EVAS_HINT_FILL);
|
|
|
|
elm_box_pack_end(hbox, o);
|
|
|
|
evas_object_show(o);
|
|
|
|
}
|