fix to prevent multiple launch appcontrol. 2.1b_release accepted/tizen_2.1/20130425.023445 submit/tizen_2.1/20130424.223948
authorChangyong Jeon <fin10.jeon@samsung.com>
Mon, 22 Apr 2013 04:28:40 +0000 (13:28 +0900)
committerChangyong Jeon <fin10.jeon@samsung.com>
Mon, 22 Apr 2013 04:30:49 +0000 (13:30 +0900)
Change-Id: I746faa87f892d31d27cc2ebd40e62372f7ae3d66

inc/AccAccountApp.h
inc/AccAccountPresentationModel.h
inc/AccAddForm.h
inc/AccMainForm.h
inc/AccTypes.h
res/screen-density-xhigh/A01_2_title_Icon_none.png [new file with mode: 0755]
src/AccAccountApp.cpp
src/AccAccountPresentationModel.cpp
src/AccAddForm.cpp
src/AccMainForm.cpp

index a4936f9..aa1e94d 100644 (file)
 #define _ACC_ACCOUNT_APP_H_
 
 #include <FApp.h>
-#include <FBase.h>
-#include <FSystem.h>
-#include <FUi.h>
 
 class AccountApp
        : public Tizen::App::UiApp
 {
 public:
-       static Tizen::App::UiApp* CreateInstance(void);
-
        AccountApp(void);
        virtual~AccountApp(void);
 
        virtual bool OnAppInitializing(Tizen::App::AppRegistry& appRegistry);
        virtual bool OnAppInitialized(void);
        virtual bool OnAppTerminating(Tizen::App::AppRegistry& appRegistry, bool forcedTermination = false);
-       virtual void OnForeground(void);
+
+       static Tizen::App::UiApp* CreateInstance(void);
 };
 
 #endif // _ACC_ACCOUNT_APP_H_
index 4151468..617e48b 100644 (file)
@@ -59,6 +59,8 @@ public:
 private:
        result Construct(void);
        void FireAccountChangedEvent(void);
+       Tizen::Graphics::Bitmap* GetBitmapN(const Tizen::Base::String& path) const;
+//     Tizen::Base::String ParseCapability(const Tizen::Base::Collection::IList& capabilityList);
 
        static void CreateInstance(void);
        static void DestroyInstance(void);
index 12b02e0..6d1f5ca 100644 (file)
@@ -35,6 +35,7 @@ class AddForm
        , public Tizen::Ui::Controls::IFormBackEventListener
        , public Tizen::Ui::Controls::ISectionTableViewItemProvider
        , public Tizen::Ui::Controls::ISectionTableViewItemEventListener
+       , public Tizen::Ui::IFocusEventListener
        , public IAccountPresentationModelListener
 {
 
@@ -61,6 +62,8 @@ public:
        virtual void UpdateItem(int sectionIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem *pItem);
        virtual void OnSectionTableViewContextItemActivationStateChanged(Tizen::Ui::Controls::SectionTableView &tableView, int sectionIndex, int itemIndex, Tizen::Ui::Controls::TableViewContextItem *pContextItem, bool activated);
        virtual void OnSectionTableViewItemStateChanged(Tizen::Ui::Controls::SectionTableView &tableView, int sectionIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem *pItem, Tizen::Ui::Controls::TableViewItemStatus status);
+       virtual void OnFocusGained(const Tizen::Ui::Control &source);
+       virtual void OnFocusLost(const Tizen::Ui::Control &source);
        virtual void OnAccountListChanged(void);
 private:
        void SetEmptyPanel(void);
@@ -69,6 +72,7 @@ private:
        AccountPresentationModel* __pPm;
        Tizen::Ui::Controls::SectionTableView* __pSectionTableView;
        Tizen::Ui::Controls::Panel* __pEmptyPanel;
+       bool __isRunningAppControl;
 };
 
 #endif //_ACC_Add_FORM_H_
index f309cd8..d5fa44a 100644 (file)
@@ -35,6 +35,7 @@ class MainForm
        , public Tizen::Ui::IActionEventListener
        , public Tizen::Ui::Controls::ISectionTableViewItemProvider
        , public Tizen::Ui::Controls::ISectionTableViewItemEventListener
