Nabi SE issue fix and TPK installation related changes
authorchitta.rs <chitta.rs@samsung.com>
Mon, 15 Apr 2013 08:14:54 +0000 (13:44 +0530)
committerchitta.rs <chitta.rs@samsung.com>
Mon, 15 Apr 2013 08:14:54 +0000 (13:44 +0530)
Change-Id: I3f56bc7652306adc48e16dfd2e57215892c2cba9

inc/MfDetailsForm.h
src/MfDetailsForm.cpp
src/MfSearchForm.cpp
src/MfSubFolderFileListForm.cpp

index 853ee3c..ae835bc 100644 (file)
@@ -94,8 +94,8 @@ public:
        //IDeviceEventListener\r
        virtual void OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const Tizen::Base::String& state);\r
 \r
-//     //IDeviceNotificationListener\r
-//     void OnDeviceChange(ComponentType deviceType, const Tizen::Base::String& state);\r
+       //IDeviceNotificationListener\r
+       void OnDeviceChange(ComponentType deviceType, const Tizen::Base::String& state);\r
 \r
 private:\r
        // Copy Constructor of the class.\r
index 111952a..deb7bcf 100644 (file)
@@ -810,97 +810,97 @@ DetailsForm::OnSceneTransitionStarted(const Tizen::Ui::Scenes::SceneId &currentS
        //Empty Implementation.\r
 }\r
 \r
