use of com.biglybt.ui.swt.beta.BetaWizard in project BiglyBT by BiglySoftware.
the class MenuFactory method addBetaMenuItem.
public static void addBetaMenuItem(Menu menuParent) {
final MenuItem menuItem = addMenuItem(menuParent, MENU_ID_BETA_PROG, new Listener() {
@Override
public void handleEvent(Event e) {
new BetaWizard();
}
});
final ParameterListener listener = new ParameterListener() {
@Override
public void parameterChanged(String parameterName) {
Utils.execSWTThread(new AERunnable() {
@Override
public void runSupport() {
if (menuItem.isDisposed()) {
return;
}
boolean enabled = COConfigurationManager.getBooleanParameter("Beta Programme Enabled");
Messages.setLanguageText(menuItem, MENU_ID_BETA_PROG + (enabled ? ".off" : ".on"));
}
});
}
};
COConfigurationManager.addAndFireParameterListener("Beta Programme Enabled", listener);
menuParent.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
COConfigurationManager.removeParameterListener("Beta Programme Enabled", listener);
}
});
boolean enabled = COConfigurationManager.getBooleanParameter("Beta Programme Enabled");
if (enabled) {
addMenuItem(menuParent, MENU_ID_BETA_PROG_BUG, new Listener() {
@Override
public void handleEvent(Event e) {
Utils.launch(MessageText.getString("beta.bug.url"));
}
});
}
}
Aggregations