+       , public Tizen::Ui::IFocusEventListener
        , public IAccountPresentationModelListener
 {
 public:
@@ -60,6 +61,8 @@ public:
        virtual void UpdateItem(int sectionIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem *pItem);
        virtual void OnSectionTableViewContextItemActivationStateChanged(Tizen::Ui::Controls::SectionTableView &tableView, int sectionIndex, int itemIndex, Tizen::Ui::Controls::TableViewContextItem *pContextItem, bool activated);
        virtual void OnSectionTableViewItemStateChanged(Tizen::Ui::Controls::SectionTableView &tableView, int sectionIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem *pItem, Tizen::Ui::Controls::TableViewItemStatus status);
+       virtual void OnFocusGained(const Tizen::Ui::Control &source);
+       virtual void OnFocusLost(const Tizen::Ui::Control &source);
        virtual void OnAccountListChanged(void);
 private:
        Tizen::Graphics::Bitmap* GetBitmapN(const Tizen::Base::String& imagePath);
@@ -69,6 +72,7 @@ private:
        AccountPresentationModel* __pPm;
        Tizen::Ui::Controls::SectionTableView* __pSectionTableView;
        Tizen::Ui::Controls::Panel* __pEmptyPanel;
+       bool __isRunningAppControl;
 };
 
 #endif //_ACC_MAIN_FORM_H_
index 3c2dbca..48b33c6 100644 (file)
@@ -48,7 +48,8 @@ extern const wchar_t* ID_SCNT_MAIN_FORM_BACK;
 enum AccountInfoType
 {
        ACCOUNT_INFO_TYPE_USER_NAME,
-       ACCOUNT_INFO_TYPE_CAPABILITIES,
+//     ACCOUNT_INFO_TYPE_CAPABILITIES,
+       ACCOUNT_INFO_TYPE_PROVIDER_NAME,
 };
 
 #endif // _ACC_TYPES_H_
diff --git a/res/screen-density-xhigh/A01_2_title_Icon_none.png b/res/screen-density-xhigh/A01_2_title_Icon_none.png
new file mode 100755 (executable)
index 0000000..62d9da1
Binary files /dev/null and b/res/screen-density-xhigh/A01_2_title_Icon_none.png differ
index c172c23..6547b5b 100644 (file)
@@ -19,6 +19,8 @@
  * @brief              This is the implementation file for AccountApp class.
  */
 
+#include <FApp.h>
+#include <FUi.h>
 #include "AccAccountApp.h"
 #include "AccMainForm.h"
 #include "AccMainFrame.h"
 #include "AccAccountPresentationModel.h"
 
 using namespace Tizen::App;
-using namespace Tizen::Base;
-using namespace Tizen::System;
-using namespace Tizen::Ui;
 using namespace Tizen::Ui::Controls;
-using namespace Tizen::Ui::Scenes;
 
 AccountApp::AccountApp(void)
 {
@@ -47,7 +45,7 @@ AccountApp::CreateInstance(void)
 }
 
 bool
-AccountApp::OnAppInitializing(AppRegistry& appRegistry)
+AccountApp::OnAppInitializing(Tizen::App::AppRegistry& appRegistry)
 {
        return true;
 }
@@ -63,40 +61,7 @@ AccountApp::OnAppInitialized(void)
 }
 
 bool
-AccountApp::OnAppTerminating(AppRegistry& appRegistry, bool forcedTermination)
+AccountApp::OnAppTerminating(Tizen::App::AppRegistry& appRegistry, bool forcedTermination)
 {
        return true;
 }
-
-void
-AccountApp::OnForeground(void)
-{
-       // Todo: TBD
-       AppLogDebug("Enter");
-//     AppId appId = AccountPresentationModel::GetInstance()->GetRunningAccountProviderAppId();
-//     if (!appId.IsEmpty())
-//     {
-//             AppManager* pAppManager = AppManager::GetInstance();
-//             if (pAppManager->IsRunning(appId))
-//             {
-//                     result r = AppManager::GetInstance()->LaunchApplication(appId);
-//                     if (IsFailed(r))
-//                     {
-//                             AppLogException("[%s] Failed to launch application", GetErrorMessage(r));
-//                             Form* pForm = GetAppFrame()->GetFrame()->GetCurrentForm();
-//                             pForm->SetEnabled(true);
-//                             pForm->Invalidate(true);
-//                     }
-//             }
-//             else
-//             {
-//                     AccountPresentationModel::GetInstance()->SetRunningAccountProviderAppId(L"");
-//                     Form* pForm = GetAppFrame()->GetFrame()->GetCurrentForm();
-//                     pForm->SetEnabled(true);
-//                     pForm->Invalidate(true);
-//             }
-//     }
-       Form* pForm = GetAppFrame()->GetFrame()->GetCurrentForm();
-       pForm->SetEnabled(true);
-       pForm->Invalidate(true);
-}
index 07ab2b9..29cf773 100644 (file)
@@ -36,53 +36,6 @@ using namespace Tizen::Social;
 
 AccountPresentationModel* AccountPresentationModel::__pInstance = null;
 
