branch develop updated (6cca679 -> a78a41a)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository jtimer. See http://git.chorem.org/jtimer.git from 6cca679 fixes #779: If more than one task is running at a time, time is recorded in an accelerated manner fixes #778: Option to only have one task running at a time fixes #780: Stop all tasks button new a78a41a fixes #1328: When idle popup is displayed, show in the popup the current running taks(s) The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit a78a41a825dbbade89bdd32c6dcf8b3c0c7491e0 Author: Eric Chatellier <chatellier@codelutin.com> Date: Fri Feb 26 15:48:26 2016 +0100 fixes #1328: When idle popup is displayed, show in the popup the current running taks(s) Summary of changes: .../org/chorem/jtimer/ui/tasks/IdleDialog.java | 45 +++++++++++++++------- .../ui/tasks/resources/IdleDialog.properties | 5 ++- .../ui/tasks/resources/IdleDialog_fr.properties | 3 +- 3 files changed, 37 insertions(+), 16 deletions(-) -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository jtimer. See http://git.chorem.org/jtimer.git commit a78a41a825dbbade89bdd32c6dcf8b3c0c7491e0 Author: Eric Chatellier <chatellier@codelutin.com> Date: Fri Feb 26 15:48:26 2016 +0100 fixes #1328: When idle popup is displayed, show in the popup the current running taks(s) --- .../org/chorem/jtimer/ui/tasks/IdleDialog.java | 45 +++++++++++++++------- .../ui/tasks/resources/IdleDialog.properties | 5 ++- .../ui/tasks/resources/IdleDialog_fr.properties | 3 +- 3 files changed, 37 insertions(+), 16 deletions(-) diff --git a/src/main/java/org/chorem/jtimer/ui/tasks/IdleDialog.java b/src/main/java/org/chorem/jtimer/ui/tasks/IdleDialog.java index b4cc059..7d69efa 100644 --- a/src/main/java/org/chorem/jtimer/ui/tasks/IdleDialog.java +++ b/src/main/java/org/chorem/jtimer/ui/tasks/IdleDialog.java @@ -2,7 +2,7 @@ * #%L * jTimer * %% - * Copyright (C) 2009 - 2012 CodeLutin, Chatellier Eric + * Copyright (C) 2009 - 2016 CodeLutin, Chatellier Eric * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as @@ -41,11 +41,14 @@ import org.apache.commons.lang3.time.DurationFormatUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.jtimer.JTimer; +import org.chorem.jtimer.entities.TimerTask; import org.jdesktop.application.Action; import org.jdesktop.application.ApplicationContext; import org.jdesktop.application.ResourceManager; import org.jdesktop.application.ResourceMap; import org.jdesktop.application.SingleFrameApplication; +import org.jdesktop.application.Task; +import org.jdesktop.application.TaskMonitor; /** * Modal idle dialog showed to user when idle has been detected. @@ -97,6 +100,9 @@ public class IdleDialog extends JDialog { /** Timestamp when idle starts. */ protected long idleStartTimestamp; + /** Task label. */ + protected JLabel taskNameLabel; + /** Duration label. */ protected JLabel idleDurationLabel; @@ -160,25 +166,29 @@ public class IdleDialog extends JDialog { 10, 5, 10, 10), 0, 0)); // label - JLabel idleLabel = new JLabel(resourceMap.getString("idleMessage", Long - .valueOf(JTimer.config.getIdleTime() / (60)))); + JLabel idleLabel = new JLabel(resourceMap.getString("idleMessage", Long.valueOf(JTimer.config.getIdleTime() / (60)))); mainComponent.add(idleLabel, new GridBagConstraints(1, 0, 3, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 0, 3), 0, 0)); - idleDurationLabel = new JLabel(" "); - mainComponent.add(idleDurationLabel, new GridBagConstraints(1, 1, 3, 1, + taskNameLabel = new JLabel(" "); + mainComponent.add(taskNameLabel, new GridBagConstraints(1, 1, 3, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 3, 5), 0, 0)); + idleDurationLabel = new JLabel(" "); + mainComponent.add(idleDurationLabel, new GridBagConstraints(1, 2, 3, 1, + 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, + new Insets(0, 0, 3, 5), 0, 0)); + // separator - mainComponent.add(new JSeparator(), new GridBagConstraints(1, 2, 3, 1, + mainComponent.add(new JSeparator(), new GridBagConstraints(1, 3, 3, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 5), 0, 0)); // label JLabel idleRestart = new JLabel(resourceMap.getString("idleRestart")); - mainComponent.add(idleRestart, new GridBagConstraints(1, 3, 3, 1, 1, 0, + mainComponent.add(idleRestart, new GridBagConstraints(1, 4, 3, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(3, 0, 0, 5), 0, 0)); @@ -186,7 +196,7 @@ public class IdleDialog extends JDialog { revertButton.setHorizontalAlignment(SwingConstants.LEFT); revertButton.setAction(application.getContext().getActionMap(this).get( "chooseRevertOption")); - mainComponent.add(revertButton, new GridBagConstraints(1, 4, 1, 1, 1, + mainComponent.add(revertButton, new GridBagConstraints(1, 5, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(3, 0, 5, 5), 0, 0)); @@ -194,7 +204,7 @@ public class IdleDialog extends JDialog { continueButton.setHorizontalAlignment(SwingConstants.LEFT); continueButton.setAction(application.getContext().getActionMap(this) .get("chooseContinueOption")); - mainComponent.add(continueButton, new GridBagConstraints(2, 4, 1, 1, 1, + mainComponent.add(continueButton, new GridBagConstraints(2, 5, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(3, 0, 5, 5), 0, 0)); @@ -202,7 +212,7 @@ public class IdleDialog extends JDialog { resumeButton.setHorizontalAlignment(SwingConstants.LEFT); resumeButton.setAction(application.getContext().getActionMap(this).get( "chooseResumeOption")); - mainComponent.add(resumeButton, new GridBagConstraints(3, 4, 1, 1, 1, + mainComponent.add(resumeButton, new GridBagConstraints(3, 5, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(3, 0, 5, 5), 0, 0)); @@ -259,6 +269,16 @@ public class IdleDialog extends JDialog { public void setVisible(boolean b) { if (b) { + // get running task + ApplicationContext ctxt = application.getContext(); + TaskMonitor tm = ctxt.getTaskMonitor(); + Task<?, ?> t = tm.getTasks().get(0); + TimerTask currentTask = ((RunTaskJob) t).getTask(); + + // update message + taskNameLabel.setText(resourceMap.getString("currentTask", currentTask.getName())); + + // schedule timer updateIdleTime = new UpdateIdleTime(); timer.schedule(updateIdleTime, 0, 1000 * 60 /* every minutes */); } else { @@ -313,14 +333,13 @@ public class IdleDialog extends JDialog { */ protected class UpdateIdleTime extends java.util.TimerTask { - /* - * @see java.util.TimerTask#run() - */ @Override public void run() { if (log.isDebugEnabled()) { log.debug("Update idle duration"); } + + // update message String duration = DurationFormatUtils.formatDuration( System.currentTimeMillis() - idleStartTimestamp, "HH:mm"); idleDurationLabel.setText(resourceMap.getString("idleDuration", duration)); diff --git a/src/main/resources/org/chorem/jtimer/ui/tasks/resources/IdleDialog.properties b/src/main/resources/org/chorem/jtimer/ui/tasks/resources/IdleDialog.properties index 0c854c2..090cf06 100644 --- a/src/main/resources/org/chorem/jtimer/ui/tasks/resources/IdleDialog.properties +++ b/src/main/resources/org/chorem/jtimer/ui/tasks/resources/IdleDialog.properties @@ -22,9 +22,10 @@ # idle i18n idleTitle = Idle detect idleIcon = appointment-new.png -idleMessage = You have been idle for %d minutes. +idleMessage = You have been idle for %d minutes on task '%s'. idleRestart = Choose restart option : -idleDuration = Idle duration : %s. +currentTask = Task : %s +idleDuration = Idle duration : %s chooseRevertOption.Action.text=Stop chooseRevertOption.Action.shortDescription=Stop task without counting elapsed time diff --git a/src/main/resources/org/chorem/jtimer/ui/tasks/resources/IdleDialog_fr.properties b/src/main/resources/org/chorem/jtimer/ui/tasks/resources/IdleDialog_fr.properties index 6463d87..475e755 100644 --- a/src/main/resources/org/chorem/jtimer/ui/tasks/resources/IdleDialog_fr.properties +++ b/src/main/resources/org/chorem/jtimer/ui/tasks/resources/IdleDialog_fr.properties @@ -23,7 +23,8 @@ idleTitle = Inactivit\u00E9 d\u00E9tect\u00E9e idleMessage = Vous avez \u00E9t\u00E9 inactif pendant %d minutes. idleRestart = Choisissez une option : -idleDuration = Dur\u00E9e de l'inactivit\u00E9 : %s. +currentTask = T\u00E2che : %s +idleDuration = Dur\u00E9e de l'inactivit\u00E9 : %s chooseRevertOption.Action.text=Stopper chooseRevertOption.Action.shortDescription=Annuler le temps \u00E9coul\u00E9 et stopper la t\u00E2che -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm