some fixes

This commit is contained in:
rdavidek 2026-01-27 22:24:40 +01:00
parent 02b84d6acc
commit 24a0ab7451
2 changed files with 29 additions and 7 deletions

View File

@ -751,6 +751,18 @@ public class FilePanelTab extends JPanel {
// Close any active context menu or other popups // Close any active context menu or other popups
MenuSelectionManager.defaultManager().clearSelectedPath(); MenuSelectionManager.defaultManager().clearSelectedPath();
} }
} else if (e.getKeyCode() == java.awt.event.KeyEvent.VK_PAGE_DOWN && e.isControlDown()) {
int row = fileTable.getSelectedRow();
if (row >= 0) {
FileItem item = (viewMode == ViewMode.BRIEF) ? tableModel.getItemFromBriefLayout(row, briefCurrentColumn) : tableModel.getItem(row);
if (item != null && (item.isDirectory() || isArchiveFile(item.getFile()))) {
openSelectedItem();
}
}
e.consume();
} else if (e.getKeyCode() == java.awt.event.KeyEvent.VK_PAGE_UP && e.isControlDown()) {
navigateUp();
e.consume();
} else if (viewMode == ViewMode.BRIEF) { } else if (viewMode == ViewMode.BRIEF) {
handleBriefKeyNavigation(e); handleBriefKeyNavigation(e);
} else if (viewMode == ViewMode.FULL) { } else if (viewMode == ViewMode.FULL) {

View File

@ -1609,7 +1609,8 @@ public class MainWindow extends JFrame {
FilePanel targetPanel = (activePanel == leftPanel) ? rightPanel : leftPanel; FilePanel targetPanel = (activePanel == leftPanel) ? rightPanel : leftPanel;
File targetDir = targetPanel.getCurrentDirectory(); File targetDir = targetPanel.getCurrentDirectory();
FilePanel sourcePanel = activePanel;
int result = showConfirmWithBackground( int result = showConfirmWithBackground(
String.format("Copy %d items to:\n%s", selectedItems.size(), targetDir.getAbsolutePath()), String.format("Copy %d items to:\n%s", selectedItems.size(), targetDir.getAbsolutePath()),
"Copy"); "Copy");
@ -1618,11 +1619,11 @@ public class MainWindow extends JFrame {
boolean background = (result == 1); boolean background = (result == 1);
if (background) { if (background) {
addOperationToQueue("Copy", String.format("Copy %d items to %s", selectedItems.size(), targetDir.getName()), addOperationToQueue("Copy", String.format("Copy %d items to %s", selectedItems.size(), targetDir.getName()),
(cb) -> FileOperations.copy(selectedItems, targetDir, cb), targetPanel); (cb) -> FileOperations.copy(selectedItems, targetDir, cb), () -> sourcePanel.unselectAll(), targetPanel);
} else { } else {
performFileOperation((callback) -> { performFileOperation((callback) -> {
FileOperations.copy(selectedItems, targetDir, callback); FileOperations.copy(selectedItems, targetDir, callback);
}, "Copy completed", false, true, targetPanel); }, "Copy completed", false, true, () -> sourcePanel.unselectAll(), targetPanel);
} }
} else { } else {
if (activePanel != null && activePanel.getFileTable() != null) { if (activePanel != null && activePanel.getFileTable() != null) {
@ -1820,6 +1821,7 @@ public class MainWindow extends JFrame {
} }
final File finalTargetZip = targetZip; final File finalTargetZip = targetZip;
final FilePanel sourcePanel = activePanel;
int result = showConfirmWithBackground( int result = showConfirmWithBackground(
String.format("Zip %d items to:\n%s", selectedItems.size(), targetZip.getAbsolutePath()), String.format("Zip %d items to:\n%s", selectedItems.size(), targetZip.getAbsolutePath()),
"Zip"); "Zip");
@ -1828,11 +1830,11 @@ public class MainWindow extends JFrame {
boolean background = (result == 1); boolean background = (result == 1);
if (background) { if (background) {
addOperationToQueue("Zip", String.format("Zip %d items to %s", selectedItems.size(), finalTargetZip.getName()), addOperationToQueue("Zip", String.format("Zip %d items to %s", selectedItems.size(), finalTargetZip.getName()),
(cb) -> FileOperations.zip(selectedItems, finalTargetZip, cb), targetPanel); (cb) -> FileOperations.zip(selectedItems, finalTargetZip, cb), () -> sourcePanel.unselectAll(), targetPanel);
} else { } else {
performFileOperation((callback) -> { performFileOperation((callback) -> {
FileOperations.zip(selectedItems, finalTargetZip, callback); FileOperations.zip(selectedItems, finalTargetZip, callback);
}, "Zipped into " + zipName, false, true, targetPanel); }, "Zipped into " + zipName, false, true, () -> sourcePanel.unselectAll(), targetPanel);
} }
} else { } else {
requestFocusInActivePanel(); requestFocusInActivePanel();
@ -1865,6 +1867,7 @@ public class MainWindow extends JFrame {
FilePanel targetPanel = (activePanel == leftPanel) ? rightPanel : leftPanel; FilePanel targetPanel = (activePanel == leftPanel) ? rightPanel : leftPanel;
File targetDir = targetPanel.getCurrentDirectory(); File targetDir = targetPanel.getCurrentDirectory();
final FilePanel sourcePanel = activePanel;
int result = showConfirmWithBackground( int result = showConfirmWithBackground(
String.format("Unzip %s to:\n%s", zipFile.getName(), targetDir.getAbsolutePath()), String.format("Unzip %s to:\n%s", zipFile.getName(), targetDir.getAbsolutePath()),
@ -1874,11 +1877,11 @@ public class MainWindow extends JFrame {
boolean background = (result == 1); boolean background = (result == 1);
if (background) { if (background) {
addOperationToQueue("Unzip", String.format("Unzip %s to %s", zipFile.getName(), targetDir.getName()), addOperationToQueue("Unzip", String.format("Unzip %s to %s", zipFile.getName(), targetDir.getName()),
(cb) -> FileOperations.unzip(zipFile, targetDir, cb), targetPanel); (cb) -> FileOperations.unzip(zipFile, targetDir, cb), () -> sourcePanel.unselectAll(), targetPanel);
} else { } else {
performFileOperation((callback) -> { performFileOperation((callback) -> {
FileOperations.unzip(zipFile, targetDir, callback); FileOperations.unzip(zipFile, targetDir, callback);
}, "Unzipped into " + targetDir.getName(), false, true, targetPanel); }, "Unzipped into " + targetDir.getName(), false, true, () -> sourcePanel.unselectAll(), targetPanel);
} }
} else { } else {
if (activePanel != null && activePanel.getFileTable() != null) { if (activePanel != null && activePanel.getFileTable() != null) {
@ -2789,6 +2792,10 @@ public class MainWindow extends JFrame {
} }
private void addOperationToQueue(String title, String description, FileOperation operation, FilePanel... panelsToRefresh) { private void addOperationToQueue(String title, String description, FileOperation operation, FilePanel... panelsToRefresh) {
addOperationToQueue(title, description, operation, null, panelsToRefresh);
}
private void addOperationToQueue(String title, String description, FileOperation operation, Runnable postTask, FilePanel... panelsToRefresh) {
FileOperationQueue.QueuedTask task = new FileOperationQueue.QueuedTask(title, description, (callback) -> { FileOperationQueue.QueuedTask task = new FileOperationQueue.QueuedTask(title, description, (callback) -> {
operation.execute(callback); operation.execute(callback);
@ -2798,6 +2805,9 @@ public class MainWindow extends JFrame {
panel.loadDirectory(panel.getCurrentDirectory(), false, false); panel.loadDirectory(panel.getCurrentDirectory(), false, false);
} }
} }
if (postTask != null) {
postTask.run();
}
}); });
}); });