Fix some display issue and change chargeevent and remove removeallcontrol
authorTaeHo Choi <thanks.choi@samsung.com>
Tue, 2 Apr 2013 06:43:07 +0000 (15:43 +0900)
committerTaeHo Choi <thanks.choi@samsung.com>
Wed, 3 Apr 2013 01:48:04 +0000 (10:48 +0900)
Change-Id: Ib4295ce9ae278baa506a52232dccbedc4d525433
Signed-off-by: TaeHo Choi <thanks.choi@samsung.com>
19 files changed:
inc/StRegionForm.h
inc/StSoundsForm.h
inc/StTimeZoneForm.h
inc/StTypes.h
src/StAboutPhoneForm.cpp
src/StAppSettingForm.cpp
src/StCertificateUserForm.cpp
src/StCertificateUserInstallForm.cpp
src/StDateTimeForm.cpp
src/StFontForm.cpp
src/StKeyboardInfoForm.cpp
src/StLocationHelpForm.cpp
src/StMainMenuForm.cpp
src/StManageApplicationInfoForm.cpp
src/StRegionForm.cpp
src/StSettingsApp.cpp
src/StSoundsForm.cpp
src/StTimeZoneForm.cpp
src/StTypes.cpp

index e752262..0287261 100644 (file)
@@ -67,7 +67,7 @@ public:
        virtual void OnTextValueChangeCanceled(const Tizen::Ui::Control& source){}
 
        virtual void OnKeypadActionPerformed(Tizen::Ui::Control& source, Tizen::Ui::KeypadAction keypadAction);
-       virtual void OnKeypadClosed(Tizen::Ui::Control& source){}
+       virtual void OnKeypadClosed(Tizen::Ui::Control& source);
        virtual void OnKeypadOpened(Tizen::Ui::Control& source){}
        virtual void OnKeypadWillOpen(Tizen::Ui::Control& source){}
        virtual void OnKeypadBoundsChanged(Tizen::Ui::Control& source){}
index f186743..208fdd4 100644 (file)
@@ -67,6 +67,9 @@ public:
        virtual void OnSliderBarMoved(Tizen::Ui::Controls::Slider& source, int value){}
 
 private:
+       void OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs);
+
+private:
        int __currentTableViewList;
 };
 
index 7d0c23c..d1229eb 100644 (file)
@@ -110,7 +110,7 @@ public:
        virtual void OnTextValueChangeCanceled(const Tizen::Ui::Control& source){}
 
        virtual void OnKeypadActionPerformed(Tizen::Ui::Control& source, Tizen::Ui::KeypadAction keypadAction);
-       virtual void OnKeypadClosed(Tizen::Ui::Control& source){}
+       virtual void OnKeypadClosed(Tizen::Ui::Control& source);
        virtual void OnKeypadOpened(Tizen::Ui::Control& source){}
        virtual void OnKeypadWillOpen(Tizen::Ui::Control& source){}
        virtual void OnKeypadBoundsChanged(Tizen::Ui::Control& source){}
index 36d6d07..0e33ee3 100644 (file)
@@ -178,6 +178,7 @@ extern const int RELATIVE_LAYOUT_LEFT_MARGIN;
 extern const int W_DETAIL_ARROW_BUTTON;
 
 extern const int FRFRESH_REQUEST_EVENT;
+extern const int BACK_GROUND_EVENT;
 
 extern const wchar_t* IDB_MAIN_FOLDER_BACKGROUND;
 
index 9e92c46..132a8ef 100644 (file)
@@ -117,8 +117,8 @@ PhoneInfoForm::OnInitializing(void)
        CreateFooter();
        CreateTableView();
 
-       PowerManager::SetBatteryEventListener(static_cast<IBatteryEventListener*>(this));
-       PowerManager::SetChargingEventListener(*(static_cast<IChargingEventListener*>(this)));
+       PowerManager::SetBatteryEventListener(this);
+       PowerManager::AddChargingEventListener(*this);
 
        return E_SUCCESS;
 }
