From e169754b77b689551d1dc4289b1f817f5dac7c87 Mon Sep 17 00:00:00 2001 From: asvitkine Date: Sun, 26 Dec 2021 23:04:41 -0500 Subject: [PATCH] Add tooltips to restore buttons. --- src/impsave/InfoPanel.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/impsave/InfoPanel.java b/src/impsave/InfoPanel.java index 116aec7..c283b9f 100644 --- a/src/impsave/InfoPanel.java +++ b/src/impsave/InfoPanel.java @@ -164,7 +164,9 @@ public void setGameInfo(GameInfo info) { BorderFactory.createEmptyBorder(2, 2, 2, 2))); grid.setLayout(new GridLayout(5, 2)); JButton button = new JButton("- Autosave -"); - button.setName(info.fileNamePrefix + "A.imp"); + String targetFile = info.fileNamePrefix + "A.imp"; + button.setName(targetFile); + button.setToolTipText("Restore to " + targetFile); button.addActionListener(this); grid.add(button); grid.add(new JPanel()); @@ -204,12 +206,15 @@ public void itemStateChanged(ItemEvent unused) { } else { button.setText(getRestoreButtonNamePrefix(i) + saveDb.getSoloSaveGameName(i)); } - button.setName(saveDb.getFilename(info.fileNamePrefix, i)); + String targetFile = saveDb.getFilename(info.fileNamePrefix, i); + button.setName(targetFile); + button.setToolTipText("Restore to " + targetFile); i++; } else { button.setText(" Select for Restore "); String targetFile = Utils.truncateAtChar(fileToRestore.getParentFile().getName(), ' '); button.setName(targetFile); + button.setToolTipText("Restore to " + targetFile); } button.setEnabled(true); }