X-Git-Url: https://gitweb.fperrin.net/?a=blobdiff_plain;f=src%2Ftim%2Fprune%2FApp.java;fp=src%2Ftim%2Fprune%2FApp.java;h=09fa510ec90327ec25a813a16829782b887154d4;hb=28ff57e241b8c7211472b1635f8ba914f2ad8dc5;hp=2e7594178ae2b379eccffd2d3cf41bb9f6494e61;hpb=d97c5cdcf78c79ccf7d5de2d2a35d2bdbce22f5e;p=GpsPrune.git diff --git a/src/tim/prune/App.java b/src/tim/prune/App.java index 2e75941..09fa510 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); @@ -759,6 +761,8 @@ public class App + " '" + inSourceInfo.getName() + "'"); // update menu _menuManager.informFileLoaded(); + // update main window title + updateTitle(); // recentre viewport on new file data _viewport.recentreViewport(); // Remove busy lock @@ -1003,4 +1007,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); + } + } }