It is currently March 29th, 2024, 3:14 pm

[!EditSkin config] opening the editor for the currently open variant of the skin if a file isn't provided

Report bugs with the Rainmeter application and suggest features.
User avatar
Yamajac
Posts: 134
Joined: June 30th, 2014, 8:44 am

[!EditSkin config] opening the editor for the currently open variant of the skin if a file isn't provided

Post by Yamajac »

Currently if you provide a skin that is open, you still have to provide a file to be edited. It'd be nice if it would just use the currently open variant, or at least default to the first one.


Image

All that just for this. Worth it.
Last edited by Yamajac on November 18th, 2019, 10:42 pm, edited 1 time in total.
User avatar
Jeff
Posts: 326
Joined: September 3rd, 2018, 11:18 am

Re: [!EditSkin config] opening the editor for the currently open variant of the skin if a file isn't provided

Post by Jeff »

Both the parameters for !EditSkin are optional, shoildn't [!EditSkin] just open the file you have?
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [!EditSkin config] opening the editor for the currently open variant of the skin if a file isn't provided

Post by jsmorley »

Jeff wrote: November 18th, 2019, 11:35 am Both the parameters for !EditSkin are optional, shoildn't [!EditSkin] just open the file you have?
I think what she is suggesting is that if you define a "config", but not a "file", it will use either the currently running .ini file in that config, or if one isn't running, the "first" variant in that config folder. Sorry, but this is not likely to happen.
User avatar
Jeff
Posts: 326
Joined: September 3rd, 2018, 11:18 am

Re: [!EditSkin config] opening the editor for the currently open variant of the skin if a file isn't provided

Post by Jeff »

jsmorley wrote: November 18th, 2019, 11:41 am the "first" variant in that config folder.
Oh, just edit the only .ini in the fo-
*multiple .inis exist in the folder*
I see the problem
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [!EditSkin config] opening the editor for the currently open variant of the skin if a file isn't provided

Post by jsmorley »

!EditSkin has two forms. 1) You can use NO parameters, and it will edit the .ini file for the skin it is running in. 2) You can define BOTH the "config" and "file" to edit any other skin you have. !EditSkin has no concept of, or ability to know, what .ini files are or are not in any config folder other than its own, nor what other skin is "running" or not. Defining "config" without "file" just generates an error.

Many bangs in Rainmeter have an optional "config" parameter. What happens in that case is that the bang is in effect passed off to the running skin defined by "config", and that skin does the processing of the bang. This only works if the defined config does in fact have a skin that is currently running. It's a hand-off, with Skin A asking Rainmeter to tell Skin B "Hey, run this bang would you?".

While I could make an argument that !EditSkin could work that way as well, it's just so much a "nice to have", that I don't see it in the near term. In any case, there is no way "variants" would ever play a role in this. Just define the "config" and the "file".
User avatar
Yamajac
Posts: 134
Joined: June 30th, 2014, 8:44 am

Re: [!EditSkin config] opening the editor for the currently open variant of the skin if a file isn't provided

Post by Yamajac »

jsmorley wrote: November 18th, 2019, 12:04 pm !EditSkin has two forms. 1) You can use NO parameters, and it will edit the .ini file for the skin it is running in. 2) You can define BOTH the "config" and "file" to edit any other skin you have. !EditSkin has no concept of, or ability to know, what .ini files are or are not in any config folder other than its own, nor what other skin is "running" or not. Defining "config" without "file" just generates an error.

Many bangs in Rainmeter have an optional "config" parameter. What happens in that case is that the bang is in effect passed off to the running skin defined by "config", and that skin does the processing of the bang. This only works if the defined config does in fact have a skin that is currently running. It's a hand-off, with Skin A asking Rainmeter to tell Skin B "Hey, run this bang would you?".

While I could make an argument that !EditSkin could work that way as well, it's just so much a "nice to have", that I don't see it in the near term. In any case, there is no way "variants" would ever play a role in this. Just define the "config" and the "file".
I'd be using this in my RainManager skin and getting the currently active .ini file with a fileview measure would add unnecessary latency on opening the context menu, so I'd have to build a whole skin indexer, which I'm planning to do anyway but it would still have responsiveness issues with potentially opening the wrong file if you just switched variants.. Anyway that's a tangent.

Looking at the source, it seems like an extremely simple thing to make !EditSkin pass the bang off to the currently active skin. I've never contributed to a project on Github that wasn't my own personal stuff, but if I were to figure out how all that stuff works, is that the kinda thing that would get approved? Or would I just be wasting my time figuring it out and getting set up for C++ again for something that won't make it in anyway lol.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [!EditSkin config] opening the editor for the currently open variant of the skin if a file isn't provided

