This will allow error reporting before attempting to load GUI
This commit is contained in:
parent
17b1d51f4b
commit
f5586ba47f
|
@ -205,12 +205,15 @@ void dc_term()
|
||||||
plugins_Term();
|
plugins_Term();
|
||||||
_vmem_release();
|
_vmem_release();
|
||||||
|
|
||||||
|
#ifndef _ANDROID
|
||||||
SaveSettings();
|
SaveSettings();
|
||||||
|
#endif
|
||||||
SaveRomFiles(GetPath("/data/"));
|
SaveRomFiles(GetPath("/data/"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoadSettings()
|
void LoadSettings()
|
||||||
{
|
{
|
||||||
|
#ifndef _ANDROID
|
||||||
settings.dynarec.Enable = cfgLoadInt("config","Dynarec.Enabled", 1)!=0;
|
settings.dynarec.Enable = cfgLoadInt("config","Dynarec.Enabled", 1)!=0;
|
||||||
settings.dynarec.idleskip = cfgLoadInt("config","Dynarec.idleskip",1)!=0;
|
settings.dynarec.idleskip = cfgLoadInt("config","Dynarec.idleskip",1)!=0;
|
||||||
settings.dynarec.unstable_opt = cfgLoadInt("config","Dynarec.unstable-opt",0);
|
settings.dynarec.unstable_opt = cfgLoadInt("config","Dynarec.unstable-opt",0);
|
||||||
|
@ -227,6 +230,7 @@ void LoadSettings()
|
||||||
|
|
||||||
settings.pvr.ta_skip = cfgLoadInt("config","ta.skip",0);
|
settings.pvr.ta_skip = cfgLoadInt("config","ta.skip",0);
|
||||||
settings.pvr.rend = cfgLoadInt("config","pvr.rend",0);
|
settings.pvr.rend = cfgLoadInt("config","pvr.rend",0);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if (HOST_OS != OS_LINUX || defined(_ANDROID) || defined(TARGET_PANDORA))
|
#if (HOST_OS != OS_LINUX || defined(_ANDROID) || defined(TARGET_PANDORA))
|
||||||
settings.aica.BufferSize=2048;
|
settings.aica.BufferSize=2048;
|
||||||
|
|
|
@ -66,21 +66,30 @@ public class MainActivity extends SlidingFragmentActivity implements
|
||||||
error.printStackTrace();
|
error.printStackTrace();
|
||||||
//Unreliable, but useful when possible
|
//Unreliable, but useful when possible
|
||||||
MainActivity.this.finish();
|
MainActivity.this.finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Thread.setDefaultUncaughtExceptionHandler(mUEHandler);
|
Thread.setDefaultUncaughtExceptionHandler(mUEHandler);
|
||||||
|
|
||||||
|
home_directory = mPrefs.getString("home_directory", home_directory);
|
||||||
|
|
||||||
String prior_error = mPrefs.getString("prior_error", null);
|
String prior_error = mPrefs.getString("prior_error", null);
|
||||||
if (prior_error != null && !prior_error.equals(null)) {
|
if (prior_error != null && !prior_error.equals(null)) {
|
||||||
initiateReport(prior_error);
|
initiateReport(prior_error, savedInstanceState);
|
||||||
mPrefs.edit().remove("prior_error").commit();
|
mPrefs.edit().remove("prior_error").commit();
|
||||||
|
} else {
|
||||||
|
loadInterface(savedInstanceState);
|
||||||
}
|
}
|
||||||
|
|
||||||
home_directory = mPrefs.getString("home_directory", home_directory);
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void loadInterface(Bundle savedInstanceState) {
|
||||||
|
if (!getFilesDir().exists()) {
|
||||||
|
getFilesDir().mkdir();
|
||||||
|
}
|
||||||
JNIdc.config(home_directory);
|
JNIdc.config(home_directory);
|
||||||
|
|
||||||
getFilesDir().mkdir();
|
|
||||||
|
|
||||||
// Check that the activity is using the layout version with
|
// Check that the activity is using the layout version with
|
||||||
// the fragment_container FrameLayout
|
// the fragment_container FrameLayout
|
||||||
|
@ -111,13 +120,13 @@ public class MainActivity extends SlidingFragmentActivity implements
|
||||||
|
|
||||||
// Add the fragment to the 'fragment_container' FrameLayout
|
// Add the fragment to the 'fragment_container' FrameLayout
|
||||||
getSupportFragmentManager()
|
getSupportFragmentManager()
|
||||||
.beginTransaction()
|
.beginTransaction()
|
||||||
.replace(R.id.fragment_container, firstFragment,
|
.replace(R.id.fragment_container, firstFragment,
|
||||||
"MAIN_BROWSER").commit();
|
"MAIN_BROWSER").commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
menuHeading = (TextView) findViewById(R.id.menu_heading);
|
menuHeading = (TextView) findViewById(R.id.menu_heading);
|
||||||
|
|
||||||
sm = getSlidingMenu();
|
sm = getSlidingMenu();
|
||||||
sm.setShadowWidthRes(R.dimen.shadow_width);
|
sm.setShadowWidthRes(R.dimen.shadow_width);
|
||||||
sm.setShadowDrawable(R.drawable.shadow);
|
sm.setShadowDrawable(R.drawable.shadow);
|
||||||
|
@ -144,9 +153,9 @@ public class MainActivity extends SlidingFragmentActivity implements
|
||||||
// specify if the desired path is for games or data
|
// specify if the desired path is for games or data
|
||||||
browseFrag.setArguments(args);
|
browseFrag.setArguments(args);
|
||||||
getSupportFragmentManager()
|
getSupportFragmentManager()
|
||||||
.beginTransaction()
|
.beginTransaction()
|
||||||
.replace(R.id.fragment_container, browseFrag,
|
.replace(R.id.fragment_container, browseFrag,
|
||||||
"MAIN_BROWSER").addToBackStack(null)
|
"MAIN_BROWSER").addToBackStack(null)
|
||||||
.commit();
|
.commit();
|
||||||
setTitle(getString(R.string.browser));
|
setTitle(getString(R.string.browser));
|
||||||
sm.toggle(true);
|
sm.toggle(true);
|
||||||
|
@ -164,9 +173,9 @@ public class MainActivity extends SlidingFragmentActivity implements
|
||||||
}
|
}
|
||||||
configFrag = new ConfigureFragment();
|
configFrag = new ConfigureFragment();
|
||||||
getSupportFragmentManager()
|
getSupportFragmentManager()
|
||||||
.beginTransaction()
|
.beginTransaction()
|
||||||
.replace(R.id.fragment_container, configFrag,
|
.replace(R.id.fragment_container, configFrag,
|
||||||
"CONFIG_FRAG").addToBackStack(null)
|
"CONFIG_FRAG").addToBackStack(null)
|
||||||
.commit();
|
.commit();
|
||||||
setTitle(getString(R.string.settings));
|
setTitle(getString(R.string.settings));
|
||||||
sm.toggle(true);
|
sm.toggle(true);
|
||||||
|
@ -186,9 +195,9 @@ public class MainActivity extends SlidingFragmentActivity implements
|
||||||
}
|
}
|
||||||
optionsFrag = new OptionsFragment();
|
optionsFrag = new OptionsFragment();
|
||||||
getSupportFragmentManager()
|
getSupportFragmentManager()
|
||||||
.beginTransaction()
|
.beginTransaction()
|
||||||
.replace(R.id.fragment_container,
|
.replace(R.id.fragment_container,
|
||||||
optionsFrag, "OPTIONS_FRAG")
|
optionsFrag, "OPTIONS_FRAG")
|
||||||
.addToBackStack(null).commit();
|
.addToBackStack(null).commit();
|
||||||
setTitle(getString(R.string.paths));
|
setTitle(getString(R.string.paths));
|
||||||
sm.toggle(true);
|
sm.toggle(true);
|
||||||
|
@ -207,15 +216,15 @@ public class MainActivity extends SlidingFragmentActivity implements
|
||||||
}
|
}
|
||||||
inputFrag = new InputFragment();
|
inputFrag = new InputFragment();
|
||||||
getSupportFragmentManager()
|
getSupportFragmentManager()
|
||||||
.beginTransaction()
|
.beginTransaction()
|
||||||
.replace(R.id.fragment_container, inputFrag,
|
.replace(R.id.fragment_container, inputFrag,
|
||||||
"INPUT_FRAG").addToBackStack(null).commit();
|
"INPUT_FRAG").addToBackStack(null).commit();
|
||||||
setTitle(getString(R.string.input));
|
setTitle(getString(R.string.input));
|
||||||
sm.toggle(true);
|
sm.toggle(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
findViewById(R.id.about_menu).setOnClickListener(new OnClickListener() {
|
findViewById(R.id.about_menu).setOnClickListener(new OnClickListener() {
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
AboutFragment aboutFrag = (AboutFragment) getSupportFragmentManager()
|
AboutFragment aboutFrag = (AboutFragment) getSupportFragmentManager()
|
||||||
|
@ -227,9 +236,9 @@ public class MainActivity extends SlidingFragmentActivity implements
|
||||||
}
|
}
|
||||||
aboutFrag = new AboutFragment();
|
aboutFrag = new AboutFragment();
|
||||||
getSupportFragmentManager()
|
getSupportFragmentManager()
|
||||||
.beginTransaction()
|
.beginTransaction()
|
||||||
.replace(R.id.fragment_container, aboutFrag,
|
.replace(R.id.fragment_container, aboutFrag,
|
||||||
"ABOUT_FRAG").addToBackStack(null).commit();
|
"ABOUT_FRAG").addToBackStack(null).commit();
|
||||||
setTitle(getString(R.string.about));
|
setTitle(getString(R.string.about));
|
||||||
sm.toggle(true);
|
sm.toggle(true);
|
||||||
}
|
}
|
||||||
|
@ -261,17 +270,16 @@ public class MainActivity extends SlidingFragmentActivity implements
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
System.gc();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initiateReport(final String error) {
|
private void initiateReport(final String error, final Bundle savedInstanceState) {
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
|
||||||
builder.setTitle(getString(R.string.report_issue));
|
builder.setTitle(getString(R.string.report_issue));
|
||||||
builder.setMessage(error);
|
builder.setMessage(error);
|
||||||
builder.setNegativeButton("Cancel",
|
builder.setNegativeButton("Cancel",
|
||||||
new DialogInterface.OnClickListener() {
|
new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
loadInterface(savedInstanceState);
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue