X-Git-Url: https://gitweb.fperrin.net/?a=blobdiff_plain;f=src%2Ftim%2Fprune%2FApp.java;h=317064d39984acb566cee90940236c52c32fd58f;hb=a3cb2b5a1ffe4d027d1c896a5ef9bb3f7b280d89;hp=1bef98ba4497d932e331e03c4125ff73a34171c9;hpb=cba8e9495b9785fd22e30f41ddcf790e98901086;p=GpsPrune.git diff --git a/src/tim/prune/App.java b/src/tim/prune/App.java index 1bef98b..317064d 100644 --- a/src/tim/prune/App.java +++ b/src/tim/prune/App.java @@ -51,6 +51,7 @@ public class App { // 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 @@ public class App public App(JFrame inFrame) { _frame = inFrame; + _titlePrefix = _frame.getTitle(); _undoStack = new UndoStack(); _track = new Track(); _trackInfo = new TrackInfo(_track); @@ -775,6 +777,10 @@ public class App + " '" + 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 @@ -1017,4 +1023,16 @@ public class App 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); + } + } }