Skip to content

Commit

Permalink
Minor textual updates, show error messages, v1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr committed Nov 3, 2024
1 parent 4224add commit f8b13f0
Show file tree
Hide file tree
Showing 13 changed files with 134 additions and 56 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Version 1.2.1
- Minor textual updates
- Show error messages

Version 1.2
- Support for latest Flickr API

Expand Down
Binary file modified EasyFlickrBackup.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016 Lutana
Copyright (c) 2024 Matthias Mohr

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# EasyFlickrBackup
Easy to use application to download and backup all your photos in original size from flickr.

* Current version: 1.2
* Current version: 1.2.1
* License: MIT License

![Screenshot](https://c2.staticflickr.com/2/1701/25533200184_1d88bdfa68_o.png)
Expand All @@ -12,7 +12,7 @@ Easy to use application to download and backup all your photos in original size

## Download & Installation

* Download: https://github.com/lutana-de/easyflickrbackup/raw/master/EasyFlickrBackup.jar
* Download: https://github.com/m-mohr/easyflickrbackup/raw/master/EasyFlickrBackup.jar

Please make sure your computer meets the system requirements. After the download has finished, click on the EasyFlickrBackup.jar file.

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.lutana</groupId>
<artifactId>EasyFlickrBackup</artifactId>
<version>1.2</version>
<version>1.2.1</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
12 changes: 7 additions & 5 deletions src/main/java/de/lutana/easyflickrbackup/AboutDlg.form
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<Font bold="true" component="jLabel1" property="font" relativeSize="true" size="0"/>
</FontInfo>
</Property>
<Property name="text" type="java.lang.String" value="EasyFlickrBackup 1.2"/>
<Property name="text" type="java.lang.String" value="EasyFlickrBackup 1.2.1"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel2">
Expand All @@ -112,7 +112,7 @@
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="ff" green="33" red="0" type="rgb"/>
</Property>
<Property name="text" type="java.lang.String" value="http://www.lutana.de"/>
<Property name="text" type="java.lang.String" value="https://mohr.ws"/>
</Properties>
<Events>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jLabel5MouseClicked"/>
Expand All @@ -135,8 +135,7 @@
<Property name="editable" type="boolean" value="false"/>
<Property name="columns" type="int" value="20"/>
<Property name="rows" type="int" value="5"/>
<Property name="text" type="java.lang.String" value="Version 1.2&#xa;- Support for latest Flickr API&#xa;&#xa;Version 1.1.1&#xa;- File names comply with flickr guidelines&#xa;&#xa;Version 1.1&#xa;- Download process about 10 times faster&#xa;- Pause &amp; Resume the download process at any time&#xa;- Store files in a separate directory per user&#xa;&#xa;Version 1.0&#xa;- Initial release"/>
<Property name="caretPosition" type="int" value="0"/>
<Property name="text" type="java.lang.String" value="Version 1.2.1&#xa;- Minor textual updates&#xa;- Show error messages&#xa;&#xa;Version 1.2&#xa;- Support for latest Flickr API&#xa;&#xa;Version 1.1.1&#xa;- File names comply with flickr guidelines&#xa;&#xa;Version 1.1&#xa;- Download process about 10 times faster&#xa;- Pause &amp; Resume the download process at any time&#xa;- Store files in a separate directory per user&#xa;&#xa;Version 1.0&#xa;- Initial release"/>
</Properties>
</Component>
</SubComponents>
Expand All @@ -151,8 +150,11 @@
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="ff" green="33" red="0" type="rgb"/>
</Property>
<Property name="text" type="java.lang.String" value="https://github.com/lutana-de/easyflickrbackup"/>
<Property name="text" type="java.lang.String" value="https://github.com/m-mohr/easyflickrbackup"/>
</Properties>
<AccessibilityProperties>
<Property name="AccessibleContext.accessibleDescription" type="java.lang.String" value=""/>
</AccessibilityProperties>
<Events>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jLabel8MouseClicked"/>
</Events>
Expand Down
15 changes: 8 additions & 7 deletions src/main/java/de/lutana/easyflickrbackup/AboutDlg.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private void initComponents() {
setResizable(false);

jLabel1.setFont(jLabel1.getFont().deriveFont(jLabel1.getFont().getStyle() | java.awt.Font.BOLD));
jLabel1.setText("EasyFlickrBackup 1.2");
jLabel1.setText("EasyFlickrBackup 1.2.1");

jLabel2.setText("MIT License");

Expand All @@ -70,7 +70,7 @@ private void initComponents() {
jLabel4.setText("Matthias Mohr");

jLabel5.setForeground(new java.awt.Color(0, 51, 255));
jLabel5.setText("http://www.lutana.de");
jLabel5.setText("https://mohr.ws");
jLabel5.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jLabel5MouseClicked(evt);
Expand All @@ -82,14 +82,13 @@ public void mouseClicked(java.awt.event.MouseEvent evt) {
jTextArea1.setEditable(false);
jTextArea1.setColumns(20);
jTextArea1.setRows(5);
jTextArea1.setText("Version 1.2\n- Support for latest Flickr API\n\nVersion 1.1.1\n- File names comply with flickr guidelines\n\nVersion 1.1\n- Download process about 10 times faster\n- Pause & Resume the download process at any time\n- Store files in a separate directory per user\n\nVersion 1.0\n- Initial release");
jTextArea1.setCaretPosition(0);
jTextArea1.setText("Version 1.2.1\n- Minor textual updates\n- Show error messages\n\nVersion 1.2\n- Support for latest Flickr API\n\nVersion 1.1.1\n- File names comply with flickr guidelines\n\nVersion 1.1\n- Download process about 10 times faster\n- Pause & Resume the download process at any time\n- Store files in a separate directory per user\n\nVersion 1.0\n- Initial release");
jScrollPane1.setViewportView(jTextArea1);

jLabel7.setText("License:");

jLabel8.setForeground(new java.awt.Color(0, 51, 255));
jLabel8.setText("https://github.com/lutana-de/easyflickrbackup");
jLabel8.setText("https://github.com/m-mohr/easyflickrbackup");
jLabel8.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jLabel8MouseClicked(evt);
Expand Down Expand Up @@ -147,19 +146,21 @@ public void mouseClicked(java.awt.event.MouseEvent evt) {
.addContainerGap())
);

jLabel8.getAccessibleContext().setAccessibleDescription("");

pack();
}// </editor-fold>//GEN-END:initComponents

private void jLabel5MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel5MouseClicked
try {
Desktop.getDesktop().browse(new URI("http://www.lutana.de"));
Desktop.getDesktop().browse(new URI("https://mohr.ws"));
} catch (URISyntaxException | IOException ex) {
}
}//GEN-LAST:event_jLabel5MouseClicked

private void jLabel8MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel8MouseClicked
try {
Desktop.getDesktop().browse(new URI("https://github.com/lutana-de/easyflickrbackup"));
Desktop.getDesktop().browse(new URI("https://github.com/m-mohr/easyflickrbackup"));
} catch (URISyntaxException | IOException ex) {
}
}//GEN-LAST:event_jLabel8MouseClicked
Expand Down
28 changes: 23 additions & 5 deletions src/main/java/de/lutana/easyflickrbackup/GUI.form
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="userBoxActionPerformed"/>
</Events>
<AuxValues>
<AuxValue name="JavaCodeGenerator_InitCodePre" type="java.lang.String" value="Auth[] auths = this.flickrAuth.retrieveAll();&#xa;for (Auth auth : auths) {&#xa;&#x9;userBox.addItem(new StringContainer.Auth(auth));&#xa;}&#xa;if (userBox.getItemCount() &gt; 0) {&#xa;&#x9;userBox.setSelectedIndex(0);&#xa;&#x9;updateAuth();&#xa;}"/>
<AuxValue name="JavaCodeGenerator_InitCodePre" type="java.lang.String" value="Auth[] auths = this.flickrAuth.retrieveAll();&#xa;for (Auth auth : auths) {&#xa;&#x9;userBox.addItem(new StringContainerAuth(auth));&#xa;}&#xa;if (userBox.getItemCount() &gt; 0) {&#xa;&#x9;userBox.setSelectedIndex(0);&#xa;&#x9;updateAuth();&#xa;}"/>
</AuxValues>
</Component>
</SubComponents>
Expand All @@ -170,11 +170,12 @@
<Component id="startBtn" max="32767" attributes="0"/>
<Component id="backupSep" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="statusLabel" max="32767" attributes="0"/>
<Component id="statusLabel" pref="459" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="cancelBtn" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="progressBar" alignment="0" max="32767" attributes="0"/>
<Component id="jScrollPane1" alignment="1" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
Expand All @@ -192,9 +193,11 @@
<Component id="statusLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="cancelBtn" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" min="-2" max="-2" attributes="0"/>
<Component id="progressBar" max="32767" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="progressBar" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane1" pref="109" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
Expand Down Expand Up @@ -225,6 +228,21 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cancelBtnActionPerformed"/>
</Events>
</Component>
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>

