Skip to content

Commit

Permalink
Merge pull request xbmc#7678 from xhaggi/gui-reset-progress-dialog-ca…
Browse files Browse the repository at this point in the history
…nceled
  • Loading branch information
jenkins4kodi committed Aug 2, 2015
2 parents c8be951 + bc819fa commit c71aac5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
23 changes: 15 additions & 8 deletions xbmc/dialogs/GUIDialogProgress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,26 @@ using namespace std;
CGUIDialogProgress::CGUIDialogProgress(void)
: CGUIDialogBoxBase(WINDOW_DIALOG_PROGRESS, "DialogProgress.xml")
{
m_bCanceled = false;
m_iCurrent=0;
m_iMax=0;
m_percentage = 0;
m_showProgress = false;
m_bCanCancel = true;
Reset();
}

CGUIDialogProgress::~CGUIDialogProgress(void)
{

}

void CGUIDialogProgress::Reset()
{
CSingleLock lock(m_section);
m_bCanceled = false;
m_iCurrent = 0;
m_iMax = 0;
m_percentage = 0;
m_showProgress = false;
m_bCanCancel = true;
SetInvalid();
}

void CGUIDialogProgress::SetCanCancel(bool bCanCancel)
{
CSingleLock lock(m_section);
Expand All @@ -58,7 +65,7 @@ void CGUIDialogProgress::SetCanCancel(bool bCanCancel)

void CGUIDialogProgress::Open()
{
CLog::Log(LOGDEBUG, "DialogProgress::StartModal called %s", m_active ? "(already running)!" : "");
CLog::Log(LOGDEBUG, "DialogProgress::Open called %s", m_active ? "(already running)!" : "");

{
CSingleLock lock(g_graphicsContext);
Expand Down Expand Up @@ -101,7 +108,7 @@ bool CGUIDialogProgress::OnMessage(CGUIMessage& message)
{

case GUI_MSG_WINDOW_DEINIT:
SetCanCancel(true);
Reset();
break;

case GUI_MSG_CLICKED:
Expand Down
3 changes: 3 additions & 0 deletions xbmc/dialogs/GUIDialogProgress.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,7 @@ class CGUIDialogProgress :
int m_iMax;
int m_percentage;
bool m_showProgress;

private:
void Reset();
};

0 comments on commit c71aac5

Please sign in to comment.