Commit graph

15 commits

Author SHA1 Message Date
William Wilgus
2456d28e21 [BugFix] open_plugin didn't recognize opx shortcuts
opx shortcuts allow an easy way to add parameters to plugins
you should be able to set them as shortcuts now

the plugin hd a use after free bug on the dat file file descriptor

Change-Id: I5fe3b0628e7da003c03b9b54f5788b0d0dbfea74
2023-03-30 01:04:51 -04:00
Christian Soffke
faa2cb9942 plugins: Improve usability of iPod keymaps
- Reduce need to press multiple buttons at
the same time to quit a plugin

- Have "Menu" be default way to quit plugins or
to access plugin menu

- Fall back to (Long) "Select" or Long "Menu"
in cases where Menu button isn't available
(e.g. in ImageViewer and many games)

out of scope:
boomshine, lua_scripts, Rockpaint,
Doom, Duke3D, Pacbox, Quake,
Sgt-Puzzles, Wolf3D, XWorld,
Minesweeper, Pixel Painter, Spacerocks

Change-Id: I6d4dc7174695fe4b8ee9cbaccb21bdbfe6af5c48
2022-12-29 04:39:22 +01:00
Aidan MacDonald
6c52fa139c Remove browse_context_init()
Prefer to use designated initializers to avoid having to specify
unneeded parameters. Non-initialized members are zero-initialized
by the compiler.

Change-Id: Ia6a03c45cb3ef0b30f458d7d0ae1604a350c737c
2022-12-17 13:36:38 +00:00
William Wilgus
0b7a387671 open_plugins add name when plugin can't open & check LANG_LAST_INDEX_IN_ARRAY
can't open '' was confusing for users so pass the key to open plugin
in theory you could have a plugin that defaulted to these lang_ids
run but its good enough to tell the user what failed to open IMO

lang_id changes mess with open_plugin since it uses them as look-up keys
so add checks for LANG_LAST_INDEX_IN_ARRAY to the checksum

the plugin now removes entries with an invalid checksum

devices with harddrives only append their .dat file so have them skip entries
with invalid checksums and only notify user if a valid entry wasn't found
(these users can run the open_plugins plugin to remove invalid entries)

Change-Id: Icf157675beaccda785643d5a9ed032a7cde30f12
2022-11-17 01:43:16 -05:00
Aidan MacDonald
d5a081cbd1 gui: Remove "enum list_wrap" from list action functions
Removing the "list_wrap" argument is actually pretty easy.
In practice, almost all lists are using LIST_WRAP_UNLESS_HELD
behavior so we can make that the default. A couple of lists
disable wraparound with LIST_WRAP_OFF; this is now achieved
by setting the list "wraparound" flag to false when setting
up the list. LIST_WRAP_ON was unused and is of questionable
value, so it has been removed entirely.

This makes list wraparound behavior a property of the list,
controlled solely by the "wraparound" flag. The result is a
simpler list API and implementation, without changing the
behavior of any lists.

Change-Id: Ib55d17519e6d92fc95ae17b84ab0aaf4233bcb5a
2022-10-05 11:22:55 -04:00
Aidan MacDonald
ff378deb69 gui: Remove gui_synclist_limit_scroll()
Since gui_synclist_do_button() overrides the setting at runtime
there is no reason to have a public API call to set it. Really
it should be a local variable, but it will be simpler to do that
after refactoring how list wraparound behavior is handled.

Change-Id: Id09d42197814102693752a9f64db8325118ca796
2022-10-05 11:22:34 -04:00
William Wilgus
e1553d860d Open_Plugin add checksum on struct offsets
Adding a checksum over the struct offset will allow checking
for compatibility across machines rather than using packed structs
to ensure compability

For any file created by the user from the device  this isn't really a concern

But for files between machines, across installs (sim v device),
possibly even across compilers this at least will alert the user
rather than returning junk data

Change-Id: Id0531bbaa7013dce24dece270849f0a10ac99c20
2021-10-18 23:30:27 -04:00
William Wilgus
71cc1e78fd Open_plugins.c bugfix address of packed struct element
helpful gcc warning after g#3895 change to packed struct

Change-Id: I89f765da94eeee14c606ea8ebaab5e219dceb2ac
2021-10-16 11:04:17 -04:00
William Wilgus
2ce7c716c3 apps/open_plugins cast menu id to (void*)
Change-Id: I14ece34e5ad0ffe00bbb4f7de37b1dadad3b92b4
2021-08-14 23:27:44 +00:00
William Wilgus
0dce973729 OpenPlugins Allow opx shortcuts
Allow opx shortcuts to be run through the shortcut menu

Change-Id: I6597b9485dfb224766c442257c4d9c8ac02eece4
2021-03-07 08:22:01 -05:00
William Wilgus
308dd4ffee Open_plugins.c fix red
rb->strncasecmp

Change-Id: Icb1e6d0db42bd4708d581e80596604fb97578761
2021-03-06 18:00:18 +00:00
William Wilgus
87ad55b06e Open_Plugins Add Features
Added an entry 'Add' to the main screen to lessen confusion

side note:
its actually a shortcut back to this plugin with flag '-add'
passed as a parameter

Change-Id: Ifeb0a1e5be99764b1d25d5a3b0e00f1449ec3d78
2021-03-06 17:21:37 +00:00
William Wilgus
f906df017d Open Plugin -- Make first run show at least one item to user
Open plugin needs the context menu to allow the user to add an item
on the first run there are no items and therefore nothing to pop the
context menu from

Change-Id: I7a78454ff29b20c7b60db44349dd23d500ed887c
2021-03-03 13:37:40 -05:00
William Wilgus
8ee035b6c8 Open_plugin add ability to import opx shortcuts, bug fix
shortcuts can be exported as .opx; now they can import as well

if parameter is a valid file..
 plugins with parameters are now hashed on the parameter path

fix bug with empty parameters not overwriting last valid parameter

Change-Id: I149519811f07cb4ba22b7113449e2f89f77f1eee
2020-08-19 02:06:16 -04:00
William Wilgus
889bcc0f76 WIP open_plugins.rock viewer
OP allows you to use Open With.. to call plugins with parameters
called directly it  acts as a shortcut list for plugins

  open_plugins.rock interfaces with the open_plugin core

  When opened directly it acts as a viewer for the plugin.dat file
  this allows you to edit the paths and parameters for
  core shortcuts as well as your added plugins

  If a plugin is supplied to the viewer it is added to the dat file

  If instead the plugin has previously been added then it is run
  with the parameters you previously supplied

-----------------------------------------------------------------------------
Added export to .opx files
this allows shortcuts to plugins with parameters to be called from
 the file browser

Change-Id: Ib8b05a60b049fb1d5881031ca09a07e3307d375a
2020-08-17 22:17:15 -04:00