Fix: better ui for displaying progress of project download

This commit is contained in:
Sheepit Renderfarm
2023-09-21 07:52:11 +00:00
parent b8e5b805af
commit 18928a11e7
4 changed files with 10 additions and 6 deletions

View File

@@ -861,8 +861,11 @@ import okhttp3.HttpUrl;
} }
protected Error.Type downloadSceneFile(Job ajob_) throws SheepItException { protected Error.Type downloadSceneFile(Job ajob_) throws SheepItException {
for (Chunk chunk : ajob_.getArchiveChunks()) {
Error.Type ret = this.downloadFile(ajob_, ajob_.getRequiredProjectChunkPath(chunk.getId()), chunk.getMd5(), String.format(LOCALE, "%s?chunk=%s", this.server.getPage("download-chunk"), chunk.getId()), "project"); int total = ajob_.getArchiveChunks().size();
for (int i = 0; i < total; i++) {
Chunk chunk = ajob_.getArchiveChunks().get(i);
Error.Type ret = this.downloadFile(ajob_, ajob_.getRequiredProjectChunkPath(chunk.getId()), chunk.getMd5(), String.format(LOCALE, "%s?chunk=%s", this.server.getPage("download-chunk"), chunk.getId()), String.format(LOCALE, "chunk %d/%d", i, total));
if (ret != Type.OK) { if (ret != Type.OK) {
return ret; return ret;
} }

View File

@@ -69,6 +69,7 @@ import java.util.TimerTask;
public class GuiSwing extends JFrame implements Gui { public class GuiSwing extends JFrame implements Gui {
public static final String type = "swing"; public static final String type = "swing";
private static final String logoPath = "/sheepit-logo.png"; private static final String logoPath = "/sheepit-logo.png";
public static final int WIDTH = 540;
public static void drawVersionStringOnImage(final BufferedImage image, String versionString) { public static void drawVersionStringOnImage(final BufferedImage image, String versionString) {
var watermarkWidth = image.getWidth(); var watermarkWidth = image.getWidth();
@@ -189,7 +190,7 @@ public class GuiSwing extends JFrame implements Gui {
} }
setTitle(title); setTitle(title);
setSize(520, 760); setSize(WIDTH, 760);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

View File

@@ -541,7 +541,7 @@ public class Settings implements Activity {
parent.getContentPanel().add(savePanel, constraints); parent.getContentPanel().add(savePanel, constraints);
// Increase the size of the app Window to ensure it shows all the information with the Advanced Options panel opened. // Increase the size of the app Window to ensure it shows all the information with the Advanced Options panel opened.
parent.setSize(520,850); parent.setSize(GuiSwing.WIDTH, 850);
if (haveAutoStarted == false && config.isAutoSignIn() && checkDisplaySaveButton()) { if (haveAutoStarted == false && config.isAutoSignIn() && checkDisplaySaveButton()) {
// auto start // auto start

View File

@@ -298,7 +298,7 @@ public class Working implements Activity {
parent.getContentPanel().add(buttonsPanel, global_constraints); parent.getContentPanel().add(buttonsPanel, global_constraints);
// Set the proper size for the Working (if coming from Settings screen, the window size will be too big for the content!) // Set the proper size for the Working (if coming from Settings screen, the window size will be too big for the content!)
parent.setSize(520, 820); parent.setSize(GuiSwing.WIDTH, 820);
} }
public void resizeWindow() { public void resizeWindow() {
@@ -306,7 +306,7 @@ public class Working implements Activity {
parent.repaint(); parent.repaint();
// Calculate the proper size based on the status of the panels (opened/collapsed) // Calculate the proper size based on the status of the panels (opened/collapsed)
parent.setSize(520, (int) (session_info_panel.getHeight() + global_stats_panel.getHeight() + last_frame_panel.getHeight()) + 400); parent.setSize(GuiSwing.WIDTH, (int) (session_info_panel.getHeight() + global_stats_panel.getHeight() + last_frame_panel.getHeight()) + 400);
} }
public void setStatus(String msg_) { public void setStatus(String msg_) {