Merge branch 'fix/status-duplicate' into 'master'
Fix: do not spam the text ui with the same status See merge request sheepitrenderfarm/client!304
This commit is contained in:
@@ -45,6 +45,7 @@ public class GuiText implements Gui {
|
|||||||
private Log log;
|
private Log log;
|
||||||
private DateFormat df;
|
private DateFormat df;
|
||||||
private String eta;
|
private String eta;
|
||||||
|
private String statusOld; // buffer to avoid displaying the same info multiple time
|
||||||
|
|
||||||
private Client client;
|
private Client client;
|
||||||
private DownloadProgress downloadProgress;
|
private DownloadProgress downloadProgress;
|
||||||
@@ -55,6 +56,7 @@ public class GuiText implements Gui {
|
|||||||
this.log = Log.getInstance(null);
|
this.log = Log.getInstance(null);
|
||||||
this.df = new SimpleDateFormat("MMM dd HH:mm:ss");
|
this.df = new SimpleDateFormat("MMM dd HH:mm:ss");
|
||||||
this.eta = "";
|
this.eta = "";
|
||||||
|
this.statusOld = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public void start() {
|
@Override public void start() {
|
||||||
@@ -115,7 +117,11 @@ public class GuiText implements Gui {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
System.out.println(String.format("%s %s", this.df.format(new Date()), msg_));
|
String statusNew = String.format("%s %s", this.df.format(new Date()), msg_);
|
||||||
|
if (statusOld.equals(statusNew) == false) {
|
||||||
|
statusOld = statusNew;
|
||||||
|
System.out.println(statusNew);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user