There is a default sub-menu 'Locate image' with this command Image LOCATE=menu,nohide.
I think that this menu or maps services under this menu should be disable if no file is selected, or better if no image is selected, or better if file without coordonate is selected.
Now if I create button with this command Image LOCATE=google, how to disable it with Evaluator if image have no coordonates ?
... but apparently IsSet() is not one of the functions referenced here:
As well as the above variables, you can also use evaluator functions like IsChecked and IsEnabled to query other information about the state of the Lister.
You need to reset option image_locate_services in Preferences / Miscellaneous / Advanced: [Behavior]. The service names are added in brackets and will be displayed after restarting Opus.
Image LOCATE buttons are hidden by default if there's no GPS information; the ones in the submenu are an exception, which are only disabled.
You should be able to use IsEnabled() in the evaluator to use this to check for GPS, e.g. IsEnabled("Image LOCATE") should return true if GPS is available.
I have 2 images in this folder, with and without coordinates.
Boutons in Lister
I have toolbar with 3 buttons, Image LOCATE=menu, Image LOCATE=menu,nohide and Image LOCATE=google.
Look this video, if no files are selected, items in both menus are not disable and the last button too. Normal ?
Note that Google Earth is not visible in button Image LOCATE=menu,nohide despite keyword nohide. Normal ?
Look now, if the file does not have GPS coordinates, items in both menus are not disable and the last button too. Normal ?
Boutons in Viewer
Look, I have button Image LOCATE=menu,nohide in menu, items in menu are not disable. Normal ?
Now, I have button Image LOCATE=google that is not display in toolbar even if image have coordinates. Normal ?
Evaluator
This do nothing... Maybe not possible to disable based on metadata ?
Context stuff won't work in the Lister itself, since determining whether a file has coordinates in it or not is an expensive operation. You could maybe do something with the evaluator, but by default it ignores Image LOCATE commands completely (with the exception of Bing Maps, which we check if it's installed or not) and they'll always be enabled.
In the viewer, we already have the image data so we know if there are coordinates or not. In the main toolbar, Image LOCATE commands are hidden if there are no coordinates. In the menu they're disabled. It's normal Windows behaviour for the parent menu to stay enabled whether the things in it are disabled or not.
I would have expected that to work, but I haven't tried it yet.
Ok I understand that extract date from metadata could be an expensive operation. I didn't succeed with Evaluator, maybe one day someone will...
In my example, file have coordinates, so items in locate menu should be enable and button in toolbar should be visible. That is, currently items in locate menu are always disabled and the buttons are always hidden
In the viewer, if the current image has coordinates, items in the locate menu should be enabled and the toolbar button should be visible, yes. That's what happens for me.
I just did some testing and found something, by myself.
I remind you that the problem is that the Locate image menu items are disabled in the viewer even though the image has GPS coordinates in the metadata.
I did a reset of the viewer toolbar and the Locate image menu items are enabled, so there is a problem with the toolbar.
I have the Image LOCATE=menu button in the File menu and I also have an Image LOCATE=google button in my bar.
I removed the Image LOCATE=google button and closed the viewer.
After reopening the viewer, the Image LOCATE=menu menu items are now activated.
So to reproduce the problem:
Reset the viewer toolbar and close it.
Reopen the viewer (so items activated in the Image menu LOCATE=menu in File)
Create a button anywhere in the toolbar with the Image LOCATE=google command.
Close and reopen the viewer.
The menu items are disabled and the created button is hidden.
Now, another test in defaut viewer toolbar, if I move Locate image menu out of File menu and restart viewer… it’s ok, items in menu are still enabled.
If you change this button command to Image LOCATE=google and restart viewer… button is always hidden.