diff --git a/Guify/src/controllers/DesktopController.java b/Guify/src/controllers/DesktopController.java index 3b22a0e..10c880c 100644 --- a/Guify/src/controllers/DesktopController.java +++ b/Guify/src/controllers/DesktopController.java @@ -166,7 +166,7 @@ public class DesktopController { // The parameter is the remote path in which the file(s) are uploaded // into Consumer 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; diff --git a/Guify/src/views/Desktop.java b/Guify/src/views/Desktop.java index 72029c9..c46063f 100644 --- a/Guify/src/views/Desktop.java +++ b/Guify/src/views/Desktop.java @@ -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);