Open rmcanany opened 3 months ago
I'm thinking about doing this next. I don't think it should be too hard. My instinct is to use a Dictionary, but want to try the Class approach you suggested.
I've sketched out what I think it might look like below. Thoughts or examples you may have would be welcome.
In Form_Main
:
Public Property Presets as List(Of Preset)
Somewhere else:
Public Class Preset
Public Property Name As String
Public Property TaskList As List(Of Task)
Public Property TaskListJSON As String
Public Property FormSettings As Dictionary(Of String, Dictionary(Of String, String))
Public Property FormSettingsJSON As String
Public Sub New()
End Sub
Public Sub ApplyPreset()
End Sub
Public Sub Save()
End Sub
' Etc.
End Class
FormSettings should be a List Of(FormSetting)
FormSetting should be a Class with its Name and Value properties
FormSetting should have its comparing methods to be able to use all the List functions. Should be enough to compare the name in my opinion
I can provide an example Monday, not on PC this weekend
Not yet tested thoroughly, but I think it's working.
The control is currently on the General Tab. If you have an idea for a better location, please chime in.
One thing to note, if you want a Preset to remember Task selections, that has to be enabled on the General Tab before saving the preset.
I always thought to have it on the top of the task list; I did move it with a cup-paste but stopped working so I didn't commit
I thought it should be visible for all tab pages, so I put it just above the status bar.
Incidentally, I looked into how to move a control from one parent to another. With the Form active in VS, go to View > Other Windows > Document Outline. There, you can drag/drop a control as needed. Here's a pic.
It seems a good position, I tweaked it a bit the toolbar to show buttons in the correct size. Please note that if you save a presets with an existing name it asks to overwrite but you will have duplicate elements in the dropdown list. Also a deleted preset reappeared after the save.
OK. I can fix that. If you get a chance, please make a PR. I don't want to create a bunch of merge conflicts.
OK. I can fix that. If you get a chance, please make a PR. I don't want to create a bunch of merge conflicts.
I thought I had done it... it is now 👍
Those two bugs should be fixed now. It is supposed to work without deleting the Preferences folder, but if it acts up, please give that a try.
It seems that when loading a preset nothing happens. I did delete the preferences folder, but it still doesn't work.
I'll look at it. If it's a Task selection not working, make sure Remember selected tasks between sessions
is turned on.
Nope, its not task selection but task list and everything else
P.S.: Have a look at the comments in my last commit, please
Sure enough. That was working before. I'll track it down.
I'll check the comments in a bit.
I think I found the issue. Just pushed a commit. Please let me know if something is still not working.
Tasks are still not loaded
I noticed that the windows size and position are saved within the preset, I would prefer it always stays the same and just saves on close and restore on load.
I swear that was working, but you're right. Made another fix and uploaded just now. Appreciate all the troubleshooting.
I'll have to look into the repositioning and resizing.
Seems to work now
Provide a way to load in settings for each step in the workflow. I currently use a checklist to prep a job for release. Here's part of it: