import java.awt.event.ActionListener;
import java.io.File;
+import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import tim.prune.I18nManager;
import tim.prune.UpdateMessageBroker;
import tim.prune.config.Config;
-import tim.prune.data.Altitude;
import tim.prune.data.Coordinate;
import tim.prune.data.DataPoint;
import tim.prune.data.Photo;
{
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
- panel.add(new JLabel(I18nManager.getText("dialog.saveexif.intro")), BorderLayout.NORTH);
+ // Label at top
+ JLabel topLabel = new JLabel(I18nManager.getText("dialog.saveexif.intro"));
+ topLabel.setBorder(BorderFactory.createEmptyBorder(8, 6, 5, 6));
+ panel.add(topLabel, BorderLayout.NORTH);
// centre panel with most controls
JPanel centrePanel = new JPanel();
centrePanel.setLayout(new BorderLayout());
{
// Only look at photos which are selected and whose status has changed since load
photo = entry.getPhoto();
- if (photo != null && photo.getOriginalStatus() != photo.getCurrentStatus())
+ if (photo != null && photo.isModified())
{
// Increment counter if save successful
if (savePhoto(photo, overwriteFlag, false)) {
}
_progressBar.setVisible(false);
// Show confirmation
- UpdateMessageBroker.informSubscribers(I18nManager.getText("confirm.saveexif.ok1") + " "
- + numSaved + " " + I18nManager.getText("confirm.saveexif.ok2"));
+ UpdateMessageBroker.informSubscribers(I18nManager.getTextWithNumber("confirm.saveexif.ok", numSaved));
if (numFailed > 0)
{
JOptionPane.showMessageDialog(_parentFrame,
- I18nManager.getText("error.saveexif.failed1") + " " + numFailed + " "
- + I18nManager.getText("error.saveexif.failed2"),
+ I18nManager.getTextWithNumber("error.saveexif.failed", numFailed),
I18nManager.getText("dialog.saveexif.title"), JOptionPane.ERROR_MESSAGE);
}
if (numForced > 0)
{
JOptionPane.showMessageDialog(_parentFrame,
- I18nManager.getText("error.saveexif.forced1") + " " + numForced + " "
- + I18nManager.getText("error.saveexif.forced2"),
+ I18nManager.getTextWithNumber("error.saveexif.forced", numForced),
I18nManager.getText("dialog.saveexif.title"), JOptionPane.WARNING_MESSAGE);
}
// close dialog, all finished
*/
private boolean savePhoto(Photo inPhoto, boolean inOverwriteFlag, boolean inForceFlag)
{
+ // If photos don't have a file, then can't save them
+ if (inPhoto.getFile() == null) {
+ return false;
+ }
// Check whether photo file still exists
if (!inPhoto.getFile().exists())
{
result[paramOffset + 3] = "-GPSLongitudeRef=" + inPoint.getLongitude().output(Coordinate.FORMAT_CARDINAL);
// add altitude if it has it
result[paramOffset + 4] = "-GPSAltitude="
- + (inPoint.hasAltitude()?inPoint.getAltitude().getValue(Altitude.Format.METRES):0);
+ + (inPoint.hasAltitude()?inPoint.getAltitude().getMetricValue():0);
result[paramOffset + 5] = "-GPSAltitudeRef='Above Sea Level'";
// add the filename to modify
result[paramOffset + 6] = inFile.getAbsolutePath();