]> gitweb.fperrin.net Git - GpsPrune.git/blobdiff - tim/prune/function/PhotoPopupFunction.java
Version 14, October 2012
[GpsPrune.git] / tim / prune / function / PhotoPopupFunction.java
index 6b8b3e016143861f3caf648ce7f5dba03be381e4..da9c5ca127d869ca64be4fb56fe63049a800c7b2 100644 (file)
@@ -61,7 +61,14 @@ public class PhotoPopupFunction extends GenericFunction
                        _frame.setLocationRelativeTo(_parentFrame);
                }
                initFrame();
-               _frame.setVisible(true);
+               final Photo photo = _app.getTrackInfo().getCurrentPhoto();
+               if (photo.getWidth() <= 0 || photo.getHeight() <= 0) {
+                       _app.showErrorMessageNoLookup(getNameKey(), I18nManager.getText("error.showphoto.failed")
+                        + " : " + photo.getName());
+               }
+               else {
+                       _frame.setVisible(true);
+               }
        }
 
        /**
@@ -71,8 +78,8 @@ public class PhotoPopupFunction extends GenericFunction
        {
                _frame.setVisible(false);
                Photo photo = _app.getTrackInfo().getCurrentPhoto();
-               _frame.setTitle(photo.getFile().getName());
-               _label.setText("'" + photo.getFile().getName() + "' ("
+               _frame.setTitle(photo.getName());
+               _label.setText("'" + photo.getName() + "' ("
                        + photo.getWidth() + " x " + photo.getHeight() + ")");
                _photoThumb.setPhoto(photo);
        }