NABI_SE issue fixes
authorchitta.rs <chitta.rs@samsung.com>
Wed, 3 Apr 2013 14:15:46 +0000 (19:45 +0530)
committerchitta.rs <chitta.rs@samsung.com>
Wed, 3 Apr 2013 14:15:46 +0000 (19:45 +0530)
Change-Id: I9483bd6b465b6e4f0477b9e937459b88b0d9594a

inc/MfCustomAppControl.h
src/MfCustomAppControl.cpp
src/MfSubBaseFileManageForm.cpp
src/MfSubBaseSelectionForm.cpp
src/MfSubFolderSelection.cpp
src/MfTopLevelDirectoryMoveCopy.cpp

index 5afbcb9..07defa0 100644 (file)
@@ -113,7 +113,6 @@ private:
 private:
        Tizen::App::IAppControlResponseListener* __pAppControlEventListener;
 
-       Tizen::Base::Collection::HashMap* __dataList;
        static CustomAppControl* __pInstance;
        static Tizen::App::AppControl* __pAppControlInUse;
 };
index 69b50b4..d81d416 100644 (file)
@@ -39,11 +39,7 @@ CustomAppControl::CustomAppControl(void)
 
 CustomAppControl::~CustomAppControl(void)
 {
-       if (__dataList != null)
-       {
-               __dataList->RemoveAll();
-               delete __dataList;
-       }
+//empty implementation
 }
 
 CustomAppControl*
@@ -89,12 +85,7 @@ CustomAppControl::DeleteInstance(void)
 result
 CustomAppControl::Construct(void)
 {
-       result r = E_FAILURE;
-
-       __dataList = new (std::nothrow) HashMap();
-       if (__dataList != null)
-               r = __dataList->Construct();
-
+       result r = E_SUCCESS;
        return r;
 }
 void
@@ -208,11 +199,9 @@ CustomAppControl::LaunchAppControl(String& mediaFullPath)
        Frame* pCurrentFrame = null;
 
        String mediaType;
-
-       String* pTypeKey = new (std::nothrow)String (L"type");
-       String* pTypeVal = new (std::nothrow)String(L"");
-       String* pPathKey = new (std::nothrow)String(L"path");
-       String* pPathVal = new (std::nothrow)String(L"");
+       String mimeType;
+       const String* uriType = new (std::nothrow) const String(mediaFullPath);
+       const String *pMimeInfo = null;
 
        mediaType = FindMediaType(mediaFullPath);
 