-Tizen::Base::String
-ParseCapability(const Tizen::Base::Collection::IList& capabilityList)
-{
-       if (capabilityList.GetCount() == 0)
-       {
-               return L"Signed in";
-       }
-
-       int otherCount = 0;
-       String capability;
-       IEnumerator* pEnum = capabilityList.GetEnumeratorN();
-       while(pEnum->MoveNext() == E_SUCCESS)
-       {
-               String value = *static_cast<String*>(pEnum->GetCurrent());
-
-               if (value.StartsWith(L"http://", 0) && value.Contains(L"/account/capability/"))
-               {
-                       value.Replace(L"http://", L"");
-                       Utility::StringTokenizer tokeneizer(value, L"/");
-                       if (tokeneizer.GetTokenCount() == 4)
-                       {
-                               String token;
-                               tokeneizer.GetNextToken(token);
-                               value.Replace(token, L"");
-                               if (value.StartsWith(L"/account/capability/", 0))
-                               {
-                                       value.Replace(L"/account/capability/", L"");
-                                       AppLogDebug("capability: %ls", value.GetPointer());
-                                       capability.Append(value);
-                                       capability.Append(L" ");
-                                       continue;
-                               }
-                       }
-               }
-
-               capability.Append(L"other");
-               if (otherCount > 0)
-               {
-                       capability.Append(otherCount);
-               }
-               otherCount++;
-               capability.Append(L" ");
-       }
-       delete pEnum;
-       return capability;
-}
-
 AccountPresentationModel::AccountPresentationModel()
        : __pAccountList(null)
        , __pAccountProviderList(null)
@@ -214,14 +167,17 @@ AccountPresentationModel::GetAccountInfo(AccountInfoType type, int index) const
        case ACCOUNT_INFO_TYPE_USER_NAME:
                info = static_cast<Account*>(__pAccountList->GetAt(index))->GetUserName();
                break;
-       case ACCOUNT_INFO_TYPE_CAPABILITIES:
-       {
-               Account* pAccount = static_cast<Account*>(__pAccountList->GetAt(index));
-               IList* pList = pAccount->GetAccountProvider().GetCapabilitiesN();
-               info = ParseCapability(*pList);
-               delete pList;
+//     case ACCOUNT_INFO_TYPE_CAPABILITIES:
+//     {
+//             Account* pAccount = static_cast<Account*>(__pAccountList->GetAt(index));
+//             IList* pList = pAccount->GetAccountProvider().GetCapabilitiesN();
+//             info = ParseCapability(*pList);
+//             delete pList;
+//             break;
+//     }
+       case ACCOUNT_INFO_TYPE_PROVIDER_NAME:
+               info = static_cast<Account*>(__pAccountList->GetAt(index))->GetAccountProvider().GetDisplayName();
                break;
-       }
        default:
                break;
        }
@@ -243,28 +199,7 @@ AccountPresentationModel::GetAccountIconN(int index) const
        AppLogDebug("index: %d", index);
        Account* pAccount = static_cast<Account*>(__pAccountList->GetAt(index));
        String path = pAccount->GetAccountProvider().GetIconPath();
-    Bitmap* pBitmap = null;
-    Image* pImage = new (std::nothrow) Image();
-    pImage->Construct();
-    if (path.EndsWith(L"jpg") || path.EndsWith(L"JPG") || path.EndsWith(L"jpeg") || path.EndsWith(L"JPEG"))
-    {
-       pBitmap = pImage->DecodeN(path, BITMAP_PIXEL_FORMAT_RGB565);
-    }
-    else if (path.EndsWith(L"bmp") || path.EndsWith(L"BMP"))
-    {
-       pBitmap = pImage->DecodeN(path, BITMAP_PIXEL_FORMAT_RGB565);
-    }
-    else if (path.EndsWith(L"png") || path.EndsWith(L"PNG") || path.EndsWith(L"wbmp") || path.EndsWith(L"WBMP"))
-    {
-       pBitmap = pImage->DecodeN(path, BITMAP_PIXEL_FORMAT_ARGB8888);
-    }
-    else if (path.EndsWith(L"gif") || path.EndsWith(L"GIF"))
-    {
-       pBitmap = pImage->DecodeN(path, BITMAP_PIXEL_FORMAT_RGB565);
-    }
-
-    delete pImage;
-    return pBitmap;
+       return GetBitmapN(path);
 }
 
 Tizen::Graphics::Bitmap*
