//
// 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
//
#include <FApp.h>
#include <FUi.h>
+
#include "GlProgressBar.h"
#include "GlResourceManager.h"
#include "GlTypes.h"
using namespace Tizen::Ui;
using namespace Tizen::Ui::Controls;
-GlProgressBar::GlProgressBar(IActionEventListener* listener)
+GlProgressBar::GlProgressBar(IActionEventListener* listener, IPropagatedKeyEventListener* propagatedListener)
: __totalVal(1)
, __curVal(1)
, __pFileProgressingPopup(null)
, __pFileProgressingProgress(null)
, __pFileProgressingHeaderLabel(null)
, __pFileProgressingLabel(null)
+ , __pFileCounterLabel(null)
, __pFileProgressingCancelButton(null)
, __pActionListener(listener)
+ , __pPropagatedListener(propagatedListener)
{
AppLogDebug("ENTER");
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
if (__pFileProgressingPopup != null && r == E_SUCCESS)
{
- __pFileProgressingCancelButton = static_cast< Button* >(__pFileProgressingPopup->GetControl(L"IDC_CANCEL_BUTTON", true));
+
+ __pFileProgressingPopup->SetPropagatedKeyEventListener(__pPropagatedListener);
+
+ __pFileProgressingCancelButton = static_cast<Button*>(__pFileProgressingPopup->GetControl(L"IDC_CANCEL_BUTTON", true));
if (__pFileProgressingCancelButton != null)
{
- __pFileProgressingCancelButton->SetActionId(ACTION_ID_PROGRESSBAR_CANCEL);
+ __pFileProgressingCancelButton->SetActionId(IDA_PROGRESSBAR_CANCEL);
__pFileProgressingCancelButton->AddActionEventListener(*__pActionListener);
__pFileProgressingCancelButton->SetShowState(true);
}
- __pFileProgressingProgress = static_cast< Progress* >(__pFileProgressingPopup->GetControl(L"IDC_PROGRESS_BAR", true));
+ __pFileProgressingProgress = static_cast<Progress*>(__pFileProgressingPopup->GetControl(L"IDC_PROGRESS_BAR", true));
if (__pFileProgressingProgress != null)
{
__pFileProgressingProgress->SetValue(0);
}
- __pFileProgressingHeaderLabel = static_cast< Label* >(__pFileProgressingPopup->GetControl(L"IDC_ANIMATION_HEADER", true));
+ __pFileProgressingHeaderLabel = static_cast<Label*>(__pFileProgressingPopup->GetControl(L"IDC_ANIMATION_HEADER", true));
if (__pFileProgressingHeaderLabel != null)
{
__pFileProgressingHeaderLabel->SetShowState(true);
}
- __pFileProgressingLabel = static_cast< Label* >(__pFileProgressingPopup->GetControl(L"IDC_ANIMATION_LABEL", true));
+ __pFileProgressingLabel = static_cast<Label*>(__pFileProgressingPopup->GetControl(L"IDC_ANIMATION_LABEL", true));
if (__pFileProgressingLabel != null)
{
__pFileProgressingLabel->SetShowState(true);
}
+ __pFileCounterLabel = static_cast<Label*>(__pFileProgressingPopup->GetControl(L"IDC_COUNTER_LABEL", true));
+
+ if (__pFileCounterLabel != null)
+ {
+ __pFileCounterLabel->SetText(L"");
+ __pFileCounterLabel->SetTextColor(CUSTOM_COLOR_GREY);
+ __pFileCounterLabel->SetShowState(true);
+ }
+
}
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
return r;
}
void
-GlProgressBar::ShowFileProgressingPopup(int val, enum FileActionMode action)
+GlProgressBar::ShowFileProgressingPopup(const int val, enum FileActionMode action)
{
AppLogDebug("ENTER");
CreateFileProgressingPopup();
{
if (__pFileProgressingHeaderLabel != null)
{
- switch(action)
+ switch (action)
{
- case FILE_MOVE_ACTION:
+ case FILE_ACTION_MOVE:
__pFileProgressingHeaderLabel->SetText(ResourceManager::GetString(L"IDS_COM_POP_MOVING"));
- break;
- case FILE_DELETE_ACTION:
- __pFileProgressingHeaderLabel->SetText(L"Deleting...");
- break;
+ break;
+
+ case FILE_ACTION_DELETE:
+ __pFileProgressingHeaderLabel->SetText(ResourceManager::GetString(L"IDS_COM_POP_DELETING"));
+ break;
+
+ case FILE_ACTION_COPY:
+ __pFileProgressingHeaderLabel->SetText(ResourceManager::GetString(L"IDS_COM_POP_COPYING_ING"));
+ break;
+
+ case FILE_ACTION_ROTATE:
+ __pFileProgressingHeaderLabel->SetText(ResourceManager::GetString(L"IDS_COM_POP_PROCESSING"));
+ break;
+
default:
break;
}
}
void
-GlProgressBar::IncProgress(int count)
+GlProgressBar::IncProgress(const int count)
{
AppLogDebug("ENTER");
+ String counter;
__curVal = count;
- __pFileProgressingProgress->SetValue( count );
+ __pFileProgressingProgress->SetValue(count);
+
+ counter.Append(count);
+ counter.Append(L"/");
+ counter.Append(__totalVal);
+
+ if (__pFileCounterLabel != null)
+ {
+ __pFileCounterLabel->SetText(counter);
+ __pFileCounterLabel->Invalidate(true);
+ }
+
__pFileProgressingPopup->SetShowState(true);
__pFileProgressingPopup->Show();
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));