Skip to content
This repository has been archived by the owner on May 28, 2021. It is now read-only.

Metadata and GUI #244

Open
Disassembler0 opened this issue May 31, 2019 · 6 comments
Open

Metadata and GUI #244

Disassembler0 opened this issue May 31, 2019 · 6 comments

Comments

@Disassembler0
Copy link
Owner

For quite some time, I have an idea for PowerShell-based WindowsForms GUI which would help people to create their own presets. The interface itself would be generated automatically based on the tweaks in supplied tweak libraries. For this purpose, every tweak would need some metadata, such as group. There were already some mentions in #229 and possibly earlier.

With the classic approach where every tweak is selfcontained in a single function and for every function, there is a counterpart which reverts the behavior, the GUI could be constructed pretty easily. If #241 gets implemented, it would be much harder. The structure of parameters would have to be homogenous and predictable, so the GUI-building logic could place appropriate blocks.

The GUI-generator code doesn't have to be as simple as the tweaks, so there may be even some introspection used and no metadata would be needed as we have most of the information somewhere anyway (group, function name, parameter names, allowed types or values etc.).

The idea is that it would look as follows:
form

  • Tabs are individual groups (privacy, security, etc.)
  • The checkboxes determine if the tweak is present in the preset
  • First column is the tweak name
  • Second columens are params
  • Dropdowns are the respective values of params (empty value means that the param is not given)
  • (Not pictured) Somewhere down, aside from the tabview would be controls to load/save the preset.

Another approach would be to create the GUI as web-based application, completely outside of scope of this project.

@casper-rilaun
Copy link

And why not doing it with PHP ? You could have the wiki and the generator at the same place, and you could arrange easier your class / group

@ghost
Copy link

ghost commented Jun 4, 2019

Wow awesome news! I planned to make a GUI myself one day, as I did't think this might be a thing that you'd be interested in, (so I'm glad you're going to take care about it ;)) though my primary goal would be a little different. E.g. sometimes I just need to run one or two fuctions outside of my usual scenario presets and it's annoying to create a temporary preset or typing things on the command line, so I was thinking about a script that would list and display all available functions from modules and then I'd just select or click what I need and fire up an one-time run.

Anyway, please consider these ideas/requests:

GUI:

  • besides load/save presets also button to directly run the preset/selected tweaks
  • ability to hide preset features (just select tweaks and run) (enabled e.g. by an argument)
  • ability to load preset on start (defined by an argument)
  • ability to show tweaks defined in a preset only (enabled e.g. by an argument)

CODE:

  • move the comments from before function into a comment block inside the function and add possible and optional information there, so Get-Help could be used for getting the help, control info, possible autogenerating wiki, find out tweak defaults etc. (or maybe you know a better way to achieve that)
    (e.g. .TITLE would contain tweak's name, so the nicer "This PC Help" would be displayed, .DESCRIPTION could contain some text describing what the tweak does and could be displayed in the gui under title and above controls, and so on...)
  • would it be possible to somehow define custom/advanced design/behavior of its controls in the GUI? (e.g. by xml in the comment block or by calling the function with some argument)
    (I can already see I'd need things like listbox, textbox etc. :))
  • would it be possible to support optionally getting tweak status? (i.e. script would call a tweak function with an argument on start (if supported by it), function would determine related info from the system and the GUI controls' states could be properly set)

Some of the ideas/requests should be easy, but I understand the others could be outside of scope of this project by its complexity, so no stress. :)

I'll continue with my crazy ideas/requests in other V4 issues, as they're more related to them...

@Disassembler0
Copy link
Owner Author

@c-rilaun: That's basically what I meant by the last sentence. But I had in mind something JS-based, so it can be run on client side even without access to the internet.

@r3incarnat0r: I feel like I should stress that I still want to keep it as simple as possible. :D

ability to hide preset features

It's literally just two buttons - load and save. What would be the benefit of that?

ability to show tweaks defined in a preset only

I'm not sure I understand. Do you mean to completely hide all the tweaks which are not in the preset from GUI? Or in other words - limit the GUI only to the tweaks defined by the preset? In what cases can it be useful?

comment block inside the function

I guess you're talking about comment-based help. I have really strong feeling about that one, as I find it overly verbose and difficult to read. Function which modifies a single registry entry and is now on 4 lines would double in size. But the point about Get-Help and metadata is valid.

would it be possible to somehow define custom/advanced design/behavior

My initial idea was to infer the controls from the params if we design the parametrization (#241) logically and consistently. I fear that any advanced control customization can go wrong and/or result in bloated code really fast.

would it be possible to support optionally getting tweak status

Do you mean something like "If registry HKLM:\blabla\DisableSensors is set, mark checkbox for DisableSensors tweak as checked"? I don't think that's practical. The tweaks are evolving, so e.g. DisableTelemetry today looks differently than it looked a week ago, which in turn looks differently than it did 6 months ago. There may also be more than one way how a user can achieve the same effect as the tweak provides, so it may be confusing to have unchecked checkbox for items where the user knows that they were taken care of, only differently.

I'm glad you're going to take care about it

Yeah, about that... do you think you can drop me a mail so I have a more direct contact with you? 👼

@ghost
Copy link

ghost commented Jun 12, 2019

My intention is basically to add an ability to set a customized script (just by customizing preset and launcher) that can act like a common tweaking or whatever purpose application and could be served to user as a solution for some scenario (to just click checkboxes, fill textboxes and apply).

comment-based help

It might look verbose, but it's just key and text pairs, dunno how it could be shorter for the features it offers. Also I don't understand what do you mean by difficult to read, it is perfectly readable for me and the whole thing makes sense in general imho. It seems the difference between our opinions is basically you just want the code as short as possible and I don't care much about it. :D (More specifically I do care about the code lenght and efficiency, but I don't count comments as the code :D ).

drop me a mail

# The riddle must be solved. ;)
Write-Output ("{2}@{1}.{0}" -f "com", "gmail", $UserName)

@entdark
Copy link

entdark commented Jun 13, 2019

I hope the GUI way won't replace the script way, will it?
Because implementing the GUI version is good but sometimes manual changes are faster and could be copied and applied across multiple machine. And sometimes it's faster and easier to compare changes in the editor.

@Kein
Copy link

Kein commented May 27, 2020

So your own version of SharpApp https://github.com/mirinsoft/sharpapp

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

4 participants