Fixed Nabi Issues N_SE-53372,54974,55228,48389,55044
[apps/osp/Internet.git] / src / IntAddBookmarkForm.cpp
index a3056fd..3f139a4 100644 (file)
@@ -2,7 +2,7 @@
 
 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
 //
-// Licensed under the Flora License, Version 1.0 (the License);
+// Licensed under the Flora License, Version 1.1 (the License);
 // you may not use this file except in compliance with the License.
 // You may obtain a copy of the License at
 //
@@ -43,8 +43,8 @@ using namespace Tizen::Ui::Controls;
 using namespace Tizen::Ui::Scenes;
 
 static const int LIST_ITEM_HEIGHT = 112;
-static const int H_ITEM_HEIGHT = 128;
-static const int H_TITLE_ITEM_HEIGHT = 140;
+static const int H_ITEM_HEIGHT = 112;
+static const int H_TITLE_ITEM_HEIGHT = 144;
 static const wchar_t* IDB_LIST_LEFT_SIDE = L"ListLeftSide.png";
 
 const int AddBookmarkForm::IDA_CREATE_BOOKMARK_FOLDER = 101;
@@ -54,7 +54,8 @@ const int AddBookmarkForm::IDA_LIST_LEFT_SIDE_MARGIN = 104;
 const int AddBookmarkForm::IDA_LIST_LEFT_SIDE_MARGIN_DROPDOWN = 105;
 
 AddBookmarkForm::AddBookmarkForm(void)
-:__folderCount(0)
+:__fontSize(36)
+,__folderCount(0)
 ,__folderName(CommonUtil::GetString(L"IDS_BR_TAB_BOOKMARKS"))
 ,__listHeight(H_TITLE_ITEM_HEIGHT)
 , __oldFolderCount(0)
@@ -71,7 +72,8 @@ AddBookmarkForm::AddBookmarkForm(void)
 ,__titleOnViewDeactivated(L"")
 , __view(L"")
 ,__urlOnViewDeactivated(L"")
-
+, __itemHeight(0)
+, __dropdownItemHeight(0)
 {
 
 }
@@ -104,6 +106,7 @@ AddBookmarkForm::OnInitializing(void)
 
        pHeader = GetHeader();
 
+       SetFormBackEventListener(this);
        if (pHeader != null)
        {
                pHeader->AddActionEventListener(*this);
@@ -116,7 +119,7 @@ AddBookmarkForm::OnInitializing(void)
        {
                return E_FAILURE;
        }
-       __pScrollPanel->SetPageScrollEnabled(true);
+       //__pScrollPanel->SetPageScrollEnabled(true);
        // Title EditField added on the Scroll Panel
        __pEditFieldTitle = static_cast< EditField* >(__pScrollPanel->GetControl(L"IDC_EDITFIELD1"));
 
@@ -158,6 +161,8 @@ AddBookmarkForm::OnInitializing(void)
        r = __pScrollPanel->SetClientAreaHeight(__pList->GetY() + __listHeight);
        ScrollPanelScrollDirection direction = __pScrollPanel->GetScrollDirection();
        AppLogDebug("ScrollDirection = %d SetClientAreaHeight ret = %s value = %d autoresize = %d",direction,GetErrorMessage(r),__pScrollPanel->GetClientAreaBounds().height,__pScrollPanel->IsScrollAreaAutoResizingEnabled());
+       __fontSize = CommonUtil::GetFontSize();
+       __itemHeight = 112 + (__fontSize-44);
        r = E_SUCCESS;
 
        return r;
@@ -206,7 +211,7 @@ AddBookmarkForm::OnActionPerformed(const Control& source, int actionId)
                bool valid = false;
 
 
-               String firstPattern(L"((https?|ftp|gopher|telnet|file|notes|ms-help):((//)|(\\\\))+[\w\d:#@%/;$()~_?\+-=\\\.&]*)");
+               String firstPattern(L"((ftp|gopher|telnet|file|notes|ms-help):((//)|(\\\\))+[\w\d:#@%/;$()~_?\+-=\\\.&]*)");
                String secondPattern(L"^[A-Za-z0-9\.\+-:#@%/;$~?]+\\.[A-Za-z0-9\+-=:#@%/;$~()_?\\\.&]{2,}$");   // Url of type  abc.com (i.e without protocol in front of it)
 
                RegularExpression firstRegex;
@@ -228,19 +233,27 @@ AddBookmarkForm::OnActionPerformed(const Control& source, int actionId)
                }
                else
                {
-                       String tempUrl = L"http://";
-                       tempUrl.Append(Url);
+                       String tempUrl;
+                       if(Url.Contains("http://") == true)
+                       {
+                               tempUrl.Append(Url);
+                       }
+                       else
+                       {
+                               tempUrl = L"http://";
+                               tempUrl.Append(Url);
+                       }
 
-                       if (flag == true)
+                       if(flag == true)
                        {
                                valid = true;
-                               Url= tempUrl ;
+                               Url = tempUrl;
                        }
                }
 
                if (valid == false)
                {
-                       String msg = CommonUtil::GetString(L"IDS_BR_POP_INVALIDADDRESS");
+                       String msg = CommonUtil::GetString(L"IDS_COM_POP_INVALID_URL");
                        CreateMessage(msg);
                }
                else
@@ -284,8 +297,22 @@ AddBookmarkForm::OnActionPerformed(const Control& source, int actionId)
 
                                AppLog("IDA_BUTTON_DONE tempParentId ID is %S",tempParentId.GetPointer());
                                AppLog("IDA_BUTTON_DONE bookMarkID ID is %S",bookMarkID.GetPointer());
+                               String urlText = __pEditFieldUrl->GetText();
+                               String urlWithSlash = L"";
+                               String urlWithoutSlash = L"";
+                               if(urlText.EndsWith(L"/"))
+                               {
+                                       urlWithSlash = urlText;
+                                       urlText.SubString(0,urlText.GetLength()-1,urlWithoutSlash);
+                               }
+                               else
+                               {
+                                       urlWithoutSlash = urlText;
+                                       urlWithSlash = urlWithoutSlash;
+                                       urlWithSlash.Append(L"/");
+                               }
 
-                               if (bookMarkID.CompareTo(tempParentId) == 0 && __pEditFieldUrl->GetText().CompareTo(tempUrl) == 0 && __pEditFieldTitle->GetText().CompareTo(tempTitle) == 0)
+                               if (bookMarkID.CompareTo(tempParentId) == 0 && (urlWithSlash.CompareTo(tempUrl) == 0 || urlWithoutSlash.CompareTo(tempUrl) == 0 )&& __pEditFieldTitle->GetText().CompareTo(tempTitle) == 0)
                                {
                                        pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT));
                                        return;
@@ -298,9 +325,9 @@ AddBookmarkForm::OnActionPerformed(const Control& source, int actionId)
                                }
 
 
-                               if ( exist == true)
+                               if ( exist == true && !(urlWithSlash.CompareTo(tempUrl) == 0 || urlWithoutSlash.CompareTo(tempUrl) == 0 ))
                                {
-                                       String msg = CommonUtil::GetString(L"IDS_BR_POP_BOOKMARK_ALREADY_EXISTS");
+                                       String msg = CommonUtil::GetString(L"IDS_BR_POP_ALREADY_EXISTS");
                                        CreateMessage(msg);
 
                                        AppLogDebug("Bookmark already exists");
@@ -358,7 +385,7 @@ AddBookmarkForm::OnActionPerformed(const Control& source, int actionId)
                                AppLog("AddBookmarkForm::OnActionPerformed does url exist 2");
                                if ( exist  == true)
                                {
-                                       String msg = CommonUtil::GetString(L"IDS_BR_POP_BOOKMARK_ALREADY_EXISTS");
+                                       String msg = CommonUtil::GetString(L"IDS_BR_POP_ALREADY_EXISTS");
                                        CreateMessage(msg);
 
                                        AppLogDebug("Bookmark already exists");
@@ -432,6 +459,30 @@ AddBookmarkForm::OnActionPerformed(const Control& source, int actionId)
 }
 
 void
+AddBookmarkForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
+{
+       SceneManager* pSceneManager = SceneManager::GetInstance();
+
+       if (pSceneManager == null)
+       {
+               return ;
+       }
+
+       if (__pEditFieldTitle != NULL)
+       {
+               __pEditFieldTitle->Clear();
+       }
+
+       if (__pEditFieldUrl != NULL)
+       {
+               __pEditFieldUrl->Clear();
+       }
+
+       pSceneManager->GoBackward(BackwardSceneTransition());
+
+
+}
+void
 AddBookmarkForm::OnListViewItemLongPressed(ListView& listView, int index, int elementId, bool& invokeListViewItemCallback)
 {
        return;
@@ -440,6 +491,7 @@ AddBookmarkForm::OnListViewItemLongPressed(ListView& listView, int index, int el
 void
 AddBookmarkForm::OnListViewItemStateChanged(ListView& listView, int index, int elementId, ListItemStatus status)
 {
+       AppLog("AddBookmarkForm::OnListViewItemStateChanged listitemstatus %d for index",status,index);
        if (__pEditFieldTitle != NULL)
        {
                __pEditFieldTitle->HideKeypad();
@@ -456,7 +508,7 @@ AddBookmarkForm::OnListViewItemStateChanged(ListView& listView, int index, int e
                        AppLog("AddBookmarkForm::OnListViewItemStateChanged false");
                        __showFolderList = true;
                        __pList->UpdateList();
-                       __listHeight = H_TITLE_ITEM_HEIGHT + (__pList->GetItemCount() -1) * H_ITEM_HEIGHT;
+                       __listHeight = __dropdownItemHeight + (__pList->GetItemCount() -1) * __itemHeight;
 
                }
                else
@@ -464,14 +516,17 @@ AddBookmarkForm::OnListViewItemStateChanged(ListView& listView, int index, int e
                        AppLog("AddBookmarkForm::OnListViewItemStateChanged true");
                        __showFolderList = false;
                        __pList->UpdateList();
-                       __listHeight = H_TITLE_ITEM_HEIGHT + (__pList->GetItemCount() - 1) * H_ITEM_HEIGHT;
+                       __listHeight = __dropdownItemHeight + (__pList->GetItemCount() - 1) * __itemHeight;
 
                }
 
        }
        else
        {
+               __pList->SetItemChecked(__selectedIndex,false);
+               __pList->SetItemChecked(index,true);
                __selectedIndex = index;
+
                if (index > 1 && __pList->GetItemCount() != index +1)
                {
                        String parentID = "0";
@@ -486,15 +541,15 @@ AddBookmarkForm::OnListViewItemStateChanged(ListView& listView, int index, int e
                {
                        __folderName = CommonUtil::GetString(L"IDS_BR_TAB_BOOKMARKS") ;
                }
-               __listHeight = H_TITLE_ITEM_HEIGHT + (__pList->GetItemCount()-1) * H_ITEM_HEIGHT;
+               __listHeight = __dropdownItemHeight + (__pList->GetItemCount()-1) * __itemHeight;
                if (__pList->GetItemCount() == index +1)
                {
                        SceneManager::GetInstance()->GoForward(ForwardSceneTransition(IDSCN_CREATE_BOOKMARK_FOLDER, SCENE_TRANSITION_ANIMATION_TYPE_LEFT));
                        return;
                }
 
-               __pList->UpdateList();
-               //              __pList->RefreshList(0, LIST_REFRESH_TYPE_ITEM_MODIFY);
+//             __pList->UpdateList();//removed for issue 53372
+                               __pList->RefreshList(0, LIST_REFRESH_TYPE_ITEM_MODIFY);
 
        }
 
@@ -576,6 +631,8 @@ AddBookmarkForm::CreateItem(int index, int itemWidth)
        DropDownCustomItem* pItem = null;
        Bitmap* pBitmap = null;
        pBitmap = AppResource::GetInstance()->GetBitmapN(IDB_LIST_LEFT_SIDE);
+       const Color ITEM_RADIO_ITEM_BACKGROUND_COLOR = CUSTOM_COLOR_SETTINGS_LISTITEM_RADIO_BACKGROUND;
+       const Color ITEM_BACKGROUND_COLOR_HIGHLIGHTED = CUSTOM_BACKGROUND_COLOR_LISTVIEW_PRESSED_HIGHLIGHTED;
        if(itemWidth == 0)
        {
                itemWidth = __pList->GetWidth();
@@ -593,6 +650,7 @@ AddBookmarkForm::CreateItem(int index, int itemWidth)
                        return null;
                }
 
+               __dropdownItemHeight = 140 + (__fontSize - 44);
                if ( __showFolderList == true )
                {
                        pItem->SetCurState(DROP_DOWN_ITEM_STATE_OPENED);
@@ -602,10 +660,11 @@ AddBookmarkForm::CreateItem(int index, int itemWidth)
                        pItem->SetCurState(DROP_DOWN__ITEM_STATE_CLOSED);
                }
 
+
                pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND);
-               pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND);
-               pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_HIGHLIGHTED, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND);
-               pItem->SetMainText(CommonUtil::GetString(L"IDS_BR_BODY_FOLDER"));
+               pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED, ITEM_BACKGROUND_COLOR_HIGHLIGHTED);
+               pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_HIGHLIGHTED, ITEM_BACKGROUND_COLOR_HIGHLIGHTED);
+               pItem->SetMainText(CommonUtil::GetString(L"IDS_BR_HEADER_FOLDER"));
                pItem->SetSubText(__folderName);
                pItem->Make();
                if (pBitmap != null)
@@ -626,8 +685,8 @@ AddBookmarkForm::CreateItem(int index, int itemWidth)
                if (index == 1)
                {
                        radioItem = new(std::nothrow) RadioCustomItem();
-                       //                      r = radioItem->Construct(GetClientAreaBounds().width, LIST_ITEM_HEIGHT);
-                       r = radioItem->Construct(itemWidth, LIST_ITEM_HEIGHT);
+                       //                      r = radioItem->Construct(GetClientAreaBounds().width, __itemHeight);
+                       r = radioItem->Construct(itemWidth, __itemHeight);
                        if (IsFailed(r))
                        {
                                AppLog("Create Item Failed with error %s", GetErrorMessage(r));
@@ -635,9 +694,13 @@ AddBookmarkForm::CreateItem(int index, int itemWidth)
                                delete pBitmap;
                                return null;
                        }
-                       radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND);
-                       radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND);
-                       radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_HIGHLIGHTED, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND);
+
+                       radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL,ITEM_RADIO_ITEM_BACKGROUND_COLOR);
+                       radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED,ITEM_BACKGROUND_COLOR_HIGHLIGHTED);
+
+//                     radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND);
+//                     radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND);
+//                     radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_HIGHLIGHTED, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND);
                        folderTitle = CommonUtil::GetString(L"IDS_BR_TAB_BOOKMARKS") ;
                        radioItem->SetText(folderTitle);
                }
@@ -649,8 +712,8 @@ AddBookmarkForm::CreateItem(int index, int itemWidth)
                                folderTitle = pBookmark->GetBookmarkTitle();
                        }
                        radioItem = new(std::nothrow) RadioCustomItem();
-                       //                      r = radioItem->Construct(GetClientAreaBounds().width, LIST_ITEM_HEIGHT);
-                       r = radioItem->Construct(itemWidth, LIST_ITEM_HEIGHT);
+                       //                      r = radioItem->Construct(GetClientAreaBounds().width, __itemHeight);
+                       r = radioItem->Construct(itemWidth, __itemHeight);
                        if (IsFailed(r))
                        {
                                AppLog("Create Item Failed with error %s", GetErrorMessage(r));
@@ -659,16 +722,18 @@ AddBookmarkForm::CreateItem(int index, int itemWidth)
                                return null;
                        }
 
-                       radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND);
-                       radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND);
-                       radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_HIGHLIGHTED, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND);
+                       radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL,ITEM_RADIO_ITEM_BACKGROUND_COLOR);
+                       radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED,ITEM_BACKGROUND_COLOR_HIGHLIGHTED);
+//                     radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND);
+//                     radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND);
+//                     radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_HIGHLIGHTED, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND);
                        radioItem->SetText(folderTitle);
                }
                else
                {
                        radioItem = new(std::nothrow) RadioCustomItem();
-                       //                      r = radioItem->Construct(GetClientAreaBounds().width, LIST_ITEM_HEIGHT);
-                       r = radioItem->Construct(itemWidth, LIST_ITEM_HEIGHT);
+                       //                      r = radioItem->Construct(GetClientAreaBounds().width, __itemHeight);
+                       r = radioItem->Construct(itemWidth, __itemHeight);
                        if (IsFailed(r))
                        {
                                AppLog("Create Item Failed with error %s", GetErrorMessage(r));
@@ -676,34 +741,41 @@ AddBookmarkForm::CreateItem(int index, int itemWidth)
                                delete pBitmap;
                                return null;
                        }
-                       //radioItem->AddElement(Rectangle(MARGIN_X, 0, __pList->GetBounds().width, LIST_ITEM_HEIGHT), IDA_FORMAT_STRING1, CommonUtil::GetString(L"IDS_CREATE_NEW_FOLDER"), textsize, Color::GetColor(COLOR_ID_BLACK), Color::GetColor(COLOR_ID_BLACK), Color::GetColor(COLOR_ID_BLACK), true);
+                       //radioItem->AddElement(Rectangle(MARGIN_X, 0, __pList->GetBounds().width, itemHeight), IDA_FORMAT_STRING1, CommonUtil::GetString(L"IDS_CREATE_NEW_FOLDER"), textsize, Color::GetColor(COLOR_ID_BLACK), Color::GetColor(COLOR_ID_BLACK), Color::GetColor(COLOR_ID_BLACK), true);
                        folderTitle = CommonUtil::GetString(L"IDS_BR_OPT_NEW_FOLDER");
-                       radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND);
-                       radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND);
-                       radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_HIGHLIGHTED, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND);
+                       radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL,ITEM_RADIO_ITEM_BACKGROUND_COLOR);
+                       radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED,ITEM_BACKGROUND_COLOR_HIGHLIGHTED);
+//                     radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND);
+//                     radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND);
+//                     radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_HIGHLIGHTED, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND);
                        radioItem->SetText(folderTitle);
 
                }
 
                if (__selectedIndex == index)
                {
-                       radioItem->SetSelected(true);
+//                     radioItem->SetSelected(true);
+                       __pList->SetItemChecked(index,true);
                }
                else
                {
-                       radioItem->SetSelected(false);
+//                     radioItem->SetSelected(false);
+                       __pList->SetItemChecked(index,false);
                }
 
                if(__selectedIndex == 0 && index == 1)
-                       radioItem->SetSelected(true);
-               if (radioItem->GetSelected() == true)
+               {
+//                     radioItem->SetSelected(true);
+                       __pList->SetItemChecked(index,true);
+               }
+               if (__pList->IsItemChecked(index) == true)
                {
                        __folderName = radioItem->GetText();
                }
 
                if (pBitmap != null)
                {
-                       //radioItem->AddElement(Rectangle(0, 0, 10, LIST_ITEM_HEIGHT), IDA_LIST_LEFT_SIDE_MARGIN, *pBitmap, null);
+                       //radioItem->AddElement(Rectangle(0, 0, 10, itemHeight), IDA_LIST_LEFT_SIDE_MARGIN, *pBitmap, null);
                        delete pBitmap;
                }
 
@@ -834,7 +906,7 @@ AddBookmarkForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId
                                return;
                        }
 
-                       if(pWindowInfo->pageTitle.CompareTo(CommonUtil::GetString(L"IDS_BR_BODY_ABOUT_C_BLANK")) != 0)
+                       if(pWindowInfo->pageTitle.CompareTo(CommonUtil::GetString(L"IDS_BR_BODY_BLANK_PAGE")) != 0)
                                pageTitle = pWindowInfo->pageTitle;
 
                        if(pWindowInfo->pageUrl.IsEmpty() == false)
@@ -893,7 +965,10 @@ AddBookmarkForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId
                }
        }
 
