10/75: added an error message if the update isn't done, asking to check for url
This is an automated email from the git hooks/post-receive script. New commit to branch feature/sync in repository jtimer. See https://gitlab.nuiton.org/chorem/jtimer.git commit 3cbcd20b9aca4e243d190e0bf46c287ed6d885ac Author: servantie <servantie.c@gmail.com> Date: Fri May 20 11:41:53 2016 +0200 added an error message if the update isn't done, asking to check for url --- .../chorem/jtimer/ui/report/TimerTaskUpdaterView.java | 19 +++++++++++++++++++ .../report/resources/TimerTaskUpdaterView.properties | 6 ++++++ .../resources/TimerTaskUpdaterView_fr.properties | 6 ++++++ 3 files changed, 31 insertions(+) diff --git a/src/main/java/org/chorem/jtimer/ui/report/TimerTaskUpdaterView.java b/src/main/java/org/chorem/jtimer/ui/report/TimerTaskUpdaterView.java index 4b72b27..078f67f 100644 --- a/src/main/java/org/chorem/jtimer/ui/report/TimerTaskUpdaterView.java +++ b/src/main/java/org/chorem/jtimer/ui/report/TimerTaskUpdaterView.java @@ -22,6 +22,7 @@ */ package org.chorem.jtimer.ui.report; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.jtimer.JTimer; @@ -174,6 +175,16 @@ public class TimerTaskUpdaterView extends FrameView implements DocumentListener panelOption.add(checkIncludesAnnotations, new GridBagConstraints(1, 1, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(1, 1, 1, 1), 0, 0)); + JLabel lastUpdateLabel = new JLabel(getResourceMap().getString("lastUpdateLabel")); + //if there has been an update before, display its date + LocalDateTime lastSyncTime = task.getLastSync(); + if (lastSyncTime != null) { + JLabel lastUpdate = new JLabel(lastSyncTime.toLocalDate().toString()); + panelOption.add(lastUpdateLabel, new GridBagConstraints(1, 2, 1, 1, 0, 0, + GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(2, 1, 1, 1), 0, 0)); + panelOption.add(lastUpdate, new GridBagConstraints(2, 2, 1, 1, 0, 0, + GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(1, 2, 1, 1), 0, 0)); + } configComponent.add(panelGeneral); @@ -449,6 +460,14 @@ public class TimerTaskUpdaterView extends FrameView implements DocumentListener if (hasUpdated) { core.getData().editTaskLastSync(task, LocalDateTime.now()); } + else { + log.error("Update error, wrong URL?"); + String message = getResourceMap().getString("action.updateError"); + String title = getResourceMap().getString("action.updateErrorTitle"); + JOptionPane.showMessageDialog(this.getMainComponent(), message, title, + JOptionPane.ERROR_MESSAGE); + + } } @Override diff --git a/src/main/resources/org/chorem/jtimer/ui/report/resources/TimerTaskUpdaterView.properties b/src/main/resources/org/chorem/jtimer/ui/report/resources/TimerTaskUpdaterView.properties index 8268439..9546d72 100644 --- a/src/main/resources/org/chorem/jtimer/ui/report/resources/TimerTaskUpdaterView.properties +++ b/src/main/resources/org/chorem/jtimer/ui/report/resources/TimerTaskUpdaterView.properties @@ -25,6 +25,9 @@ updateOptions=Options updateFrom=From : updateTo=To : +lastUpdateLabel=Last Sync at: + + pickCurrentMonth.Action.text = Select current month pickCurrentMonth.Action.shortDescription = Select current month @@ -51,3 +54,6 @@ sendUpdate.Action.shortDescription = Send update closeView.Action.text = &Close closeView.Action.icon = dialog-close.png closeView.Action.shortDescription = Close + +action.updateError = Update failed, check URL ? +action.updateErrorTitle = Update error diff --git a/src/main/resources/org/chorem/jtimer/ui/report/resources/TimerTaskUpdaterView_fr.properties b/src/main/resources/org/chorem/jtimer/ui/report/resources/TimerTaskUpdaterView_fr.properties index 3f3eacc..d5c7b71 100644 --- a/src/main/resources/org/chorem/jtimer/ui/report/resources/TimerTaskUpdaterView_fr.properties +++ b/src/main/resources/org/chorem/jtimer/ui/report/resources/TimerTaskUpdaterView_fr.properties @@ -26,6 +26,9 @@ updateOptions=Options updateFrom=De : updateTo=\u00C0 : +lastUpdateLabel=Derni\u00E8re mise \u00E0 jour : + + pickCurrentMonth.Action.text = Selectionner le mois courant pickCurrentMonth.Action.shortDescription = Selectionner le mois courant @@ -51,3 +54,6 @@ sendUpdate.Action.shortDescription = Envoyer la mise \u00C0 jour closeView.Action.text = &Fermer closeView.Action.icon = dialog-close.png closeView.Action.shortDescription = Fermer + +action.updateError = Erreur de mise \u00E0 jour, v\u00E9rifier l'URL ? +action.updateErrorTitle = Erreur de mise \u00E0 jour \ No newline at end of file -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm