Apply changed UsbConnection API
[profile/tv/apps/native/filebrowser.git] / src / views / BaseView / FbBaseView.cpp
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 */
 }