From: Changyong Jeon Date: Mon, 24 Jun 2013 10:14:59 +0000 (+0900) Subject: fix messages for checking version. X-Git-Tag: submit/tizen_2.2/20130714.134432~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=db581523f1a8d91bbd6e0fd907dd4503c943fb3f;p=apps%2Fosp%2FInstaller.git fix messages for checking version. Change-Id: I50c30bdad9a2c4c1803927812379fffdd0ec299d --- diff --git a/Installer/inc/IstPanelFactory.h b/Installer/inc/IstPanelFactory.h deleted file mode 100644 index 3eb43d4..0000000 --- a/Installer/inc/IstPanelFactory.h +++ /dev/null @@ -1,39 +0,0 @@ -// -// Copyright (c) 2012 Samsung Electronics Co., Ltd. -// -// 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 -// -// http://floralicense.org/license/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -/** - *@file IstPanelFactory.h - *@brief This file contains the implementation PanelFactory class, which manages - * all the panels of the application. - */ - -#ifndef _IST_PANEL_FACTORY_H_ -#define _IST_PANEL_FACTORY_H_ - -#include -#include - -class PanelFactory - : public Tizen::Ui::Scenes::IPanelFactory -{ -public: - PanelFactory(void); - virtual ~PanelFactory(void); - - virtual Tizen::Ui::Controls::Panel* CreatePanelN(const Tizen::Base::String& panelId, const Tizen::Ui::Scenes::SceneId& sceneId); -}; - -#endif /* _IST_PANEL_FACTORY_H_ */ diff --git a/Installer/res/screen-size-normal/IDL_INSTALLED_POPUP.xml b/Installer/res/screen-size-normal/IDL_INSTALLED_POPUP.xml index ee85236..3523e03 100644 --- a/Installer/res/screen-size-normal/IDL_INSTALLED_POPUP.xml +++ b/Installer/res/screen-size-normal/IDL_INSTALLED_POPUP.xml @@ -4,7 +4,7 @@ --> - + @@ -12,32 +12,32 @@ - - + + diff --git a/Installer/res/screen-size-normal/IDL_PANEL_BACKGROUND_BUTTON_ITEM.xml b/Installer/res/screen-size-normal/IDL_PANEL_BACKGROUND_BUTTON_ITEM.xml index 5a83594..942f9ed 100644 --- a/Installer/res/screen-size-normal/IDL_PANEL_BACKGROUND_BUTTON_ITEM.xml +++ b/Installer/res/screen-size-normal/IDL_PANEL_BACKGROUND_BUTTON_ITEM.xml @@ -4,7 +4,7 @@ --> - + @@ -12,7 +12,7 @@ diff --git a/Installer/res/screen-size-normal/IDL_PANEL_EXPANDABLE_ITEM.xml b/Installer/res/screen-size-normal/IDL_PANEL_EXPANDABLE_ITEM.xml index c5274a4..03ab45a 100644 --- a/Installer/res/screen-size-normal/IDL_PANEL_EXPANDABLE_ITEM.xml +++ b/Installer/res/screen-size-normal/IDL_PANEL_EXPANDABLE_ITEM.xml @@ -4,7 +4,7 @@ --> - + @@ -17,12 +17,12 @@ diff --git a/Installer/src/InstallerEntry.cpp b/Installer/src/InstallerEntry.cpp index 0135051..6a485f2 100644 --- a/Installer/src/InstallerEntry.cpp +++ b/Installer/src/InstallerEntry.cpp @@ -40,7 +40,7 @@ OspMain(int argc, char* pArgv[]) } result r = Tizen::App::UiApp::Execute(InstallerApp::CreateInstance, &args); - TryLog(r == E_SUCCESS, "[%s] Application execution failed", GetErrorMessage(r)); + AppLogExceptionIf(r != E_SUCCESS, "[%s] Application execution failed", GetErrorMessage(r)); AppLog("Application finished."); return static_cast(r); diff --git a/Installer/src/IstInstalledPopup.cpp b/Installer/src/IstInstalledPopup.cpp index d8c4b0f..962b589 100644 --- a/Installer/src/IstInstalledPopup.cpp +++ b/Installer/src/IstInstalledPopup.cpp @@ -57,7 +57,21 @@ result InstalledPopup::RequestPopup(const Tizen::Base::String& appName, const Tizen::Base::String& installedVersion, const Tizen::Base::String& currentVersion) { - __installMessage.Format(100, L"%ls already had been installed.", appName.GetPointer()); + int compare = currentVersion.CompareTo(installedVersion); + if (compare > 0) + { + __installMessage = L"Older version already exists on phone. Update?"; + } + else if (compare < 0) + { + __installMessage = L"An newer version of this application already exists. Reinstall it with older version?"; + } + else + { + String installMessage = L"%ls already had been installed."; + __installMessage.Format(100, installMessage.GetPointer(), appName.GetPointer()); + } + __versionMessage.Format(100, L"Installed version: %ls\nPackaged version: %ls", installedVersion.GetPointer(), currentVersion.GetPointer()); SetShowState(true); diff --git a/Installer/src/IstInstallerApp.cpp b/Installer/src/IstInstallerApp.cpp index fd3f3a3..0bdf19b 100644 --- a/Installer/src/IstInstallerApp.cpp +++ b/Installer/src/IstInstallerApp.cpp @@ -98,14 +98,26 @@ void InstallerApp::OnAppControlRequestReceived(RequestId reqId, const Tizen::Base::String& operationId, const Tizen::Base::String* pUriData, const Tizen::Base::String* pMimeType, const Tizen::Base::Collection::IMap* pExtraData) { - if (!pUriData || !pUriData->StartsWith(L"file://", 0)) + if (pExtraData) + { + const String* pFilePath = static_cast(pExtraData->GetValue(String(L"http://tizen.org/appcontrol/data/notification"))); + if (pFilePath) + { + __packageFilePath = *pFilePath; + } + } + else if (!pUriData || !pUriData->StartsWith(L"file://", 0)) { AppLogException("Invalid URI date."); return; } + else + { + __packageFilePath = *pUriData; + __packageFilePath.Replace(L"file://", L""); + } - __packageFilePath = *pUriData; - __packageFilePath.Replace(L"file://", L""); + AppLogDebug("file path: %ls", __packageFilePath.GetPointer()); __pPackageInfo = PackageManager::GetInstance()->GetPackageInfoFromFileN(__packageFilePath); - TryLog(GetLastResult() == E_SUCCESS, "[%s] Failed to get package information - %ls", GetErrorMessage(GetLastResult()), __packageFilePath.GetPointer()); + AppLogExceptionIf(GetLastResult() != E_SUCCESS, "[%s] Failed to get package information - %ls", GetErrorMessage(GetLastResult()), __packageFilePath.GetPointer()); } diff --git a/Installer/src/IstMainFrame.cpp b/Installer/src/IstMainFrame.cpp index 68d1f1a..9dfa113 100644 --- a/Installer/src/IstMainFrame.cpp +++ b/Installer/src/IstMainFrame.cpp @@ -27,7 +27,6 @@ #include "IstMainFrame.h" #include "IstInstallerApp.h" #include "IstFormFactory.h" -#include "IstPanelFactory.h" using namespace Tizen::App; using namespace Tizen::App::Package; @@ -56,7 +55,7 @@ MainFrame::OnInitializing(void) { SetBackgroundColor(Color(0, 0, 0, 0)); MessageBox msgBox; - msgBox.Construct(L"Error",L"Can't install the file. Invalid format file.",MSGBOX_STYLE_OK, 5000); + msgBox.Construct(L"Error", L"Can't install the file. Invalid format file.",MSGBOX_STYLE_OK, 5000); int modal; msgBox.ShowAndWait(modal); return E_FAILURE; @@ -64,7 +63,6 @@ MainFrame::OnInitializing(void) SceneManager* pSceneManager = SceneManager::GetInstance(); pSceneManager->RegisterFormFactory(*new (std::nothrow) FormFactory()); - pSceneManager->RegisterPanelFactory(*new (std::nothrow) PanelFactory()); pSceneManager->RegisterScene("workflow"); __pInstalledPopup = new (std::nothrow) InstalledPopup(); diff --git a/Installer/src/IstPanelFactory.cpp b/Installer/src/IstPanelFactory.cpp deleted file mode 100644 index 83ceb2e..0000000 --- a/Installer/src/IstPanelFactory.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// -// Copyright (c) 2012 Samsung Electronics Co., Ltd. -// -// 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 -// -// http://floralicense.org/license/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -/** - *@file IstPanelFactory.cpp - *@brief This file contains the implementation PanelFactory class, which manages - * all the panels of the application. - */ - -#include "IstPanelFactory.h" - -PanelFactory::PanelFactory(void) -{ -} - -PanelFactory::~PanelFactory(void) -{ -} - -Tizen::Ui::Controls::Panel* -PanelFactory::CreatePanelN(const Tizen::Base::String& panelId, const Tizen::Ui::Scenes::SceneId& sceneId) -{ - return null; -}