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 // The parameter is the remote path in which the file(s) are uploaded
// into // into
Consumer<String> uploadCompletedEvent = s -> this Consumer<String> uploadCompletedEvent = s -> this
.uploadCompletedEvent(s); .operationCompletedEvent(s);
for (File file : selectedFiles) { for (File file : selectedFiles) {
SshEngine.uploadFile(file, this.getCurrentWorkingDirectory(), 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())) { if (!path.equals(getCurrentWorkingDirectory())) {
// Redraw the desktop only if necessary // Redraw the desktop only if necessary
@ -477,7 +478,7 @@ public class DesktopController {
SwingUtilities.invokeLater(new Runnable() { SwingUtilities.invokeLater(new Runnable() {
@Override @Override
public void run() { public void run() {
uploadCompletedEvent(path); operationCompletedEvent(path);
} }
}); });
return; return;

View File

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