diff options
author | dukan.kim <dukan.kim@samsung.com> | 2013-12-10 19:29:33 +0900 |
---|---|---|
committer | dukan.kim <dukan.kim@samsung.com> | 2013-12-10 19:29:33 +0900 |
commit | 8b6ad94f14c997259bbce6f2cd42dd5f5d002e02 (patch) | |
tree | 24c3304416a68bbb49dd9d10adb05e0f385651cf | |
parent | 3e8ca64497de1a6a2348cc1f34500f82fc756d76 (diff) | |
download | FriendFinder-8b6ad94f14c997259bbce6f2cd42dd5f5d002e02.tar.gz FriendFinder-8b6ad94f14c997259bbce6f2cd42dd5f5d002e02.tar.bz2 FriendFinder-8b6ad94f14c997259bbce6f2cd42dd5f5d002e02.zip |
modified not to launch ImageViewer AppControl twice.tizen
Change-Id: I9fbcf76c62679b6577552d6609479438a0d0a90d
Signed-off-by: dukan.kim <dukan.kim@samsung.com>
-rwxr-xr-x | project/inc/FriendFinder.h | 2 | ||||
-rwxr-xr-x | project/inc/MainForm.h | 2 | ||||
-rwxr-xr-x | project/src/FriendFinder.cpp | 12 | ||||
-rwxr-xr-x | project/src/MainForm.cpp | 18 |
4 files changed, 32 insertions, 2 deletions
diff --git a/project/inc/FriendFinder.h b/project/inc/FriendFinder.h index 5405b10..9c4dce3 100755 --- a/project/inc/FriendFinder.h +++ b/project/inc/FriendFinder.h @@ -36,7 +36,7 @@ public: virtual bool OnAppInitializing(Tizen::App::AppRegistry& appRegistry); virtual bool OnAppTerminating(Tizen::App::AppRegistry& appRegistry, bool forcedTermination = false); - virtual void OnForeground(void) {} + virtual void OnForeground(void); virtual void OnBackground(void); virtual void OnLowMemory(void) {} virtual void OnBatteryLevelChanged(Tizen::System::BatteryLevel batteryLevel) {} diff --git a/project/inc/MainForm.h b/project/inc/MainForm.h index 7c33630..150fd26 100755 --- a/project/inc/MainForm.h +++ b/project/inc/MainForm.h @@ -85,6 +85,7 @@ public: void DisableCancelButton(void); void ShowNoticePopup(const Tizen::Base::String& title, const Tizen::Base::String& description); void CloseNoticePopup(void); + void SetOnForeground(bool isOnForeground); private: static const int ID_BUTTON_ACCEPT_CONNECTION = 101; @@ -111,6 +112,7 @@ private: ConnectionManager __connManager; Tizen::Base::String __friendImagePath; + bool __isOnForeground; }; #endif //_MAIN_FORM_H_ diff --git a/project/src/FriendFinder.cpp b/project/src/FriendFinder.cpp index d8e9258..9269a79 100755 --- a/project/src/FriendFinder.cpp +++ b/project/src/FriendFinder.cpp @@ -94,3 +94,15 @@ FriendFinder::OnBackground(void) } } +void +FriendFinder::OnForeground(void) +{ + SceneManager* pSceneManager = SceneManager::GetInstance(); + MainForm* pMainForm = dynamic_cast<MainForm*> (pSceneManager->GetCurrentScene()->GetForm()); + + if(pSceneManager->GetCurrentSceneId() == "MainScene") + { + pMainForm->SetOnForeground(true); + } +} + diff --git a/project/src/MainForm.cpp b/project/src/MainForm.cpp index 0696f39..ef52113 100755 --- a/project/src/MainForm.cpp +++ b/project/src/MainForm.cpp @@ -52,6 +52,7 @@ MainForm::MainForm(void) , __pFriendListForm(null) , __connManager(this) , __friendImagePath(L"") + , __isOnForeground(true) { } @@ -158,6 +159,10 @@ void MainForm::OnTouchPressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo) { + result r = E_SUCCESS; + + TryReturnVoid(__isOnForeground == true, "ImageViewer is on initializing."); + if (source.Equals(*__pFriendProfileLabel)) { // shows the detailed image of the connected friend by using the Image AppControl. @@ -167,7 +172,11 @@ MainForm::OnTouchPressed(const Tizen::Ui::Control& source, const Tizen::Graphics if (__pImageAppControl != null) { - __pImageAppControl->Start(&uri, null, null, null); + r = __pImageAppControl->Start(&uri, null, null, null); + if (r == E_SUCCESS) + { + __isOnForeground = false; + } delete __pImageAppControl; } } @@ -475,3 +484,10 @@ MainForm::CloseNoticePopup(void) delete __pNoticePopup; __pNoticePopup = null; } + +void +MainForm::SetOnForeground(bool isOnForeground) +{ + __isOnForeground = isOnForeground; +} + |