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 40dcd7a1e432840bc3c9653f1e231ceb556619dc Author: servantie <servantie.c@gmail.com> Date: Thu Jun 9 12:01:13 2016 +0200 corrected output of manual sync (was not sending the json at all) --- .../jtimer/ui/report/TimerTaskUpdaterView.java | 21 ++++++++++++--------- .../resources/TimerTaskUpdaterView.properties | 2 +- .../resources/TimerTaskUpdaterView_fr.properties | 2 +- 3 files changed, 14 insertions(+), 11 deletions(-) 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 4537971..4d7ea5f 100644 --- a/src/main/java/org/chorem/jtimer/ui/report/TimerTaskUpdaterView.java +++ b/src/main/java/org/chorem/jtimer/ui/report/TimerTaskUpdaterView.java @@ -100,9 +100,9 @@ public class TimerTaskUpdaterView extends FrameView implements DocumentListener this.core = core; this.task = task; + timezone = "+0100"; setComponent(getMainComponent()); //default the timezone - timezone = "+0100"; updateJson = new ArrayList<>(); @@ -179,27 +179,30 @@ public class TimerTaskUpdaterView extends FrameView implements DocumentListener JXTaskPane panelOption = new JXTaskPane(getResourceMap().getString("updateOptions")); panelOption.setLayout(new GridBagLayout()); + //checkbox to include annotations checkIncludesAnnotations = new JCheckBox(); checkIncludesAnnotations.setAction(getContext().getActionMap(this).get("isIncludingAnnotations")); 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")); + //display the lastSyncDate + JLabel lastSyncDate = 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, + panelOption.add(lastSyncDate, 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)); } + //display of the timezone JLabel timezoneLabel = new JLabel(getResourceMap().getString("timezone")); - JTextField timezoneText = new JTextField(this.timezone); - panelOption.add(timezoneLabel, new GridBagConstraints(1,3,1,1,0,0, + JLabel timezoneText = new JLabel(this.timezone); + panelOption.add(timezoneLabel, new GridBagConstraints(1,3,1,2,0,0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(2,1,1,1),0,0)); - panelOption.add(timezoneText, new GridBagConstraints(2,3,1,1,0,0, + panelOption.add(timezoneText, new GridBagConstraints(2,3,1,2,0,0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(1,2,1,1),0,0)); configComponent.add(panelGeneral); @@ -431,10 +434,10 @@ public class TimerTaskUpdaterView extends FrameView implements DocumentListener connection.setUseCaches(false); connection.setDoInput(true); - connection.setRequestProperty("Content-Length", "" + updateJsonString); connection.setDoOutput(true); + connection.setRequestProperty("Content-Length", "" + Integer.toString(updateJsonString.length())); connection.setRequestProperty("Accept-Charset", charset); - connection.setRequestProperty("Content-Type", "application/json" + charset); + connection.setRequestProperty("Content-Type", "application/json"); try { connection.setRequestMethod("POST"); } catch (ProtocolException e) { @@ -442,7 +445,7 @@ public class TimerTaskUpdaterView extends FrameView implements DocumentListener } byte[] postDataBytes = new byte[0]; try { - postDataBytes = updateJson.toString().getBytes("UTF-8"); + postDataBytes = object.toString().getBytes("UTF-8"); } catch (UnsupportedEncodingException e) { log.error("Unsupported Encoding"); } 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 2ab6693..09a82f9 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 @@ -26,7 +26,7 @@ updateFrom=From : updateTo=To : lastUpdateLabel=Last Sync at: -timezone= Timezone +timezone= Timezone: pickCurrentMonth.Action.text = Select current month 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 91ed7cd..4a9a20a 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 @@ -27,7 +27,7 @@ updateFrom=De : updateTo=\u00C0 : lastUpdateLabel=Derni\u00E8re synchronisation : -timezone= Timezone +timezone= Timezone : pickCurrentMonth.Action.text = Selectionner le mois courant -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.