/* Hide wireless network list */
elm_object_signal_emit(priv->ly, SIG_WIRELESS_EXISTS, SRC_ELM);
-/* listmgr_hide_grid(priv->listmgr, LIST_WIRELESS,
- PART_WIRELESS_LIST);*/
viewmgr_update_view(VIEW_WIRELESS_LIST, GRID_HIDE, NULL);
elm_object_signal_emit(priv->ly, SIG_LOADING_STOP, SRC_ELM);
SETTING_TRACE("New network");
elm_object_text_set(priv->action_btn, STR_RETRY);
- /* Hide wireless network list */
+ /* Hide wireless network list */
elm_object_signal_emit(priv->ly, SIG_WIRELESS_EXISTS, SRC_ELM);
- /*listmgr_hide_grid(priv->listmgr, LIST_WIRELESS,
- PART_WIRELESS_LIST);*/
viewmgr_update_view(VIEW_WIRELESS_LIST, GRID_UPDATE, NULL);
elm_object_signal_emit(priv->ly, SIG_LOADING_STOP, SRC_ELM);
elm_object_part_text_set(priv->ly, PART_NO_NETWORK_TEXT, "");
- /* Show wired network status */
+ /* Show wired network status */
elm_object_part_content_set(priv->ly, "part.wired.area",
priv->wired_layout);
evas_object_show(priv->wired_layout);
/* Set network type as wired */
elm_object_text_set(priv->network_type_btn, STR_WIRED);
-// viewmgr_pop_all_views();
+ viewmgr_remove_view(VIEW_NEW_NETWORK);
+
if (!viewmgr_add_view(view_new_network_get_vclass(), priv->wired)) {
_ERR("Add new network view failed.");
return;
#include <app.h>
#include <Elementary.h>
+#include <glib.h>
#include "common/viewmgr.h"
#include "common/layoutmgr.h"
};
static bool _update_entry_input_state(struct _priv *priv);
+static void _set_default_config_values(struct _priv *priv);
static inline bool _check_entry_filled(Evas_Object *entry)
{
static void _ip_type_option_selected(struct _priv *priv, int id,
Evas_Object *obj)
{
+ SETTING_TRACE_BEGIN;
switch (id) {
case TYPE_AUTOMATICALLY:
SETTING_TRACE("Automatic IP");
elm_object_text_set(priv->ip_type_btn, str_config_type_opt[0]);
- _update_entry_input_state(priv);
priv->ip_menu = 0;
+ _set_default_config_values(priv);
+ _update_entry_input_state(priv);
elm_object_disabled_set(priv->content_manual->address_ip, EINA_TRUE);
elm_object_disabled_set(priv->content_manual->address_subnet, EINA_TRUE);
elm_object_disabled_set(priv->content_manual->address_gateway, EINA_TRUE);
case TYPE_MANUALLY:
SETTING_TRACE("Manual IP");
elm_object_text_set(priv->ip_type_btn, str_config_type_opt[1]);
- _update_entry_input_state(priv);
priv->ip_menu = 1;
+ _update_entry_input_state(priv);
elm_object_disabled_set(priv->content_manual->address_ip, EINA_FALSE);
elm_object_disabled_set(priv->content_manual->address_subnet, EINA_FALSE);
elm_object_disabled_set(priv->content_manual->address_gateway, EINA_FALSE);
elm_object_text_set(priv->dns_type_btn, str_config_type_opt[0]);
priv->dns_menu = 0;
elm_object_disabled_set(priv->content_manual->address_dns, EINA_TRUE);
+ _set_default_config_values(priv);
_update_entry_input_state(priv);
break;
.clicked = _dns_type_clicked_cb,
};
+static void _set_default_config_values(struct _priv *priv)
+{
+ SETTING_TRACE_BEGIN;
+ char *address = "000.000.000.000";
+ char **ip_text = NULL;
+
+ struct _content_manual *content = priv->content_manual;
+
+ if (get_ethernet_profile(priv->conn))
+ _DBG("Profile not found ");
+
+ if(priv->ip_menu == 0)
+ {
+ /* IP address entry */
+ get_address(priv->conn, IP_ADDRESS, &address);
+ ip_text = g_strsplit(address, ".", 5);
+ elm_entry_entry_set(content->ip1, ip_text[0]);
+ elm_entry_entry_set(content->ip2, ip_text[1]);
+ elm_entry_entry_set(content->ip3, ip_text[2]);
+ elm_entry_entry_set(content->ip4, ip_text[3]);
+
+ /* Subnet mask entry */
+ get_address(priv->conn, SUBNET_MASK, &address);
+ ip_text = g_strsplit(address, ".", 5);
+ elm_entry_entry_set(content->sub_ip1, ip_text[0]);
+ elm_entry_entry_set(content->sub_ip2, ip_text[1]);
+ elm_entry_entry_set(content->sub_ip3, ip_text[2]);
+ elm_entry_entry_set(content->sub_ip4, ip_text[3]);
+
+ /* Gateway address entry */
+ get_address(priv->conn, GATEWAY_ADDRESS, &address);
+ ip_text = g_strsplit(address, ".", 5);
+ elm_entry_entry_set(content->gateway_ip1, ip_text[0]);
+ elm_entry_entry_set(content->gateway_ip2, ip_text[1]);
+ elm_entry_entry_set(content->gateway_ip3, ip_text[2]);
+ elm_entry_entry_set(content->gateway_ip4, ip_text[3]);
+ }
+
+ if(priv->dns_menu == 0)
+ {
+ /* DNS address entry */
+ get_address(priv->conn, DNS_ADDRESS, &address);
+ ip_text = g_strsplit(address, ".", 5);
+ elm_entry_entry_set(content->dns_ip1, ip_text[0]);
+ elm_entry_entry_set(content->dns_ip2, ip_text[1]);
+ elm_entry_entry_set(content->dns_ip3, ip_text[2]);
+ elm_entry_entry_set(content->dns_ip4, ip_text[3]);
+ }
+ if(strcmp(address, "000.000.000.000"))
+ free(address);
+}
+
static bool _draw_config_buttons(struct _priv *priv)
{
Evas_Object *ip_btn, *dns_btn;
priv->content_manual = content;
+ _set_default_config_values(priv);//Set automatic configuration values
+
elm_object_disabled_set(priv->content_manual->address_ip, EINA_TRUE);
elm_object_disabled_set(priv->content_manual->address_subnet, EINA_TRUE);
elm_object_disabled_set(priv->content_manual->address_gateway, EINA_TRUE);
priv->conn = data;
priv->input_panel_show = false;
+ priv->ip_menu = 0;
+ priv->dns_menu = 0;
+
_create_content_manual(priv);
elm_object_part_content_set(base, "part.content.area",
priv->content_manual->layout);
- priv->ip_menu = 0;
- priv->dns_menu = 0;
if (!viewmgr_set_view_data(VIEW_NEW_NETWORK, priv)) {
_ERR("Set view data failed.");