<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTextArea" name="messageArea">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="columns" type="int" value="20"/>
</Properties>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel1">
Expand Down
54 changes: 44 additions & 10 deletions src/main/java/de/lutana/easyflickrbackup/GUI.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* The MIT License
*
* Copyright 2016 Lutana.de
* Copyright 2024 Matthias Mohr
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -88,6 +88,8 @@ private void initComponents() {
statusLabel = new javax.swing.JLabel();
progressBar = new javax.swing.JProgressBar();
cancelBtn = new javax.swing.JButton();
jScrollPane1 = new javax.swing.JScrollPane();
messageArea = new javax.swing.JTextArea();
jPanel1 = new javax.swing.JPanel();
openFolderBtn = new javax.swing.JButton();
jButton1 = new javax.swing.JButton();
Expand Down Expand Up @@ -120,7 +122,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {

Auth[] auths = this.flickrAuth.retrieveAll();
for (Auth auth : auths) {
userBox.addItem(new StringContainer.Auth(auth));
userBox.addItem(new StringContainerAuth(auth));
}
if (userBox.getItemCount() > 0) {
userBox.setSelectedIndex(0);
Expand Down Expand Up @@ -190,6 +192,10 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
}
});

messageArea.setEditable(false);
messageArea.setColumns(20);
jScrollPane1.setViewportView(messageArea);

