#include "StSettingScenesList.h"
#include "StTypes.h"
-using namespace Tizen::App;
+
using namespace Tizen::Base;
using namespace Tizen::Graphics;
using namespace Tizen::Locales;
static const int SECOND_CONTROL_ITEM = 1;
static const int SECOND_TEXT_ITEM = 2;
-static int MIN_YEAR = 1980;
-static int MAX_YEAR = 2035;
+static const int MIN_YEAR = 1980;
+static const int MAX_YEAR = 2035;
static const float RESIZE_RATE = 5.5;
static const int DIVIDE_BY_TEN = 10;
-const String MinYearKey("MinYearKey");
-const String MaxYearKey("MaxYearKey");
-
DateTimeForm::DateTimeForm(void)
{
}
CreateHeader(ResourceManager::GetString(L"IDS_ST_BODY_DATE_AND_TIME"));
CreateFooter();
CreateTableView();
- result r = E_FAILURE;
- Tizen::App::AppRegistry* pAppRegistry = App::GetInstance()->GetAppRegistry();
-
- r = pAppRegistry->Get(MinYearKey, MIN_YEAR);
- if (r == E_KEY_NOT_FOUND)
- {
- pAppRegistry->Add(MinYearKey, MIN_YEAR);
- }
-
- r = pAppRegistry->Get(MaxYearKey, MAX_YEAR);
- if (r == E_KEY_NOT_FOUND)
- {
- pAppRegistry->Add(MaxYearKey, MAX_YEAR);
- }
- r = pAppRegistry->Save();
- if (IsFailed(r))
- {
- // Failed to save data to registry
- AppLogDebug("OnInitialized failed to save data to registry with %s", GetErrorMessage(r));
- return E_FAILURE;
- }
AppLogDebug("ENTER");
bool hourFormat = false;
- Tizen::App::AppRegistry* pAppRegistry = App::GetInstance()->GetAppRegistry();
-
EditDate* pEditDate = new (std::nothrow) EditDate();
pEditDate->Construct(Point(0, 0), itemMainText);
pEditDate->SetCurrentDate();
+ int minYear = MIN_YEAR;
+ int maxYear = MAX_YEAR;
+
if (pEditDate->GetYear() < MIN_YEAR)
{
- MIN_YEAR--;
- pAppRegistry->Set(MinYearKey, MIN_YEAR);
- pAppRegistry->Save();
+ minYear = pEditDate->GetYear();
}
if (pEditDate->GetYear() > MAX_YEAR)
{
- MAX_YEAR++;
- pAppRegistry->Set(MaxYearKey, MAX_YEAR);
- pAppRegistry->Save();
+ maxYear = pEditDate->GetYear();
}
- pEditDate->SetYearRange(MIN_YEAR, MAX_YEAR);
+ pEditDate->SetYearRange(minYear, maxYear);
pEditDate->AddDateChangeEventListener(*this);
pEditDate->SetName(L"EditDate");
delete pArgs;
}
}
-}
\ No newline at end of file
+}