summaryrefslogtreecommitdiff
path: root/project
diff options
context:
space:
mode:
Diffstat (limited to 'project')
-rwxr-xr-xproject/inc/FriendFinder.h2
-rwxr-xr-xproject/inc/MainForm.h2
-rwxr-xr-xproject/src/FriendFinder.cpp12
-rwxr-xr-xproject/src/MainForm.cpp18
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;
+}
+