Don't know about you, but I keep accidentally closing emu

This also removes the debug preference, since this menu is no longer
visible until pressed. If someone presses it by accident, they would
have probably enabled it by accident as well. Nothing dangerous is in
there anyway.
This commit is contained in:
TwistedUmbrella 2014-02-12 17:56:38 -05:00
parent dd78ed1c88
commit bf6fd5fd09
4 changed files with 35 additions and 107 deletions

View File

@ -238,33 +238,6 @@
</LinearLayout>
</TableRow>
<TableRow
android:layout_marginTop="10dp"
android:gravity="center_vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:ems="10"
android:gravity="center_vertical|left"
android:text="@string/show_profiling_tools" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:orientation="vertical" >
<de.ankri.views.Switch
android:id="@+id/debug_profling_tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="true" />
</LinearLayout>
</TableRow>
<TableRow
android:layout_marginTop="10dp"
android:gravity="center_vertical" >

View File

@ -30,7 +30,6 @@
<string name="select_sound">Enable Emulator Sound</string>
<string name="select_force_gpu">Force v6 GPU Config</string>
<string name="default_disk">Set Default Disk</string>
<string name="show_profiling_tools">Show BIOS Debug Tools</string>
<string name="games_listing">Available Dreamcast Games</string>

View File

@ -108,11 +108,7 @@ public class ConfigureFragment extends Fragment {
MainActivity.force_gpu = isChecked;
}
};
if (MainActivity.force_gpu) {
force_gpu_opt.setChecked(true);
} else {
force_gpu_opt.setChecked(false);
}
force_gpu_opt.setChecked(MainActivity.force_gpu);
force_gpu_opt.setOnCheckedChangeListener(force_gpu_options);
} else {
force_gpu_opt.setEnabled(false);
@ -138,11 +134,7 @@ public class ConfigureFragment extends Fragment {
};
int software = mPrefs.getInt("render_type",
GL2JNIView.LAYER_TYPE_HARDWARE);
if (software == GL2JNIView.LAYER_TYPE_SOFTWARE) {
force_software_opt.setChecked(true);
} else {
force_software_opt.setChecked(false);
}
force_software_opt.setChecked(software == GL2JNIView.LAYER_TYPE_SOFTWARE);
force_software_opt.setOnCheckedChangeListener(force_software);
Switch sound_opt = (Switch) getView().findViewById(
@ -156,11 +148,7 @@ public class ConfigureFragment extends Fragment {
};
boolean sound = mPrefs.getBoolean("sound_enabled",
true);
if (sound) {
sound_opt.setChecked(true);
} else {
sound_opt.setChecked(false);
}
sound_opt.setChecked(sound);
sound_opt.setOnCheckedChangeListener(emu_sound);
OnCheckedChangeListener dynarec_options = new OnCheckedChangeListener() {
@ -173,11 +161,7 @@ public class ConfigureFragment extends Fragment {
};
Switch dynarec_opt = (Switch) getView().findViewById(
R.id.dynarec_option);
if (ConfigureFragment.dynarecopt) {
dynarec_opt.setChecked(true);
} else {
dynarec_opt.setChecked(false);
}
dynarec_opt.setChecked(ConfigureFragment.dynarecopt);
dynarec_opt.setOnCheckedChangeListener(dynarec_options);
OnCheckedChangeListener unstable_option = new OnCheckedChangeListener() {
@ -236,11 +220,7 @@ public class ConfigureFragment extends Fragment {
};
Switch limit_fps = (Switch) getView()
.findViewById(R.id.limitfps_option);
if (ConfigureFragment.limitfps) {
limit_fps.setChecked(true);
} else {
limit_fps.setChecked(false);
}
limit_fps.setChecked(ConfigureFragment.limitfps);
limit_fps.setOnCheckedChangeListener(limitfps_option);
OnCheckedChangeListener mipmaps_option = new OnCheckedChangeListener() {
@ -253,11 +233,7 @@ public class ConfigureFragment extends Fragment {
};
Switch mipmap_opt = (Switch) getView()
.findViewById(R.id.mipmaps_option);
if (ConfigureFragment.mipmaps) {
mipmap_opt.setChecked(true);
} else {
mipmap_opt.setChecked(false);
}
mipmap_opt.setChecked(ConfigureFragment.mipmaps);
mipmap_opt.setOnCheckedChangeListener(mipmaps_option);
OnCheckedChangeListener full_screen = new OnCheckedChangeListener() {
@ -270,28 +246,9 @@ public class ConfigureFragment extends Fragment {
};
Switch stretch_view = (Switch) getView().findViewById(
R.id.stretch_option);
if (ConfigureFragment.widescreen) {
stretch_view.setChecked(true);
} else {
stretch_view.setChecked(false);
}
stretch_view.setChecked(ConfigureFragment.widescreen);
stretch_view.setOnCheckedChangeListener(full_screen);
Switch showProfilingToolsSwitch = (Switch) getView().findViewById(
R.id.debug_profling_tools);
boolean showProfilingTools = mPrefs.getBoolean("debug_profling_tools",
false);
showProfilingToolsSwitch.setChecked(showProfilingTools);
showProfilingToolsSwitch
.setOnCheckedChangeListener(new OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView,
boolean isChecked) {
mPrefs.edit()
.putBoolean("debug_profling_tools", isChecked)
.commit();
}
});
mainFrames = (TextView) getView().findViewById(R.id.current_frames);
mainFrames.setText(String.valueOf(ConfigureFragment.frameskip));
@ -328,11 +285,7 @@ public class ConfigureFragment extends Fragment {
}
};
Switch pvr_render = (Switch) getView().findViewById(R.id.render_option);
if (ConfigureFragment.pvrrender) {
pvr_render.setChecked(true);
} else {
pvr_render.setChecked(false);
}
pvr_render.setChecked(ConfigureFragment.pvrrender);
pvr_render.setOnCheckedChangeListener(pvr_rendering);
final EditText cheatEdit = (EditText) getView().findViewById(

View File

@ -54,24 +54,12 @@ public class OnScreenMenu {
hlay.setOrientation(LinearLayout.HORIZONTAL);
hlay.addView(addbut(R.drawable.close, new OnClickListener() {
hlay.addView(addbut(R.drawable.up, new OnClickListener() {
public void onClick(View v) {
Intent inte = new Intent(mContext, MainActivity.class);
mContext.startActivity(inte);
((Activity) mContext).finish();
popUp.dismiss();
}
}), params);
if (prefs.getBoolean("debug_profling_tools", false)) {
hlay.addView(addbut(R.drawable.disk_unknown, new OnClickListener() {
public void onClick(View v) {
displayDebugPopup(popUp);
popUp.dismiss();
}
}), params);
}
hlay.addView(addbut(R.drawable.vmu_swap, new OnClickListener() {
public void onClick(View v) {
JNIdc.vmuSwap();
@ -86,6 +74,21 @@ public class OnScreenMenu {
}
}), params);
hlay.addView(addbut(R.drawable.disk_unknown, new OnClickListener() {
public void onClick(View v) {
displayDebugPopup(popUp);
popUp.dismiss();
}
}), params);
hlay.addView(addbut(R.drawable.close, new OnClickListener() {
public void onClick(View v) {
Intent inte = new Intent(mContext, MainActivity.class);
mContext.startActivity(inte);
((Activity) mContext).finish();
}
}), params);
// layout.addView(hlay,params);
popUp.setContentView(hlay);
return popUp;
@ -100,10 +103,11 @@ public class OnScreenMenu {
LinearLayout hlay = new LinearLayout(mContext);
hlay.setOrientation(LinearLayout.HORIZONTAL);
hlay.addView(addbut(R.drawable.close, new OnClickListener() {
hlay.addView(addbut(R.drawable.up, new OnClickListener() {
public void onClick(View v) {
popUpDebug.dismiss();
mContext.displayPopUp(popUp);
}
}), debugParams);
@ -135,10 +139,9 @@ public class OnScreenMenu {
}
}), debugParams);
hlay.addView(addbut(R.drawable.up, new OnClickListener() {
hlay.addView(addbut(R.drawable.close, new OnClickListener() {
public void onClick(View v) {
popUpDebug.dismiss();
mContext.displayPopUp(popUp);
}
}), debugParams);
@ -156,9 +159,10 @@ public class OnScreenMenu {
hlay.setOrientation(LinearLayout.HORIZONTAL);
hlay.addView(addbut(R.drawable.close, new OnClickListener() {
hlay.addView(addbut(R.drawable.up, new OnClickListener() {
public void onClick(View v) {
popUpConfig.dismiss();
mContext.displayPopUp(popUp);
}
}), configParams);
@ -181,10 +185,10 @@ public class OnScreenMenu {
});
}
hlay.addView(fullscreen, params);
final ImageButton frames_up = new ImageButton(mContext);
final ImageButton frames_down = new ImageButton(mContext);
frames_up.setImageResource(R.drawable.frames_up);
frames_up.setScaleType(ScaleType.FIT_CENTER);
frames_up.setOnClickListener(new OnClickListener() {
@ -204,7 +208,7 @@ public class OnScreenMenu {
enableState(frames_up, frames_down);
}
});
hlay.addView(frames_up, params);
hlay.addView(frames_down, params);
enableState(frames_up, frames_down);
@ -255,10 +259,9 @@ public class OnScreenMenu {
hlay.addView(audiosetting, params);
}
hlay.addView(addbut(R.drawable.up, new OnClickListener() {
hlay.addView(addbut(R.drawable.close, new OnClickListener() {
public void onClick(View v) {
popUpConfig.dismiss();
mContext.displayPopUp(popUp);
}
}), configParams);