@@ -220,51 +209,33 @@ CustomAppControl::LaunchAppControl(String& mediaFullPath)
        {
                AppLogDebug("Image App Control");
                ((MyFilesApp*) Application::GetInstance())->SetImageAppControlLanched(true);
-
                pAc = AppManager::FindAppControlN(L"tizen.imageviewer", L"http://tizen.org/appcontrol/operation/view");
-               pTypeVal->Append(L"image");
-               pPathVal->Append(mediaFullPath);
+               mimeType.Append(L"image/*");
        }
        else if (mediaType == "audio")
        {
                pAc = AppManager::FindAppControlN(L"tizen.musicplayer", L"http://tizen.org/appcontrol/operation/view");
-               pTypeVal->Append(L"audio");
-               pPathVal->Append(mediaFullPath);
+               mimeType.Append(L"audio/*");
        }
        else if (mediaType == "video")
        {
-
                pAc = AppManager::FindAppControlN(L"tizen.videoplayer", L"http://tizen.org/appcontrol/operation/view");
-               pTypeVal->Append(L"video");
-               pPathVal->Append(mediaFullPath);
-
-               AppLogDebug("Video File found :%S", pPathVal->GetPointer());
+               mimeType.Append(L"video/*");
        }
 
        else if (mediaType == "web")
        {
                pAc = AppManager::FindAppControlN(L"tizen.internet", L"http://tizen.org/appcontrol/operation/view");
-               pTypeKey->Clear();
-               pTypeKey->Append(L"url");
-               pTypeVal->Append(mediaFullPath);
        }
        else if (mediaType == "contact")
        {
                pAc = AppManager::FindAppControlN(L"tizen.contacts", L"http://tizen.org/appcontrol/operation/view");
-               pTypeKey->Clear();
-               pTypeKey->Append(L"viewType");
-               pTypeVal->Clear();
-               pTypeVal->Append(L"vcf");
-               pPathVal->Append(mediaFullPath);
+               mimeType.Append(L"text/x-vcard");
        }
        else if (mediaType == "calendar")
        {
                pAc = AppManager::FindAppControlN(L"tizen.calendar", L"http://tizen.org/appcontrol/operation/view");
-               pTypeKey->Clear();
-               pTypeKey->Append(L"viewType");
-               pTypeVal->Clear();
-               pTypeVal->Append(L"vcs");
-               pPathVal->Append(mediaFullPath);
+               mimeType.Append(L"text/x-vcalendar");
        }
        else if (mediaType == "email")
        {
@@ -283,10 +254,11 @@ CustomAppControl::LaunchAppControl(String& mediaFullPath)
                        pAc->GetAppId() != videoPlayerAppId )
        {
                AppLogDebug("Returning");
-               delete pTypeKey;
-               delete pTypeVal;
-               delete pPathKey;
-               delete pPathVal;
+
+               if (uriType != null)
+               {
+                       delete uriType;
+               }
 
                if (pAc != null)
                {
@@ -296,55 +268,46 @@ CustomAppControl::LaunchAppControl(String& mediaFullPath)
                return null;
        }
 
-       if (pTypeVal->CompareTo("") != 0)
-       {
-               __dataList->Add(pTypeKey, pTypeVal);
-       }
-       else
-       {
-               delete pTypeVal;
-       }
-
-       if (pPathVal->CompareTo("") != 0)
+       pMimeInfo = new (std::nothrow) const String(mimeType);
+       if(pAc->GetAppId() == musicPlayerAppId || pAc->GetAppId() == browserAppId || pAc->GetAppId() == phoneAppId || pAc->GetAppId() == videoPlayerAppId )
        {
-               AppLogDebug("CustomAppControl::LaunchAppControl:%S", pPathVal->GetPointer());
-
-               r = __dataList->Add(pPathKey, pPathVal);
-               AppLogDebug("CustomAppControl::LaunchAppControl:%s", GetErrorMessage(r));
+               //In case of Music Player, Browser, Phone appcontrols , No need to register Listener
+               r = pAc->Start(uriType,pMimeInfo,null,null);
+               AppLogDebug("start result is %s",GetErrorMessage(r));
        }
        else
        {
-               delete pPathVal;
+               AppLogDebug("pac not null");
+               AppLogDebug("uri is %S",uriType->GetPointer());
+               AppLogDebug("mimeType is %S",mimeType.GetPointer());
+               r = pAc->Start(uriType,pMimeInfo,null,__pAppControlEventListener);
+               AppLogDebug("start result is %s",GetErrorMessage(r));
        }
 
-
-       if(pAc->GetAppId() == musicPlayerAppId || pAc->GetAppId() == browserAppId || pAc->GetAppId() == phoneAppId || pAc->GetAppId() == videoPlayerAppId )
-               //In case of Music Player, Browser, Phone appcontrols , No need to register Listener
-               r = pAc->Start(null, null, __dataList, null);
-       else
-               r = pAc->Start(null, null, __dataList,__pAppControlEventListener);
-
        AppLogDebug("EXIT::CustomAppControl::LaunchAppControl::%s", GetErrorMessage(r));
 
-       __dataList->Remove(*pTypeKey);
-       __dataList->Remove(*pPathKey);
-
        pCurrentFrame =  Application::GetInstance()->GetAppFrame()->GetFrame();
 
-       if (pCurrentFrame != null)
+       if (pCurrentFrame != null && r==E_SUCCESS)
        {
                pCurrentFrame->SetEnabled(false);
        }
 
        AppLogDebug("EXIT:: CustomAppControl::LaunchAppControl::%s", GetErrorMessage(GetLastResult()));
 
+       if (pMimeInfo != null)
+       {
+               delete pMimeInfo;
+       }
+
+       if (uriType != null)
+       {
+               delete uriType;
+       }
        return pAc;
 
 CATCH:
-
-    delete pTypeKey;
-    delete pTypeVal;
-    delete pPathKey;
-    delete pPathVal;
+delete pMimeInfo;
+delete uriType;
        return null;
 }
index 5c85a7d..4cf3245 100644 (file)
@@ -904,19 +904,18 @@ SubBaseFileManageForm::ShareFile(ShareVia shareType)
        DirectoryEntry* ptempDirEntry = null;
        IMapEnumerator* pMapEnum = null;
        AppControl* pAc = null;
-       String* pTypeKey = null;
-       String* pTypeValue = null;
-       String* pAttachKey = null;
-       String attachValue;
+       const String* pAttachKey = null;
+       const String* pUriType = null;
        const HashMap* pResultHash = null;
