@@ -0,0 +1,2936 @@
+package com.onextent.augmatic;%0A%0Aimport android.app.Dialog;%0Aimport android.os.Bundle;%0Aimport android.view.LayoutInflater;%0Aimport android.view.View;%0Aimport android.view.ViewGroup;%0Aimport android.widget.CheckBox;%0Aimport android.widget.CompoundButton;%0Aimport android.widget.CompoundButton.OnCheckedChangeListener;%0A%0Aimport com.actionbarsherlock.app.SherlockDialogFragment;%0Aimport com.onextent.android.codeable.CodeableName;%0Aimport com.onextent.augie.AugLog;%0Aimport com.onextent.augie.AugieActivity;%0Aimport com.onextent.augie.AugieException;%0Aimport com.onextent.augie.Augiement;%0Aimport com.onextent.augie.AugiementFactory;%0Aimport com.onextent.augie.Mode;%0Aimport com.onextent.augie.ModeManager;%0A%0Apublic class AugiementStatusFrag extends SherlockDialogFragment %7B%0A    %0A    private AugiementListHelper helper;%0A%0A    @Override%0A    public View onCreateView(LayoutInflater inflater, %0A            ViewGroup container,%0A            Bundle savedInstanceState) %7B%0A       %0A        AugiementSettingsActivity activity = (AugiementSettingsActivity) getSherlockActivity();%0A        helper = new AugiementListHelper(activity);%0A        helper.init();%0A%0A        Dialog d = getDialog();%0A        if (d != null) d.setTitle(%22Enable Augiement%22);%0A        View v = inflater.inflate(R.layout.module_status, container, false);%0A        CheckBox cbox = (CheckBox) v.findViewById(R.id.module_enabled);%0A%0A        final CodeableName cn = helper.getCnList().get(activity.getCurrentAugiementIdx());%0A%0A        boolean isEnabled = helper.getModeAugiements().containsKey(cn);%0A        cbox.setChecked(isEnabled);%0A        helper.updateButtonText(cbox, cn, isEnabled);%0A        helper.updateStatusText(v, cn);%0A        boolean isRequired = helper.updateDepText(v, cn);%0A        if (isEnabled && isRequired)%0A            cbox.setEnabled(false);%0A%0A        cbox.setOnCheckedChangeListener(new OnCheckedChangeListener() %7B%0A%0A            @Override%0A            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) %7B%0A%0A                ModeManager modeManager = ((AugieActivity) getActivity()).getModeManager();%0A                AugiementFactory af = modeManager.getAugiementFactory();%0A                Mode mode = modeManager.getCurrentMode();%0A                if (isChecked) %7B%0A                    Augiement a = af.newInstance(cn);%0A                    mode.addAugiement(a);%0A                    helper.refreshModeAugiements(mode);%0A                    helper.updateButtonText(buttonView, cn, isChecked);%0A                %7D else %7B%0A                    Augiement a = helper.getModeAugiements().get(cn);%0A                    mode.removeAugiement(a);%0A                    helper.refreshModeAugiements(mode);%0A                %7D%0A                try %7B%0A                    modeManager.setCurrentMode(mode);%0A                %7D catch (AugieException e) %7B%0A                    AugLog.e( e.toString(), e);%0A                %7D //reset everything with new a%0A            %7D%0A        %7D);%0A%0A        return v;%0A    %7D%0A%7D%0A

fix htc crash with no-arg const frag