UIProgressDialog.h revision 0cec432d9663133d971451c30d969c065010e886
/** @file
*
* VBox frontends: Qt4 GUI ("VirtualBox"):
* UIProgressDialog class declaration
*/
/*
* Copyright (C) 2009-2013 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#ifndef __UIProgressDialog_h__
#define __UIProgressDialog_h__
/* GUI includes: */
#include "QIDialog.h"
#include "QIWithRetranslateUI.h"
/* Forward declarations: */
/**
* A QProgressDialog enhancement that allows to:
*
* 1) prevent closing the dialog when it has no cancel button;
* 2) effectively track the IProgress object completion (w/o using
* IProgress::waitForCompletion() and w/o blocking the UI thread in any other
* way for too long).
*
* @note The CProgress instance is passed as a non-const reference to the
* constructor (to memorize COM errors if they happen), and therefore must
* not be destroyed before the created UIProgressDialog instance is
* destroyed.
*/
{
/* Constructor/destructor: */
/* API: Run stuff: */
int run(int aRefreshInterval);
/* Helper: Translate stuff: */
void retranslateUi();
/* Helper: Cancel stuff: */
void reject();
/* Handlers: Event processing stuff: */
/* Handlers: */
void sltShowDialog();
void sltCancelOperation();
/* Variables: */
bool m_fCancelEnabled;
const ulong m_cOperations;
bool m_fEnded;
static const char *m_spcszOpDescTpl;
};
#endif /* __UIProgressDialog_h__ */