Search in sources :

Example 1 with SWTSkinCheckboxListener

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);
        }
    });
}
Also used : SWTSkinCheckboxListener(com.biglybt.ui.swt.skin.SWTSkinCheckboxListener) SWTSkinObjectCheckbox(com.biglybt.ui.swt.skin.SWTSkinObjectCheckbox) SWTSkin(com.biglybt.ui.swt.skin.SWTSkin) Shell(org.eclipse.swt.widgets.Shell) UserPrompterResultListener(com.biglybt.ui.UserPrompterResultListener) SWTSkinObjectContainer(com.biglybt.ui.swt.skin.SWTSkinObjectContainer) VuzeMessageBoxListener(com.biglybt.ui.swt.views.skin.VuzeMessageBoxListener) VuzeMessageBox(com.biglybt.ui.swt.views.skin.VuzeMessageBox) SBC_SubscriptionResult(com.biglybt.ui.swt.subscriptions.SBC_SubscriptionResult)

Aggregations

UserPrompterResultListener (com.biglybt.ui.UserPrompterResultListener)1 SWTSkin (com.biglybt.ui.swt.skin.SWTSkin)1 SWTSkinCheckboxListener (com.biglybt.ui.swt.skin.SWTSkinCheckboxListener)1 SWTSkinObjectCheckbox (com.biglybt.ui.swt.skin.SWTSkinObjectCheckbox)1 SWTSkinObjectContainer (com.biglybt.ui.swt.skin.SWTSkinObjectContainer)1 SBC_SubscriptionResult (com.biglybt.ui.swt.subscriptions.SBC_SubscriptionResult)1 VuzeMessageBox (com.biglybt.ui.swt.views.skin.VuzeMessageBox)1 VuzeMessageBoxListener (com.biglybt.ui.swt.views.skin.VuzeMessageBoxListener)1 Shell (org.eclipse.swt.widgets.Shell)1