From: Frédéric Perrin Date: Sat, 30 Nov 2019 20:50:38 +0000 (+0000) Subject: Merge branch 'not-ready-for-upstreaming' into fp-integration X-Git-Tag: v19.2.fp1 X-Git-Url: http://gitweb.fperrin.net/?p=GpsPrune.git;a=commitdiff_plain;h=a3cb2b5a1ffe4d027d1c896a5ef9bb3f7b280d89;hp=-c Merge branch 'not-ready-for-upstreaming' into fp-integration --- a3cb2b5a1ffe4d027d1c896a5ef9bb3f7b280d89 diff --combined src/tim/prune/App.java index 54f1e98,247a133..317064d --- a/src/tim/prune/App.java +++ b/src/tim/prune/App.java @@@ -51,6 -51,7 +51,7 @@@ public class Ap { // Instance variables private JFrame _frame = null; + private String _titlePrefix = null; private Track _track = null; private TrackInfo _trackInfo = null; private int _lastSavePosition = 0; @@@ -79,6 -80,7 +80,7 @@@ public App(JFrame inFrame) { _frame = inFrame; + _titlePrefix = _frame.getTitle(); _undoStack = new UndoStack(); _track = new Track(); _trackInfo = new TrackInfo(_track); @@@ -454,22 -456,6 +456,22 @@@ } + /** + * Remove altitudes from selected points + */ + public void removeAltitudes(int selStart, int selEnd) + { + UndoRemoveAltitudes undo = new UndoRemoveAltitudes(_trackInfo, selStart, selEnd); + if (_trackInfo.getTrack().removeAltitudes(selStart, selEnd)) + { + _undoStack.add(undo); + _trackInfo.getSelection().markInvalid(); + UpdateMessageBroker.informSubscribers(DataSubscriber.DATA_EDITED); + UpdateMessageBroker.informSubscribers(I18nManager.getText("confirm.removealtitudes")); + } + } + + /** * Merge the track segments within the current selection */ @@@ -775,8 -761,8 +777,10 @@@ + " '" + inSourceInfo.getName() + "'"); // update menu _menuManager.informFileLoaded(); + // recentre viewport on new file data + _viewport.recentreViewport(); + // update main window title + updateTitle(); // Remove busy lock _busyLoading = false; // load next file if there's a queue @@@ -1019,4 -1005,16 +1023,16 @@@ public void setCurrentMode(AppMode inMode) { _appMode = inMode; } + + /** Update main window title **/ + public void updateTitle() { + ArrayList filenames = _trackInfo.getFileInfo().getFilenames(); + if (filenames.size() > 0) { + _frame.setTitle(_titlePrefix + ": " + String.join(", ", filenames)); + } + else + { + _frame.setTitle(_titlePrefix); + } + } }