/* $Id$ */
/** @file
* VBox Qt GUI - UINetworkManagerIndicator stuff implementation.
*/
/*
* Copyright (C) 2012 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.
*/
# include <precomp.h>
#else /* !VBOX_WITH_PRECOMPILED_HEADERS */
/* Local includes: */
# include "UINetworkManagerIndicator.h"
# include "UINetworkRequest.h"
# include "VBoxGlobal.h"
#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
{
/* Assign state icons: */
/* Translate content: */
}
{
/* Make sure network-request is really exists: */
/* Make sure network-request was NOT registered yet: */
/* Append network-request data: */
/* Prepare network-request listeners: */
/* Update appearance: */
}
{
/* Make sure network-request still registered: */
/* Search for network-request index: */
/* Delete corresponding network-request: */
/* Update appearance: */
}
{
/* Make sure that network-request still registered: */
/* Search for network-request index: */
/* Update corresponding network-request data: */
data.bytesReceived = 0;
data.bytesTotal = 0;
/* Update appearance: */
}
{
/* Make sure that network-request still registered: */
/* Update appearance: */
}
{
/* Make sure that network-request still registered: */
/* Search for network-request index: */
/* Update corresponding data: */
/* Update appearance: */
}
{
/* Make sure that network-request still registered: */
/* Update appearance: */
}
{
/* Make sure that network-request still registered: */
/* Search for network-request index: */
/* Update corresponding network-request data: */
/* Update appearance: */
}
{
/* Update appearance: */
}
{
/* Check if there are network-requests at all: */
{
/* Set state to 'idle': */
}
else
{
/* Check if there is at least one failed network-request: */
bool fIsThereAtLeastOneFailedNetworkRequest = false;
{
{
break;
}
}
/* If there it least one failed network-request: */
{
/* Set state to 'error': */
}
else
{
/* Set state to 'loading': */
}
}
/* Update appearance finally: */
}
{
/* First of all, we are hiding LED in case of 'idle' state: */
hide();
/* Prepare description: */
/* Check if there are any network-requests: */
{
/* Prepare table: */
/* Prepare header: */
/* Prepare table body: */
{
tr("(%1 of %2)")
QString strBodyLine(strBodyItem.arg(strNobreak.arg(strDescription)).arg(strNobreak.arg(strStatus)));
strBody += strBodyLine;
}
/* Compose description: */
}
else
strDecription = QString();
/* Set description: */
/* Finally, we are showing LED in case of state is not 'idle': */
show();
}