* use wait-cursor for when loading xattr takes a while

This commit is contained in:
Reinhard Pointner 2014-06-28 06:34:06 +00:00
parent 7799f25a3a
commit 5a8bcba4f1
1 changed files with 12 additions and 8 deletions

View File

@ -305,16 +305,20 @@ public class RenamePanel extends JComponent {
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
try { try {
if (namesList.getModel().isEmpty()) { if (namesList.getModel().isEmpty()) {
ArrayList<File> files = new ArrayList<File>(renameModel.files()); try {
ArrayList<Object> objects = new ArrayList<Object>(files.size()); getWindow(evt.getSource()).setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
for (File file : files) { ArrayList<File> files = new ArrayList<File>(renameModel.files());
Object metaObject = MediaDetection.readMetaInfo(file); ArrayList<Object> objects = new ArrayList<Object>(files.size());
objects.add(metaObject != null ? metaObject : file); for (File file : files) {
Object metaObject = MediaDetection.readMetaInfo(file);
objects.add(metaObject != null ? metaObject : file);
}
renameModel.clear();
renameModel.addAll(objects, files);
} finally {
getWindow(evt.getSource()).setCursor(Cursor.getDefaultCursor());
} }
renameModel.clear();
renameModel.addAll(objects, files);
} else { } else {
int index = namesList.getListComponent().getSelectedIndex(); int index = namesList.getListComponent().getSelectedIndex();
File file = (File) filesList.getListComponent().getModel().getElementAt(index); File file = (File) filesList.getListComponent().getModel().getElementAt(index);