It is currently April 18th, 2024, 1:45 pm

RainRestart

Share and get help with Plugins and Addons
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RainRestart

Post by jsmorley »

By the way, I'd be interested to see how this works with UAC turned on in Vista/Seven. I don't have it turned on... Let's see if anyone has problems with privileges in Vista/Seven.
sgtevmckay

Re: RainRestart

Post by sgtevmckay »

Give me a couple of days, i run both Vist and &, now, and I will need some time. I run my UAC, but will have to turn off the admin Privies, so I need time to sleep and think :roll:
dragonmage
Developer
Posts: 1270
Joined: April 3rd, 2009, 4:31 am
Location: NC, US

Re: RainRestart

Post by dragonmage »

Yes! Ok, I'm gonna try and play with this today.

A couple of thoughts...
  • How hard will it be to add commandline support for switching themes?
  • Should we require "no spaces'" in the theme name to easier accommodate commandline support?
  • What would you think of a "New" button on the dialog that would create a blank rainmeter.ini? (so you don't have to manually close all the current skins to start a new theme)
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RainRestart

Post by jsmorley »

dragonmage wrote:Yes! Ok, I'm gonna try and play with this today.

A couple of thoughts...
  • How hard will it be to add commandline support for switching themes?
  • Should we require "no spaces'" in the theme name to easier accommodate commandline support?
  • What would you think of a "New" button on the dialog that would create a blank rainmeter.ini? (so you don't have to manually close all the current skins to start a new theme)
Command line support shouldn't be a problem. I'll have to look at the best way to go, but my gut reaction is that it would be one or the other. In other words, if you use command lines like:

RainThemes.exe /load "my standard setup"
RainThemes.exe /save "my new setup"
RainThemes.exe /delete "my new setup"
RainThemes.exe /rename "my old name" "my new name"

it would do the action and restart Rainmeter as required, but you would never see the RainThemes GUI. My only concern is what to do about error messages, "are you sure" prompts, and "ok, I did this" confirmation messages. I can write to STDOUT but you won't see them in Windows if you run it from a shortcut, I can open a CMD window and have the output there, but that is super ugly and unprofessional looking when run from a shortcut, or I can pop up dialog boxes in Windows but that is going to be problematic if you are running it from a CMD window. I'll have to think about this.

There is also the issue of text "case", which is irrelevant now, as the user chooses the name to load, delete and rename from a list and I don't have to worry if "my new setup" is the same thing as "My New Setup". Also not hard to solve, but will take some code. I don't want to force upper or lower case.

I don't think we need or want to disallow spaces in the name. That is so 1990's... They will just have to use quotes around parameters.

I propose we start with command line for "switching" ONLY, use the GUI for managing (saving, renaming, deleting) That would be simple to implement, would reduce the error checking and wouldn't require any prompts. Just do it. Success or failure would be obvious since Rainmeter won't restart if it fails.

I am not sure about a "new blank" button. It could be done I guess. I could edit the current Rainmeter.ini and set all the "Active=1" lines to "Active=0" and save it, or zap all the [SkinName] sections from the .ini and save it. Definitely don't want to create a "blank" .ini, as the user would lose their defined text editor. Not sure I even see a need for this to be honest. Let me ponder a bit.
dragonmage
Developer
Posts: 1270
Joined: April 3rd, 2009, 4:31 am
Location: NC, US

Re: RainRestart

Post by dragonmage »

If you can get rid of all the skin sections that would be perfect. Use would be... I'm currently running close to 20 configs, I want to save this setup, then start a completely different theme. I would manually have to close all 20 configs, to get back to a "starting point"
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RainRestart

Post by jsmorley »

dragonmage wrote:If you can get rid of all the skin sections that would be perfect. Use would be... I'm currently running close to 20 configs, I want to save this setup, then start a completely different theme. I would manually have to close all 20 configs, to get back to a "starting point"
Gotcha... I will work on this and the "switch only" command line today and post a new version in a little while.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RainRestart

Post by jsmorley »

Here is a version with the "Save as an empty configuration" feature working.

I decided to try it with leaving everything in the config, but turning "Active=" to "0" on all configs so they don't load. That way you don't lose all the positioning, draggable, transparency etc on all your skins, and when you load a skin into the new config you have that information available as a starting point. There are pluses and minuses to both approaches, what do you think?

Image

ftp://uzaeagle.serveftp.com/rainmeter/RainThemes.zip

Had a struggle today, as I found a bug in the built-in routine in AutoIt3 which retrieves a list of files/directories into an arrary which I used to populate the list. It would just blow up if you had a directory named "1" or "01" or "001" and so on. Anything which could be interpreted as the number "1" would just cause it to chew off its own arm trying to escape. It also hated directories with a "." in them, so it caused problems if you called a Theme "Configuration 1.2".

I ended up writing my own function to return directories into an arrary. Couple of hours lost there, (mostly in trying to figure out the problem without replacing the function) but it all works right now. ;-)

Code: Select all

Func _GetFolders()

Dim $aFileList[9999]
$FileAttrib = ""
$ArrayNum = 0

$ThemeSearch = FileFindFirstFile("Skins\Themes\*.*")  

If $ThemeSearch <> -1 Then

  While 1
    $FoundFile = FileFindNextFile($ThemeSearch)
    If @error Then ExitLoop
	$FileAttrib = FileGetAttrib("Skins\Themes\" & $FoundFile)
	if StringRegExp($FileAttrib, 'D', 0) Then
      $ArrayNum = $ArrayNum + 1
	  $aFileList[0] = $ArrayNum
	  $aFileList[$ArrayNum] = $FoundFile
	EndIf
  WEnd

EndIf

FileClose($ThemeSearch)
ReDim $aFileList[$aFileList[0] + 1]
Return $aFileList

EndFunc
dragonmage
Developer
Posts: 1270
Joined: April 3rd, 2009, 4:31 am
Location: NC, US

Re: RainRestart

Post by dragonmage »

Working great so far. Still not sure about the "New" theme behavior yet, need to think about it more.