mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
Show progress trail for scanning for existing items
This commit is contained in:
@@ -95,7 +95,7 @@ public class GuiDownloader extends DefaultBoundedRangeModel {
|
||||
pnl.add(pnlDialog, "w 400px!, h 350px!, ax center, ay center");
|
||||
SOverlayUtils.showOverlay();
|
||||
|
||||
service.initialize(txtAddress, txtPort, progressBar, btnStart, cmdClose, new Runnable() {
|
||||
service.initialize(txtAddress, txtPort, progressBar, btnStart, cmdClose, null, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
fireStateChanged();
|
||||
|
||||
@@ -19,6 +19,8 @@ package forge.screens.settings;
|
||||
|
||||
import java.net.Proxy;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
|
||||
import forge.UiCommand;
|
||||
import forge.assets.FSkinFont;
|
||||
import forge.download.GuiDownloadService;
|
||||
@@ -74,11 +76,19 @@ public class GuiDownloader extends FDialog {
|
||||
btnCancel.setCommand(cmdClose);
|
||||
|
||||
progressBar.reset();
|
||||
progressBar.setShowProgressTrail(true);
|
||||
progressBar.setDescription("Scanning for existing items...");
|
||||
Gdx.graphics.setContinuousRendering(true);
|
||||
|
||||
show();
|
||||
|
||||
service.initialize(txtAddress, txtPort, progressBar, btnStart, cmdClose, null);
|
||||
service.initialize(txtAddress, txtPort, progressBar, btnStart, cmdClose, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Gdx.graphics.setContinuousRendering(false);
|
||||
progressBar.setShowProgressTrail(false);
|
||||
}
|
||||
}, null);
|
||||
}
|
||||
|
||||
private class ProxyHandler implements FEventHandler {
|
||||
|
||||
@@ -78,7 +78,7 @@ public abstract class GuiDownloadService implements Runnable {
|
||||
protected GuiDownloadService() {
|
||||
}
|
||||
|
||||
public void initialize(ITextField txtAddress0, ITextField txtPort0, IProgressBar progressBar0, IButton btnStart0, UiCommand cmdClose0, Runnable onUpdate0) {
|
||||
public void initialize(ITextField txtAddress0, ITextField txtPort0, IProgressBar progressBar0, IButton btnStart0, UiCommand cmdClose0, final Runnable onReadyToStart, Runnable onUpdate0) {
|
||||
txtAddress = txtAddress0;
|
||||
txtPort = txtPort0;
|
||||
progressBar = progressBar0;
|
||||
@@ -99,6 +99,9 @@ public abstract class GuiDownloadService implements Runnable {
|
||||
FThreads.invokeInEdtLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (onReadyToStart != null) {
|
||||
onReadyToStart.run();
|
||||
}
|
||||
readyToStart();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user