@@ -272,28 +207,7 @@ AccountPresentationModel::GetAccountProviderIconN(int index) const
 {
        AppLogDebug("index: %d", index);
        String path = static_cast<AccountProvider*>(__pAccountProviderList->GetAt(index))->GetIconPath();
-    Bitmap* pBitmap = null;
-    Image* pImage = new (std::nothrow) Image();
-    pImage->Construct();
-    if (path.EndsWith(L"jpg") || path.EndsWith(L"JPG") || path.EndsWith(L"jpeg") || path.EndsWith(L"JPEG"))
-    {
-       pBitmap = pImage->DecodeN(path, BITMAP_PIXEL_FORMAT_RGB565);
-    }
-    else if (path.EndsWith(L"bmp") || path.EndsWith(L"BMP"))
-    {
-       pBitmap = pImage->DecodeN(path, BITMAP_PIXEL_FORMAT_RGB565);
-    }
-    else if (path.EndsWith(L"png") || path.EndsWith(L"PNG") || path.EndsWith(L"wbmp") || path.EndsWith(L"WBMP"))
-    {
-       pBitmap = pImage->DecodeN(path, BITMAP_PIXEL_FORMAT_ARGB8888);
-    }
-    else if (path.EndsWith(L"gif") || path.EndsWith(L"GIF"))
-    {
-       pBitmap = pImage->DecodeN(path, BITMAP_PIXEL_FORMAT_RGB565);
-    }
-
-    delete pImage;
-    return pBitmap;
+       return GetBitmapN(path);
 }
 
 Tizen::App::AppId
@@ -435,3 +349,77 @@ AccountPresentationModel::FireAccountChangedEvent(void)
                delete pEnum;
        }
 }
+
+Tizen::Graphics::Bitmap*
+AccountPresentationModel::GetBitmapN(const Tizen::Base::String& path) const
+{
+       Bitmap* pBitmap = null;
+       Image* pImage = new (std::nothrow) Image();
+       pImage->Construct();
+       if (path.EndsWith(L"jpg") || path.EndsWith(L"JPG") || path.EndsWith(L"jpeg") || path.EndsWith(L"JPEG"))
+       {
+               pBitmap = pImage->DecodeN(path, BITMAP_PIXEL_FORMAT_RGB565);
+       }
+       else if (path.EndsWith(L"bmp") || path.EndsWith(L"BMP"))
+       {
+               pBitmap = pImage->DecodeN(path, BITMAP_PIXEL_FORMAT_RGB565);
+       }
+       else if (path.EndsWith(L"png") || path.EndsWith(L"PNG") || path.EndsWith(L"wbmp") || path.EndsWith(L"WBMP"))
+       {
+               pBitmap = pImage->DecodeN(path, BITMAP_PIXEL_FORMAT_ARGB8888);
+       }
+       else if (path.EndsWith(L"gif") || path.EndsWith(L"GIF"))
+       {
+               pBitmap = pImage->DecodeN(path, BITMAP_PIXEL_FORMAT_RGB565);
+       }
+
+       delete pImage;
+       return pBitmap;
+}
+
+//Tizen::Base::String
+//AccountPresentationModel::ParseCapability(const Tizen::Base::Collection::IList& capabilityList)
+//{
+//     if (capabilityList.GetCount() == 0)
+//     {
+//             return L"Signed in";
+//     }
+//
+//     int otherCount = 0;
+//     String capability;
+//     IEnumerator* pEnum = capabilityList.GetEnumeratorN();
+//     while(pEnum->MoveNext() == E_SUCCESS)
+//     {
+//             String value = *static_cast<String*>(pEnum->GetCurrent());
+//
+//             if (value.StartsWith(L"http://", 0) && value.Contains(L"/account/capability/"))
+//             {
+//                     value.Replace(L"http://", L"");
+//                     Utility::StringTokenizer tokeneizer(value, L"/");
+//                     if (tokeneizer.GetTokenCount() == 4)
+//                     {
+//                             String token;
+//                             tokeneizer.GetNextToken(token);
+//                             value.Replace(token, L"");
+//                             if (value.StartsWith(L"/account/capability/", 0))
+//                             {
+//                                     value.Replace(L"/account/capability/", L"");
+//                                     AppLogDebug("capability: %ls", value.GetPointer());
+//                                     capability.Append(value);
+//                                     capability.Append(L" ");
+//                                     continue;
+//                             }
+//                     }
+//             }
+//
+//             capability.Append(L"other");
+//             if (otherCount > 0)
+//             {
+//                     capability.Append(otherCount);
+//             }
+//             otherCount++;
+//             capability.Append(L" ");
+//     }
+//     delete pEnum;
+//     return capability;
+//}
index c002cbd..95fc74c 100644 (file)
@@ -34,6 +34,7 @@ AddForm::AddForm(void)
        : __pPm(null)
        , __pSectionTableView(null)
        , __pEmptyPanel(null)
