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 47ce041af4f1e53bf768c71ab6bd619c24eb4385 Author: servantie <servantie.c@gmail.com> Date: Mon Jun 13 10:39:36 2016 +0200 added url shows up in combobox list --- src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java | 8 ++++---- src/main/java/org/chorem/jtimer/io/TimerTaskSynchronizer.java | 3 +++ .../java/org/chorem/jtimer/ui/report/TimerTaskUpdaterView.java | 9 +++++++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java b/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java index 6c40ed5..2d20deb 100644 --- a/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java +++ b/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java @@ -375,9 +375,9 @@ public class TimerTaskHelper { String dateString = date.toString(); //as jtimer has time entries only for a day, the id of the times will be the date in yyyy-mm-dd format JsonObject periodElement = new JsonObject(); - periodElement.addProperty("periodId", dateString); - periodElement.addProperty("periodStartDate", dateString + "T00:00:00.000" + timezone); - periodElement.addProperty("periodDuration", entry.getValue()); + periodElement.addProperty("id", dateString); + periodElement.addProperty("startDate", dateString + "T00:00:00.000" + timezone); + periodElement.addProperty("duration", entry.getValue()); if (withAnnotations && !(getAnnotation(task, entry.getKey()).isEmpty())) { StringBuilder builder = new StringBuilder(); for (String s : getAnnotation(task, entry.getKey())) { @@ -385,7 +385,7 @@ public class TimerTaskHelper { builder.append(","); } String annotations = builder.toString(); - periodElement.addProperty("periodInfo", annotations); + periodElement.addProperty("info", annotations); } periodArray.add(periodElement); diff --git a/src/main/java/org/chorem/jtimer/io/TimerTaskSynchronizer.java b/src/main/java/org/chorem/jtimer/io/TimerTaskSynchronizer.java index 37c685f..601c0a5 100644 --- a/src/main/java/org/chorem/jtimer/io/TimerTaskSynchronizer.java +++ b/src/main/java/org/chorem/jtimer/io/TimerTaskSynchronizer.java @@ -161,6 +161,9 @@ public class TimerTaskSynchronizer implements DataEventListener { if ("HTTP/1.1 200 OK".equals(s)) { hasUpdated = true; } + else { + log.info("Error" + s); + } } } } catch (MalformedURLException e) { 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 19e838c..b302fde 100644 --- a/src/main/java/org/chorem/jtimer/ui/report/TimerTaskUpdaterView.java +++ b/src/main/java/org/chorem/jtimer/ui/report/TimerTaskUpdaterView.java @@ -211,7 +211,7 @@ public class TimerTaskUpdaterView extends FrameView implements DocumentListener, //display the various urls to sync to in a combobox to choose which one will be updated JLabel urlcomboBoxLabel = new JLabel(getResourceMap().getString("urlComboLabel")); urlComboBox = new JComboBox<>(); - //make it editable to add new urls -todo: save these urls to the task- + //make it editable to add new urls urlComboBox.setEditable(true); urlComboBox.addActionListener(this); //add the urls to the combobox @@ -469,8 +469,12 @@ public class TimerTaskUpdaterView extends FrameView implements DocumentListener, for (String s : entry.getValue()) { //positive answer, synchronization accepted if ("HTTP/1.1 200 OK".equals(s)) { + log.debug("OK (200)"); hasUpdated = true; } + else if ("HTTP/1.1 400 Bad Request".equals(s)) { + log.debug("Bad Request (400)"); + } } } connection.disconnect(); @@ -535,7 +539,8 @@ public class TimerTaskUpdaterView extends FrameView implements DocumentListener, */ public void itemAdded(){ String urlToAdd = (String) urlComboBox.getSelectedItem(); - if (!urlToAdd.isEmpty()) { + if ((!urlToAdd.isEmpty()) && (!urlSyncList.contains(urlToAdd))) { + urlComboBox.addItem(urlToAdd); task.addURLToSyncList(urlToAdd); } -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.