Function renaming

This commit is contained in:
xfarrow 2023-08-10 10:21:39 +02:00
parent 4325c59a40
commit 8dcde7c309
2 changed files with 7 additions and 8 deletions

View File

@ -166,7 +166,7 @@ public class DesktopController {
// The parameter is the remote path in which the file(s) are uploaded
// into
Consumer<String> uploadCompletedEvent = s -> this
.uploadCompletedEvent(s);
.operationCompletedEvent(s);
for (File file : selectedFiles) {
SshEngine.uploadFile(file, this.getCurrentWorkingDirectory(),
@ -460,9 +460,10 @@ public class DesktopController {
}
/**
* Event that gets fired once
* Event that gets fired once an operation on the file
* system has been completed (such as an upload)
*/
public void uploadCompletedEvent(String path) {
public void operationCompletedEvent(String path) {
if (!path.equals(getCurrentWorkingDirectory())) {
// Redraw the desktop only if necessary
@ -477,7 +478,7 @@ public class DesktopController {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
uploadCompletedEvent(path);
operationCompletedEvent(path);
}
});
return;

View File

@ -198,7 +198,7 @@ public class Desktop extends JFrame implements IDesktopFrame {
controller.setCurrentWorkingDirectory(directory);
try {
// Load the desktop content
// Load the desktop's content
loadDesktop();
} catch (Exception ex) {
// Handle lack of permissions or other errors
@ -267,9 +267,7 @@ public class Desktop extends JFrame implements IDesktopFrame {
element.add(iconLabel);
element.setBackground(new Color(255, 255, 255));
element.setToolTipText(node.getFilename());
int buttonWidth = 75;
int buttonHeight = element.getPreferredSize().height;
Dimension buttonSize = new Dimension(buttonWidth, buttonHeight);
Dimension buttonSize = new Dimension(75, element.getPreferredSize().height);
element.setPreferredSize(buttonSize);
element.setMaximumSize(buttonSize);
element.setMinimumSize(buttonSize);