Warning: session_start(): open(/var/lib/php/sessions/sess_ge9odcok94e8tm4um66kphstc9, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
sclass JForwardingLibDownloader is Swingable {
transient SingleComponentPanel scp;
settable S nameOfLibrary;
// snippet ID of library required for this platform
settable S libID;
settable S sizeInformation; // how big is the library?
bool supported() { ret libID() != null; }
selfType forward(IF0 forward) {
this.forward = forward;
this;
}
swappable JComponent forward() {
ret jcenteredlabel(nameOfLibrary() + " enabled");
}
bool libDownloaded() {
ret fileExists(DiskSnippetCache_getLibrary(libID()));
}
bool hasLib() {
bool has = currentProgramHasLibrary(DiskSnippetCache_getLibrary(libID()));
print("Video library ID: " + libID() + ", loaded: " + has);
ret has;
}
void addLib() {
if (supported())
if (addLibraryToCurrentProgram(libID()))
print(nameOfLibrary() + " loaded: " + libID());
}
visualize {
if (scp == null)
scp = singleComponentPanel(makeComponent());
ret scp;
}
JComponent makeComponent() {
if (!supported())
ret jcenteredlabel(nameOfLibrary() + " is not yet supported on your platform");
if (libDownloaded()) {
addLib();
ret forward();
} else
ret jfullcenter(centerAndEastWithMargin(
jcenteredlabel("Download " + nameOfLibrary() + " for " + platformName() + appendBracketed(sizeInformation()) + "?"),
jbuttonWithDisable("OK", r addLibWithProgressBar)));
}
void addLibWithProgressBar {
scp.setComponent(jcenteredlabel("Downloading " + nameOfLibrary() + "..."));
try {
addLib();
scp.setComponent(forward());
} catch print e {
scp.setComponent(jErrorView(e));
}
}
}