@@ -131,8 +131,8 @@ PhoneInfoForm::OnTerminating(void)
                __pTableView->SetItemProvider(null);
        }
 
-       PowerManager::SetBatteryEventListener(static_cast<IBatteryEventListener*>(null));
-       PowerManager::SetChargingEventListener(*(static_cast<IChargingEventListener*>(null)));
+       PowerManager::SetBatteryEventListener(null);
+       PowerManager::RemoveChargingEventListener(*this);
 
        SetFormBackEventListener(null);
        return E_SUCCESS;
@@ -797,7 +797,7 @@ PhoneInfoForm::UpdateItem(int groupIndex, int itemIndex, Tizen::Ui::Controls::Ta
                                        return;
                                }
 
-                               pFirstLine->SetText(ResourceManager::GetString(L"IDS_ST_BODY_MY_NUMBER"));
+                               pFirstLine->SetText(ResourceManager::GetString(L"IDS_ST_BODY_BATTERY"));
                                pFirstLine->Invalidate(false);
 
                                String batteryPercentage;
@@ -837,7 +837,6 @@ PhoneInfoForm::OnGroupedTableViewGroupItemStateChanged(Tizen::Ui::Controls::Grou
 void
 PhoneInfoForm::OnKeypadClosed(Tizen::Ui::Control& source)
 {
-       SetFocus();
 }
 
 void
@@ -873,9 +872,38 @@ PhoneInfoForm::RefreshTableViewItem(int groupIndex)
 {
        int itemCount = __pTableView->GetItemCountAt(groupIndex);
 
+       bool showEmptyMessageBox = true;
+       int textLength = __pEditField->GetText().GetLength();
+
+       for (int i = 0; i < textLength; i++)
+       {
+               wchar_t element;
+               __pEditField->GetText().GetCharAt(i, element);
+
+               if (element != ISSPACE )
+               {
+                       showEmptyMessageBox = false;
+                       break;
+               }
+       }
+
        for (int count = 0; count < itemCount; count++)
        {
-               __pTableView->RefreshItem(groupIndex, count, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
+               if (count == 0)
+               {
+                       if ((showEmptyMessageBox == true) || (__pEditField->GetText().Equals(L"", false)))
+                       {
+                               AppLogDebug("__pEditField is empty");
+                       }
+                       else
+                       {
+                               __pTableView->RefreshItem(groupIndex, count, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
+                       }
+               }
+               else
+               {
+                       __pTableView->RefreshItem(groupIndex, count, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
+               }
        }
 }
 
@@ -888,6 +916,42 @@ PhoneInfoForm::OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection
        {
                RefreshTableViewItem(0);
        }
+       else if (requestId == BACK_GROUND_EVENT)
+       {
+               String phoneName;
+               if (SettingInfo::GetValue(SETTING_INFO_KEY_DEVICE_NAME, phoneName) != E_SUCCESS)
+               {
+                       AppLogDebug("GetValue Fail ");
+               }
+               else
+               {
+                       if (__pEditField->GetText().IsEmpty() == false)
+                       {
+                               bool showEmptyMessageBox = true;
+                               int textLength = __pEditField->GetText().GetLength();
+
+                               for (int i = 0; i < textLength; i++)
+                               {
+                                       wchar_t element;
+                                       __pEditField->GetText().GetCharAt(i, element);
+
+                                       if (element != ISSPACE )
+                                       {
+                                               showEmptyMessageBox = false;
+                                               break;
+                                       }
+                               }
+
+                               if (showEmptyMessageBox == false)
+                               {
+                                       if (__pEditField->GetText().CompareTo(phoneName))
+                                       {
+                                               SettingInfo::SetValue(SETTING_INFO_KEY_DEVICE_NAME, __pEditField->GetText());
+                                       }
+                               }
+                       }
+               }
+       }
        if (pArgs == null)
        {
                AppLogDebug("pArgs is null");
index f39ebb9..32c636d 100644 (file)
@@ -840,7 +840,12 @@ AppSettingForm::OnTerminating(void)
        }
        else
        {
-               RemoveAllControls();
+               int contorlCount = GetControlCount();
+               for (int i = 0; i < contorlCount; i++)
+               {
+                       RemoveControl(GetControl(0));
+               }
+//             RemoveAllControls();
        }
        RemoveAllGroupItemNodeList();
        RemoveAllItemHashCodeMap();
index 3358708..ad56cb0 100644 (file)
@@ -1,4 +1,4 @@
-//
+//
 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
 //
 // Licensed under the Flora License, Version 1.0 (the License);
@@ -117,10 +117,20 @@ CertificateUserForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previou
 {
        if (__pTableView != null)
        {
-               __pTableView->RemoveAllControls();
+               int tableViewControlCount = __pTableView->GetControlCount();
+               for (int i = 0; i < tableViewControlCount; i++)
+               {
+                       __pTableView->RemoveControl(__pTableView->GetControl(0));
+               }
+//             __pTableView->RemoveAllControls();
                __pTableView = null;
        }
-       RemoveAllControls();
+       int controlCount = GetControlCount();
+       for (int i = 0; i < controlCount; i++)
+       {
+               RemoveControl(GetControl(0));
+       }
+//     RemoveAllControls();
        if ( GetUserCertificateStoreCount() != 0)
        {
                AppLogDebug("GetUserCertificateStoreCount %d", GetUserCertificateStoreCount());
index 748a316..4706420 100644 (file)
@@ -1,4 +1,4 @@
-//
+//
 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
 //
 // Licensed under the Flora License, Version 1.0 (the License);
@@ -83,10 +83,20 @@ CertificateUserInstallForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId&
 
        if (__pTableView != null)
        {
-               __pTableView->RemoveAllControls();
+               int tableViewControlCount = __pTableView->GetControlCount();
+               for (int i = 0; i < tableViewControlCount; i++)
+               {
+                       __pTableView->RemoveControl(__pTableView->GetControl(0));
+               }
+//             __pTableView->RemoveAllControls();
                __pTableView = null;
        }
-       RemoveAllControls();
+       int controlCount = GetControlCount();
+       for (int i = 0; i < controlCount; i++)
+       {
+               RemoveControl(GetControl(0));
+       }
+//     RemoveAllControls();
        if (!IsFailed(__pCertificatePresentationModelInstance->FindUserCertificateToInstallFromStorage()))
        {
                CreateTableView();
index 980609a..4e28063 100644 (file)
@@ -124,6 +124,7 @@ DateTimeForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneI
        bool hourFormat = false;
        __pTableView->UpdateTableView();
        __pTableView->CollapseGroup(ID_GROUP_DATE_AND_TIME_FORMAT_LIST);
+       __pTableView->RefreshItem(ID_GROUP_DATE_AND_TIME_FORMAT, 0, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
 
        if (SettingInfo::GetValue(SETTING_INFO_KEY_LOCALE_UPDATE_AUTO, automaticUpdate) == E_SUCCESS)
        {
@@ -575,6 +576,14 @@ DateTimeForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
                {
                        Rectangle detailArrow;
                        Bitmap* pBitmap = ResourceManager::GetBitmapN(IDB_DETAIL_BUTTON_EXPAND_CLOSED);
+                       if (__pTableView->IsGroupExpanded(ID_GROUP_DATE_AND_TIME_FORMAT_LIST))
+                       {
+                               pBitmap = ResourceManager::GetBitmapN(IDB_DETAIL_BUTTON_EXPAND_OPENED);
+                       }
+                       else
+                       {
+                               pBitmap = ResourceManager::GetBitmapN(IDB_DETAIL_BUTTON_EXPAND_CLOSED);
+                       }
 
                        detailArrow = itemRectangle;
                        detailArrow.y = itemRectangle.y + ((itemHeight - W_DETAIL_ARROW_BUTTON) / DEVIDE_TWO);
index f5324a4..2d81fe6 100644 (file)
@@ -354,6 +354,14 @@ FontForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
                if (groupIndex == ID_GROUP_FONT)
                {
                        pBitmap = ResourceManager::GetBitmapN(IDB_DETAIL_BUTTON_EXPAND_CLOSED);
+                       if (__pTableView->IsGroupExpanded(ID_GROUP_FONT_LIST))
+                       {
+                               pBitmap = ResourceManager::GetBitmapN(IDB_DETAIL_BUTTON_EXPAND_OPENED);
+                       }
+                       else
+                       {
+                               pBitmap = ResourceManager::GetBitmapN(IDB_DETAIL_BUTTON_EXPAND_CLOSED);
+                       }
 
                        detailArrow = itemRectangle;
                        detailArrow.y = itemRectangle.y + ((itemHeight - W_DETAIL_ARROW_BUTTON) / DEVIDE_TWO);
index f359cb0..6a0e409 100644 (file)
@@ -1,4 +1,4 @@
-//
+//
 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
 //
 // Licensed under the Flora License, Version 1.0 (the License);
@@ -106,10 +106,20 @@ KeyboardInfoForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSc
 
        if (__pTableView != null)
        {
-               __pTableView->RemoveAllControls();
+               int tableViewControlCount = __pTableView->GetControlCount();
+               for (int i = 0; i < tableViewControlCount; i++)
+               {
+                       __pTableView->RemoveControl(__pTableView->GetControl(0));
+               }
+//             __pTableView->RemoveAllControls();
                __pTableView = null;
        }
-       RemoveAllControls();
+       int controlCount = GetControlCount();
+       for (int i = 0; i < controlCount; i++)
+       {
+               RemoveControl(GetControl(0));
+       }
+//     RemoveAllControls();
        if (pLangList->GetCount() != 0)
        {
                CreateTableView();
index 2cb5e3c..b6d8bab 100644 (file)
@@ -1,4 +1,4 @@
-//
+//
 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
 //
 // Licensed under the Flora License, Version 1.0 (the License);
@@ -137,14 +137,15 @@ LocationHelpForm::CreateHelpText(const Rectangle& bounds)
 
                AddControl(*pLabel);
 
-               pLabel = new (std::nothrow) Label();
-               pLabel->Construct(HelpContentsRect, itemHelp);
-               pLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
-               pLabel->SetTextVerticalAlignment(ALIGNMENT_TOP);
-               pLabel->SetTextConfig(FONT_SIZE_TITLE_HELP_TEXT, LABEL_TEXT_STYLE_NORMAL);
-               pLabel->SetTextColor(COLOR_HELP_TEXT_TYPE_01);
+               Label* pSecondLabel = new (std::nothrow) Label();
+               pSecondLabel = new (std::nothrow) Label();
+               pSecondLabel->Construct(HelpContentsRect, itemHelp);
+               pSecondLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
+               pSecondLabel->SetTextVerticalAlignment(ALIGNMENT_TOP);
+               pSecondLabel->SetTextConfig(FONT_SIZE_TITLE_HELP_TEXT, LABEL_TEXT_STYLE_NORMAL);
+               pSecondLabel->SetTextColor(COLOR_HELP_TEXT_TYPE_01);
 
-               AddControl(*pLabel);
+               AddControl(*pSecondLabel);
 
                helpTitleRect.y = (HelpContentsRect.y + HelpContentsRect.height);
        }
@@ -203,8 +204,12 @@ LocationHelpForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
 void
 LocationHelpForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus)
 {
-       RemoveAllControls();
-
+       int controlCount = GetControlCount();
+       for (int i = 0; i < controlCount; i++)
+       {
+               RemoveControl(GetControl(0));
+       }
+//     RemoveAllControls();
        CreateHelpTextView();
 }
 
index f71c5bd..8fff822 100644 (file)
@@ -65,6 +65,10 @@ static const int ID_ITEM_CONNECTIVITY_NETWORK = 2;
 static const int ID_ITEM_CONNECTIVITY_NFC = 3;
 static const int ID_GROUP_CONNECTIVITY_ITEM_COUNT = 4;
 
+//static const int ID_GROUP_MODE = 1;
+//static const int ID_ITEM_MODE_FLIGHT_MODE = 0;
+//static const int ID_GROUP_MODE_ITEM_COUNT = 1;
+
 static const int ID_GROUP_PERSONAL = 1;
 static const int ID_ITEM_PERSONAL_HOME_SCREEN = 0;
 static const int ID_ITEM_PERSONAL_LOCK_SCREEN = 1;
@@ -410,7 +414,7 @@ MainMenuForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
                        {
                        case ID_ITEM_PERSONAL_HOME_SCREEN:
                                {
-                                       pBitmap = ResourceManager::GetBitmapN(IDB_WALLPAPER);
+                                       pBitmap = ResourceManager::GetBitmapN(IDB_HOME_SCREEN);
                                        itemText = ResourceManager::GetString(L"IDS_ST_HEADER_HOME_SCREEN");
                                }
                                break;
index cc7aadb..e7564ff 100644 (file)
@@ -155,6 +155,7 @@ ManageApplicationInfoForm::OnTerminating(void)
 
        __pTableView = null;
        SetFormBackEventListener(null);
+       RemoveOrientationEventListener(*this);
        return E_SUCCESS;
 }
 
@@ -658,6 +659,11 @@ ManageApplicationInfoForm::OnGroupedTableViewGroupItemStateChanged(Tizen::Ui::Co
 void
 ManageApplicationInfoForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus)
 {
+       if (__pTableView == null)
+       {
+               AppLogDebug("__pTableView is null");
+               return;
+       }
        __pTableView->RefreshItem(ID_GROUP_APPLICATION_NAME, ID_ITEM_APPLICATION_COMMAND_BUTTON, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
        Invalidate(true);
 }
index 18a7a96..fd6e43f 100644 (file)
@@ -545,4 +545,10 @@ LocaleRegionForm::OnKeypadActionPerformed(Tizen::Ui::Control& source, Tizen::Ui:
        default:
                break;
        }
+}
+
+void
+LocaleRegionForm::OnKeypadClosed(Tizen::Ui::Control& source)
+{
+       __pSearchBar->SetMode(SEARCH_BAR_MODE_NORMAL);
 }
\ No newline at end of file
index d972561..ac2b824 100644 (file)
@@ -22,6 +22,7 @@
 #include "StMainFrame.h"
 #include "StSettingsApp.h"
 #include "StSettingScenesList.h"
+#include "StTypes.h"
 
 using namespace Tizen::App;
 using namespace Tizen::Base;
@@ -31,8 +32,6 @@ using namespace Tizen::Ui;
 using namespace Tizen::Ui::Controls;
 using namespace Tizen::Ui::Scenes;
 
-static const int FRFRESH_REQUEST_EVENT = 9999;
-
 static const wchar_t* APPCONTROL_OPERATION_ID_CONFIGURE_LOCATION = L"http://tizen.org/appcontrol/operation/configure/location";
 static const wchar_t* APPCONTROL_OPERATION_ID_CONFIGURE_BLUETOOTH_VISIBILITY = L"http://tizen.org/appcontrol/operation/configure/bluetooth/visibility";
 static const wchar_t* APPCONTROL_OPERATION_ID_CONFIGURE_FONT_TYPE = L"http://tizen.org/appcontrol/operation/configure/font/type";
@@ -125,6 +124,8 @@ void
 SettingsApp::OnBackground(void)
 {
        AppLogDebug("Background");
+       Form* pCurrentForm = (SceneManager::GetInstance()->GetCurrentScene()->GetForm());
+       pCurrentForm->SendUserEvent(BACK_GROUND_EVENT, null);
 }
 
 void
@@ -205,7 +206,7 @@ SettingsApp::OnAppControlRequestReceived(RequestId reqId, const Tizen::Base::Str
        }
        else if (operationId.CompareTo(APPCONTROL_OPERATION_ID_CONFIGURE_BLUETOOTH_VISIBILITY) == 0)
        {
-               AppLogTag("hwkim","operationId[%ls]", operationId.GetPointer());
+               AppLogDebug("operationId[%ls]", operationId.GetPointer());
                const wchar_t* pSceneName = null;
                ArrayList* pArgs = new (std::nothrow) ArrayList();
                pArgs->Construct();
index 6c37fa8..c4b9087 100644 (file)
@@ -966,4 +966,40 @@ SoundsForm::OnGroupedTableViewContextItemActivationStateChanged(Tizen::Ui::Contr
 void
 SoundsForm::OnGroupedTableViewGroupItemStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status)
 {
+}
+
+void
+SoundsForm::OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs)
+{
+       if (requestId == FRFRESH_REQUEST_EVENT)
+       {
+               if (__pTableView)
+               {
+                       __pTableView->UpdateTableView();
+                       bool itemStatus = false;
+
+                       if (SettingInfo::GetValue(SETTING_INFO_KEY_VIBRATOR, itemStatus) == E_SUCCESS)
+                       {
+                               __pTableView->SetItemChecked(ID_GROUP1, ID_ITEM_MAIN_VIBRATION, itemStatus);
+                       }
+                       if (SettingInfo::GetValue(SETTING_INFO_KEY_SOUND_SILENTMODE, itemStatus) == E_SUCCESS)
+                       {
+                               if (itemStatus == true)
+                               {
+                                       __pTableView->SetItemChecked(ID_GROUP1, ID_ITEM_MAIN_VOLUME, false);
+                                       __pTableView->SetItemEnabled(ID_GROUP2, ID_GROUP2_INDEX1, false);
+                               }
+                               else
+                               {
+                                       __pTableView->SetItemChecked(ID_GROUP1, ID_ITEM_MAIN_VOLUME, true);
+                                       __pTableView->SetItemEnabled(ID_GROUP2, ID_GROUP2_INDEX1, true);
+                               }
+                       }
+               }
+               if (pArgs)
+               {
+                       pArgs->RemoveAll(true);
+                       delete pArgs;
+               }
+       }
 }
\ No newline at end of file
index 7189302..55fed97 100644 (file)
@@ -89,8 +89,6 @@ TimeZoneForm::CreateFooter(void)
        Footer* pFooter = GetFooter();
        AppAssert(pFooter);
 
-       pFooter->SetStyle(FOOTER_STYLE_BUTTON_TEXT);
-
        FooterItem  footerItemName;
        footerItemName.Construct(IDA_FOOTER_ITEM_NAME);
        footerItemName.SetText(ResourceManager::GetString(L"IDS_ST_BODY_NAME"));
@@ -719,6 +717,12 @@ TimeZoneForm::OnKeypadActionPerformed(Tizen::Ui::Control& source, Tizen::Ui::Key
        }
 }
 
+void
+TimeZoneForm::OnKeypadClosed(Tizen::Ui::Control& source)
+{
+       __pSearchBar->SetMode(SEARCH_BAR_MODE_NORMAL);
+}
+
 result
 TiemZoneComparer::Compare(const Tizen::Base::Object& obj1, const Tizen::Base::Object& obj2, int& cmp) const
 {
index aee04d5..3288c9a 100644 (file)
@@ -174,6 +174,7 @@ const int RELATIVE_LAYOUT_LEFT_MARGIN = 116;
 const int W_DETAIL_ARROW_BUTTON = 72;
 
 const int FRFRESH_REQUEST_EVENT = 9999;
+const int BACK_GROUND_EVENT = 9998;
 
 const wchar_t* IDB_MAIN_FOLDER_BACKGROUND = L"T01_main_folder_bg.png";