cleanup the logging a bit.
[vuplus_xbmc] / xbmc / dialogs / GUIDialogBusy.cpp
1 /*
2  *      Copyright (C) 2005-2012 Team XBMC
3  *      http://www.xbmc.org
4  *
5  *  This Program is free software; you can redistribute it and/or modify
6  *  it under the terms of the GNU General Public License as published by
7  *  the Free Software Foundation; either version 2, or (at your option)
8  *  any later version.
9  *
10  *  This Program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  *  GNU General Public License for more details.
14  *
15  *  You should have received a copy of the GNU General Public License
16  *  along with XBMC; see the file COPYING.  If not, see
17  *  <http://www.gnu.org/licenses/>.
18  *
19  */
20
21 #include "GUIDialogBusy.h"
22 #include "guilib/GUIWindowManager.h"
23
24 CGUIDialogBusy::CGUIDialogBusy(void)
25   : CGUIDialog(WINDOW_DIALOG_BUSY, "DialogBusy.xml"), m_bLastVisible(false)
26 {
27   m_loadType = LOAD_ON_GUI_INIT;
28   m_bModal = true;
29 }
30
31 CGUIDialogBusy::~CGUIDialogBusy(void)
32 {
33 }
34
35 void CGUIDialogBusy::Show_Internal()
36 {
37   m_bCanceled = false;
38   m_active = true;
39   m_bModal = true;
40   m_bLastVisible = true;
41   m_closing = false;
42   g_windowManager.RouteToWindow(this);
43
44   // active this window...
45   CGUIMessage msg(GUI_MSG_WINDOW_INIT, 0, 0);
46   OnMessage(msg);
47 }
48
49 void CGUIDialogBusy::DoProcess(unsigned int currentTime, CDirtyRegionList &dirtyregions)
50 {
51   bool visible = g_windowManager.GetTopMostModalDialogID() == WINDOW_DIALOG_BUSY;
52   if(!visible && m_bLastVisible)
53     dirtyregions.push_back(m_renderRegion);
54   m_bLastVisible = visible;
55   CGUIDialog::DoProcess(currentTime, dirtyregions);
56 }
57
58 void CGUIDialogBusy::Render()
59 {
60   if(!m_bLastVisible)
61     return;
62   CGUIDialog::Render();
63 }
64
65 bool CGUIDialogBusy::OnBack(int actionID)
66 {
67   m_bCanceled = true;
68   return true;
69 }