#include <libintl.h>
#include <vconf.h>
#include <efl_util.h>
+#include <system_info.h>
#include <unistd.h>
elm_win_override_set(m_win, EINA_TRUE);
elm_win_alpha_set(m_win, EINA_TRUE);
-#ifdef MOBILE_UI
-
- // popup
- m_popup = elm_popup_add(m_win);
- if (!m_popup) {
- ALOGE("EFL : Failed to add popup");
- throw Exception("Elementary failed");
- }
- elm_popup_align_set(m_popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
- elm_object_part_text_set(m_popup, "title,text", popupTitle);
- evas_object_size_hint_weight_set(m_popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-
- // layout
- m_layout = elm_layout_add(m_popup);
- elm_layout_file_set(m_layout, RES_DIR"/popup_custom.edj", "popup_checkview_layout_mobile");
- evas_object_size_hint_weight_set(m_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-
- // content
- m_content = elm_label_add(m_layout);
- if (!m_content) {
- ALOGE("EFL : Failed to add content");
- throw Exception("Enlightement failed");
- }
- elm_object_style_set(m_content, "popup/default");
- elm_label_line_wrap_set(m_content, ELM_WRAP_MIXED);
- evas_object_size_hint_weight_set(m_content, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(m_content, EVAS_HINT_FILL, EVAS_HINT_FILL);
- elm_object_part_content_set(m_layout, "elm.swallow.content", m_content);
-
- // checkbox
- m_checkbox = elm_check_add(m_layout);
- if (!m_checkbox) {
- ALOGE("EFL : Failed to add checkbox");
- throw Exception("Enlightement failed");
+ char *profileName = nullptr;
+ system_info_get_platform_string("http://tizen.org/feature/profile", &profileName);
+ if (!profileName) {
+ ALOGE("profileName is NULL");
+ throw Exception("get profileName failed");
}
- elm_object_part_content_set(m_layout, "elm.swallow.end", m_checkbox);
- elm_object_text_set(m_checkbox, checkBoxText);
- elm_check_state_set(m_checkbox, EINA_FALSE);
- evas_object_show(m_checkbox);
-
- // buttons
- m_denyButton = elm_button_add(m_popup);
- if (!m_denyButton) {
- ALOGE("EFL : Failed to add deny button");
- throw Exception("Enlightement failed");
- }
- elm_object_part_content_set(m_popup, "button1", m_denyButton);
- elm_object_text_set(m_denyButton, dgettext(PROJECT_NAME,
- "IDS_IDLE_BUTTON_DENY"));
-
- m_allowButton = elm_button_add(m_popup);
- if (!m_allowButton) {
- ALOGE("EFL : Failed to add allow button");
- throw Exception("Enlightement failed");
+ std::unique_ptr<char, decltype(free)*> profileNamePtr(profileName, free);
+ if (*profileName != 'w' && *profileName != 'W') {
+ // popup
+ m_popup = elm_popup_add(m_win);
+ if (!m_popup) {
+ ALOGE("EFL : Failed to add popup");
+ throw Exception("Elementary failed");
+ }
+ elm_popup_align_set(m_popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
+ elm_object_part_text_set(m_popup, "title,text", popupTitle);
+ evas_object_size_hint_weight_set(m_popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+ // layout
+ m_layout = elm_layout_add(m_popup);
+ elm_layout_file_set(m_layout, RES_DIR"/popup_custom.edj", "popup_checkview_layout_mobile");
+ evas_object_size_hint_weight_set(m_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+ // content
+ m_content = elm_label_add(m_layout);
+ if (!m_content) {
+ ALOGE("EFL : Failed to add content");
+ throw Exception("Enlightement failed");
+ }
+ elm_object_style_set(m_content, "popup/default");
+ elm_label_line_wrap_set(m_content, ELM_WRAP_MIXED);
+ evas_object_size_hint_weight_set(m_content, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(m_content, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_object_part_content_set(m_layout, "elm.swallow.content", m_content);
+
+ // checkbox
+ m_checkbox = elm_check_add(m_layout);
+ if (!m_checkbox) {
+ ALOGE("EFL : Failed to add checkbox");
+ throw Exception("Enlightement failed");
+ }
+ elm_object_part_content_set(m_layout, "elm.swallow.end", m_checkbox);
+ elm_object_text_set(m_checkbox, checkBoxText);
+ elm_check_state_set(m_checkbox, EINA_FALSE);
+ evas_object_show(m_checkbox);
+
+ // buttons
+ m_denyButton = elm_button_add(m_popup);
+ if (!m_denyButton) {
+ ALOGE("EFL : Failed to add deny button");
+ throw Exception("Enlightement failed");
+ }
+ elm_object_part_content_set(m_popup, "button1", m_denyButton);
+ elm_object_text_set(m_denyButton, dgettext(PROJECT_NAME,
+ "IDS_IDLE_BUTTON_DENY"));
+
+ m_allowButton = elm_button_add(m_popup);
+ if (!m_allowButton) {
+ ALOGE("EFL : Failed to add allow button");
+ throw Exception("Enlightement failed");
+ }
+ elm_object_part_content_set(m_popup, "button2", m_allowButton);
+ elm_object_text_set(m_allowButton, dgettext(PROJECT_NAME,
+ "IDS_IDLE_BUTTON_ALLOW_ABB7"));
+ elm_object_content_set(m_popup, m_layout);
+ evas_object_show(m_popup);
+
+ } else {
+ Evas_Object *icon;
+
+ m_popup = elm_popup_add(m_win);
+ elm_object_style_set(m_popup, "circle");
+
+ m_layout = elm_layout_add(m_popup);
+ elm_layout_theme_set(m_layout, "layout", "popup", "content/circle/buttons2");
+ elm_object_part_text_set(m_layout, "elm.text.title", popupTitle);
+ elm_object_content_set(m_popup, m_layout);
+
+ m_layoutInner = elm_layout_add(m_layout);
+ elm_layout_file_set(m_layoutInner, RES_DIR"/popup_custom.edj", "popup_checkview_internal");
+ evas_object_size_hint_weight_set(m_layoutInner, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_object_part_content_set(m_layout, "elm.swallow.content", m_layoutInner);
+
+ m_content = elm_label_add(m_layoutInner);
+ elm_object_style_set(m_content, "popup/default");
+ elm_label_line_wrap_set(m_content, ELM_WRAP_MIXED);
+ evas_object_size_hint_weight_set(m_content, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(m_content, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_object_part_content_set(m_layoutInner, "label", m_content);
+
+
+ m_checkbox = elm_check_add(m_popup);
+ elm_object_style_set(m_checkbox, "popup");
+ elm_object_text_set(m_checkbox, checkBoxText);
+ elm_check_state_set(m_checkbox, EINA_FALSE);
+ evas_object_size_hint_align_set(m_checkbox, EVAS_HINT_FILL, 0.0);
+ elm_object_part_content_set(m_layoutInner, "elm.swallow.end", m_checkbox);
+ evas_object_show(m_checkbox);
+
+ m_allowButton = elm_button_add(m_popup);
+ elm_object_style_set(m_allowButton, "popup/circle/right");
+ elm_object_part_content_set(m_popup, "button2", m_allowButton);
+
+ icon = elm_image_add(m_allowButton);
+ elm_image_file_set(icon, RES_DIR"/tw_ic_popup_btn_check.png", NULL);
+ evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_object_part_content_set(m_allowButton, "elm.swallow.content", icon);
+ evas_object_show(icon);
+
+ m_denyButton = elm_button_add(m_popup);
+ elm_object_style_set(m_denyButton, "popup/circle/left");
+ elm_object_part_content_set(m_popup, "button1", m_denyButton);
+
+ icon = elm_image_add(m_denyButton);
+ elm_image_file_set(icon, RES_DIR"/tw_ic_popup_btn_delete.png", NULL);
+ elm_object_part_content_set(m_denyButton, "elm.swallow.content", icon);
+ evas_object_show(icon);
+
+ evas_object_show(m_popup);
}
- elm_object_part_content_set(m_popup, "button2", m_allowButton);
- elm_object_text_set(m_allowButton, dgettext(PROJECT_NAME,
- "IDS_IDLE_BUTTON_ALLOW_ABB7"));
- elm_object_content_set(m_popup, m_layout);
- evas_object_show(m_popup);
-
-#elif defined(CIRCLE_UI)
- Evas_Object *icon;
-
- m_popup = elm_popup_add(m_win);
- elm_object_style_set(m_popup, "circle");
-
- m_layout = elm_layout_add(m_popup);
- elm_layout_theme_set(m_layout, "layout", "popup", "content/circle/buttons2");
- elm_object_part_text_set(m_layout, "elm.text.title", popupTitle);
- elm_object_content_set(m_popup, m_layout);
-
- m_layoutInner = elm_layout_add(m_layout);
- elm_layout_file_set(m_layoutInner, RES_DIR"/popup_custom.edj", "popup_checkview_internal");
- evas_object_size_hint_weight_set(m_layoutInner, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- elm_object_part_content_set(m_layout, "elm.swallow.content", m_layoutInner);
-
- m_content = elm_label_add(m_layoutInner);
- elm_object_style_set(m_content, "popup/default");
- elm_label_line_wrap_set(m_content, ELM_WRAP_MIXED);
- evas_object_size_hint_weight_set(m_content, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(m_content, EVAS_HINT_FILL, EVAS_HINT_FILL);
- elm_object_part_content_set(m_layoutInner, "label", m_content);
-
-
- m_checkbox = elm_check_add(m_popup);
- elm_object_style_set(m_checkbox, "popup");
- elm_object_text_set(m_checkbox, checkBoxText);
- elm_check_state_set(m_checkbox, EINA_FALSE);
- evas_object_size_hint_align_set(m_checkbox, EVAS_HINT_FILL, 0.0);
- elm_object_part_content_set(m_layoutInner, "elm.swallow.end", m_checkbox);
- evas_object_show(m_checkbox);
-
- m_allowButton = elm_button_add(m_popup);
- elm_object_style_set(m_allowButton, "popup/circle/right");
- elm_object_part_content_set(m_popup, "button2", m_allowButton);
-
- icon = elm_image_add(m_allowButton);
- elm_image_file_set(icon, RES_DIR"/tw_ic_popup_btn_check.png", NULL);
- evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- elm_object_part_content_set(m_allowButton, "elm.swallow.content", icon);
- evas_object_show(icon);
-
- m_denyButton = elm_button_add(m_popup);
- elm_object_style_set(m_denyButton, "popup/circle/left");
- elm_object_part_content_set(m_popup, "button1", m_denyButton);
-
- icon = elm_image_add(m_denyButton);
- elm_image_file_set(icon, RES_DIR"/tw_ic_popup_btn_delete.png", NULL);
- elm_object_part_content_set(m_denyButton, "elm.swallow.content", icon);
- evas_object_show(icon);
-
- evas_object_show(m_popup);
-#endif
// callbacks
elm_win_indicator_opacity_set(m_win, ELM_WIN_INDICATOR_OPAQUE);
elm_win_indicator_mode_set(m_win, ELM_WIN_INDICATOR_SHOW);