It is currently June 25th, 2019, 12:24 am

New network options for SysInfo plugin

Changes made during the Rainmeter 3.1 beta cycle.
User avatar
jsmorley
Developer
Posts: 19268
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

New network options for SysInfo plugin

jsmorley » December 22nd, 2013, 4:19 pm

We have added two new SysInfoType option values to the SysInfo plugin.

SysInfoType=LAN_CONNECTIVITY : Checks to see if your computer is connected to a LAN (Local Area Network).

SysInfoType=INTERNET_CONNECTIVITY : Checks to see if your computer is connected to the Internet.

The measure will be set to 1 on success, to -1 on failure.

This can be used to test and react to the state of network connectivity in your skins. Like the Windows notification area icon, it can react to having no network connection at all (LAN) or having no Internet (WAN) connection.

A sample skin to demonstrate:
CheckNetwork_1.0.rmskin

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1

[MeasureNetwork]
Measure=Plugin
Plugin=SysInfo
SysInfoType=LAN_CONNECTIVITY
UpdateDivider=5
IfCondition=MeasureNetwork = -1
IfTrueAction=[!SetOption MeterImage ImageName ErrorNetwork.png][!DisableMeasure MeasureInternet][!UpdateMeter *][!Redraw] 
IfCondition2=MeasureNetwork = 1
IfTrueAction2=[!SetOption MeterImage ImageName NetworkOk.png][!EnableMeasure MeasureInternet][!UpdateMeter *][!Redraw]
IfConditionMode=1

[MeasureInternet]
Measure=Plugin
Plugin=SysInfo
SysInfoType=INTERNET_CONNECTIVITY
UpdateDivider=5
Disabled=1
IfCondition=MeasureInternet = -1
IfTrueAction=[!SetOption MeterImage ImageName ErrorInternet.png][!UpdateMeter *][!Redraw] 
IfCondition2=MeasureInternet = 1
IfTrueAction2=[!SetOption MeterImage ImageName NetworkOk.png][!UpdateMeter *][!Redraw]
IfConditionMode=1

[MeterImage]
Meter=Image
ImagePath=#@#Images\
ImageName=NetworkChecking.png
CheckNetwork.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
Mordasius
Posts: 1059
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: New network options for SysInfo plugin

Mordasius » December 22nd, 2013, 4:35 pm

Whoopee! This will hopefully avoid the stutters and hangs when skins find themselves connected to a LAN but can't get a Ping value or response from Webparser.

My thanks to all involved.
User avatar
jsmorley
Developer
Posts: 19268
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: New network options for SysInfo plugin

jsmorley » December 22nd, 2013, 4:43 pm

Mordasius wrote:Whoopee! This will hopefully avoid the stutters and hangs when skins find themselves connected to a LAN but can't get a Ping value or response from Webparser.

My thanks to all involved.
Yeah, as in that sample skin, you can leave WebParser measures disabled unless the test for "internet" succeeds, and if it doesn't, perhaps react with some error meter.
poiru
Developer
Posts: 2877
Joined: April 17th, 2009, 12:18 pm

Re: New network options for SysInfo plugin

poiru » December 23rd, 2013, 1:14 pm

Note that this feature is supported only on Vista and later (for now, at least).
User avatar
jsmorley
Developer
Posts: 19268
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: New network options for SysInfo plugin

jsmorley » December 23rd, 2013, 5:22 pm

poiru wrote:Note that this feature is supported only on Vista and later (for now, at least).
We have modified the behavior in the latest beta (r2218) so that on a Windows XP system, it will always assume success and return "1". That way skins you distribute won't just consistently misbehave on XP systems.
User avatar
TweaknFreak
Posts: 220
Joined: July 14th, 2012, 7:26 am

Re: New network options for SysInfo plugin

TweaknFreak » June 23rd, 2014, 7:43 am

Good, saves a lot of lines.
Be one of the iNEViTABLES - Storm, Earthquake, Lightning, Flood - and the world will bow down to you.

My current desktop
[hsimg]http://i1313.photobucket.com/albums/t559/TweaknFreak/6-22-20149-46-40PM_zps7bcbc1f6.png[/hsimg]