javax.swing.GroupLayout backupPanelLayout = new javax.swing.GroupLayout(backupPanel);
backupPanel.setLayout(backupPanelLayout);
backupPanelLayout.setHorizontalGroup(
Expand All @@ -200,10 +206,11 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addComponent(startBtn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(backupSep)
.addGroup(backupPanelLayout.createSequentialGroup()
.addComponent(statusLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(statusLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 459, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(cancelBtn))
.addComponent(progressBar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addComponent(progressBar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING))
.addContainerGap())
);
backupPanelLayout.setVerticalGroup(
Expand All @@ -218,7 +225,9 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addComponent(statusLabel)
.addComponent(cancelBtn))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(progressBar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 109, Short.MAX_VALUE)
.addContainerGap())
);

Expand Down Expand Up @@ -309,7 +318,7 @@ private void updateComponents() {
}

public void updateAuth() {
StringContainer.Auth authContainer = (StringContainer.Auth) userBox.getSelectedItem();
StringContainerAuth authContainer = (StringContainerAuth) userBox.getSelectedItem();
if (authContainer != null) {
this.setAuth(authContainer.get());
}
Expand Down Expand Up @@ -375,7 +384,7 @@ private void authBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST
try {
OAuth1Token requestToken = authInterface.getAccessToken(accessToken, tokenKey);
Auth auth = authInterface.checkToken(requestToken);
StringContainer.Auth ac = new StringContainer.Auth(auth);
StringContainerAuth ac = new StringContainerAuth(auth);
userBox.addItem(ac);
userBox.setSelectedItem(ac);
updateAuth();
Expand Down Expand Up @@ -479,29 +488,52 @@ public void run() {
fos.flush();
fos.close();
bis.close();
addMessage("Succeeded", current);
}
else {
addMessage("Exists -> Skipped", current);
}
} catch (Exception e) {
addMessage(e.getMessage(), current);
error++;
}
progressBar.setValue(current);
}
page++;
} while (page <= pages && isRunning);
statusLabel.setText(isRunning ? "Download of " + total + " photos finished. " + (error == 0 ? "No" : error) + " errors occured!" : "Stopped downloading process. You can resume it at any time.");
addMessage(isRunning ? "Download of " + total + " photos finished. " + (error == 0 ? "No" : error) + " errors occured!" : "Stopped downloading process. You can resume it at any time.");
} catch (FlickrException ex) {
statusLabel.setText(ex.getMessage());
addMessage(ex.getMessage());
}
isRunning = false;
updateComponents();
}

public void addMessage(String message) {
this.addMessage(message, null);
}

public void addMessage(String message, Integer count) {
if (count == null) {
statusLabel.setText(message);
}
if (messageArea.getDocument().getLength() > 0) {
messageArea.append(System.lineSeparator());
messageArea.setCaretPosition(messageArea.getDocument().getLength());
}
if (count != null) {
messageArea.append(count + ": ");
}
messageArea.append(message);
}

/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
Expand Down Expand Up @@ -552,6 +584,8 @@ public void run() {
private javax.swing.JLabel dirLabel;
private javax.swing.JButton jButton1;
private javax.swing.JPanel jPanel1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTextArea messageArea;
private javax.swing.JButton openFolderBtn;
private javax.swing.JProgressBar progressBar;
private javax.swing.JPanel settingsPanel;
Expand Down
9 changes: 2 additions & 7 deletions src/main/java/de/lutana/easyflickrbackup/ImageSizes.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* The MIT License
*
* Copyright 2016 Matthias.
* Copyright 2016 Matthias Mohr.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand All @@ -24,17 +24,12 @@
package de.lutana.easyflickrbackup;

import com.flickr4java.flickr.photos.Size;
import java.util.AbstractMap;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;

public class ImageSizes {

private Map<Integer,String> suffix;
private final Map<Integer,String> suffix;

public ImageSizes() {
suffix = new HashMap<>();
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/de/lutana/easyflickrbackup/Settings.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* The MIT License
*
* Copyright 2016 Lutana.de
* Copyright 2024 Matthias Mohr
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand All @@ -28,7 +28,7 @@

public class Settings {

private static Preferences prefs = Preferences.userNodeForPackage(de.lutana.easyflickrbackup.Settings.class);
private static final Preferences prefs = Preferences.userNodeForPackage(Settings.class);

public static void setBackupDirectory(File file) {
if (file != null) {
Expand Down
Loading

0 comments on commit f8b13f0

Please sign in to comment.