mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Rainmeter.stats is now updated periodically only if NetTotal measure has been used in current session.
This commit is contained in:
parent
e14ef154f3
commit
92864ea360
@ -478,6 +478,7 @@ void CMeasureNet::ReadConfig(CConfigParser& parser, const WCHAR* section, NET ne
|
||||
{
|
||||
netName = L"NetTotalSpeed";
|
||||
value = Rainmeter->GetGlobalConfig().netInSpeed + Rainmeter->GetGlobalConfig().netOutSpeed;
|
||||
CSystem::SetNetworkStatisticsTimer();
|
||||
}
|
||||
|
||||
double maxValue = parser.ReadFloat(section, L"MaxValue", -1);
|
||||
|
@ -30,7 +30,8 @@ typedef VOID (NETIOAPI_API_ * FPFREEMIBTABLE)(PVOID Memory);
|
||||
class CMeasureNet : public CMeasure
|
||||
{
|
||||
public:
|
||||
enum NET {
|
||||
enum NET
|
||||
{
|
||||
NET_IN,
|
||||
NET_OUT,
|
||||
NET_TOTAL
|
||||
|
@ -124,7 +124,6 @@ void CSystem::Initialize(HINSTANCE instance)
|
||||
WINEVENT_OUTOFCONTEXT | WINEVENT_SKIPOWNPROCESS);
|
||||
|
||||
SetTimer(c_Window, TIMER_SHOWDESKTOP, INTERVAL_SHOWDESKTOP, NULL);
|
||||
SetTimer(c_Window, TIMER_NETSTATS, INTERVAL_NETSTATS, NULL);
|
||||
SetTimer(c_Window, TIMER_DELETELATER, INTERVAL_DELETELATER, NULL);
|
||||
}
|
||||
|
||||
@ -159,6 +158,11 @@ void CSystem::Finalize()
|
||||
}
|
||||
}
|
||||
|
||||
void CSystem::SetNetworkStatisticsTimer()
|
||||
{
|
||||
static bool set = SetTimer(c_Window, TIMER_NETSTATS, INTERVAL_NETSTATS, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
** MyInfoEnumProc
|
||||
**
|
||||
|
@ -56,6 +56,8 @@ public:
|
||||
static void Initialize(HINSTANCE instance);
|
||||
static void Finalize();
|
||||
|
||||
static void SetNetworkStatisticsTimer();
|
||||
|
||||
static const MULTIMONITOR_INFO& GetMultiMonitorInfo() { return c_Monitors; }
|
||||
static size_t GetMonitorCount();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user