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

Add custom QrCode saving #552

Merged
merged 2 commits into from
Dec 13, 2024
Merged

Add custom QrCode saving #552

merged 2 commits into from
Dec 13, 2024

Conversation

MyMindWorld
Copy link
Contributor

Proposed Changes

This MR introduces the ability to save custom QR codes to the configuration file (bruce.conf) for a faster and more convenient way to display frequently used QR codes.

Additionally, users can remove default QR codes from the system.


Types of Changes

  • New Feature:
    • Ability to save custom QR codes to the configuration file (bruce.conf).
    • Ability to remove pre-configured default QR codes directly from the UI.

Verification

All changes are accessible via the Other → QR Codes menu.

Previous Behavior:

  • A static, hardcoded list of QR codes was displayed, which included:
    • "Bruce AP"
    • "Bruce Repo"
    • "Rickroll"
    • "HackerTyper"
    • "ZomboCom"

New Behavior:

  • The list of QR codes is now loaded dynamically from the configuration file (bruce.conf).
  • By default, the list in the qrCodes array has the same entries as before.
  • Any QR code can now be added, removed, or customized.

New Options in the Custom Menu

Within the Custom menu, users have access to the following options:

  • Display:
    Write text and generate a QR code dynamically.

  • Save & Display:
    Write a name and content for a QR code, save it to the configuration, and display it. Saved QR codes can be accessed via the main QR Codes menu.

  • Remove:
    Select and delete any saved QR code, including default QR codes.

  • Back:
    Return to the main QR Codes menu.


Testing

Tested on an M5Stack-CPLUS2 device under the following scenarios:

  • Update from previous version: Ensured all existing functionality remained intact.
  • Fresh install: Verified the default list of QR codes loaded correctly.
  • Adding new QR codes: Successfully saved and displayed QR codes using the new Save & Display option.
  • Removing QR codes: Successfully removed default and user-added QR codes from the system.

Linked Issues

None


User-Facing Changes

- Introduced the ability to save custom QR codes and remove default ones.

Copy link
Owner

@pr3y pr3y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! thanks for contributing!
i was thinking about adding "Bruce Wiki" and "bruce.computer" on the static hardcoded list also, something like:
{"Bruce Wiki", "https://github.com/pr3y/Bruce/wiki"}, {"Bruce Site", "https://bruce.computer"},

@MyMindWorld
Copy link
Contributor Author

Thanks for the feedback and suggestion!

With this new options I think it might be a good idea to trim the list slightly. Otherwise, the list could become too large, making it harder for users to discover the Custom option.

Current list is:

{"Bruce AP", "WIFI:T:WPA;S:BruceNet;P:brucenet;;"},
{"Bruce Repo", "https://github.com/pr3y/Bruce"},
{"Rickroll", "https://youtu.be/dQw4w9WgXcQ"},
{"HackerTyper", "https://hackertyper.net/"},
{"ZomboCom", "https://html5zombo.com/"}

And I propose something like:

{"Bruce AP", "WIFI:T:WPA;S:BruceNet;P:brucenet;;"},
{"Bruce Wiki", "https://github.com/pr3y/Bruce/wiki"}, 
{"Bruce Site", "https://bruce.computer"},
{"Rickroll", "https://youtu.be/dQw4w9WgXcQ"}

Without separate repo link, because advanced users will recognize git anyway.

That said, I’m not hard on this point. If you feel it’s better to keep all of the current options and add this new ones, I’m happy to do that instead. Let me know what you think!

@pr3y
Copy link
Owner

pr3y commented Dec 13, 2024

Really good!
The way you proposed its perfect for me, i didnt liked hackertype or zombocom QRs either :v

@MyMindWorld
Copy link
Contributor Author

They are gone now 😄

@pr3y pr3y merged commit b35fbbe into pr3y:main Dec 13, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants