Page 1 of 1

Help with recycle bin image if condition

Posted: November 25th, 2017, 9:30 pm
by achintyagk
Hi,

I'm trying to make a Recycle Bin skin which changes to reflect how full the bin is. For example, if the recycle bin has items which collectively are equal to or less than 256 MB, I want it to show an image which looks quarter full. If it's less than 512 MB, I want it to show an image which looks half full. If it's less than 768 MB I want it to show a three quarters full recycle bin and if it's above 768 MB, I want it to show a full recycle bin. I've already made the icons in photoshop. I tried if conditions, but they don't seem to work. Can anyone please help?

Here's my code.

Code: Select all

[Rainmeter]
Update=3000

;______________________________;
;-------VARIABLES------;

[Variables]
Imgname=#@#Images\Recycle Bin Empty.png

;______________________________;
;-------MEASURES-------;


[measureBinSize]
; Returns the total size of the Recycle Bin in bytes.
Measure=Plugin
Plugin=RecycleManager.dll
RecycleType=Size
UpdateDivider=3
IfCondition=(MeasureBinSize = 0)
IfTrueAction=[!SetVariable Imgname "#@#Images\Recycle Bin Empty.png"]
IfCondition=(MeasureBinSize > 0) && (MeasureBinSize <= 268435456)
IfTrueAction=[!SetVariable Imgname "#@#Images\Recycle Bin One Quarter.png"]
IfCondition=(MeasureBinSize > 268435456) && (MeasureBinSize <= 536870912)
IfTrueAction=[!SetVariable Imgname "#@#Images\Recycle Bin Half.png"]
IfCondition=(MeasureBinSize > 536870912) && (MeasureBinSize <= 805306368)
IfTrueAction=[!SetVariable Imgname "#@#Images\Recycle Bin Three Quarters.png"]
IfCondition=MeasureBinSize > 805306368
IfTrueAction=[!SetVariable Imgname "#@#Images\Recycle Bin Full.png"]
OnUpdateAction=[!UpdateMeter MeterImage][!Redraw]

[MeterImage]
Meter=Image
ImageName=#Imgname#
H=100
PreserveAspectRatio=1
DynamicVariables=1

Re: Help with recycle bin image if condition

Posted: November 25th, 2017, 9:46 pm
by balala
The IfCondition / IfTrueAction options must be numbered:

Code: Select all

[measureBinSize]
; Returns the total size of the Recycle Bin in bytes.
Measure=Plugin
Plugin=RecycleManager.dll
RecycleType=Size
UpdateDivider=3
IfCondition=(MeasureBinSize = 0)
IfTrueAction=[!SetVariable Imgname "#@#Images\Recycle Bin Empty.png"]
IfCondition2=(MeasureBinSize > 0) && (MeasureBinSize <= 268435456)
IfTrueAction2=[!SetVariable Imgname "#@#Images\Recycle Bin One Quarter.png"]
IfCondition3=(MeasureBinSize > 268435456) && (MeasureBinSize <= 536870912)
IfTrueAction3=[!SetVariable Imgname "#@#Images\Recycle Bin Half.png"]
IfCondition4=(MeasureBinSize > 536870912) && (MeasureBinSize <= 805306368)
IfTrueAction4=[!SetVariable Imgname "#@#Images\Recycle Bin Three Quarters.png"]
IfCondition5=MeasureBinSize > 805306368
IfTrueAction5=[!SetVariable Imgname "#@#Images\Recycle Bin Full.png"]
OnUpdateAction=[!UpdateMeter MeterImage][!Redraw]

Re: Help with recycle bin image if condition

Posted: November 25th, 2017, 10:36 pm
by achintyagk
That worked! Thank you so much!

Re: Help with recycle bin image if condition

Posted: November 26th, 2017, 12:54 am
by achintyagk
Now there's another problem. When I delete 2 files of 200 MB each one by one, it shows the hall full image, as it should, but if I restore only one of the files from the recycle bin, it keeps showing the half full image instead of the quarter full image (since the file size is less than 256). Refreshing doesn't work, and the only way to make it show the correct image is by either restoring or deleting every file from the recycle bin, so that it's empty. Could you help please?

Re: Help with recycle bin image if condition

Posted: November 26th, 2017, 1:09 pm
by balala
achintyagk wrote:When I delete 2 files of 200 MB each one by one, it shows the hall full image, as it should, but if I restore only one of the files from the recycle bin, it keeps showing the half full image instead of the quarter full image (since the file size is less than 256). Refreshing doesn't work, and the only way to make it show the correct image is by either restoring or deleting every file from the recycle bin, so that it's empty. Could you help please?
I'm not entirely sure what's going on, but it seems you're right. If I'm not wrong, a while ago here on the forum we had a post about a bug of the RecycleManager plugin. I can't remember what have I read and now I can't find that post, but I think I've read something like this.
Maybe someone who knows better what's going on, will come to clarify...

Re: Help with recycle bin image if condition

Posted: November 26th, 2017, 1:26 pm
by jsmorley

Re: Help with recycle bin image if condition

Posted: November 26th, 2017, 1:35 pm
by balala
I think this is exactly the post I remember I saw, but couldn't find. Even if I was wrong remembering it was about a bug.... :thumbup:

Re: Help with recycle bin image if condition

Posted: November 26th, 2017, 4:53 pm
by achintyagk
Oh. Thanks anyway! You've both been of immense help! I guess I'll just keep the recycle bin as is. I was wondering why there isn't many recycle bin skins like what I was trying to make. Perhaps this is why? Anyhow, thanks once again!

Re: Help with recycle bin image if condition

Posted: November 26th, 2017, 8:44 pm
by achintyagk
balala wrote:The IfCondition / IfTrueAction options must be numbered:

Code: Select all

[measureBinSize]
; Returns the total size of the Recycle Bin in bytes.
Measure=Plugin
Plugin=RecycleManager.dll
RecycleType=Size
UpdateDivider=3
IfCondition=(MeasureBinSize = 0)
IfTrueAction=[!SetVariable Imgname "#@#Images\Recycle Bin Empty.png"]
IfCondition2=(MeasureBinSize > 0) && (MeasureBinSize <= 268435456)
IfTrueAction2=[!SetVariable Imgname "#@#Images\Recycle Bin One Quarter.png"]
IfCondition3=(MeasureBinSize > 268435456) && (MeasureBinSize <= 536870912)
IfTrueAction3=[!SetVariable Imgname "#@#Images\Recycle Bin Half.png"]
IfCondition4=(MeasureBinSize > 536870912) && (MeasureBinSize <= 805306368)
IfTrueAction4=[!SetVariable Imgname "#@#Images\Recycle Bin Three Quarters.png"]
IfCondition5=MeasureBinSize > 805306368
IfTrueAction5=[!SetVariable Imgname "#@#Images\Recycle Bin Full.png"]
OnUpdateAction=[!UpdateMeter MeterImage][!Redraw]
Just uploaded my skin to DeviantArt! Here it is!

Image