]> gitweb.fperrin.net Git - GpsPrune.git/blobdiff - tim/prune/function/compress/MarkAndDeleteFunction.java
Version 18, July 2015
[GpsPrune.git] / tim / prune / function / compress / MarkAndDeleteFunction.java
index 2189ecb8c46d664a0b88ac897f21c0a63481de9f..dddc897480942648b603569c325b226f3831089f 100644 (file)
@@ -3,6 +3,7 @@ package tim.prune.function.compress;
 import javax.swing.JOptionPane;
 
 import tim.prune.App;
+import tim.prune.FunctionLibrary;
 import tim.prune.GenericFunction;
 import tim.prune.I18nManager;
 
@@ -39,13 +40,23 @@ public abstract class MarkAndDeleteFunction extends GenericFunction
                        I18nManager.getText(getNameKey()), JOptionPane.YES_NO_CANCEL_OPTION,
                        JOptionPane.WARNING_MESSAGE, null, buttonTexts, buttonTexts[1]);
                if (answer == JOptionPane.CANCEL_OPTION) {_automaticallyDelete = true;} // "always" is third option
+
+               // Make sure function knows what to do, whether we'll call it now or later
+               FunctionLibrary.FUNCTION_DELETE_MARKED_POINTS.setParentFunction(
+                               getNameKey(), getShouldSplitSegments());
                if (_automaticallyDelete || answer == JOptionPane.YES_OPTION)
                {
                        new Thread(new Runnable() {
-                               public void run() {
-                                       _app.finishCompressTrack();
+                               public void run()
+                               {
+                                       FunctionLibrary.FUNCTION_DELETE_MARKED_POINTS.begin();
                                }
                        }).start();
                }
        }
+
+       /** by default, segments are not split at deleted points */
+       protected boolean getShouldSplitSegments() {
+               return false;
+       }
 }