Search in sources :

Example 1 with BetaWizard

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"));
            }
        });
    }
}
Also used : BetaWizard(com.biglybt.ui.swt.beta.BetaWizard) UpdateCheckInstanceListener(com.biglybt.pif.update.UpdateCheckInstanceListener) ParameterListener(com.biglybt.core.config.ParameterListener) UIInputReceiverListener(com.biglybt.pif.ui.UIInputReceiverListener) CoreRunningListener(com.biglybt.core.CoreRunningListener) ParameterListener(com.biglybt.core.config.ParameterListener)

Aggregations

CoreRunningListener (com.biglybt.core.CoreRunningListener)1 ParameterListener (com.biglybt.core.config.ParameterListener)1 UIInputReceiverListener (com.biglybt.pif.ui.UIInputReceiverListener)1 UpdateCheckInstanceListener (com.biglybt.pif.update.UpdateCheckInstanceListener)1 BetaWizard (com.biglybt.ui.swt.beta.BetaWizard)1