Fix nabi issue(N_SE-35275) and add nocontent image at privacy & downloaded applicatio...
authorTaeHo Choi <thanks.choi@samsung.com>
Fri, 19 Apr 2013 06:36:41 +0000 (15:36 +0900)
committerTaeHo Choi <thanks.choi@samsung.com>
Fri, 19 Apr 2013 06:45:20 +0000 (15:45 +0900)
Change-Id: I4babbdad54e0e13bcd62ab8605e1186769d8eb03
Signed-off-by: TaeHo Choi <thanks.choi@samsung.com>
inc/StDownloadedApplicationForm.h
inc/StPrivacyForm.h
src/StCertificateUserForm.cpp
src/StCertificateUserInstallForm.cpp
src/StDeveloperOptionForm.cpp
src/StDownloadedApplicationForm.cpp
src/StPrivacyForm.cpp
src/StScreenTypeForm.cpp

index 2e8d5ec..90e8426 100644 (file)
@@ -66,6 +66,7 @@ private:
        Tizen::Base::String GetAppSettingIconPathFromAppIdListAt(Tizen::Base::String& id);
        void OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs);
        void OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus);
+       void UpdateTableViewAndNoContent(void);
 
 private:
        Tizen::Base::Collection::IList* __pDownloadAppIdKeyList;
index d93e24a..5f3258d 100644 (file)
@@ -54,12 +54,14 @@ public:
        virtual void OnGroupedTableViewContextItemActivationStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewContextItem* pContextItem, bool activated);
        virtual void OnGroupedTableViewGroupItemStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status);
        virtual void OnGroupedTableViewItemStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status);
+       virtual void OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus);
        
 private:
        void InitPackgaeManager(void);
        result InitPrivacyAppPackageList(void);
        Tizen::Base::String GetDisplayPackageName(int itemIndex);
        Tizen::Base::String GetUsedPrivacyService(int itemIndex);
+       void UpdateTableViewAndNoContent(void);
 
 private:
        Tizen::Security::PrivacyManager* __pPrivacyManager;
index 6f43b81..113d3d3 100644 (file)
@@ -491,12 +491,12 @@ CertificateUserForm::CreateAlertPopup(void)
        clientRect.width =  W_ALERT_POPUP_CLIENT_RECT_RESIZE;
        clientRect.height = H_ALERT_POPUP_CLIENT_RECT_RESIZE;
 
-       itemRectLabel.x = 0;
+       itemRectLabel.x = X_ALERT_POPUP_ITEM_RECT_LHS_BUTTON_DEFAULT;
        itemRectLabel.y = Y_ALERT_POPUP_ITEM_RECT_LABEL_DEFAULT;
        itemRectLabel.width = clientRect.width;
        itemRectLabel.height = H_ALERT_POPUP_ITEM_RECT_LABEL_DEFAULT;
 
-       itemRectLhsButton.x = X_ALERT_POPUP_ITEM_RECT_LHS_BUTTON_DEFAULT;
+       itemRectLhsButton.x = X_ALERT_POPUP_ITEM_RECT_LHS_BUTTON_DEFAULT + itemRectLabel.x;
        itemRectLhsButton.y = Y_ALERT_POPUP_ITEM_RECT_LHS_BUTTON_DEFAULT;
        itemRectLhsButton.width = W_ALERT_POPUP_ITEM_RECT_LHS_BUTTON_DEFAULT;
        itemRectLhsButton.height = H_ALERT_POPUP_ITEM_RECT_LHS_BUTTON_DEFAULT;
index 594d999..131cb5f 100644 (file)
@@ -96,7 +96,14 @@ CertificateUserInstallForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId&
                RemoveControl(GetControl(0));
        }
 //     RemoveAllControls();