-       __pEditFieldTitle->ShowKeypad();
+//     if(__pEditFieldTitle != NULL)
+//     {
+//             __pEditFieldTitle->ShowKeypad();
+//     }
        if ( previousSceneId != IDSCN_CREATE_BOOKMARK_FOLDER )
        {
                if (__pEditFieldTitle != NULL)
@@ -934,10 +1009,20 @@ AddBookmarkForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId
                {
                        __selectedIndex = __folderCount + 1;
                }
-
+               if(__selectedIndex > 1)
+               {
+                       String parentID = L"0";
+                       ArrayList folderList;
+                       BookmarkData* pBookmark = null;
+                       BookmarkPresentationModel::GetInstance()->GetFolder(parentID, 0, __folderCount, folderList);
+                       pBookmark = static_cast<BookmarkData*>(folderList.GetAt(__selectedIndex-2));
+                       if(pBookmark != null)
+                       {
+                               __folderName = pBookmark->GetBookmarkTitle();
+                       }
+               }
        }
 
-
        if (__view == CommonUtil::GetString(L"IDS_COM_SK_ADD")  && previousSceneId == IDSCN_CREATE_BOOKMARK_FOLDER)
        {
 
@@ -985,12 +1070,12 @@ AddBookmarkForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId
        // To disable done button if either of the Title or Url field is empty
        if (title.GetLength() == 0 || url.GetLength() == 0)
        {
-               pHeader->SetButtonEnabled(BUTTON_POSITION_LEFT, false);
+               pHeader->SetButtonEnabled(BUTTON_POSITION_RIGHT, false);
                pHeader->Invalidate(true);
        }
        else
        {
-               pHeader->SetButtonEnabled(BUTTON_POSITION_LEFT, true);
+               pHeader->SetButtonEnabled(BUTTON_POSITION_RIGHT, true);
                pHeader->Invalidate(true);
        }
 
@@ -998,8 +1083,9 @@ AddBookmarkForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId
        {
 
                __pList->UpdateList();
-               __listHeight = H_TITLE_ITEM_HEIGHT + (__pList->GetItemCount() - 1) * H_ITEM_HEIGHT;
+               __listHeight = __dropdownItemHeight + (__pList->GetItemCount() - 1) * __itemHeight;
                __pList->SetBounds(__pList->GetX(),__pList->GetY(),__pList->GetWidth(),__listHeight);
+               AppLog("ListWidth %d",__pList->GetWidth());
        }
 
        Invalidate(true);
@@ -1070,12 +1156,12 @@ AddBookmarkForm::OnTextValueChanged(const Control& source)
        // To disable done button if either of the Title or Url field is empty
        if (title.GetLength() == 0 || url.GetLength() == 0)
        {
-               pHeader->SetButtonEnabled(BUTTON_POSITION_LEFT, false);
+               pHeader->SetButtonEnabled(BUTTON_POSITION_RIGHT, false);
                pHeader->Invalidate(true);
        }
        else
        {
-               pHeader->SetButtonEnabled(BUTTON_POSITION_LEFT, true);
+               pHeader->SetButtonEnabled(BUTTON_POSITION_RIGHT, true);
                pHeader->Invalidate(true);
        }
 
@@ -1097,7 +1183,7 @@ AddBookmarkForm::CreateMessage(String& str)
        pMsgBox = new(std::nothrow) MessageBox;
        if (pMsgBox != null)
        {
-               pMsgBox->Construct(str, L"", MSGBOX_STYLE_OK, 3000);
+               pMsgBox->Construct(L"", str, MSGBOX_STYLE_OK, 3000);
                pMsgBox->ShowAndWait(__modalMsgBoxResult);
                delete pMsgBox;
                pMsgBox = null;
@@ -1119,6 +1205,7 @@ AddBookmarkForm::OnOrientationChanged(const Control& source, OrientationStatus o
        //              __pEditFieldUrl->HideKeypad();
        //      }
 
+       AppLog("AddBookmarkForm::OnOrientationChanged ClientAreaBound %d, %d",GetClientAreaBounds().width,GetClientAreaBounds().height);
        if (orientationStatus == ORIENTATION_STATUS_LANDSCAPE)
        {
                if (__pScrollPanel != null)
@@ -1130,7 +1217,7 @@ AddBookmarkForm::OnOrientationChanged(const Control& source, OrientationStatus o
 
        if (__pList != null)
        {
-               __pList->SetBounds(__pList->GetX(),__pList->GetY(),__pList->GetWidth(),__listHeight);
+               __pList->SetBounds(__pList->GetX(),__pList->GetY(),GetClientAreaBounds().width,__listHeight);
                __pList->UpdateList();
        }
        Invalidate(true);