-//void\r
-//DetailsForm::OnDeviceChange(ComponentType deviceType, const Tizen::Base::String& state)\r
-//{\r
-//     bool setMediaPath = false;\r
-//     bool searchHistoryStatus = false;\r
-//     MemoryType currentMemoryType = MEMORY_TYPE_PHONE;\r
-//     String unmounted = sdCardStatusUnmounted;\r
-//     String removed = usbDeviceStatusRemoved;\r
-//     String currentPath;\r
-//     String searchScene;\r
-//     SceneManager* pSceneManager = null;\r
-//     IListT< SceneId >* pSceneList = null;\r
-//     int itemCount = 0;\r
-//\r
-//     pSceneManager = SceneManager::GetInstance();\r
-//\r
-//     if (state == unmounted || state == removed)\r
-//     {\r
-//             currentPath = FolderNavigationPresentationModel::GetCurrentPath();\r
-//             if (state == unmounted)\r
-//             {\r
-//                     if (currentPath.Contains(BasePresentationModel::GetSdCardPath()))\r
-//                     {\r
-//                             FolderNavigationPresentationModel::SetCurrentFilePath(BasePresentationModel::GetMediaPath());\r
-//                             FolderNavigationPresentationModel::SetStorageType(currentMemoryType);\r
-//                             setMediaPath = true;\r
-//                     }\r
-//             }\r
-//\r
-//             if (state == removed)\r
-//             {\r
-//                     if (currentPath.Contains(BasePresentationModel::GetUsbPath()))\r
-//                     {\r
-//                             FolderNavigationPresentationModel::SetCurrentFilePath(BasePresentationModel::GetMediaPath());\r
-//                             FolderNavigationPresentationModel::SetStorageType(currentMemoryType);\r
-//                             setMediaPath = true;\r
-//                     }\r
-//             }\r
-//\r
-//             if (setMediaPath)\r
-//             {\r
-//                     if (pSceneManager != null)\r
-//                     {\r
-//                             pSceneList = pSceneManager->GetSceneHistoryN();\r
-//                     }\r
-//\r
-//                     if (pSceneList != null)\r
-//                     {\r
-//                             itemCount = pSceneList->GetCount() - 1;\r
-//                             pSceneList->GetAt(itemCount, searchScene);\r
-//                             while (searchScene != IDSCN_SEARCH_FORM && itemCount >= 0)\r
-//                             {\r
-//                                     itemCount--;\r
-//                                     pSceneList->GetAt(itemCount, searchScene);\r
-//                             }\r
-//                     }\r
-//\r
-//                     if (searchScene == IDSCN_SEARCH_FORM)\r
-//                     {\r
-//                             AppLogDebug("Search scene present");\r
-//                             searchHistoryStatus = true;\r
-//                     }\r
-//                     else\r
-//                     {\r
-//                             AppLogDebug("Search scene not present");\r
-//                             searchHistoryStatus = false;\r
-//                     }\r
-//\r
-//                     if(pSceneList)\r
-//                     {\r
-//                             pSceneList->RemoveAll();\r
-//                             delete pSceneList;\r
-//                             pSceneList = null;\r
-//                     }\r
-//\r
-//                     if (searchHistoryStatus == true)\r
-//                     {\r
-//                             if (pSceneManager != null)\r
-//                             {\r
-//                                     pSceneManager->DestroyScene(IDSCN_SEARCH_FORM);\r
-//                                     pSceneManager->ClearSceneHistory();\r
-//                             }\r
-//                     }\r
-//\r
-//                     if (pSceneManager != null)\r
-//                     {\r
-//                             pSceneManager->GoForward(ForwardSceneTransition(IDSCN_TEMP_FORM, SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY, SCENE_DESTROY_OPTION_DESTROY), null);\r
-//                     }\r
-//             }\r
-//     }\r
-//}\r
+void\r
+DetailsForm::OnDeviceChange(ComponentType deviceType, const Tizen::Base::String& state)\r
+{\r
+       bool setMediaPath = false;\r
+       bool searchHistoryStatus = false;\r
+       MemoryType currentMemoryType = MEMORY_TYPE_PHONE;\r
+       String unmounted = sdCardStatusUnmounted;\r
+       String removed = usbDeviceStatusRemoved;\r
+       String currentPath;\r
+       String searchScene;\r
+       SceneManager* pSceneManager = null;\r
+       IListT< SceneId >* pSceneList = null;\r
+       int itemCount = 0;\r
+\r
+       pSceneManager = SceneManager::GetInstance();\r
+\r
+       if (state == unmounted || state == removed)\r
+       {\r
+               currentPath = FolderNavigationPresentationModel::GetCurrentPath();\r
+               if (state == unmounted)\r
+               {\r
+                       if (currentPath.Contains(BasePresentationModel::GetSdCardPath()))\r
+                       {\r
+                               FolderNavigationPresentationModel::SetCurrentFilePath(BasePresentationModel::GetMediaPath());\r
+                               FolderNavigationPresentationModel::SetStorageType(currentMemoryType);\r
+                               setMediaPath = true;\r
+                       }\r
+               }\r
+\r
+               if (state == removed)\r
+               {\r
+                       if (currentPath.Contains(BasePresentationModel::GetUsbPath()))\r
+                       {\r
+                               FolderNavigationPresentationModel::SetCurrentFilePath(BasePresentationModel::GetMediaPath());\r
+                               FolderNavigationPresentationModel::SetStorageType(currentMemoryType);\r
+                               setMediaPath = true;\r
+                       }\r
+               }\r
+\r
+               if (setMediaPath)\r
+               {\r
+                       if (pSceneManager != null)\r
+                       {\r
+                               pSceneList = pSceneManager->GetSceneHistoryN();\r
+                       }\r
+\r
+                       if (pSceneList != null)\r
+                       {\r
+                               itemCount = pSceneList->GetCount() - 1;\r
+                               pSceneList->GetAt(itemCount, searchScene);\r
+                               while (searchScene != IDSCN_SEARCH_FORM && itemCount >= 0)\r
+                               {\r
+                                       itemCount--;\r
+                                       pSceneList->GetAt(itemCount, searchScene);\r
+                               }\r
+                       }\r
+\r
+                       if (searchScene == IDSCN_SEARCH_FORM)\r
+                       {\r
+                               AppLogDebug("Search scene present");\r
+                               searchHistoryStatus = true;\r
+                       }\r
+                       else\r
+                       {\r
+                               AppLogDebug("Search scene not present");\r
+                               searchHistoryStatus = false;\r
+                       }\r
+\r
+                       if(pSceneList)\r
+                       {\r
+                               pSceneList->RemoveAll();\r
+                               delete pSceneList;\r
+                               pSceneList = null;\r
+                       }\r
+\r
+                       if (searchHistoryStatus == true)\r
+                       {\r
+                               if (pSceneManager != null)\r
+                               {\r
+                                       pSceneManager->DestroyScene(IDSCN_SEARCH_FORM);\r
+                                       pSceneManager->ClearSceneHistory();\r
+                               }\r
+                       }\r
+\r
+                       if (pSceneManager != null)\r
+                       {\r
+                               pSceneManager->GoForward(ForwardSceneTransition(IDSCN_TOP_LEVEL_DIRECTORY_FORM, SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY, SCENE_DESTROY_OPTION_DESTROY), null);\r
+                       }\r
+               }\r
+       }\r
+}\r
 \r
 void\r
 DetailsForm::OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const Tizen::Base::String& state)\r
@@ -926,5 +926,5 @@ DetailsForm::OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const Ti
        }\r
        break;\r
        }\r
-//     OnDeviceChange(currentDeviceType, state);\r
+       OnDeviceChange(currentDeviceType, state);\r
 }\r
index 46c1a9b..84fc397 100644 (file)
@@ -605,17 +605,13 @@ SearchForm::OnListViewItemStateChanged(ListView& listView, int index, int elemen
                else\r
                {\r
                        //Else launch the corresponding AppControl.\r
-                       if (__pathOfSelectedFile.EndsWith(L".tpk"))\r
+                       if (__pathOfSelectedFile.EndsWith(L".tpk") || __pathOfSelectedFile.EndsWith(L".wgt"))\r
                        {\r
                                String* pFileUriScheme = new (std::nothrow) String(L"file://");\r
                                pFileUriScheme->Append(__pathOfSelectedFile);\r
-                               AppControl* pAc = null;\r
-                               pAc = AppManager::FindAppControlN(L"D7eOJquGtL.Installer", L"http://tizen.org/appcontrol/operation/install");\r
-                               if(pAc != null)\r
-                               {\r
-                                       pAc->Start(pFileUriScheme, null, null, null);\r
-                               }\r
-                               delete pFileUriScheme;\r
+\r
+                               AppControl::FindAndStart(L"http://tizen.org/appcontrol/operation/view", pFileUriScheme, null, null, null, null);\r
+                               //delete pFileUriScheme;\r
                        }\r
                        else\r
                        {\r
index 6d298a4..ca08f88 100644 (file)
@@ -798,17 +798,13 @@ SubFolderFileListForm::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView&
                        {
                                _pathOfSelectedFile = tempRootMediaPath;
                                //It's not a directory, Launch the AppControl.
-                               if (_pathOfSelectedFile.EndsWith(L".tpk"))
+                               if (_pathOfSelectedFile.EndsWith(L".tpk") || _pathOfSelectedFile.EndsWith(L".wgt"))
                                {
                                        String* pFileUriScheme = new (std::nothrow) String(L"file://");
                                        pFileUriScheme->Append(_pathOfSelectedFile);
-                                       AppControl* pAc = null;
-                                       pAc = AppManager::FindAppControlN(L"D7eOJquGtL.Installer", L"http://tizen.org/appcontrol/operation/install");
-                                       if(pAc != null)
-                                       {
-                                               pAc->Start(pFileUriScheme, null, null, null);
-                                       }
-                                       delete pFileUriScheme;
+
+                                       AppControl::FindAndStart(L"http://tizen.org/appcontrol/operation/view", pFileUriScheme, null, null, null, null);
+                                       //delete pFileUriScheme;
                                }
                                else
                                {