-       if (!IsFailed(__pCertificatePresentationModelInstance->FindUserCertificateToInstallFromStorage()))
+       result r = __pCertificatePresentationModelInstance->FindUserCertificateToInstallFromStorage();
+       if (IsFailed(r))
+       {
+               AppLogDebug("FindUserCertificateToInstallFromStorage is error %s", GetErrorMessage(r));
+               return;
+       }
+
+       if (__pCertificatePresentationModelInstance->GetFoundUserCertificateToInstallListCount() != 0)
        {
                CreateTableView();
                __pTableView->UpdateTableView();
index cf9b39e..58aa224 100644 (file)
@@ -533,8 +533,8 @@ DeveloperOptionForm::CreateAlertPopup(void)
        clientRect.width = W_ALERT_POPUP_CLIENT_RECT_DEFAULT;
        clientRect.height = H_ALERT_POPUP_CLIENT_RECT_DEFAULT;
 
-       itemRectLabel.x = 0;
-       itemRectLabel.y = Y_ALERT_POPUP_ITEM_RECT_LABEL_DEFAULT;
+       itemRectLabel.x = Y_ALERT_POPUP_ITEM_RECT_LABEL_DEFAULT;
+       itemRectLabel.y = Y_ALERT_POPUP_ITEM_RECT_LABEL_DEFAULT + itemRectLabel.x;
        itemRectLabel.width = W_ALERT_POPUP_ITEM_RECT_LABEL_DEFAULT;
        itemRectLabel.height = H_ALERT_POPUP_ITEM_RECT_LABEL_DEFAULT;
 
index ffefd34..5a18456 100644 (file)
@@ -74,6 +74,7 @@ DownloadedApplicationForm::OnInitializing(void)
        CreateFooter();
        CreateTableView();
        SetAppIdListFromPackageManager();
+       UpdateTableViewAndNoContent();
 
        return E_SUCCESS;
 }
@@ -83,6 +84,11 @@ DownloadedApplicationForm::OnTerminating(void)
 {
        RemoveAllDownLoadAppIdKeyList();
        RemoveAllAppIdList();
+       int controlCount = GetControlCount();
+       for (int i = 0; i < controlCount; i++)
+       {
+               RemoveControl(GetControl(0));
+       }
        __pTableView = null;
 
        SetFormBackEventListener(null);
@@ -99,7 +105,7 @@ DownloadedApplicationForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& p
        RemoveAllDownLoadAppIdKeyList();
        SetAppIdListFromPackageManager();
 
-       __pTableView->UpdateTableView();
+       UpdateTableViewAndNoContent();
 }
 
 void
@@ -338,6 +344,7 @@ DownloadedApplicationForm::OnGroupedTableViewGroupItemStateChanged(Tizen::Ui::Co
 void
 DownloadedApplicationForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus)
 {
+       UpdateTableViewAndNoContent();
        Invalidate(true);
 }
 
@@ -653,4 +660,82 @@ DownloadedApplicationForm::GetAppSettingIconPathFromAppIdListAt(Tizen::Base::Str
                }
        }
        return iconPath;
+}
+
+void
+DownloadedApplicationForm::UpdateTableViewAndNoContent(void)
+{
+       bool createTableView = false;
+       if (__pTableView != null)
+       {
+               if (GetDownLoadAppCount() != 0)
+               {
+                       __pTableView->UpdateTableView();
+                       return;
+               }
+       }
+       else
+       {
+               if (GetDownLoadAppCount() != 0)
+               {
+                       createTableView = true;
+               }
+       }
+
+       if (__pTableView != null)
+       {
+               int tableViewControlCount = __pTableView->GetControlCount();
+               for (int i = 0; i < tableViewControlCount; i++)
+               {
+                       __pTableView->RemoveControl(__pTableView->GetControl(0));
+               }
+//                     __pTableView->RemoveAllControls();
+               __pTableView = null;
+       }
+       int controlCount = GetControlCount();
+       for (int i = 0; i < controlCount; i++)
+       {
+               RemoveControl(GetControl(0));
+       }
+//     RemoveAllControls();
+
+       if (createTableView)
+       {
+               CreateTableView();
+               __pTableView->UpdateTableView();
+       }
+       else
+       {
+               Label* pLabel = static_cast<Label*>(this->GetControl(NO_CONTENTS, false));
+               if (pLabel == null)
+               {
+                       Rectangle clientRect = GetClientAreaBounds();
+                       Bitmap* pBitmp = ResourceManager::GetBitmapN(IDB_NO_CONTENTS);
+
+                       int bitmapWidth = pBitmp->GetWidth();
+                       int bitmapHeight = pBitmp->GetHeight();
+                       String labelText = ResourceManager::GetString(L"IDS_ST_BODY_NO_CONTENT");
+                       Color textColor = COLOR_HELP_TEXT_TYPE_03_NORMAL;
+                       int noContentTextHeight = GetHeightForStringArea(labelText, bitmapWidth, 32);
+
+                       int xPos = (clientRect.width / LINE_COUNT_2) - (bitmapWidth / DEVIDE_TWO);
+                       int yPos = (clientRect.height / LINE_COUNT_2) - ((bitmapHeight + noContentTextHeight) / DEVIDE_TWO);
+
+                       Label* pLabel = new (std::nothrow) Label();
+                       pLabel->Construct(Rectangle(xPos, yPos, bitmapWidth, bitmapHeight), L"");
+                       pLabel->SetName(NO_CONTENTS);
+                       pLabel->SetBackgroundBitmap(*pBitmp);
+
+                       yPos = yPos + bitmapHeight;
+
+                       Label* pLabelNoContents = new (std::nothrow) Label();
+                       pLabelNoContents->Construct(Rectangle(0, yPos, clientRect.width, noContentTextHeight), L"");
+                       pLabelNoContents->SetName(NO_CONTENTS_TEXT);
+                       pLabelNoContents->SetTextColor(textColor);
+                       pLabelNoContents->SetText(labelText);
+
+                       AddControl(*pLabel);
+                       AddControl(*pLabelNoContents);
+               }
+       }
 }
