mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +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");
|
pnl.add(pnlDialog, "w 400px!, h 350px!, ax center, ay center");
|
||||||
SOverlayUtils.showOverlay();
|
SOverlayUtils.showOverlay();
|
||||||
|
|
||||||
service.initialize(txtAddress, txtPort, progressBar, btnStart, cmdClose, new Runnable() {
|
service.initialize(txtAddress, txtPort, progressBar, btnStart, cmdClose, null, new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
fireStateChanged();
|
fireStateChanged();
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ package forge.screens.settings;
|
|||||||
|
|
||||||
import java.net.Proxy;
|
import java.net.Proxy;
|
||||||
|
|
||||||
|
import com.badlogic.gdx.Gdx;
|
||||||
|
|
||||||
import forge.UiCommand;
|
import forge.UiCommand;
|
||||||
import forge.assets.FSkinFont;
|
import forge.assets.FSkinFont;
|
||||||
import forge.download.GuiDownloadService;
|
import forge.download.GuiDownloadService;
|
||||||
@@ -74,11 +76,19 @@ public class GuiDownloader extends FDialog {
|
|||||||
btnCancel.setCommand(cmdClose);
|
btnCancel.setCommand(cmdClose);
|
||||||
|
|
||||||
progressBar.reset();
|
progressBar.reset();
|
||||||
|
progressBar.setShowProgressTrail(true);
|
||||||
progressBar.setDescription("Scanning for existing items...");
|
progressBar.setDescription("Scanning for existing items...");
|
||||||
|
Gdx.graphics.setContinuousRendering(true);
|
||||||
|
|
||||||
show();
|
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 {
|
private class ProxyHandler implements FEventHandler {
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ public abstract class GuiDownloadService implements Runnable {
|
|||||||
protected GuiDownloadService() {
|
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;
|
txtAddress = txtAddress0;
|
||||||
txtPort = txtPort0;
|
txtPort = txtPort0;
|
||||||
progressBar = progressBar0;
|
progressBar = progressBar0;
|
||||||
@@ -99,6 +99,9 @@ public abstract class GuiDownloadService implements Runnable {
|
|||||||
FThreads.invokeInEdtLater(new Runnable() {
|
FThreads.invokeInEdtLater(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
if (onReadyToStart != null) {
|
||||||
|
onReadyToStart.run();
|
||||||
|
}
|
||||||
readyToStart();
|
readyToStart();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user