It is currently January 22nd, 2022, 4:42 am

Changing the FileView plugin to support Inline Variables

Report bugs with the Rainmeter application and suggest features.
User avatar
death.crafter
Rainmeter Sage
Posts: 1293
Joined: April 24th, 2021, 8:13 pm

Changing the FileView plugin to support Inline Variables

Post by death.crafter »

This has been on my mind from the beginning of time, we should use give inline variables in FileView plugin. I mean, creating a measure for each info we want to get is redundant. I could try to add those, but if there is a reason you people did not implement this, please let me know.
from the Realm of Death
User avatar
Brian
Developer
Posts: 2329
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: Changing the FileView plugin to support Inline Variables

Post by Brian »

It's not a bad idea really.

The reason it doesn't exist is because the FileVIew plugin was written before the introduction of custom plugin functions.

-Brian
User avatar
death.crafter
Rainmeter Sage
Posts: 1293
Joined: April 24th, 2021, 8:13 pm

Re: Changing the FileView plugin to support Inline Variables

Post by death.crafter »

Brian wrote: December 21st, 2021, 6:22 am It's not a bad idea really.

The reason it doesn't exist is because the FileVIew plugin was written before the introduction of custom plugin functions.

-Brian
Ohh. I will work on adding those then. 👍
from the Realm of Death
User avatar
death.crafter
Rainmeter Sage
Posts: 1293
Joined: April 24th, 2021, 8:13 pm

Re: Changing the FileView plugin to support Inline Variables

Post by death.crafter »

I have some changes in mind. These would require some discussion.

So, first, we implement inline variables, that would work something like this:

New Child Measure Options:
  • GetIcon = 0/1 {This will save the icon in the path specified by IconPath, irrespective of Type.}
New Inline functions:
  • :ItemCount('ExcludeFolders[0?/1]')
  • :Name('ExcludeExtension[0?/1]')
  • :FullPath()
  • :PathToFile('IncludeTerminalBackslash[0/1?]')
  • :ParentDirectory('ExcludeTerminalBackslash[0?/1]')
    Changed PathToFile to ParentDirectory, cause not every child is a file.
  • :Date('Type[Modified?/Created/Accessed]', 'NumericValue(0?/1)')
  • :FolderSize() {Will return size of parent directory}
  • :FileSize('ReturnEmptyStringIfFolder(0?/1)') {Will return 0 or null, depending upon parameter, if indexed item is a folder}
  • :FileType()
  • :Icon() {Will return empty string if GetIcon=0 is used, or Type is not Icon. Or would return IconPath.}
Is there anything there should be added, removed or modified?
Last edited by death.crafter on December 30th, 2021, 9:14 am, edited 12 times in total.
from the Realm of Death
User avatar
death.crafter
Rainmeter Sage
Posts: 1293
Joined: April 24th, 2021, 8:13 pm

Re: Changing the FileView plugin to support Inline Variables

Post by death.crafter »

I just realized that there is nothing that gives the file count or folder count of indexed items, if they are folders. It's not like we absolutely need that, still adding it wouldn't be bad. Or are there complicacies?

Some type like IndexedFolderCount or IndexedFileCount.

Btw, a new type I am planning to add is ItemCount. It will return the count of all items. Currently you have to make two measures for the same, FolderCount and FileCount
from the Realm of Death
User avatar
eclectic-tech
Rainmeter Sage
Posts: 4581
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Changing the FileView plugin to support Inline Variables

Post by eclectic-tech »

death.crafter wrote: December 21st, 2021, 11:20 am I have some changes in mind. These would require some discussion.

So, first, we implement inline variables, that would work something like this:

New Child Measure Options:
  • GetIcon = 0/1 {This will save the icon in the path specified by IconPath, irrespective of Type.}
New Inline functions:
  • :ItemCount('IncludeFolders[0/1?]')
  • :Name('IncludeExtension[0?/1]')
  • :FullPath()
  • :PathToFile('IncludeTerminalBackslash[0/1?]')
  • :Date('Type[Modified?/Created/Accessed]')
  • :Size()
  • :FolderSize() {Will return 0 if indexed item is a file}
  • :FileSize() {Will return 0 if indexed item is a folder}
  • :FileType()
  • :Icon() {Will return empty string if GetIcon=0 is used, or Type is not Icon. Or would return IconPath.}
Is there anything there should be added, removed or modified?
This list seems to handle most items.

The ability to show a particular file or folder at all times IgnoreCount should be an option.

I have been trying to get a feel for how the inline access would work and you seem to have the important values covered.

I look forward to seeing what you can develop. :thumbup:
User avatar
eclectic-tech
Rainmeter Sage
Posts: 4581
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Changing the FileView plugin to support Inline Variables

Post by eclectic-tech »

death.crafter wrote: December 21st, 2021, 8:20 pm I just realized that there is nothing that gives the file count or folder count of indexed items, if they are folders. It's not like we absolutely need that, still adding it wouldn't be bad. Or are there complicacies?

Some type like IndexedFolderCount or IndexedFileCount.
The COUNT was controlled by a value defined in the Parent measure; I used that value to control how the items are displayed. Not being a programmer, how will the number of displayed items be controlled with the changes you are looking to do?
death.crafterBtw, a new type I am planning to add is [Snippet wrote:ItemCount[/Snippet]. It will return the count of all items. Currently you have to make two measures for the same, FolderCount and FileCount
Adding an ItemCount is a good idea.
User avatar
death.crafter
Rainmeter Sage
Posts: 1293
Joined: April 24th, 2021, 8:13 pm

Re: Changing the FileView plugin to support Inline Variables

Post by death.crafter »

eclectic-tech wrote: December 27th, 2021, 1:58 am The ability to show a particular file or folder at all times IgnoreCount should be an option.
But this option is already there isn't it?

Also yes, you HAVE to make a measure for each child item. Inline variables are there so that you don't have to make 10 child measures for each child item.
from the Realm of Death
User avatar
death.crafter
Rainmeter Sage
Posts: 1293
Joined: April 24th, 2021, 8:13 pm

Re: Changing the FileView plugin to support Inline Variables

Post by death.crafter »

eclectic-tech wrote: December 27th, 2021, 2:07 am The COUNT was controlled by a value defined in the Parent measure; I used that value to control how the items are displayed. Not being a programmer, how will the number of displayed items be controlled with the changes you are looking to do?
Ahh no. The FolderCount and FileCount are types that give the counts for the parent measure, that is the items inside the parent directory.

IndexedFolderCount and IndexedFileCount are supposed to give the count of folders or files inside a child directory.

These have nothing to do with Count, that you use to determine how many items you can index at a time. But yes, using ItemCount, you can hide the meters when not in use.
from the Realm of Death
User avatar
death.crafter
Rainmeter Sage
Posts: 1293
Joined: April 24th, 2021, 8:13 pm

Re: Changing the FileView plugin to support Inline Variables

Post by death.crafter »

A new option "IconDirectory".

A new addition to the commands would be,
[!CommandMeasure FileView "ExtractIcon <iconsize> <iconname> filepath"]

iconsize - https://docs.rainmeter.net/manual/plugins/fileview/#IconSize
iconname - a valid file name
filepath - path to folder or file whose icon is to be extracted

The extracted icon will be saved to IconDirectory\iconname.png.

Suggesting this cause sometimes, we want to extract only some icons, but there is no simple way of doing this. Also, there is FileChoose plugin by setsuka, which does thing similar to this.
from the Realm of Death