\ No newline at end of file
index 18a112e..e3b3791 100644 (file)
@@ -74,7 +74,7 @@ PrivacyForm::OnInitializing(void)
 
        CreateHeader(ResourceManager::GetString(L"IDS_COM_BODY_PRIVACY"));
        CreateFooter();
-       CreateTableView();
+       UpdateTableViewAndNoContent();
 
        return r;
 }
@@ -84,9 +84,17 @@ PrivacyForm::OnTerminating(void)
 {
        __pPrivacyManager = null;
 
-       __privacyPackageList->RemoveAll(true);
-       __privacyPackageList = null;
+       if (__privacyPackageList != null)
+       {
+               __privacyPackageList->RemoveAll(true);
+               __privacyPackageList = null;
+       }
 
+       int controlCount = GetControlCount();
+       for (int i = 0; i < controlCount; i++)
+       {
+               RemoveControl(GetControl(0));
+       }
        __pTableView = null;
 
        SetFormBackEventListener(null);
@@ -103,10 +111,7 @@ PrivacyForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId
                delete pArgs;
        }
 
-       if (__pTableView)
-       {
-               __pTableView->UpdateTableView();
-       }
+       UpdateTableViewAndNoContent();
 }
 
 result
@@ -433,4 +438,89 @@ PrivacyForm::OnGroupedTableViewContextItemActivationStateChanged(Tizen::Ui::Cont
 void
 PrivacyForm::OnGroupedTableViewGroupItemStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status)
 {
+}
+
+void
+PrivacyForm::UpdateTableViewAndNoContent(void)
+{
+       bool createTableView = false;
+       if (__pTableView != null)
+       {
+               if (__privacyPackageList != null)
+               {
+                       __pTableView->UpdateTableView();
+                       return;
+               }
+       }
+       else
+       {
+               if (__privacyPackageList != null)
+               {
+                       createTableView = true;
+               }
+       }
+
+       if (__pTableView != null)
+       {
+               int tableViewControlCount = __pTableView->GetControlCount();
+               for (int i = 0; i < tableViewControlCount; i++)
+               {
+                       __pTableView->RemoveControl(__pTableView->GetControl(0));
+               }
+//                     __pTableView->RemoveAllControls();
+               __pTableView = null;
+       }
+       int controlCount = GetControlCount();
+       for (int i = 0; i < controlCount; i++)
+       {
+               RemoveControl(GetControl(0));
+       }
+//     RemoveAllControls();
+
+       if (createTableView)
+       {
+               CreateTableView();
+               __pTableView->UpdateTableView();
+       }
+       else
+       {
+               Label* pLabel = static_cast<Label*>(this->GetControl(NO_CONTENTS, false));
+               if (pLabel == null)
+               {
+                       Rectangle clientRect = GetClientAreaBounds();
+                       Bitmap* pBitmp = ResourceManager::GetBitmapN(IDB_NO_CONTENTS);
+
+                       int bitmapWidth = pBitmp->GetWidth();
+                       int bitmapHeight = pBitmp->GetHeight();
+                       String labelText = ResourceManager::GetString(L"IDS_ST_BODY_NO_CONTENT");
+                       Color textColor = COLOR_HELP_TEXT_TYPE_03_NORMAL;
+                       int noContentTextHeight = GetHeightForStringArea(labelText, bitmapWidth, 32);
+
+                       int xPos = (clientRect.width / LINE_COUNT_2) - (bitmapWidth / DEVIDE_TWO);
+                       int yPos = (clientRect.height / LINE_COUNT_2) - ((bitmapHeight + noContentTextHeight) / DEVIDE_TWO);
+
+                       Label* pLabel = new (std::nothrow) Label();
+                       pLabel->Construct(Rectangle(xPos, yPos, bitmapWidth, bitmapHeight), L"");
+                       pLabel->SetName(NO_CONTENTS);
+                       pLabel->SetBackgroundBitmap(*pBitmp);
+
+                       yPos = yPos + bitmapHeight;
+
+                       Label* pLabelNoContents = new (std::nothrow) Label();
+                       pLabelNoContents->Construct(Rectangle(0, yPos, clientRect.width, noContentTextHeight), L"");
+                       pLabelNoContents->SetName(NO_CONTENTS_TEXT);
+                       pLabelNoContents->SetTextColor(textColor);
+                       pLabelNoContents->SetText(labelText);
+
+                       AddControl(*pLabel);
+                       AddControl(*pLabelNoContents);
+               }
+       }
+}
+
+void
+PrivacyForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus)
+{
+       UpdateTableViewAndNoContent();
+       Invalidate(true);
 }
