kodi
GUIDialogBusy.h
1 /*
2  * Copyright (C) 2005-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include "guilib/GUIDialog.h"
12 
13 class IRunnable;
14 class CEvent;
15 
17 {
18 public:
19  CGUIDialogBusy(void);
20  ~CGUIDialogBusy(void) override;
21  bool OnBack(int actionID) override;
22  void DoProcess(unsigned int currentTime, CDirtyRegionList &dirtyregions) override;
23  void Render() override;
27  bool IsCanceled() { return m_bCanceled; }
28 
37  static bool Wait(IRunnable *runnable, unsigned int displaytime, bool allowCancel);
38 
46  static bool WaitOnEvent(CEvent &event, unsigned int displaytime = 100, bool allowCancel = true);
47 protected:
48  void Open_Internal(bool bProcessRenderLoop, const std::string& param = "") override;
49  bool m_bCanceled;
50  bool m_bLastVisible = false;
51 };
This is an Event class built from a ConditionVariable.
Definition: Event.h:35
Definition: GUIDialogBusy.h:16
Definition: IRunnable.h:11
Definition: GUIDialog.h:35
static bool Wait(IRunnable *runnable, unsigned int displaytime, bool allowCancel)
Wait for a runnable to execute off-thread. Creates a thread to run the given runnable, and while waiting it displays the busy dialog.
Definition: GUIDialogBusy.cpp:62
bool IsCanceled()
set the current progress of the busy operation
Definition: GUIDialogBusy.h:27
static bool WaitOnEvent(CEvent &event, unsigned int displaytime=100, bool allowCancel=true)
Wait on an event while displaying the busy dialog. Throws up the busy dialog after the given time...
Definition: GUIDialogBusy.cpp:74