Set window level for the case several popups are launched at the same time 32/102732/1 accepted/tizen/3.0/common/20161207.194805 accepted/tizen/3.0/ivi/20161207.013314 accepted/tizen/3.0/mobile/20161207.013215 accepted/tizen/3.0/tv/20161207.013233 accepted/tizen/3.0/wearable/20161207.013254 accepted/tizen/common/20161206.131811 accepted/tizen/ivi/20161207.030345 accepted/tizen/mobile/20161207.030251 accepted/tizen/tv/20161207.030309 accepted/tizen/wearable/20161207.030326 submit/tizen/20161206.113322 submit/tizen_3.0/20161206.113810
authorYunjin Lee <yunjin-.lee@samsung.com>
Tue, 6 Dec 2016 10:38:29 +0000 (19:38 +0900)
committerYunjin Lee <yunjin-.lee@samsung.com>
Tue, 6 Dec 2016 10:38:29 +0000 (19:38 +0900)
Change-Id: I4961c149e84ba369e3983326aeadd631d171ac4d
Signed-off-by: Yunjin Lee <yunjin-.lee@samsung.com>
packaging/askuser.spec
src/agent/notification-daemon/CMakeLists.txt
src/agent/notification-daemon/GuiRunner.cpp
src/agent/notification-daemon/GuiRunner.h

index 8997078..9d41fd1 100644 (file)
@@ -27,6 +27,7 @@ BuildRequires: pkgconfig(security-privilege-manager)
 BuildRequires: pkgconfig(glib-2.0)
 BuildRequires: pkgconfig(pkgmgr-info)
 BuildRequires: pkgconfig(vconf)
+BuildRequires: pkgconfig(capi-ui-efl-util)
 BuildRequires: coregl
 BuildRequires: edje-bin
 
index 866d672..574eaf3 100644 (file)
@@ -9,6 +9,7 @@ PKG_CHECK_MODULES(ASKUSER_NOTIFICATION_DEP
     security-privilege-manager
     pkgmgr-info
     vconf
+    capi-ui-efl-util
 )
 
 INCLUDE_DIRECTORIES(SYSTEM
@@ -42,9 +43,9 @@ TARGET_LINK_LIBRARIES(${TARGET_ASKUSER_NOTIFICATION}
 )
 
 ADD_CUSTOM_TARGET(popup_custom.edj
-       COMMAND edje_cc -no-save res/popup_custom.edc res/popup_custom.edj
-       DEPENDS res/popup_custom.edc
-       )
+    COMMAND edje_cc -no-save res/popup_custom.edc res/popup_custom.edj
+    DEPENDS res/popup_custom.edc
+    )
 ADD_DEPENDENCIES(${PROJECT_NAME} popup_custom.edj)
 
 INSTALL(TARGETS ${TARGET_ASKUSER_NOTIFICATION} DESTINATION ${BIN_INSTALL_DIR})
index a078cb1..e7addd5 100644 (file)
@@ -27,6 +27,7 @@
 #include <translator/Translator.h>
 #include <libintl.h>
 #include <vconf.h>
+#include <efl_util.h>
 #include "Policy.h"
 
 namespace AskUser {
@@ -38,16 +39,17 @@ void GuiRunner::unfocused(void *data, Evas_Object *, void *)
     GuiRunner *runner = static_cast<GuiRunner*>(data);
 
     if (runner->m_shouldRaise)
-        elm_win_raise(runner->m_win);
+        evas_object_show(runner->m_win);//elm_win_raise(runner->m_win);
     else
         elm_exit();
+
 }
 
 void GuiRunner::winClose()
 {
     ALOGD("Window close");
     m_shouldRaise = false;
-    elm_win_lower(m_win);
+    evas_object_hide(m_win);
 }
 
 // responseMap[allow][always]
@@ -141,11 +143,13 @@ void GuiRunner::initialize()
     elm_init(0, NULL);
 
     //placeholder
-    m_win = elm_win_add(NULL, popupTitle, ELM_WIN_DOCK);
+    m_win = elm_win_add(NULL, popupTitle, ELM_WIN_NOTIFICATION);
     if (!m_win) {
         ALOGE("EFL : Failed to add window");
         throw Exception("Elementary failed");
     }
+    efl_util_set_notification_window_level(m_win, EFL_UTIL_NOTIFICATION_LEVEL_2);
+
     elm_win_autodel_set(m_win, EINA_TRUE);
     elm_win_override_set(m_win, EINA_TRUE);
     elm_win_alpha_set(m_win, EINA_TRUE);
@@ -288,30 +292,14 @@ void GuiRunner::setLocale()
         ALOGE("textdomain failed");
 }
 
-void GuiRunner::refresh()
-{
-    char *popupTitle = dgettext(PROJECT_NAME, "IDS_IDLE_HEADER_PRIVACY_REQUEST");
-    char *checkBoxText = dgettext(PROJECT_NAME, "IDS_ST_OPT_DONT_SHOW_AGAIN");
-#ifdef MOBILE_UI
-    elm_object_part_text_set(m_popup, "title,text", popupTitle);
-    elm_object_text_set(m_denyButton, dgettext(PROJECT_NAME, "IDS_IDLE_BUTTON_DENY"));
-    elm_object_text_set(m_allowButton, dgettext(PROJECT_NAME, "IDS_IDLE_BUTTON_ALLOW_ABB7"));
-#elif defined(CIRCLE_UI)
-    elm_object_part_text_set(m_layout, "elm.text.title", popupTitle);
-#endif
-    elm_object_text_set(m_checkbox, checkBoxText);
-    elm_check_state_set(m_checkbox, EINA_FALSE);
-}
-
 NResponseType GuiRunner::popupRun(const std::string &app, const std::string &perm)
 {
     try {
         setLocale();
-        if (!m_initialized) {
-            initialize();
-        }
-        refresh();
+        initialize();
+
         m_running = true;
+
         std::string appId;
         std::string pkgLabel;
         identifyApp(app, appId, pkgLabel);
@@ -335,8 +323,6 @@ NResponseType GuiRunner::popupRun(const std::string &app, const std::string &per
         evas_object_show(m_popup);
         evas_object_show(m_win);
 
-        elm_win_raise(m_win);
-
         ALOGD("Showing popup");
         elm_run();
         ALOGD("Popup closed");
index d84fd8e..50bbe79 100644 (file)
@@ -41,7 +41,6 @@ public:
     GuiRunner() = default;
     void initialize();
     void setLocale();
-    void refresh();
     void addDismissFd(int fd, DissmissCb cb, void *data);
     void delDismissFd(int fd);
     ~GuiRunner();