X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2FIntEditHomePageForm.cpp;h=88256ae6ae4dd34b8eea75e6d28fb11cf2bc9175;hb=5daa64494242feeca2f97154e9bfc225f85a2867;hp=c5808fe1e9d0f03ed06a30c9de69218199e9c9c6;hpb=24421092b6343b4d23f9ca2bda7595e850bd3c09;p=apps%2Fosp%2FInternet.git diff --git a/src/IntEditHomePageForm.cpp b/src/IntEditHomePageForm.cpp index c5808fe..88256ae 100644 --- a/src/IntEditHomePageForm.cpp +++ b/src/IntEditHomePageForm.cpp @@ -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 // @@ -120,6 +120,11 @@ EditHomePageForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneI void EditHomePageForm::OnFormBackRequested(Form& source) { + ArrayList* pArgList = null; + pArgList = new(std::nothrow) ArrayList(); + pArgList->Construct(); + pArgList->Add(*new(std::nothrow) String(CommonUtil::GetString(L"IDS_BR_SK_CANCEL"))); + SceneManager::GetInstance()->GoBackward(BackwardSceneTransition(), pArgList); } @@ -128,27 +133,29 @@ EditHomePageForm::OnActionPerformed(const Control& source, int actionId) { ArrayList* pArgList = null; pArgList = new(std::nothrow) ArrayList(); + pArgList->Construct(); switch(actionId) { case IDA_BUTTON_DONE: { pArgList->Add(*new(std::nothrow) String(CommonUtil::GetString(L"IDS_BR_SK_DONE"))); String urlText = __pUrlEditField->GetText(); + urlText.Trim(); AppLogDebug("set url text is %ls",urlText.GetPointer()); bool ret = false; bool flag = false; - String firstPattern(L"((https?|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) + String firstPattern(L"((https?|ftp|gopher|telnet|file|notes|ms-help):((//)|(\\\\))+[\w\d:#@%/;$()~_?\+-=\\\.&]*)");//[\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; RegularExpression secondRegex; firstRegex.Construct(firstPattern, REGEX_CASELESS); secondRegex.Construct(secondPattern, REGEX_CASELESS); - Uri uri; - uri.SetUri(urlText); - urlText = uri.GetEncodedString(); +// Uri uri; +// uri.SetUri(urlText); +// urlText = uri.GetEncodedString(); // Match ret = firstRegex.Match(urlText, false); // This returns true value @@ -179,7 +186,7 @@ EditHomePageForm::OnActionPerformed(const Control& source, int actionId) else { // show pop up , not a valid URL - String msg = CommonUtil::GetString(L"IDS_BR_POP_INVALIDADDRESS"); + String msg = CommonUtil::GetString(L"IDS_COM_POP_INVALID_URL"); CreateMessage(msg); } }