Fixed Nabi Issues N_SE-56966,56735
[apps/osp/Internet.git] / src / IntMainForm.cpp
index 45839cc..0005ffc 100644 (file)
@@ -1134,7 +1134,7 @@ MainForm::InitFindWordPanel(void)
                Rectangle pRect = pPanel1->GetBounds();
                pRect.x = pRect.y = 0;
                __pFindWordBgLabel->SetBounds(pRect);
-               Bitmap *pBitmap = CommonUtil::GetNinepatchedBitmapN(L"I01_search_input_field_bg.9.png", __pFindWordBgLabel->GetWidth(), __pFindWordBgLabel->GetHeight());
+               Bitmap *pBitmap = CommonUtil::GetNinepatchedBitmapN(L"I01_search_input_field_bg.#.png", __pFindWordBgLabel->GetWidth(), __pFindWordBgLabel->GetHeight());
                if (pBitmap != null)
                {
                        AppLogDebug("InitFindWordPanel: Coming here");
@@ -1154,7 +1154,7 @@ MainForm::InitFindWordPanel(void)
                        Rectangle pRect = pPanel1->GetBounds();
                        pRect.x = pRect.y = 0;
                        __pFindWordBgLabelRightToLeft->SetBounds(pRect);
-                       Bitmap *pBitmap = CommonUtil::GetNinepatchedBitmapN(L"I01_search_input_field_bg.9.png", __pFindWordBgLabel->GetWidth(), __pFindWordBgLabel->GetHeight());
+                       Bitmap *pBitmap = CommonUtil::GetNinepatchedBitmapN(L"I01_search_input_field_bg.#.png", __pFindWordBgLabel->GetWidth(), __pFindWordBgLabel->GetHeight());
                        if (pBitmap != null)
                        {
                                AppLogDebug("InitFindWordPanel: Coming here");
@@ -2197,8 +2197,22 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
                {
                        String srcUrl = __pHitElementResult->GetAttributeValue(L"src");
                        AppLog("MainForm::OnTouchLongPressed srcUrl is %ls",srcUrl.GetPointer());
-                       LoadUrl(srcUrl);
 
+                       Uri currentUri;
+                       currentUri.SetUri(__pWebViewer->GetUrl());
+
+                       String newUrl;
+                       Uri newUri;
+                       newUri.SetUri(srcUrl);
+                       AppLog("newuri gethost %ls",newUri.GetHost().GetPointer());
+                       if(newUri.GetHost().GetLength() == 0)
+                       {
+                               newUrl = currentUri.GetHost();
+                               newUrl.Append(srcUrl);
+                               srcUrl = newUrl;
+                       }
+
+                       LoadUrl(srcUrl);
                }
        }
        break;
@@ -2969,7 +2983,10 @@ MainForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
        RelayoutControls(false);
        AppLog("ABC: OnSceneActivatedN started exit");
        if(__pWebViewer)
+       {
                AppLog("WebControl's width height %d %d,",__pWebViewer->GetWidth(),__pWebViewer->GetHeight());
+               __pWebViewer->Resume();
+       }
 
 }
 
@@ -3018,6 +3035,10 @@ MainForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
        delete pWebCanvas;
        if(__pAddressbar)
                __pAddressbar->SetShowState(false);
+       if(__pWebViewer)
+       {
+               __pWebViewer->Pause();
+       }
        AppLog("Coming here");
 }
 
@@ -3423,8 +3444,12 @@ MainForm::OnUrlSubmitted(Addressbar& addBar)
        String url = addBar.GetUrl();
        AppLog("MainForm::OnUrlSubmitted url is %ls", url.GetPointer());
 
+
        if(__pFooterUrlField)
+       {
+               AppLog("Position:: %d, %ls",__pFooterUrlField->GetTextLength(),__pFooterUrlField->GetText().GetPointer());
                __pFooterUrlField->SetCursorPosition(__pFooterUrlField->GetTextLength());
+       }
        AddressBarCancelledClicked(*__pAddressbar);
        LoadUrl(url);
 }
@@ -3470,6 +3495,8 @@ MainForm::LoadUrl(String& url)
        ret = firstRegex.Match(url, false); // This returns true value
        flag = secondRegex.Match(url, false);  // Checks whether URL typed is of type  abc.com (i.e without protocol in front of it)
 
+
+
        if (ret == true && __pWebViewer != null)
        {
                SetUrl(url);
@@ -3871,6 +3898,7 @@ MainForm::OnPageTitleReceived(const Tizen::Base::String& title)
 void
 MainForm::UpdateFavicon(void)
 {
+       AppLog("MainForm::UpdateFavicon called");
        bool urlImageType = false;
        String *tempPath = null;
        if(__pWebViewer)
@@ -3908,6 +3936,7 @@ MainForm::UpdateFavicon(void)
 
                        if (pBitmap != null)
                        {
+                               AppLog("__pWindowInfo->pFavicon updating favicon");
                                if (__pWindowInfo->pFavicon != NULL)
                                {
                                        __pWindowInfo->pFavicon = null;
@@ -5597,8 +5626,7 @@ MainForm::ShowIndicatorNotification(const String& messageText, const String& con
        request.SetAlertText(messageText);
        request.SetTitleText(L"");
        request.SetAppMessage(contentPath);
-       request.SetOngoingActivityType(ONGOING_ACTIVITY_TYPE_TEXT);
-       request.SetNotificationStyle(NOTIFICATION_STYLE_THUMBNAIL);
+
        Tizen::App::App* pApp = Tizen::App::App::GetInstance();
        String homePath = pApp->GetAppRootPath();
        String iconPath = homePath + L"res/screen-density-xhigh/Notification_download_complete.png";
@@ -5607,7 +5635,7 @@ MainForm::ShowIndicatorNotification(const String& messageText, const String& con
 
        Tizen::Shell::NotificationManager notiMgr;
        notiMgr.Construct();
-       notiMgr.NotifyOngoingActivity(request);
+       notiMgr.Notify(request);
        AppLogDebug("EXIT: %s", GetErrorMessage(GetLastResult()));
        return;
 }
@@ -5856,7 +5884,10 @@ void MainForm::SetUrl(const String& url)
                                __pAddressbar->SetUrl(__displayUrl);
                }
                if(__pFooterUrlField)
+               {
+                       AppLog("Position:: %d, %ls",__pFooterUrlField->GetTextLength(),__pFooterUrlField->GetText().GetPointer());
                        __pFooterUrlField->SetCursorPosition(__pFooterUrlField->GetTextLength());
+               }
                __pFooterUrlField->Invalidate(false);
                if(__pAddressbar != NULL && __pAddressbar->HasFocus())
                        __pAddressbar->Invalidate(true);