Post by jsmorley »

I don't have any problem with the principle of making the "config" parameter for !EditSkin, when used alone, with no "file" parameter, behave the same as many other bangs do. What that would mean is that the config parameter would be passed off to the RUNNING config in question, and then it would open "itself" for editing. Same behavior as no config or file with the bang in the current skin.

If there are both config and file parameters, it should behave EXACTLY as it does now.

I would not be interested in having it try to open anything in a config that isn't running, and it should not try to figure out or manage anything having to do with "variants" in a config folder. The only way it opens a .ini file that isn't running is by explicitly specifying the config and file.

If you can do a fork of Rainmeter, make the change, ensure that 1) it has no conflicts with the current codebase, and 2) that is has no backwards compatibility issues, then I don't see any reason why we wouldn't merge a pull request from you on this.

I think the concept is perfectly reasonable, and not inconsistent with current bang behavior. We welcome help with the code, as long as the principles that Rainmeter is designed around are followed. I also caution that my opinion is just my opinion. We operate on a "consensus" basis, and if any of the folks who work on the project have heartburn with this, that would effectively end it.
User avatar
Yamajac
Posts: 134
Joined: June 30th, 2014, 8:44 am

Re: [!EditSkin config] opening the editor for the currently open variant of the skin if a file isn't provided

Post by Yamajac »

jsmorley wrote: November 18th, 2019, 6:46 pm I don't have any problem with the principle of making the "config" parameter for !EditSkin, when used alone, with no "file" parameter, behave the same as many other bangs do. What that would mean is that the config parameter would be passed off to the RUNNING config in question, and then it would open "itself" for editing.

If you can do a fork of Rainmeter, make the change, ensure that 1) it has no conflicts with the current codebase, and 2) that is has no backwards compatibility issues, then I don't see any reason why we wouldn't merge a pull request from you on this.
Awesome. Rainmeter code looks pretty damn clean so should be simple enough, I'll figure out how all the fork/pull stuff works and do that later I suppose. Should be a fun learning experience.


Though I've eaten my words before, so we'll see.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [!EditSkin config] opening the editor for the currently open variant of the skin if a file isn't provided

Post by jsmorley »

Yamajac wrote: November 18th, 2019, 7:11 pm Awesome. Rainmeter code looks pretty damn clean so should be simple enough, I'll figure out how all the fork/pull stuff works and do that later I suppose. Should be a fun learning experience.


Though I've eaten my words before, so we'll see.
I wish you well. I'm not the expert on how the code is put together, Brian is much better at that. He might be able to help answer any questions you run into, although I caution that he is very busy just now, and isn't always constantly around.
User avatar
Yamajac
Posts: 134
Joined: June 30th, 2014, 8:44 am

Re: [!EditSkin config] opening the editor for the currently open variant of the skin if a file isn't provided

Post by Yamajac »

jsmorley wrote: November 18th, 2019, 6:46 pm I don't have any problem with the principle of making the "config" parameter for !EditSkin, when used alone, with no "file" parameter, behave the same as many other bangs do. What that would mean is that the config parameter would be passed off to the RUNNING config in question, and then it would open "itself" for editing. Same behavior as no config or file with the bang in the current skin.

If there are both config and file parameters, it should behave EXACTLY as it does now.

I would not be interested in having it try to open anything in a config that isn't running, and it should not try to figure out or manage anything having to do with "variants" in a config folder. The only way it opens a .ini file that isn't running is by explicitly specifying the config and file.

If you can do a fork of Rainmeter, make the change, ensure that 1) it has no conflicts with the current codebase, and 2) that is has no backwards compatibility issues, then I don't see any reason why we wouldn't merge a pull request from you on this.

I think the concept is perfectly reasonable, and not inconsistent with current bang behavior. We welcome help with the code, as long as the principles that Rainmeter is designed around are followed. I also caution that my opinion is just my opinion. We operate on a "consensus" basis, and if any of the folks who work on the project have heartburn with this, that would effectively end it.


O, yea, it'd basically just replace the "There are extra args but they aren't valid" error message. So if there's one arg, and it's a valid skin, it passes the bang to that skin in the same way other bangs would. Then another case gets added to Skin::DoBang() and bippity boppity edit skin works ezpz.

I'd have to actually have it set up in a proper IDE to be 100% sure that it all works as intended with no side effects but from a cursory glance it seems like that'd be all that's required and there shouldn't be any conflicts. So I'll probably send a pull request later today, unless my cursory glance failed me. Which I expect.