2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.tizenopensource.org/license
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
20 #include "wifi-syspopup.h"
21 #include "view-alerts.h"
22 #include "i18nmanager.h"
24 extern wifi_object* app_state;
26 static void _timeout_cb(void *data, Evas_Object *obj, void *event_info)
32 int view_alerts_powering_on_show(void)
34 __COMMON_FUNC_ENTER__;
35 if(WIFI_SYSPOPUP_SUPPORT_QUICKPANEL == app_state->wifi_syspopup_support){
39 if(NULL != app_state->alertpopup) {
40 evas_object_del(app_state->alertpopup);
41 app_state->alertpopup = NULL;
44 Evas_Object *conformant = NULL;
45 conformant = elm_conformant_add(app_state->win_main);
46 elm_win_conformant_set(app_state->win_main, EINA_TRUE);
47 elm_win_resize_object_add(app_state->win_main, conformant);
48 evas_object_size_hint_weight_set(conformant, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
49 evas_object_size_hint_align_set(conformant, EVAS_HINT_FILL, EVAS_HINT_FILL);
50 evas_object_show(conformant);
52 Evas_Object *content = elm_layout_add(conformant);
53 elm_object_content_set(conformant, content);
54 app_state->alertpopup = elm_popup_add(content);
56 Evas_Object *box = elm_box_add(app_state->alertpopup);
57 evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
58 evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
59 evas_object_show(box);
61 Evas_Object *progressbar = elm_progressbar_add(box);
62 elm_object_style_set(progressbar, "list_process");
63 evas_object_size_hint_weight_set(progressbar, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
64 evas_object_size_hint_align_set(progressbar, EVAS_HINT_FILL, EVAS_HINT_FILL);
65 elm_progressbar_pulse(progressbar, EINA_TRUE);
66 evas_object_show(progressbar);
67 elm_box_pack_end(box, progressbar);
69 Evas_Object *label = elm_label_add(box);
70 elm_object_style_set(label, "popup/default");
71 evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
72 evas_object_size_hint_align_set(label, EVAS_HINT_FILL, EVAS_HINT_FILL);
73 elm_object_text_set(label, sc(PACKAGE, I18N_TYPE_Activating));
74 evas_object_show(label);
75 elm_box_pack_end(box, label);
77 elm_object_content_set(app_state->alertpopup, box);
78 evas_object_size_hint_weight_set(app_state->alertpopup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
79 evas_object_show(app_state->alertpopup);
86 int view_alerts_connection_fail_show(void)
88 __COMMON_FUNC_ENTER__;
90 if (WIFI_SYSPOPUP_SUPPORT_QUICKPANEL == app_state->wifi_syspopup_support) {
96 if (NULL != app_state->alertpopup) {
97 evas_object_del(app_state->alertpopup);
98 app_state->alertpopup = NULL;
101 app_state->alertpopup = elm_popup_add(app_state->win_main);
102 elm_object_text_set(app_state->alertpopup, "Connection attempt failed.<br>Try again.");
103 elm_popup_timeout_set(app_state->alertpopup, 2.0f);
104 evas_object_smart_callback_add(app_state->alertpopup, "timeout", _timeout_cb, NULL);
105 evas_object_size_hint_weight_set(app_state->alertpopup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
106 evas_object_show(app_state->alertpopup);
108 __COMMON_FUNC_EXIT__;
113 int view_alerts_connection_fail_timeout_show(void)
115 __COMMON_FUNC_ENTER__;
117 if (WIFI_SYSPOPUP_SUPPORT_QUICKPANEL == app_state->wifi_syspopup_support) {
118 __COMMON_FUNC_EXIT__;
123 if (NULL != app_state->alertpopup) {
124 evas_object_del(app_state->alertpopup);
125 app_state->alertpopup = NULL;
128 app_state->alertpopup = elm_popup_add(app_state->win_main);
129 elm_object_text_set(app_state->alertpopup, "No response from AP");
130 elm_popup_timeout_set(app_state->alertpopup, 2.0f);
131 evas_object_smart_callback_add(app_state->alertpopup, "timeout", _timeout_cb, NULL);
133 evas_object_size_hint_weight_set(app_state->alertpopup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
134 evas_object_show(app_state->alertpopup);
136 __COMMON_FUNC_EXIT__;
141 int view_alerts_password_length_error_show(void)
143 __COMMON_FUNC_ENTER__;
145 if (WIFI_SYSPOPUP_SUPPORT_QUICKPANEL == app_state->wifi_syspopup_support) {
146 __COMMON_FUNC_EXIT__;
151 if (NULL != app_state->alertpopup) {
152 evas_object_del(app_state->alertpopup);
153 app_state->alertpopup = NULL;
156 app_state->alertpopup = elm_popup_add(app_state->win_main);
157 elm_object_text_set(app_state->alertpopup, "WPA2 requires 8 - 63 letters for a password.<br>Please, check your input.");
158 elm_popup_timeout_set(app_state->alertpopup, 2.0f);
159 evas_object_smart_callback_add(app_state->alertpopup, "timeout", _timeout_cb, NULL);
161 evas_object_size_hint_weight_set(app_state->alertpopup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
162 evas_object_show(app_state->alertpopup);
164 __COMMON_FUNC_EXIT__;