+       result r = E_SUCCESS;
 
        HashMap dataList;
+       ArrayList* filePathList = null;
        MessageBox messageBox;
        int modalResult = 0;
-       int selectedFileCount = 0;
 
        dataList.Construct();
-       pAttachKey = new (std::nothrow) String(L"attachments");
+       pAttachKey = new (std::nothrow) const String(L"http://tizen.org/appcontrol/data/path");
 
        switch (shareType)
        {
@@ -928,10 +927,8 @@ SubBaseFileManageForm::ShareFile(ShareVia shareType)
 
        case SHARE_VIA_MESSAGE:
        {
+               pUriType = new (std::nothrow) const String(L"mmsto");
                pAc = AppManager::FindAppControlN(L"tizen.messages", "http://tizen.org/appcontrol/operation/compose");
-               pTypeKey = new (std::nothrow) String(L"type");
-               pTypeValue = new (std::nothrow) String(L"MMS");
-               dataList.Add(pTypeKey, pTypeValue);
        }
        break;
 
@@ -948,32 +945,42 @@ SubBaseFileManageForm::ShareFile(ShareVia shareType)
                pMapEnum = _pFileManager->GetCheckedList()->GetMapEnumeratorN();
                if (pMapEnum != null)
                {
+                       if (filePathList == null)
+                       {
+                               filePathList = new (std::nothrow) ArrayList();
+                       }
                        while (pMapEnum->MoveNext() == E_SUCCESS)
                        {
                                ptempDirEntry = static_cast< DirectoryEntry* >(pMapEnum->GetValue());
 
                                if (ptempDirEntry != null)
                                {
-                                       attachValue.Append(ptempDirEntry->GetFullFilePath());
-                                       selectedFileCount++;
-                                       if (pResultHash != null)
-                                       {
-                                               if (selectedFileCount < pResultHash->GetCount())
-                                               {
-                                                       attachValue.Append(";");
-                                               }
-                                       }
+                                       filePathList->Add(new (std::nothrow) String (ptempDirEntry->GetFullFilePath()));
                                }
                        }
                }
        }
 
