Merge branch 'fix/ui-dialog' into 'master'
Fix: when there an empty queue, display a better exit dialog See merge request sheepitrenderfarm/client!235
This commit is contained in:
@@ -559,8 +559,14 @@ public class Working implements Activity {
|
||||
}
|
||||
|
||||
int jobsQueueSize = getJobsQueueSize(client);
|
||||
if (jobsQueueSize == 0) {
|
||||
int userDecision = showCloseDialogNoFrame();
|
||||
if (userDecision == 0) {
|
||||
exitImmediately(client);
|
||||
}
|
||||
}
|
||||
else {
|
||||
int userDecision = showCloseDialog(jobsQueueSize);
|
||||
|
||||
if (userDecision == 0) {
|
||||
finishJobBeforeExit(client, jobsQueueSize);
|
||||
}
|
||||
@@ -569,6 +575,13 @@ public class Working implements Activity {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int showCloseDialogNoFrame() {
|
||||
String[] exitJobOptions = {"Exit Immediately", "Do Nothing" };
|
||||
return JOptionPane.showOptionDialog(null, "Exit Now or Later", "Exit Now or Later",
|
||||
JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null, exitJobOptions, exitJobOptions[1]); // Make the "Do nothing" button the default one to avoid mistakes
|
||||
}
|
||||
|
||||
public int showCloseDialog(int jobsQueueSize) {
|
||||
String[] exitJobOptions = { "Exit after current Jobs", "Exit Immediately", "Do Nothing" };
|
||||
|
||||
Reference in New Issue
Block a user