diff options
author | Yunchan Cho <yunchan.cho@samsung.com> | 2013-09-30 17:24:50 +0900 |
---|---|---|
committer | Gerrit Code Review <gerrit@gerrit.vlan144.tizendev.org> | 2013-10-01 07:45:15 +0000 |
commit | 500d729ae8f11d7f33a7ba3eeb602844d84cb5ce (patch) | |
tree | 2f10630ed5db6460326d218b4ac716284d6c0216 | |
parent | 4a2b0c68b28c19a3f707200eb790d061bccf4e55 (diff) | |
download | web-provider-500d729ae8f11d7f33a7ba3eeb602844d84cb5ce.tar.gz web-provider-500d729ae8f11d7f33a7ba3eeb602844d84cb5ce.tar.bz2 web-provider-500d729ae8f11d7f33a7ba3eeb602844d84cb5ce.zip |
Closing period popup on pressing h/w back key
[Issue#] N/A
[Problem] period popup is not disappeared even if h/w back key is pressed.
[Cause] web-provider did not handle h/w key including back key.
[Solution] web-provider registers special callback for h/w back key.
So if h/w back key is pressed, web-provider removes resources
associated with the opened popup in that callback.
Change-Id: I9cbc3fec940f838f983ac26d66bb2a127dd194ed
-rwxr-xr-x | packaging/livebox.web-provider.spec | 1 | ||||
-rwxr-xr-x | src/Core/Service/CMakeLists.txt | 1 | ||||
-rwxr-xr-x | src/Core/Service/PeriodChanger.cpp | 18 | ||||
-rwxr-xr-x | src/Core/Service/PeriodChanger.h | 1 |
4 files changed, 21 insertions, 0 deletions
diff --git a/packaging/livebox.web-provider.spec b/packaging/livebox.web-provider.spec index 273fb93..fd551a5 100755 --- a/packaging/livebox.web-provider.spec +++ b/packaging/livebox.web-provider.spec @@ -19,6 +19,7 @@ BuildRequires: pkgconfig(ecore-x) BuildRequires: pkgconfig(evas) BuildRequires: pkgconfig(ecore-evas) BuildRequires: pkgconfig(elementary) +BuildRequires: pkgconfig(efl-assist) BuildRequires: pkgconfig(ewebkit2) BuildRequires: pkgconfig(wrt-core) BuildRequires: pkgconfig(xmlsec1) diff --git a/src/Core/Service/CMakeLists.txt b/src/Core/Service/CMakeLists.txt index abc3c72..ad8fa36 100755 --- a/src/Core/Service/CMakeLists.txt +++ b/src/Core/Service/CMakeLists.txt @@ -25,6 +25,7 @@ PKG_CHECK_MODULES(${DEPS} eina ecore-x elementary + efl-assist provider ecore REQUIRED diff --git a/src/Core/Service/PeriodChanger.cpp b/src/Core/Service/PeriodChanger.cpp index b104aa0..54f689c 100755 --- a/src/Core/Service/PeriodChanger.cpp +++ b/src/Core/Service/PeriodChanger.cpp @@ -23,6 +23,7 @@ #include <Ecore_X.h> #include <Ecore.h> #include <Elementary.h> +#include <efl_assist.h> #include <livebox-service.h> #include <Core/Util/Log.h> #include <Core/Util/Util.h> @@ -138,6 +139,11 @@ void PeriodChanger::showPeriodPopup() elm_object_part_content_set(popup, "button1", cancelButton); evas_object_show(cancelButton); evas_object_smart_callback_add(cancelButton, "clicked", cancelButtonCallback, this); + + // register back key callback + ea_object_event_callback_add( + popup, EA_CALLBACK_BACK, + pressHardwareBackKeyCallback, this); } void PeriodChanger::destroyPeriodPopup(Evas_Object *obj) @@ -153,6 +159,9 @@ void PeriodChanger::destroyPeriodPopup(Evas_Object *obj) } parent = elm_object_parent_widget_get(parent); } + + // register back key callback + ea_object_event_callback_del(popup, EA_CALLBACK_BACK, pressHardwareBackKeyCallback); evas_object_del(popup); destroyWindow(); } @@ -259,6 +268,15 @@ void PeriodChanger::cancelButtonCallback(void *data, Evas_Object *obj, void *eve This->destroyPeriodPopup(obj); } +void PeriodChanger::pressHardwareBackKeyCallback(void *data, Evas_Object *obj, void *event_info) +{ + LogD("enter"); + UNUSED_PARAM(event_info); + + PeriodChanger* This = static_cast<PeriodChanger*>(data); + This->destroyPeriodPopup(obj); +} + Eina_Bool PeriodChanger::popupDestroyIdlerCallback(void *data) { LogD("enter"); diff --git a/src/Core/Service/PeriodChanger.h b/src/Core/Service/PeriodChanger.h index 62feb87..6d76ebd 100755 --- a/src/Core/Service/PeriodChanger.h +++ b/src/Core/Service/PeriodChanger.h @@ -51,6 +51,7 @@ class PeriodChanger { static void selectPeriodCallback(void *data, Evas_Object *obj, void *event_info); static void cancelButtonCallback(void *data, Evas_Object *obj, void *event_info); + static void pressHardwareBackKeyCallback(void *data, Evas_Object *obj, void *event_info); static Eina_Bool popupDestroyIdlerCallback(void *data); PeriodChanger( |