\ No newline at end of file
index b3503ae..b17886a 100644 (file)
@@ -266,7 +266,7 @@ ScreenTypeForm::OnGroupedTableViewItemStateChanged(Tizen::Ui::Controls::GroupedT
        AppAssert(pSceneManager);
 
        PackageAppInfo* pPackageAppInfo = dynamic_cast <PackageAppInfo*>(__pPackageAppInfoList->GetAt(groupIndex));
-       AppLog("AppId [%ls]", pPackageAppInfo->GetAppId().GetPointer());
+       AppLogDebug("AppId [%ls]", pPackageAppInfo->GetAppId().GetPointer());
 
        String screenType;
        if (GetWallpaperIndex() == 0)
@@ -381,28 +381,28 @@ ScreenTypeForm::InitPackageInfoList(void)
        __pPackageAppInfoList = pPackageManager->GetPackageAppInfoListN(packageAppFilterMap);
 
 #if 1 // temp for debugging
-       AppLog("Package app filter = [%ls]", pKey->GetPointer());
+       AppLogDebug("Package app filter = [%ls]", pKey->GetPointer());
 
        if (__pPackageAppInfoList)
        {
                for (int i = 0; i < __pPackageAppInfoList->GetCount(); i++)
                {
-                       PackageAppInfo* pPackageAppInfo = dynamic_cast <PackageAppInfo*>(__pPackageAppInfoList->GetAt(i));
+                       PackageAppInfo* pPackageAppInfo = dynamic_cast<PackageAppInfo*>(__pPackageAppInfoList->GetAt(i));
                        if (pPackageAppInfo)
                        {
-                               AppLog("[%d]-------------------------------------------------------", i+1);
-                               AppLog("AppId [%ls]", pPackageAppInfo->GetAppId().GetPointer());
-                               AppLog("Name [%ls]", pPackageAppInfo->GetAppName().GetPointer());
+                               AppLogDebug("[%d]-------------------------------------------------------", i+1);
+                               AppLogDebug("AppId [%ls]", pPackageAppInfo->GetAppId().GetPointer());
+                               AppLogDebug("Name [%ls]", pPackageAppInfo->GetAppName().GetPointer());
                        }
                        else
                        {
-                               AppLog("pPackageAppInfo is null.");
+                               AppLogDebug("pPackageAppInfo is null.");
                        }
                }
        }
        else
        {
-               AppLog("pList is null.");
+               AppLogDebug("pList is null.");
        }
 #endif
 
@@ -424,7 +424,9 @@ int
 ScreenTypeForm::GetPackageAppInfoListCount(void)
 {
        if(__pPackageAppInfoList)
+       {
                return __pPackageAppInfoList->GetCount();
+       }
 
        return 0;
 }