Apply changed UsbConnection API 84/37784/1
authorJuWan Kim <juwan.kim@samsung.com>
Mon, 6 Apr 2015 05:40:16 +0000 (14:40 +0900)
committerJuWan Kim <juwan.kim@samsung.com>
Mon, 6 Apr 2015 05:40:16 +0000 (14:40 +0900)
Change-Id: Id0155ed09fbc9dc9fb77e34e890399d2eaeb9203
Signed-off-by: JuWan Kim <juwan.kim@samsung.com>
include/FbBaseView.h
src/views/BaseView/FbBaseView.cpp

index 77623fb..56b70eb 100644 (file)
@@ -40,7 +40,7 @@ public:
 
 public:
 
-       virtual void OnConnect(void);
+       virtual void OnStatusChanged(SUsbHostDeviceStatus status);
        virtual void OnUpdated(const SEntity *entity);
 };
 
index bf87f87..3a98993 100644 (file)
@@ -685,24 +685,27 @@ Evas_Object* CFbBaseView::Base(void)
 }
 
 
-void CFbBaseView::OnConnect(void)
+void CFbBaseView::OnStatusChanged(SUsbHostDeviceStatus status)
 {
-       m->pPopup = new CPopup;
-       if (!m->pPopup)
-               return;
-       if (!m->pPopup->Create(m->eoBase)) {
-               delete m->pPopup;
-               m->pPopup = NULL;
-               return;
-       }
+       if(status == USB_HOST_DEV_CONNECTED) {
+               m->pPopup = new CPopup;
+               if (!m->pPopup)
+                       return;
+               if (!m->pPopup->Create(m->eoBase)) {
+                       delete m->pPopup;
+                       m->pPopup = NULL;
+                       return;
+               }
 
-       if (CInfo::SourceType() == E_USB) {
-               if (!FlagConnected()) {
-                       CInfo::SetSourceType(E_ALL);
-                       elm_object_text_set(m->eoBtnSource,
-                               _(CSourceCtxPopup::SourceText(CInfo::SourceType())));
+               if (CInfo::SourceType() == E_USB) {
+                       if (!FlagConnected()) {
+                               CInfo::SetSourceType(E_ALL);
+                               elm_object_text_set(m->eoBtnSource,
+                                               _(CSourceCtxPopup::SourceText(CInfo::SourceType())));
+                       }
                }
        }
+       /* FIXME: should add disconnected flow */
 }