-       dataList.Add(pAttachKey, new (std::nothrow) String(attachValue));
-       AppLogDebug(" AttachValue is %S",attachValue.GetPointer());
+       dataList.Add(*pAttachKey,*filePathList);
+       if (shareType == SHARE_VIA_MESSAGE)
+       {
+               dataList.Add(new (std::nothrow) String (L"http://tizen.org/appcontrol/data/message/type"),new (std::nothrow) String (L"mms"));
+       }
 
        if (pAc != null)
        {
-               if (pAc->Start(null, null, &dataList, null) == E_MAX_EXCEEDED)
+               AppLogDebug("filePathList count is %d",filePathList->GetCount());
+
+               if (shareType == SHARE_VIA_EMAIL)
+               {
+                       r = pAc->Start(null, null, &dataList, null);
+               }
+               else if (shareType == SHARE_VIA_MESSAGE)
+               {
+                       r = pAc->Start(pUriType, null, &dataList, null);
+               }
+
+               if (r == E_MAX_EXCEEDED)
                {
                        messageBox.Construct(L"", L"Email Size Exceeded", MSGBOX_STYLE_OK);
                        messageBox.ShowAndWait(modalResult);
@@ -983,8 +990,16 @@ SubBaseFileManageForm::ShareFile(ShareVia shareType)
 
        if (dataList.GetCount() > 0)
        {
+               if (filePathList != null)
+               {
+                       filePathList->RemoveAll(true);
+               }
                dataList.RemoveAll(true);
        }
+       if (pUriType != null)
+       {
+               delete pUriType;
+       }
 }
 
 void
@@ -1181,7 +1196,7 @@ SubBaseFileManageForm::CreateFileProgressingPopup(void)
 
        if (_pFileProgressingPopup != null)
        {
-               _pFileProgressingPopup->RemoveAllControls();
+               //_pFileProgressingPopup->RemoveAllControls();
                delete _pFileProgressingPopup;
                _pFileProgressingPopup = null;
        }
index 4d8a37d..b38da45 100644 (file)
@@ -739,6 +739,12 @@ SubBaseSelection::OnFormBackRequested(Form& source)
        SceneManager* pSceneManager = null;\r
        pSceneManager = SceneManager::GetInstance();\r
        currentPath = FolderNavigationPresentationModel::GetCurrentPath();\r
+\r
+       if (_currentViewStyle != APPCONTROL_VIEW_EXPORT)\r
+       {\r
+               ResetFooter();\r
+       }\r
+\r
        if (currentPath == BasePresentationModel::GetMediaPath() || currentPath == BasePresentationModel::GetSdCardPath())\r
        {\r
                FolderNavigationPresentationModel::SetCurrentFilePath(currentPath);\r
index 2d4c568..f2c2344 100644 (file)
@@ -585,6 +585,15 @@ SubFolderSelection::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previous
 \r
        SceneManager::GetInstance()->AddSceneManagerEventListener(*this);\r
 \r
+       _itemSelectedCount.Clear();\r
+\r
+       if (_pFileManager != null)\r
+       {\r
+               if (!_pFileManager->IsCheckedListNull())\r
+               {\r
+                       _pFileManager->ClearCheckedList();\r
+               }\r
+       }\r
        if (_selectionMode == SELECTION_MODE_SINGE) // start of MULTIPLE_MODE_SELECTION if\r
        {\r
                pLayout  = dynamic_cast <RelativeLayout*> (Form::GetLayoutN());\r
index 2a4db30..f97eb9c 100644 (file)
@@ -272,7 +272,9 @@ MfTopLevelDirectoryMoveCopy::CreateItem(int index, int itemWidth)
        if (pAppResource != null)\r
        {\r
                pAppResource->GetString(L"IDS_MF_TAB_MEMORY_CARD", memoryCard);\r
+#if 0\r
                pAppResource->GetString(L"IDS_MF_TAB_EXTERNAL_STORAGE", externalStorage);\r
+#endif\r
        }\r
 \r
        ListAnnexStyle style = LIST_ANNEX_STYLE_NORMAL;\r
@@ -307,7 +309,10 @@ MfTopLevelDirectoryMoveCopy::CreateItem(int index, int itemWidth)
        titleText.Clear();\r
        titleText.Append(*tempStr);\r
 \r
-       pItem->AddElement(Rectangle(116, 34, 604, 44), IDA_FORMAT_STRING, titleText, true);\r
+       pItem->AddElement(Rectangle(W_LISTVIEW_ITEM_BITMAP + 2 * X_LISTVIEW, (H_ITEM_LISTVIEW - H_LISTVIEW_ITEM_TITLE) /2, itemWidth - (W_LISTVIEW_ITEM_BITMAP + 3 * X_LISTVIEW), H_LISTVIEW_ITEM_TITLE),\r
+                       IDA_FORMAT_STRING,\r
+                       titleText,\r
+                       true);\r
 \r
        return pItem;\r
 }\r
@@ -497,7 +502,9 @@ MfTopLevelDirectoryMoveCopy::OnSceneTransitionCompleted(const Tizen::Ui::Scenes:
        if (pAppResource != null)\r
        {\r
                pAppResource->GetString(L"IDS_MF_TAB_MEMORY_CARD", sdCardStorage);\r
+#if 0\r
                pAppResource->GetString(L"IDS_MF_TAB_EXTERNAL_STORAGE", externalStorage);\r
+#endif\r
 \r
        }\r
 \r
@@ -514,6 +521,7 @@ MfTopLevelDirectoryMoveCopy::OnSceneTransitionCompleted(const Tizen::Ui::Scenes:
                __pFolderList->RemoveAt(__listItemCount - 1, true);\r
        }\r
 \r
+#if 0\r
        if (deviceSateUSBStorage == inserted)\r
        {\r
                pExternalStorage = new (std::nothrow) String(externalStorage);\r
@@ -523,6 +531,8 @@ MfTopLevelDirectoryMoveCopy::OnSceneTransitionCompleted(const Tizen::Ui::Scenes:
        {\r
                __pFolderList->RemoveAt(__listItemCount - 1);\r
        }\r
+#endif\r
+\r
        __listItemCount = __pFolderList->GetCount();\r
 \r
        //__pListView->UpdateList();\r
@@ -591,7 +601,9 @@ MfTopLevelDirectoryMoveCopy::OnDeviceStateChanged(Tizen::System::DeviceType devi
        if (pAppResource != null)\r
        {\r
                pAppResource->GetString(L"IDS_MF_TAB_MEMORY_CARD", sdCardStorage);\r
+#if 0\r
                pAppResource->GetString(L"IDS_MF_TAB_EXTERNAL_STORAGE", externalStorage);\r
+#endif\r
 \r
        }\r
 \r