Conversation
This commit refactors the `build_menu` function to encapsulate the logic for determining the "Run on Start" menu item's checked state. Changes: - `build_menu` no longer accepts `run_on_start_enabled` as a parameter. - Instead, `build_menu` now calls `is_run_on_start_enabled()` internally to get the current state. - Call sites for `build_menu` (in `main` function, `update_icon` closure, and the `ToggleRunOnStart` event handler) have been updated to reflect the new function signature. This improves code clarity by making `build_menu` self-contained regarding the "Run on Start" state and simplifies its usage. I made this change based on your feedback to improve the previous implementation.
Updates actions/checkout, actions/cache, and actions/upload-artifact to newer versions (v4) to resolve an issue with "Missing download info" for actions/cache@v2 and to use more current, supported action versions. - Changed actions/checkout@v2 to actions/checkout@v4 - Changed actions/cache@v2 to actions/cache@v4 - Changed actions/upload-artifact@master to actions/upload-artifact@v4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit introduces an option to make the application run on Windows startup.
The changes include:
is_run_on_start_enabled()to check the registry for the autostart setting (HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run - "RustCat").set_run_on_start(enable: bool)to add or remove the "RustCat" value from the startup registry key. This function also retrieves the current executable path.ToggleRunOnStartto callset_run_on_startand updates the menu item's check state.