You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wrote an annotation plugin that requires project-specific settings. The plugin should be active if the settings file is in the project directory, or otherwise it shouldn't do anything. To me, it's intuitive that if the settings file doesn't exist, the plugin should just not be displayed in the menu.
Yet I find that when I create an annotation plugin, I am required to create a menu entry. For instance, if I define PluginAnnotationMenuEntries as follows, then I get an exception.
public IEnumerable<PluginAnnotationMenuEntry> PluginAnnotationMenuEntries
{
get { return new List<PluginAnnotationMenuEntry>(); }
}
The log reads:
[2024-12-19T08:22:30-06, Thread=1] - Information: Usage: Form: Paratext.MainForm: Shown
[2024-12-19T08:22:31-06, Thread=1] - Error: Exception restoring window: Exception has been thrown by the target of an invocation.
[2024-12-19T08:22:31-06, Thread=1] - Error: at System.RuntimeTypeHan
(And the text window doesn't load at all, but instead displays an error message about the exception.)
I suggest as a minimum that if PluginAnnotationMenuEntries is empty, Paratext should be able to recover from that somehow. (I would expect it to print an error to the log and proceed as if the plugin had never opened.)
Going beyond that, I would suggest at least one of the following:
A way to indicate to Paratext that initialization of the plugin failed, and the plugin should be ignored.
Failing that, the ability to disable the menu entry (i.e., grey it out). I could not find such a setting in PluginAnnotationMenuEntry.
The text was updated successfully, but these errors were encountered:
I agree that it seems sensible to allow the plugin to specify whether or not the menu item is available. I'm not sure we'd want to allow it to not provide a menu item at all. However, we might want to make a way, at them time the plugin is being loaded for the plugin to indicate that it should not be loaded. That would allow your plugin to detect that the required settings are not present, and just not load. All that said, I'm not sure whether the Paratext 9 team has any plans to enhance the plugin interfaces.
All that said, I'm not sure whether the Paratext 9 team has any plans to enhance the plugin interfaces.
Just curious: do you say that because plug-ins just aren't a high priority in general, or because development is focused on Paranext?
Maybe a little bit of both. For sure in Paratext 10 Studio, extension support will be a top priority. I don't set priorities, so it's just a guess. There is someone on the Paratext 9 team who is intimately acquainted with the plugin stuff, so if they do decide to prioritize this, I'm sure he'll be able to handle it.
I wrote an annotation plugin that requires project-specific settings. The plugin should be active if the settings file is in the project directory, or otherwise it shouldn't do anything. To me, it's intuitive that if the settings file doesn't exist, the plugin should just not be displayed in the menu.
Yet I find that when I create an annotation plugin, I am required to create a menu entry. For instance, if I define
PluginAnnotationMenuEntries
as follows, then I get an exception.The log reads:
(And the text window doesn't load at all, but instead displays an error message about the exception.)
I suggest as a minimum that if
PluginAnnotationMenuEntries
is empty, Paratext should be able to recover from that somehow. (I would expect it to print an error to the log and proceed as if the plugin had never opened.)Going beyond that, I would suggest at least one of the following:
PluginAnnotationMenuEntry
.The text was updated successfully, but these errors were encountered: