use of com.biglybt.ui.swt.skin.SWTSkinCheckboxListener in project BiglyBT by BiglySoftware.
the class SBC_SearchResultsView method showDownloadFTUX.
protected static void showDownloadFTUX(SearchSubsResultBase entry, final UserPrompterResultListener listener) {
if (entry instanceof SBC_SubscriptionResult) {
listener.prompterClosed(0);
return;
}
if (RememberedDecisionsManager.getRememberedDecision("searchsubs.dl.ftux") == 1) {
listener.prompterClosed(0);
return;
}
final VuzeMessageBox box = new VuzeMessageBox(MessageText.getString("searchsubs.dl.ftux.title"), null, new String[] { MessageText.getString("Button.ok"), MessageText.getString("Button.cancel") }, 0);
box.setSubTitle(MessageText.getString("searchsubs.dl.ftux.heading"));
final boolean[] check_state = new boolean[] { true };
box.setListener(new VuzeMessageBoxListener() {
@Override
public void shellReady(Shell shell, SWTSkinObjectContainer soExtra) {
SWTSkin skin = soExtra.getSkin();
addResourceBundle(skin, "com/biglybt/ui/swt/columns/searchsubs/", "skin3_dl_ftux");
String id = "searchsubs.dlftux.shell";
skin.createSkinObject(id, id, soExtra);
final SWTSkinObjectCheckbox cb = (SWTSkinObjectCheckbox) skin.getSkinObject("agree-checkbox");
cb.setChecked(true);
cb.addSelectionListener(new SWTSkinCheckboxListener() {
@Override
public void checkboxChanged(SWTSkinObjectCheckbox so, boolean checked) {
check_state[0] = checked;
}
});
}
});
box.open(new UserPrompterResultListener() {
@Override
public void prompterClosed(int result) {
if (result == 0 && check_state[0]) {
RememberedDecisionsManager.setRemembered("searchsubs.dl.ftux", 1);
}
listener.prompterClosed(result);
}
});
}
Aggregations