Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve script structure #412

Open
11 of 19 tasks
htcfreek opened this issue Jul 5, 2021 · 16 comments
Open
11 of 19 tasks

Improve script structure #412

htcfreek opened this issue Jul 5, 2021 · 16 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request in-progress Accepted, at least some code is implemented or pending push

Comments

@htcfreek
Copy link
Contributor

htcfreek commented Jul 5, 2021

Move general code for better structure

  • Move FileInstall into _ResourceHelper.au3
  • Create _OtherHelpers.au3 for various small functions
    • Move _INIUnicode($sINI)
    • Move _Translate($iMUI, $sString)
    • Move all other small functions like the one before.
  • Move command line processing into _CommandLineHelper.au3
  • Combine related functions (example: HighContrast + LightTheme => GetColorTheme)

Checks

  • Create a function for every check and place it in _Checks.au3
    • Use this functions for GUI and command line

Gui code

  • Move Gui including into #699
    • Move all Gui related functions including GDI+ function (_GDIPlus_GraphicsGetDPIRatio)
  • Add new function _UpdateScanResult($iScanResultIndex, $iState, $sResultText, $sResultInfo) => $iState = Question, Warning, Okay, Error

Comments and structure

  • Add a comment to each function like this:
; Description: Function does ...
; Input: param1 = ...; param2 = ...
; Output: ....
; On error: ....
  • Structure code by adding comment structure (Not only this region thing, which isn't supported by every editor.):
; ========= Init global vars ====
(...)

;  ======== Includes ========
; AutoIT-UDFs
(...)

; Internal Includes
(...)

; ========= Init Gui =========
(...)

; ========== Begin Checks ===============
; Checking CPU
(...)

; Checking GPT
(...)
  • Improve script order (Main part):
  1. Global vars
  2. Includes
  3. Options
  4. Check OS
  5. Init Gui part or command line part
  6. run checks for command line or gui

Folder/file structure

  • Align naming: All upper case or all lower case.
  • Move source code (*.au3, include, lang, assets) into folder /src.
  • Fix include commands
  • Fix Wrapper_Add_Icon commands path.

@rcmaehl
This would help other contributors to fast understanding the code.
I would do it. But this makes no sense because this is inkompatibel to other commits.

@micwoj92
Copy link
Collaborator

micwoj92 commented Jul 5, 2021 via email

@htcfreek
Copy link
Contributor Author

htcfreek commented Jul 5, 2021

@micwoj92
Done!

@micwoj92
Copy link
Collaborator

micwoj92 commented Jul 5, 2021

Should I assign this to you?

@micwoj92 micwoj92 added documentation Improvements or additions to documentation enhancement New feature or request labels Jul 5, 2021
@rcmaehl
Copy link
Owner

rcmaehl commented Jul 5, 2021

Should I assign this to you?

Me

@htcfreek
Copy link
Contributor Author

htcfreek commented Jul 5, 2021

Updated main comment.

@micwoj92
Copy link
Collaborator

micwoj92 commented Jul 5, 2021

@rcmaehl you can assign yourself :P

rcmaehl added a commit that referenced this issue Jul 6, 2021
Start on #412
rcmaehl added a commit that referenced this issue Jul 6, 2021
Continue on #412
rcmaehl added a commit that referenced this issue Jul 6, 2021
Continue on #412
rcmaehl added a commit that referenced this issue Jul 6, 2021
Continue #412
@htcfreek
Copy link
Contributor Author

htcfreek commented Jul 6, 2021

@rcmaehl
We should use the same naming structure for the same type of include. This means Resources.au3 should be _Resources.au3.

@htcfreek
Copy link
Contributor Author

htcfreek commented Jul 6, 2021

@rcmaehl

  1. Your includes are broken. (See fix here: https://github.com/htcfreek/WhyNotWin11/commit/9a24e7d6a2e446e0e8d5973475a66b20dfa8eeb0)
  2. The lang copy is broken. It crashed my changed lang files. (Don't know why.)

@micwoj92
Copy link
Collaborator

micwoj92 commented Jul 6, 2021

As far as I know you are using this IDE called "ISN AutoIt Studio" while Robert uses Scite4Autoit, could you try with Scite and see if it still is issue?

@htcfreek
Copy link
Contributor Author

htcfreek commented Jul 6, 2021

As far as I know you are using this IDE called "ISN AutoIt Studio" while Robert uses Scite, could you try with Scite and see if it still is issue?

  1. The includes are working now. The error came from Wrapper and tidy.
  2. The lang files aren't broken. But the doesn't get read.

Let me work tomorrow on this. It's time for sleeping. 😅

rcmaehl added a commit that referenced this issue Jul 7, 2021
@htcfreek
Copy link
Contributor Author

htcfreek commented Jul 7, 2021

@rcmaehl
Csn you please stop doing this .\ things while including. This breaks code. You need "Includes\...au3".

See here: https://www.autoitscript.com/autoit3/docs/keywords/include.htm

@htcfreek
Copy link
Contributor Author

htcfreek commented Jul 7, 2021

@rcmaehl
I have added a new group "Folder/file structure" to the checklist.

@micwoj92
Copy link
Collaborator

micwoj92 commented Jul 7, 2021 via email

@htcfreek
Copy link
Contributor Author

htcfreek commented Jul 7, 2021

@micwoj92
The include files/assets aren't found/included. Wrapper and Check saying that files aren't available.

rcmaehl added a commit that referenced this issue Jul 7, 2021
rcmaehl added a commit that referenced this issue Jul 8, 2021
rcmaehl added a commit that referenced this issue Jul 8, 2021
@htcfreek
Copy link
Contributor Author

htcfreek commented Jul 9, 2021

@micwoj92
Can you please add "In-progress" lable.

@micwoj92 micwoj92 added the in-progress Accepted, at least some code is implemented or pending push label Jul 9, 2021
rcmaehl added a commit that referenced this issue Jul 9, 2021
rcmaehl added a commit that referenced this issue Aug 5, 2021
Clean up Icon Names
@micwoj92
Copy link
Collaborator

Has there been any progress on this in ~1 year?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request in-progress Accepted, at least some code is implemented or pending push
Projects
None yet
Development

No branches or pull requests

3 participants