From 1da730dd1d7fb65ef5471ac19fee431ffcf32792 Mon Sep 17 00:00:00 2001 From: M*C*O Date: Thu, 14 Jun 2018 23:07:06 +0200 Subject: [PATCH] Allow user to set a specific title for gui client --- src/com/sheepit/client/standalone/GuiSwing.java | 6 ++++-- src/com/sheepit/client/standalone/Worker.java | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/com/sheepit/client/standalone/GuiSwing.java b/src/com/sheepit/client/standalone/GuiSwing.java index 6057411..6fdaaaf 100644 --- a/src/com/sheepit/client/standalone/GuiSwing.java +++ b/src/com/sheepit/client/standalone/GuiSwing.java @@ -62,6 +62,7 @@ public class GuiSwing extends JFrame implements Gui { private Settings activitySettings; private TrayIcon trayIcon; private boolean useSysTray; + private String title; private int framesRendered; @@ -70,9 +71,10 @@ public class GuiSwing extends JFrame implements Gui { private ThreadClient threadClient; - public GuiSwing(boolean useSysTray_) { + public GuiSwing(boolean useSysTray_, String title_) { framesRendered = 0; useSysTray = useSysTray_; + title = title_; waitingForAuthentication = true; new Timer().scheduleAtFixedRate(new TimerTask() { @@ -118,7 +120,7 @@ public class GuiSwing extends JFrame implements Gui { setIconImage(img.getImage()); } - setTitle("SheepIt Render Farm"); + setTitle(title); setSize(520, 680); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); diff --git a/src/com/sheepit/client/standalone/Worker.java b/src/com/sheepit/client/standalone/Worker.java index b3e18cc..1f3386e 100644 --- a/src/com/sheepit/client/standalone/Worker.java +++ b/src/com/sheepit/client/standalone/Worker.java @@ -102,6 +102,9 @@ public class Worker { @Option(name = "-priority", usage = "Set render process priority (19 lowest to -19 highest)", required = false) private int priority = 19; + + @Option(name = "-title", usage = "Custom title for the GUI Client", required = false) + private String title = "SheepIt Render Farm"; public static void main(String[] args) { new Worker().doMain(args); @@ -304,7 +307,7 @@ public class Worker { System.out.println("You should set a DISPLAY or use a text ui (with -ui " + GuiTextOneLine.type + " or -ui " + GuiText.type + ")."); System.exit(3); } - gui = new GuiSwing(no_systray == false); + gui = new GuiSwing(no_systray == false, title); break; } Client cli = new Client(gui, config, server);