It is currently April 18th, 2024, 6:08 pm

New network options for SysInfo plugin

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

New network options for SysInfo plugin

Post by jsmorley »

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: 1171
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: New network options for SysInfo plugin

Post by Mordasius »

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: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: New network options for SysInfo plugin

Post by jsmorley »

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: 2872
Joined: April 17th, 2009, 12:18 pm

Re: New network options for SysInfo plugin

Post by poiru »

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

Re: New network options for SysInfo plugin

Post by jsmorley »

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: 217
Joined: July 14th, 2012, 7:26 am

Re: New network options for SysInfo plugin

Post by TweaknFreak »

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]