Skip to content

Commit

Permalink
Widget open-file actions: support $(property)
Browse files Browse the repository at this point in the history
.. like $(text) of an action button

#2576
  • Loading branch information
kasemir committed Mar 27, 2023
1 parent fbb6732 commit 8f6166a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ private static void openDisplay(final Widget source_widget,
final Macros expanded = new Macros(action.getMacros());
expanded.expandValues(source_widget.getEffectiveMacros());
final Macros macros = Macros.merge(source_widget.getEffectiveMacros(), expanded);
// For display path, use the combined macros...
expanded_path = MacroHandler.replace(new MacroOrSystemProvider(macros), action.getFile());
// .. but fall back to properties
expanded_path = MacroHandler.replace(source_widget.getMacrosOrProperties(), expanded_path);
logger.log(Level.FINER, "{0}, effective macros {1} ({2})", new Object[] { action, macros, expanded_path });

// Resolve new display file relative to the source widget model (not 'top'!)
Expand Down Expand Up @@ -370,7 +373,7 @@ private static void openWebpage(final Widget source_widget, final OpenWebpageAct
private static String resolve(final Widget source_widget, final String path) throws Exception
{
// Path to resolve, after expanding macros
final Macros macros = source_widget.getEffectiveMacros();
final MacroValueProvider macros = source_widget.getMacrosOrProperties();
final String expanded_path = MacroHandler.replace(macros, path);

// Resolve file relative to the source widget model (not 'top'!)
Expand Down

0 comments on commit 8f6166a

Please sign in to comment.