* limitations under the License.
*/
-#include <Elementary.h>
-#include <Eina.h>
#include <Ecore.h>
#include <aul.h>
-#include "i18n.h"
#include "define.h"
-
-#include "AppCommon.h"
-#include "ExtNameInfo.h"
#include "common.h"
-#include "dbg.h"
-#include <MediaContentDbListener.h>
-#include <UsbConnectionListener.h>
-#include "Popup.h"
-#include "InputHandler.h"
-#include <CtxPopup.h>
-
-#include <BaseView.h>
+#include <AppCommon.h>
#include "FbBaseView.h"
+#include "i18n.h"
#include "Info.h"
-
+#include "Popup.h"
#include "SourceCtxPopup.h"
#include "SortCtxPopup.h"
-
-#include <ViewMgr.h>
-#include <LayoutMgr.h>
-#include <BaseLayout.h>
#include "FbAllLayout.h"
#include "FbPhotoLayout.h"
#include "FbVideoLayout.h"
Evas_Object *eoBtnSource;
Evas_Object *eoBtnSort;
- CCtxPopup *pCtxPopup;
+ CContextPopup *pCtxPopup;
CPopup *pPopup;
CLayoutMgr *pLayoutMgr;
private:
SFbBaseView *m;
private:
- static void sm_CbCtxPopupSelected(void* cookie, CCtxPopup* instance, const char* text)
+ static void sm_CbCtxPopupSelected(void* cookie, CContextPopup* instance, const char* text)
{
SFbBaseView* m = (SFbBaseView*)cookie;
if (!m)
_DBG(" instance->Type(): %d", instance->Type());
switch (instance->Type()) {
- case CCtxPopup::TOPBTN_SORT:
+ case CContextPopup::TOPBTN_SORT:
elm_object_text_set(m->eoBtnSort, text);
switch(m->curLayoutId)
{
m->pLayoutMgr->Show(_get_layout_id(m->curLayoutId));
break;
- case CCtxPopup::TOPBTN_SOURCE:
+ case CContextPopup::TOPBTN_SOURCE:
elm_object_text_set(m->eoBtnSource, text);
switch(m->curLayoutId)
{
_CHECK(m->pLayoutMgr->AddLayout(m->pFbPhotoLayout))
_CHECK(m->pLayoutMgr->AddLayout(m->pFbVideoLayout))
_CHECK(m->pLayoutMgr->AddLayout(m->pFbMusicLayout))
- _CHECK(CUsbConnectionListener::Create())
- _CHECK(CMediaContentDbUpdateListener::Create())
-
+ _COMMAND{
+ if(!CUsbListener::Create())
+ _ERR("Fail to create CUsbListener()");
+ if(!CMediaContentListener::Create())
+ _ERR("Fail to create CMediaContentListener()");
+ }
_WHEN_SUCCESS{}
- _CHECK_FAIL{ CMediaContentDbUpdateListener::Destroy(); }
- _CHECK_FAIL{ CUsbConnectionListener::Destroy(); }
_CHECK_FAIL{ m->pLayoutMgr->RemoveLayout(m->pFbMusicLayout); }
_CHECK_FAIL{ m->pLayoutMgr->RemoveLayout(m->pFbVideoLayout); }
_CHECK_FAIL{ m->pLayoutMgr->RemoveLayout(m->pFbPhotoLayout); }
ASSERT(m);
CBaseView::Destroy();
- CMediaContentDbUpdateListener::Destroy();
- CUsbConnectionListener::Destroy();
+
+ if(CMediaContentListener::FlagCreate())
+ CMediaContentListener::Destroy();
+ if(CUsbListener::FlagCreate())
+ CUsbListener::Destroy();
m->pLayoutMgr->RemoveLayout(m->pFbMusicLayout);
m->pFbMusicLayout->Destroy();
}
-void CFbBaseView::OnConnect(void)
+void CFbBaseView::OnStatusChanged(SUsbHostDeviceInfo *changedDevice, 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 */
}
-void CFbBaseView::OnUpdated(const SEntity *entity)
+void CFbBaseView::OnDbUpdated(const SEntity *entity)
{
_DBG();
m->pPopup->Destroy();