Author: echatellier Date: 2012-03-07 18:21:15 +0100 (Wed, 07 Mar 2012) New Revision: 2811 Url: http://chorem.org/repositories/revision/jtimer/2811 Log: Fix seconds/ms convertion Modified: trunk/src/main/java/org/chorem/jtimer/JTimerConfig.java trunk/src/main/java/org/chorem/jtimer/ui/tasks/IdleDialog.java trunk/src/main/java/org/chorem/jtimer/ui/tasks/RunTaskJob.java Modified: trunk/src/main/java/org/chorem/jtimer/JTimerConfig.java =================================================================== --- trunk/src/main/java/org/chorem/jtimer/JTimerConfig.java 2012-03-07 17:11:12 UTC (rev 2810) +++ trunk/src/main/java/org/chorem/jtimer/JTimerConfig.java 2012-03-07 17:21:15 UTC (rev 2811) @@ -1,25 +1,23 @@ /* * #%L - * - * * $Id$ * $HeadURL$ * %% * Copyright (C) 2012 Codelutin, Chatellier Eric * %% * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as + * it under the terms of the GNU General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Lesser Public + * You should have received a copy of the GNU General Public * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * <http://www.gnu.org/licenses/gpl-3.0.html>. * #L% */ @@ -91,11 +89,21 @@ public String getIOSaverDirectory() { return appConfig.getOption(JTimerOption.IO_SAVER_DIRECTORY.key); } - + + /** + * Return auto save delay in seconds. + * + * @return auto save delay + */ public long getIOSaverAutoSaveDelay() { return appConfig.getOptionAsLong(JTimerOption.IO_SAVER_AUTOSAVEDELAY.key); } + /** + * Return user idle time threshold in seconds. + * + * @return idle time threshold + */ public long getIdleTime() { return appConfig.getOptionAsLong(JTimerOption.UI_IDLE_TIME.key); } Modified: trunk/src/main/java/org/chorem/jtimer/ui/tasks/IdleDialog.java =================================================================== --- trunk/src/main/java/org/chorem/jtimer/ui/tasks/IdleDialog.java 2012-03-07 17:11:12 UTC (rev 2810) +++ trunk/src/main/java/org/chorem/jtimer/ui/tasks/IdleDialog.java 2012-03-07 17:21:15 UTC (rev 2811) @@ -160,7 +160,7 @@ // label JLabel idleLabel = new JLabel(resourceMap.getString("idleMessage", Long - .valueOf(JTimer.config.getIdleTime() / (60 * 1000)))); + .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)); Modified: trunk/src/main/java/org/chorem/jtimer/ui/tasks/RunTaskJob.java =================================================================== --- trunk/src/main/java/org/chorem/jtimer/ui/tasks/RunTaskJob.java 2012-03-07 17:11:12 UTC (rev 2810) +++ trunk/src/main/java/org/chorem/jtimer/ui/tasks/RunTaskJob.java 2012-03-07 17:21:15 UTC (rev 2811) @@ -247,7 +247,7 @@ resetTiming(); // get idle time - long configIdleTime = JTimer.config.getIdleTime(); + long configIdleTime = JTimer.config.getIdleTime() * 1000; boolean dontWantToStop = true; while (dontWantToStop) { @@ -279,7 +279,7 @@ checkReset(); // if long idleTime is unavailable, if is always false - if (idleTime >= JTimer.config.getIdleTime()) { + if (idleTime >= configIdleTime) { // to not display negative time near midnight long idleTimeOffset = Math.min(idleTime, currentTime - taskStartCalendar.getTimeInMillis());
participants (1)
-
echatellier@users.chorem.org