Make the uninstall button disable when the app is current home or lock
authorHongryeol Gil <hr.gil@samsung.com>
Mon, 22 Apr 2013 06:55:17 +0000 (15:55 +0900)
committerHongryeol Gil <hr.gil@samsung.com>
Mon, 22 Apr 2013 06:55:17 +0000 (15:55 +0900)
Change-Id: I60012daa9e8c2863a41b8dada7e5a35ba8a4f602
Signed-off-by: Hongryeol Gil <hr.gil@samsung.com>
src/StManageApplicationInfoForm.cpp
src/StScreenTypeForm.cpp

index 883baa6..25f49fb 100644 (file)
@@ -471,6 +471,8 @@ ManageApplicationInfoForm::CreateItem(int groupIndex, int itemIndex, int itemWid
 
        if (isCommandButton == true)
        {
+               String homeAppId;
+               String lockAppId;
                String appId;
                firstLineRectangle.height -= (H_ITEM_TYPE_1_LABEL / DIVIDE_BY_TWO);
 
@@ -491,10 +493,13 @@ ManageApplicationInfoForm::CreateItem(int groupIndex, int itemIndex, int itemWid
                pStopButton->Construct(stopButtonRect, ResourceManager::GetString(L"IDS_ST_BUTTON_FORCE_STOP"));
                pStopButton->SetActionId(IDA_FORCE_STOP);
 
+               SettingInfo::GetValue(SETTING_INFO_KEY_SCREEN_TYPE_HOME, homeAppId);
+               SettingInfo::GetValue(SETTING_INFO_KEY_SCREEN_TYPE_LOCK, lockAppId);
+
                appId = *(static_cast<String*>(__applicationData->GetAt(DATA_TYPE_APPLICATION_ID)));
                AppManager* pAppManager = AppManager::GetInstance();
 
-               if (pAppManager->IsRunning(appId) == false)
+               if (pAppManager->IsRunning(appId) == false || appId == homeAppId || appId == lockAppId)
                {
                        pStopButton->SetEnabled(false);
                }
@@ -506,7 +511,7 @@ ManageApplicationInfoForm::CreateItem(int groupIndex, int itemIndex, int itemWid
                pUninstallButton = new (std::nothrow) Button();
                pUninstallButton->Construct(uninstallButtonRect, ResourceManager::GetString(L"IDS_ST_BUTTON_UNINSTALL"));
 
-               if (uninstallable.Equals(L"0", true))
+               if (uninstallable.Equals(L"0", true) || appId == homeAppId || appId == lockAppId)
                {
                        pUninstallButton->SetEnabled(false);
                }
index 13a17a1..200a3f4 100644 (file)
@@ -265,7 +265,7 @@ ScreenTypeForm::OnGroupedTableViewItemStateChanged(Tizen::Ui::Controls::GroupedT
        SceneManager* pSceneManager = SceneManager::GetInstance();
        AppAssert(pSceneManager);
 
-       PackageAppInfo* pPackageAppInfo = dynamic_cast <PackageAppInfo*>(__pPackageAppInfoList->GetAt(groupIndex));
+       PackageAppInfo* pPackageAppInfo = dynamic_cast <PackageAppInfo*>(__pPackageAppInfoList->GetAt(itemIndex));
        AppLogDebug("AppId [%ls]", pPackageAppInfo->GetAppId().GetPointer());
 
        String screenType;