+       , __isRunningAppControl(false)
 {
 }
 
@@ -50,6 +51,8 @@ AddForm::Initialize()
 result
 AddForm::OnInitializing(void)
 {
+       AppLogDebug("ENTER");
+       AddFocusEventListener(*this);
        SetFormBackEventListener(this);
 
        __pPm = AccountPresentationModel::GetInstance();
@@ -64,6 +67,7 @@ AddForm::OnInitializing(void)
 result
 AddForm::OnTerminating(void)
 {
+       AppLogDebug("ENTER");
        return E_SUCCESS;
 }
 
@@ -107,11 +111,6 @@ void
 AddForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)
 {
        AppLogDebug("ENTER");
-       if (!IsEnabled())
-       {
-               SetEnabled(true);
-       }
-
        __pPm->AddAccountChangedEventListener(*this);
        __pSectionTableView->UpdateTableView();
        if (__pSectionTableView->GetSectionCount() == 0)
@@ -145,17 +144,19 @@ AddForm::CreateItem(int sectionIndex, int itemIndex, int itemWidth)
        Panel* pPanel = new (std::nothrow) Panel();
        pPanel->Construct(IDL_PANEL_SINGLE_LINE_ITEM);
 
-       Label* pMainLabel = static_cast<Label*>(pPanel->GetControl(L"IDC_LABEL_MAIN_TEXT"));
+       Label* pMainLabel = static_cast<Label*>(pPanel->GetControl(IDC_LABEL_MAIN_TEXT));
        pMainLabel->SetText(__pPm->GetAccountProviderName(itemIndex));
 
        Bitmap* pIcon = __pPm->GetAccountProviderIconN(itemIndex);
-       if (pIcon)
+       if (!pIcon)
        {
-               Label* pIconLabel = static_cast<Label*>(pPanel->GetControl(L"IDC_LABEL_ICON"));
-               pIconLabel->SetBackgroundBitmap(*pIcon);
-               delete pIcon;
+               pIcon = UiApp::GetInstance()->GetAppResource()->GetBitmapN(L"A01_2_title_Icon_none.png");
        }
 
+       Label* pIconLabel = static_cast<Label*>(pPanel->GetControl(IDC_LABEL_ICON));
+       pIconLabel->SetBackgroundBitmap(*pIcon);
+       delete pIcon;
+
        pItem->AddControl(pPanel);
 
        layout.SetHorizontalFitPolicy(*pPanel, FIT_POLICY_PARENT);
@@ -246,21 +247,22 @@ AddForm::OnSectionTableViewItemStateChanged(Tizen::Ui::Controls::SectionTableVie
        {
        case 0:
        {
-               AppId appId = __pPm->GetAccountProviderAppId(itemIndex);
-               AppControl* pAppControl = AppManager::GetInstance()->FindAppControlN(appId, L"http://tizen.org/appcontrol/operation/account/add");
-               if (pAppControl)
+               if (!__isRunningAppControl)
                {
-                       result r = pAppControl->Start(null, null, null, this);
-                       TryReturnVoid(r == E_SUCCESS, "[%s] Failed to start appcontrol", GetErrorMessage(r));
-                       delete pAppControl;
-
-                       // Todo: TBD
-//                     __pPm->SetRunningAccountProviderAppId(appId);
-                       SetEnabled(false);
-               }
-               else
-               {
-                       AppLogException("[%s] Failed to find appcontrol", GetErrorMessage(GetLastResult()));
+                       AppId appId = __pPm->GetAccountProviderAppId(itemIndex);
+                       AppControl* pAppControl = AppManager::GetInstance()->FindAppControlN(appId, L"http://tizen.org/appcontrol/operation/account/add");
+                       if (pAppControl)
+                       {
+                               result r = pAppControl->Start(null, null, null, this);
+                               delete pAppControl;
+                               TryReturnVoid(r == E_SUCCESS, "[%s] Failed to start appcontrol", GetErrorMessage(r));
+
+                               __isRunningAppControl = true;
+                       }
+                       else
+                       {
+                               AppLogException("[%s] Failed to find appcontrol", GetErrorMessage(GetLastResult()));
+                       }
                }
                break;
        }
@@ -270,6 +272,19 @@ AddForm::OnSectionTableViewItemStateChanged(Tizen::Ui::Controls::SectionTableVie
 }
 
 void
+AddForm::OnFocusGained(const Tizen::Ui::Control &source)
+{
+       AppLogDebug("Enter");
+       __isRunningAppControl = false;
+}
+
+void
+AddForm::OnFocusLost(const Tizen::Ui::Control &source)
+{
+       AppLogDebug("Enter");
+}
+
+void
 AddForm::OnAccountListChanged(void)
 {
        AppLogDebug("Enter");
index 250d6f2..61f2269 100644 (file)
@@ -43,6 +43,7 @@ MainForm::MainForm(void)
        : __pPm(null)
        , __pSectionTableView(null)
        , __pEmptyPanel(null)
+       , __isRunningAppControl(false)
 {
 }
 
@@ -60,8 +61,7 @@ result
 MainForm::OnInitializing(void)
 {
        AppLogDebug("ENTER");
-       result r = E_SUCCESS;
-
+       AddFocusEventListener(*this);
        SetFormBackEventListener(this);
        GetFooter()->AddActionEventListener(*this);
 
@@ -71,7 +71,7 @@ MainForm::OnInitializing(void)
        __pSectionTableView->SetItemProvider(this);
        __pSectionTableView->AddSectionTableViewItemEventListener(*this);
 
-       return r;
+       return E_SUCCESS;
 }
 
 result
@@ -85,11 +85,6 @@ void
 MainForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)
 {
        AppLogDebug("ENTER");
-       if (!IsEnabled())
-       {
-               SetEnabled(true);
-       }
-
        __pPm->AddAccountChangedEventListener(*this);
        __pSectionTableView->UpdateTableView();
        if (__pSectionTableView->GetSectionCount() == 0)
@@ -113,13 +108,16 @@ void
 MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
 {
        AppLogDebug("actionId: %d", actionId);
-       switch(actionId)
+       if (!__isRunningAppControl)
        {
-       case IDA_ADD_ACCOUNT:
-                SceneManager::GetInstance()->GoForward(SceneTransitionId(ID_SCNT_ACCOUNT_ADD));
-               break;
-       default:
-               break;
+               switch(actionId)
+               {
+               case IDA_ADD_ACCOUNT:
+                                SceneManager::GetInstance()->GoForward(SceneTransitionId(ID_SCNT_ACCOUNT_ADD));
+                       break;
+               default:
+                       break;
+               }
        }
 }
 
@@ -139,22 +137,27 @@ MainForm::CreateItem(int sectionIndex, int itemIndex, int itemWidth)
        layout.Construct();
 
        TableViewItem* pItem = new (std::nothrow) TableViewItem();
-       pItem->Construct(layout, Dimension(itemWidth, 112));
+       pItem->Construct(layout, Dimension(itemWidth, 140));
 
        Panel* pPanel = new (std::nothrow) Panel();
-       pPanel->Construct(IDL_PANEL_SINGLE_LINE_ITEM);
+       pPanel->Construct(IDL_PANEL_MULTI_LINE_ITEM);
 
        Label* pMainLabel = static_cast<Label*>(pPanel->GetControl(IDC_LABEL_MAIN_TEXT));
        pMainLabel->SetText(__pPm->GetAccountInfo(ACCOUNT_INFO_TYPE_USER_NAME, itemIndex));
 
+       Label* pSubLabel = static_cast<Label*>(pPanel->GetControl(IDC_LABEL_SUB_TEXT));
+       pSubLabel->SetText(__pPm->GetAccountInfo(ACCOUNT_INFO_TYPE_PROVIDER_NAME, itemIndex));
+
        Bitmap* pIcon = __pPm->GetAccountIconN(itemIndex);
-       if (pIcon)
+       if (!pIcon)
        {
-               Label* pIconLabel = static_cast<Label*>(pPanel->GetControl(IDC_LABEL_ICON));
-               pIconLabel->SetBackgroundBitmap(*pIcon);
-               delete pIcon;
+               pIcon = UiApp::GetInstance()->GetAppResource()->GetBitmapN(L"A01_2_title_Icon_none.png");
        }
 
+       Label* pIconLabel = static_cast<Label*>(pPanel->GetControl(IDC_LABEL_ICON));
+       pIconLabel->SetBackgroundBitmap(*pIcon);
+       delete pIcon;
+
        pItem->AddControl(pPanel);
 
        layout.SetHorizontalFitPolicy(*pPanel, FIT_POLICY_PARENT);
@@ -262,24 +265,25 @@ MainForm::OnSectionTableViewItemStateChanged(Tizen::Ui::Controls::SectionTableVi
        {
        case 0:
        {
-               AppId appId = __pPm->GetAccountAppId(itemIndex);
-               AppControl* pAppControl = AppManager::GetInstance()->FindAppControlN(appId, L"http://tizen.org/appcontrol/operation/account/configure");
-               if (pAppControl)
-               {
-                       HashMap argMap(SingleObjectDeleter);
-                       argMap.Construct();
-                       argMap.Add(new (std::nothrow) String(L"http://tizen.org/appcontrol/data/account/id"), new (std::nothrow) String(Integer::ToString(__pPm->GetAccountId(itemIndex))));
-
-                       result r = pAppControl->Start(null, null, &argMap, null);
-                       TryLog(r == E_SUCCESS, "[%s] Failed to start appcontrol", GetErrorMessage(r));
-                       delete pAppControl;
-
-                       // Todo: TBD
-//                     __pPm->SetRunningAccountProviderAppId(appId);
-               }
-               else
+               if (!__isRunningAppControl)
                {
-                       AppLogException("[%s] Failed to find appcontrol", GetErrorMessage(GetLastResult()));
+                       AppId appId = __pPm->GetAccountAppId(itemIndex);
+                       AppControl* pAppControl = AppManager::GetInstance()->FindAppControlN(appId, L"http://tizen.org/appcontrol/operation/account/configure");
+                       if (pAppControl)
+                       {
+                               HashMap argMap(SingleObjectDeleter);
+                               argMap.Construct();
+                               argMap.Add(new (std::nothrow) String(L"http://tizen.org/appcontrol/data/account/id"), new (std::nothrow) String(Integer::ToString(__pPm->GetAccountId(itemIndex))));
+
+                               result r = pAppControl->Start(null, null, &argMap, null);
+                               delete pAppControl;
+                               TryReturnVoid(r == E_SUCCESS, "[%s] Failed to start appcontrol", GetErrorMessage(r));
+                               __isRunningAppControl = true;
+                       }
+                       else
+                       {
+                               AppLogException("[%s] Failed to find appcontrol", GetErrorMessage(GetLastResult()));
+                       }
                }
                break;
        }
@@ -289,6 +293,19 @@ MainForm::OnSectionTableViewItemStateChanged(Tizen::Ui::Controls::SectionTableVi
 }
 
 void
+MainForm::OnFocusGained(const Tizen::Ui::Control &source)
+{
+       AppLogDebug("Enter");
+       __isRunningAppControl = false;
+}
+
+void
+MainForm::OnFocusLost(const Tizen::Ui::Control &source)
+{
+       AppLogDebug("Enter");
+}
+
+void
 MainForm::OnAccountListChanged(void)
 {
        AppLogDebug("Enter");
@@ -321,7 +338,7 @@ MainForm::RemoveEmptyPanel(void)
 {
        if (__pEmptyPanel)
        {
-               __pSectionTableView->RemoveControl(*__pEmptyPanel);
+               __pSectionTableView->RemoveControl(__pEmptyPanel);
                __pEmptyPanel = null;
        }
 }