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

Desktop: Directories support for keybinds #331

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

956MB
Copy link
Member

@956MB 956MB commented Dec 25, 2024

What's new

Adds RIGHT button select in the file browser dialogs and changes the Open File action to Open File/Directory in Settings > Desktop > Keybinds Setup. This adds the ability to open to any directory in the Archive app, in addition to the default behavior of opening a file in it's default app.

ScreenRecording2024-12-25at6 19 41AM-ezgif com-video-to-gif-converter


For the reviewer

  • I've uploaded the firmware with this patch to a device and verified its functionality
  • I've confirmed the bug to be fixed / feature to be stable

- Adds *RIGHT* button select in the file browser dialogs and changing the `Open File` action to `Open File/Directory` in `Settings > Desktop > Keybinds Setup`. This adds the ability to open to any directory in the Archive app, in addition to the default behavior of opening a file in it's default app.
- Normal files and directories are now able to be added to then main menu and are run in their appropriate apps.
- e.g. .txt files shown in text viewer, .js files are run in the JS Runner app, and folders are navigated to by the Archive app. All similar to the desktop keybinds functionality.
- Icons are also assigned appropriately based on the extensions, though more could probably be added to the `loader_menu_get_ext_icon` function.
- Also replaced some of the long arduous is_dir checks and just used the `storage_dir_exists` function since its already there and does the same.
@956MB
Copy link
Member Author

956MB commented Dec 28, 2024

The adding of JS files and other stuff to the main menu seemed connected to the initial PR with the select_right thing for the keybinds dialog, so I just added on to this PR instead of creating a new one for this feature.

Screenshot of the files/folder with icons in the Main Menu

Screenshot-20241227-205546

Another thing I was thinking about but haven't messed with is whether the word App ought to still be used in the menu, as it can basically have any file type with this change, not just apps. For simplicity sake it'd probably be best just to keep it, though I think File can work well if you think of everything on the device as 'a file', including apps.

  • "App 1/12" -> "File 1/12"
  • "Add App" -> "Add File"
  • "Move App" -> "Move FIle"
  • "Remove App" -> "Remove File"

Just a thought.

@Willy-JL
Copy link
Member

The adding of JS files and other stuff to the main menu seemed connected to the initial PR with the select_right thing for the keybinds dialog, so I just added on to this PR instead of creating a new one for this feature.

very nice!

Another thing I was thinking about but haven't messed with is whether the word App ought to still be used in the menu, as it can basically have any file type with this change, not just apps. For simplicity sake it'd probably be best just to keep it, though I think File can work well if you think of everything on the device as 'a file', including apps.

  • "App 1/12" -> "File 1/12"
  • "Add App" -> "Add File"
  • "Move App" -> "Move FIle"
  • "Remove App" -> "Remove File"

Just a thought.

i think "Item" would work better as a single name for both apps and files. or alternatively, could use both app and file, changing the text of the buttons based on what is currently selected, but that is a bit over the top i think

@956MB
Copy link
Member Author

956MB commented Dec 28, 2024

i think "Item" would work better as a single name for both apps and files.

Oh yep, you're right. "Item" is generic enough for all of it 👍

@956MB 956MB self-assigned this Jan 13, 2025
Comment on lines +165 to +173
Desktop* desktop = furi_record_open(RECORD_DESKTOP);
desktop->archive_dir = furi_string_alloc_set(menu_app->path);
furi_record_close(RECORD_DESKTOP);

furi_thread_flags_set(furi_thread_get_id(app->loader_menu->thread), 0);
if(app->loader_menu->closed_cb) app->loader_menu->closed_cb(app->loader_menu->context);

view_dispatcher_send_custom_event(
desktop->view_dispatcher, DesktopMainEventOpenArchive);
Copy link
Member

Choose a reason for hiding this comment

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

i get why its like this, but i hate it xD

ill try to come up with a way to launch archive without passing through desktop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants