Added explanation tooltips to the settings activity

This commit is contained in:
Harlekin
2021-04-21 09:05:22 +02:00
parent e5b102b2d7
commit 5c1451d322
2 changed files with 51 additions and 1 deletions

View File

@@ -0,0 +1,40 @@
package com.sheepit.client.standalone;
public enum SwingTooltips {
WORKING_DIRECTORY(
"Where Sheepit stores things like downloaded projects, finished frames etc. Unless you want to free up your C: drive, Auto detected will do just fine."),
COMPUTE_DEVICES("What Sheepit will use to render. Note that only one device can be active at a time, e.g. sometimes you get jobs for your \n"
+ "GPU so your CPU takes a break, sometimes it's the other way around. The only way to always use 100% of your system \n"
+ "is to setup 2 clients, but for that you need to use the command line to give them different configs."),
RENDERBUCKET_SIZE("Basically the size of the orange squares you see in blender when you render. Blender calls it tile size. Unless you know better, the default is fine."),
CPU_CORES("How many (logical) cores of your CPU, often called threads, Sheepit may use. This doesn't apply to GPU-jobs. \n"
+ "(Generally GPU jobs will use a single core to use the GPU, which doesn't use 100% of that core.)"),
MEMORY("How much RAM Sheepit may use. This isn't a 100% safe limit, since Blender can erroneously use more, \n"
+ "but Sheepit will try its best to give you jobs that require less than what you've entered here."),
PRIORITY("Which priority in your system the rendering process should have. Note that minus 19 is the highest, 19 is the lowest."),
MINIMIZE_TO_SYSTRAY("Whether Sheepit should vanish into your system tray (the icons next to the clock in the bottom right) when you minimize the window."),
PROXY("If you don't know what this does, you don't need it. Useful for example if you're in a company network with restricted access."),
COMPUTER_NAME("What this machine will be displayed as on your Sheepit profile page. Only you and admins can see this."),
MAX_TIME_PER_FRAME("How much time a frame should take at most. Sheepit will try to assign jobs to your machine that take less time to compute.");
private final String explanation;
private SwingTooltips(String explanation) {
this.explanation = explanation;
}
public String getText() {
return explanation;
}
}

View File

@@ -73,6 +73,7 @@ import com.sheepit.client.os.OS;
import com.sheepit.client.standalone.GuiSwing;
import com.sheepit.client.standalone.GuiText;
import com.sheepit.client.standalone.GuiTextOneLine;
import com.sheepit.client.standalone.SwingTooltips;
import com.sheepit.client.standalone.swing.components.CollapsibleJPanel;
public class Settings implements Activity {
@@ -220,6 +221,7 @@ public class Settings implements Activity {
CollapsibleJPanel directory_panel = new CollapsibleJPanel(new GridLayout(1, 3), this);
directory_panel.setBorder(BorderFactory.createTitledBorder("Cache"));
JLabel cacheLabel = new JLabel("Working directory:");
cacheLabel.setToolTipText(SwingTooltips.WORKING_DIRECTORY.getText());
directory_panel.add(cacheLabel);
String destination = DUMMY_CACHE_DIR;
if (config.isUserHasSpecifiedACacheDir()) {
@@ -254,6 +256,7 @@ public class Settings implements Activity {
CollapsibleJPanel compute_devices_panel = new CollapsibleJPanel(gridbag, this);
compute_devices_panel.setBorder(BorderFactory.createTitledBorder("Compute devices"));
compute_devices_panel.setToolTipText(SwingTooltips.COMPUTE_DEVICES.getText());
ComputeType method = config.getComputeMethod();
useCPU = new JCheckBox("CPU");
@@ -289,6 +292,7 @@ public class Settings implements Activity {
renderbucketSize.setMinorTickSpacing(1);
renderbucketSize.setPaintTicks(true);
renderbucketSize.setPaintLabels(true);
renderbucketSizeLabel.setToolTipText(SwingTooltips.RENDERBUCKET_SIZE.getText());
renderbucketSizeLabel.setVisible(false);
renderbucketSize.setVisible(false);
@@ -370,6 +374,7 @@ public class Settings implements Activity {
cpuCores.setPaintLabels(true);
cpuCores.setValue(config.getNbCores() != -1 ? config.getNbCores() : cpuCores.getMaximum());
JLabel coreLabel = new JLabel("CPU cores:");
coreLabel.setToolTipText(SwingTooltips.CPU_CORES.getText());
compute_devices_constraints.weightx = 1.0 / gpus.size();
compute_devices_constraints.gridx = 0;
@@ -406,6 +411,7 @@ public class Settings implements Activity {
ram.setPaintLabels(true);
ram.setValue((int) (config.getMaxMemory() != -1 ? config.getMaxMemory() : os.getMemory()));
JLabel ramLabel = new JLabel("Memory:");
ramLabel.setToolTipText(SwingTooltips.MEMORY.getText());
compute_devices_constraints.weightx = 1.0 / gpus.size();
compute_devices_constraints.gridx = 0;
@@ -432,6 +438,7 @@ public class Settings implements Activity {
priority.setPaintLabels(true);
priority.setValue(config.getPriority());
JLabel priorityLabel = new JLabel(high_priority_support ? "Priority (High <-> Low):" : "Priority (Normal <-> Low):");
priorityLabel.setToolTipText(SwingTooltips.PRIORITY.getText());
boolean showPrioritySlider = os.checkNiceAvailability();
priority.setVisible(showPrioritySlider);
@@ -461,6 +468,7 @@ public class Settings implements Activity {
advanced_panel.setBorder(BorderFactory.createTitledBorder("Advanced options"));
JLabel useSysTrayLabel = new JLabel("Minimize to SysTray");
useSysTrayLabel.setToolTipText(SwingTooltips.MINIMIZE_TO_SYSTRAY.getText());
useSysTray = new JCheckBox();
useSysTray.setSelected(config.isUseSysTray());
@@ -468,7 +476,7 @@ public class Settings implements Activity {
advanced_panel.add(useSysTray);
JLabel proxyLabel = new JLabel("Proxy:");
proxyLabel.setToolTipText("http://login:password@host:port");
proxyLabel.setToolTipText("http://login:password@host:port\n" + SwingTooltips.PROXY.getText());
proxy = new JTextField();
proxy.setToolTipText("http://login:password@host:port");
proxy.setText(parent.getConfiguration().getProxy());
@@ -478,6 +486,7 @@ public class Settings implements Activity {
advanced_panel.add(proxy);
JLabel hostnameLabel = new JLabel("Computer name:");
hostnameLabel.setToolTipText(SwingTooltips.COMPUTER_NAME.getText());
hostname = new JTextField();
hostname.setText(parent.getConfiguration().getHostname());
@@ -485,6 +494,7 @@ public class Settings implements Activity {
advanced_panel.add(hostname);
JLabel renderTimeLabel = new JLabel("Max time per frame (in minute):");
renderTimeLabel.setToolTipText(SwingTooltips.MAX_TIME_PER_FRAME.getText());
int val = 0;
if (parent.getConfiguration().getMaxRenderTime() > 0) {
val = parent.getConfiguration().getMaxRenderTime() / 60;