]> gitweb.fperrin.net Git - GpsPrune.git/blobdiff - tim/prune/function/estimate/EstimateTime.java
Version 16, February 2014
[GpsPrune.git] / tim / prune / function / estimate / EstimateTime.java
index 7a502e4332ed03e9aca1d451d170f7bd70aa4800..ef6979358edaefb64828469f18a2c41e6daf8846 100644 (file)
@@ -29,6 +29,7 @@ import tim.prune.data.Unit;
 import tim.prune.gui.DecimalNumberField;
 import tim.prune.gui.DisplayUtils;
 import tim.prune.gui.GuiGridLayout;
+import tim.prune.tips.TipManager;
 
 /**
  * Class to calculate and show the results of estimating (hike) time for the current range
@@ -86,7 +87,8 @@ public class EstimateTime extends GenericFunction
                }
                if (_dialog == null)
                {
-                       // TODO: Check whether params are at default, show tip message if unaltered?
+                       // First time in, check whether params are at default, show tip message if unaltered
+                       showTip();
                        _dialog = new JDialog(_parentFrame, I18nManager.getText(getNameKey()), true);
                        _dialog.setLocationRelativeTo(_parentFrame);
                        _dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
@@ -360,4 +362,16 @@ public class EstimateTime extends GenericFunction
                }
                _dialog.dispose();
        }
+
+       /**
+        * Show a tip to use the learn function, if appropriate
+        */
+       private void showTip()
+       {
+               EstimationParameters currParams = new EstimationParameters(
+                       Config.getConfigString(Config.KEY_ESTIMATION_PARAMS));
+               if (currParams.sameAsDefaults()) {
+                       _app.showTip(TipManager.Tip_LearnTimeParams);
+               }
+       }
 }