-
Notifications
You must be signed in to change notification settings - Fork 200
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
Enable Recursive Plugin Panels for Plugin.Command Calls #680
Comments
@w17 Thanks for adding the auto plugin stack feature. Please take a look at this ticket when you have some time. |
@rohitab ok, maybe next weekend... |
build 6140 |
Thank you so much! I just tested version Unfortunately, there appears to be another issue that has arisen due to this. If you have an archive panel open, and you use the command-line prefix I apologize. I should have tested more thoroughly before asking you to make the command-line prefix change. |
@rohitab what is your use case for Plugin.Command? |
@w17, here is my use case. Use CaseI have a file association for Dex files that runs a Lua macro, which converts them to JAR files on pressing To simplify, there is an encoded archive within an archive. The encoded archive is decoded to a temporary file and opened using Plugin.Command Test CaseA very easy way to test this is by running the following commands, one at a time, using the Far command line input. cd "%TEMP%"
copy /Y "%FARHOME%\Plugins\FarColorer\base\common.zip" test-one.zip
goto:test-one.zip
copy /Y test-one.zip test-two.zip
lua:Plugin.Command("65642111-AA69-4B84-B4B8-9249579EC4FA", "test-one.zip")
lua:Plugin.Command("65642111-AA69-4B84-B4B8-9249579EC4FA", "test-two.zip")
lua:Keys("CtrlPgUp") 🔴 Results for version
|
I just tested version Plugin.Command Test Case (Updated)The following modified test case, which uses cd "%TEMP%"
copy /Y "%FARHOME%\Plugins\FarColorer\base\common.zip" test-one.zip
goto:test-one.zip
copy /Y test-one.zip test-two.zip
lua:Plugin.Command("65642111-AA69-4B84-B4B8-9249579EC4FA", "test-one.zip")
lua:Plugin.Command("65642111-AA69-4B84-B4B8-9249579EC4FA", "-r test-two.zip")
lua:Keys("CtrlPgUp") 🟢 Results for version
|
@w17 Is it possible for Test CaseAs an example, in this test case, cd "%TEMP%"
copy /Y "%FARHOME%\Plugins\FarColorer\base\common.zip" test-one.zip
goto:test-one.zip
copy /Y test-one.zip test-two.zip
lua:Plugin.Command("65642111-AA69-4B84-B4B8-9249579EC4FA", "-r -x test-one.zip")
lua:Plugin.Command("65642111-AA69-4B84-B4B8-9249579EC4FA", "-r -x test-two.zip")
lua:Keys("CtrlPgUp") Open Panel FlagsIs it possible to have the new flags // Delete Host file (and containing directory), if specified
if (!(cached_Flags & OPIF_REALNAMES) && !cached_hostfile.empty())
{
if (cached_Flags & OPIF_DELETEDIRONCLOSE)
{
DeleteFileWithFolder(cached_hostfile);
}
else if (cached_Flags & OPIF_DELETEFILEONCLOSE)
{
std::ignore = os::fs::delete_file(cached_hostfile);
}
} I tried the above code and it seems to be working without any issues so far. The first archive gets deleted as well now. The above code is just proof-of-concept. I'm in no way suggesting that you use it. I think this is a good feature to have, especially with the new flags, since it should not affect any plugins that don't use them. This would allow using commands like |
I think it is possible (and good idea). |
@w17, I apologize, I have not closely followed the proceedings here, however... It looks like you added a new user-facing functionality to the arclite plugin. New command line options it seems. Is it worth updating plugin help? I can do the actual writing, but I would need some kind of informal description or explanation. What do you think? |
It is still experimental. |
@rohitab, could you check build 6155? |
@w17, I just tested version IssueThe file does not get deleted if it is opened from a Temporary panel. Test CaseHere is an updated test case that reproduces the issue. You will see the message cd "%TEMP%"
copy /Y "%FARHOME%\Plugins\FarColorer\base\common.zip" test-one.zip
goto:test-one.zip
tmp:<echo %TEMP%\test-one.zip
arc:-r -x test-one.zip
lua:Keys("CtrlPgUp")
lua:=mf.fexist("test-one.zip") and "ERROR: File not Deleted" or "OK: File Deleted" The results are the same if you use OPIF_REALNAMESJust for testing, I moved the check for Lines 5673 to 5681 in edadb6c
After making this change and running the above test, I see the message |
6157 |
Perfect! Just tried version |
|
Thanks. I'll find time. Meanwhile, #703. |
Description of the new feature or improvement
Please refer to commit 7d3c296 which adds an experimental feature for auto plugin panel stack.
See Stack of plug-in panels for details.
This feature works great when launching a plugin from inside another plugin, e.g. PE Analyzer from inside an archive, so thank you! However, if the plugin is launched from a Lua Macro using
Plugin.Command
, the stack is not saved, and the user is returned back to the file panel instead of the archiver panel.It would be nice if the auto plugin stack could be enabled for this case as well. I understand that this is an experimental feature and not fully implemented.
Additional Info (if interested in usage): I have a file association for Dex files that runs a Lua macro and converts them to JAR files on pressing
Ctrl+PgDn
. These Dex files are normally located inside an APK, which is a ZIP archive. After the conversion, the JAR file (which is also a ZIP archive) is opened in the ArcLite plugin usingPlugin.Command
function. When I exit the archive usingCtrl+PgUp
, I get returned to the file panel instead of the ArcLite panel with the APK.Proposed technical implementation details (optional)
The following code was added to
PluginManager::CommandsMenu
function to handle the plugin command case in commit 7d3c296FarManager/far/plugins.cpp
Lines 1599 to 1644 in c085d23
The following code is from the
PluginManager::CallPluginItem
function. If you replace this code with the above code, the auto plugin stack works with thePlugin.Command
function from Lua as well. I just tested it out and it appears to be working.FarManager/far/plugins.cpp
Lines 2357 to 2371 in c085d23
Of course, the above change requires adding the
PF_RECURSIVEPANEL
flag to theGetPluginInfoW
function in the ArcLite plugin. Addinginfo->Flags = PF_RECURSIVEPANEL;
just below the following line works.FarManager/plugins/arclite/plugin.cpp
Line 1250 in c085d23
To add support for command-line (prefix) calling, the following code in
PluginManager::ProcessCommandLine
would need to be replaced with the above code, excluding theProcessPluginEvent
part. I tested this change as well and it appears to be working correctly.FarManager/far/plugins.cpp
Lines 2083 to 2089 in c085d23
I'm not very familiar with the code so the above changes may have side effects that I'm currently unaware of.
The text was updated successfully, but these errors were encountered: