use of com.biglybt.ui.swt.views.skin.SkinViewManager.SkinViewManagerListener in project BiglyBT by BiglySoftware.
the class DeviceManagerUI method uiAttachedAndCoreRunning.
private void uiAttachedAndCoreRunning(Core core) {
Utils.execSWTThread(new AERunnable() {
@Override
public void runSupport() {
MultipleDocumentInterfaceSWT mdi = UIFunctionsManagerSWT.getUIFunctionsSWT().getMDISWT();
if (mdi != null) {
setupUI(mdi);
} else {
SkinViewManager.addListener(new SkinViewManagerListener() {
@Override
public void skinViewAdded(SkinView skinview) {
if (skinview instanceof SideBar) {
setupUI((SideBar) skinview);
SkinViewManager.RemoveListener(this);
}
}
});
}
}
});
canCloseListener = new canCloseListener() {
@Override
public boolean canClose() {
try {
if (device_manager == null) {
return (true);
}
if (!device_manager.isTranscodeManagerInitialized()) {
return true;
}
final TranscodeJob job = device_manager.getTranscodeManager().getQueue().getCurrentJob();
if (job == null || job.getState() != TranscodeJob.ST_RUNNING) {
return (true);
}
if (job.getTranscodeFile().getDevice().isHidden()) {
return (true);
}
String title = MessageText.getString("device.quit.transcoding.title");
String text = MessageText.getString("device.quit.transcoding.text", new String[] { job.getName(), job.getTarget().getDevice().getName(), String.valueOf(job.getPercentComplete()) });
MessageBoxShell mb = new MessageBoxShell(title, text, new String[] { MessageText.getString("UpdateWindow.quit"), MessageText.getString("Content.alert.notuploaded.button.abort") }, 1);
mb.open(null);
mb.waitUntilClosed();
return mb.getResult() == 0;
} catch (Throwable e) {
Debug.out(e);
return true;
}
}
};
UIExitUtilsSWT.addListener(canCloseListener);
}
Aggregations