Title now includes the hostname

This may be useful when more instances of Guify are open.
This commit is contained in:
xfarrow 2023-07-24 11:48:52 +02:00
parent 8c095a3d3e
commit f54fef2f0d
3 changed files with 11 additions and 3 deletions

View File

@ -4,8 +4,8 @@ import java.awt.Color;
public class Constants { public class Constants {
public static final String APP_NAME = "Guify"; public static final String APP_NAME = "Guify";
public static final String VERSION = "1.0"; public static final String VERSION = "1.0.1";
public static final int VERSION_PROGRESSIVE = 0; public static final int VERSION_PROGRESSIVE = 1;
public static class Constants_FSOperations{ public static class Constants_FSOperations{
public static final int NONE = 0; public static final int NONE = 0;

View File

@ -7,6 +7,7 @@ import com.jcraft.jsch.SftpException;
import code.Constants; import code.Constants;
import code.Constants.Constants_FSOperations; import code.Constants.Constants_FSOperations;
import code.GuiAbstractions.Implementations.JFrameFactory; import code.GuiAbstractions.Implementations.JFrameFactory;
import controllers.LoginController.LoginCredentials;
import views.interfaces.IDesktopFrame; import views.interfaces.IDesktopFrame;
import code.TreeNode; import code.TreeNode;
import code.Helper; import code.Helper;
@ -430,6 +431,13 @@ public class DesktopController {
frame.setVisible(show); frame.setVisible(show);
} }
public String getTitle() {
StringBuilder title = new StringBuilder(Constants.APP_NAME);
title.append(" - ");
title.append(LoginCredentials.host);
return title.toString();
}
/* /*
* ========== END Other ========== * ========== END Other ==========
*/ */

View File

@ -89,7 +89,7 @@ public class Desktop extends JFrame implements IDesktopFrame {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 1280, 720); setBounds(100, 100, 1280, 720);
getContentPane().setLayout(null); getContentPane().setLayout(null);
setTitle(Constants.APP_NAME); setTitle(this.controller.getTitle());
treePanel = new JScrollPane(); treePanel = new JScrollPane();
treePanel.setBounds(0, 36, 150, 634); treePanel.setBounds(0, 36, 150, 634);