Notify users of an unsupported kernel, Pending version ID
This commit is contained in:
parent
4c034740ea
commit
2f902ed5e2
|
@ -7,6 +7,8 @@
|
|||
<string name="git_issues">https://github.com/reicast/reicast-emulator/issues/</string>
|
||||
<string name="log_url">http://twisted.dyndns.tv:3194/ReicastBot/report/submit.php</string>
|
||||
|
||||
<string name="error_kernel"></string>
|
||||
|
||||
<string-array name="depth">
|
||||
<item>16</item>
|
||||
<item>24</item>
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
<string name="game_path">Default Game Storage</string>
|
||||
<string name="config_home">Please configure a home directory</string>
|
||||
<string name="config_game">Please configure a games directory</string>
|
||||
<string name="unsupported">Unsupported Kernel Version!</string>
|
||||
|
||||
<string name="boot_bios">Boot Dreamcast Bios</string>
|
||||
<string name="missing_bios">BIOS Missing. The Dreamcast BIOS is required for this emulator to work. Place the BIOS file in %1$s/data/dc_boot.bin</string>
|
||||
|
|
|
@ -27,6 +27,7 @@ import android.view.View;
|
|||
import android.view.View.OnClickListener;
|
||||
import android.view.View.OnTouchListener;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu;
|
||||
import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu.OnOpenListener;
|
||||
|
@ -347,79 +348,84 @@ public class MainActivity extends SlidingFragmentActivity implements
|
|||
}
|
||||
|
||||
public void onGameSelected(Uri uri) {
|
||||
String msg = null;
|
||||
if (!isBiosExisting())
|
||||
msg = getString(R.string.missing_bios, home_directory);
|
||||
else if (!isFlashExisting())
|
||||
msg = getString(R.string.missing_flash, home_directory);
|
||||
|
||||
if (msg != null) {
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
|
||||
this);
|
||||
|
||||
// set title
|
||||
alertDialogBuilder.setTitle("You have to provide the BIOS");
|
||||
|
||||
// set dialog message
|
||||
alertDialogBuilder
|
||||
.setMessage(msg)
|
||||
.setCancelable(false)
|
||||
.setPositiveButton("Dismiss",
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog,
|
||||
int id) {
|
||||
// if this button is clicked, close
|
||||
// current activity
|
||||
// MainActivity.this.finish();
|
||||
}
|
||||
})
|
||||
.setNegativeButton("Options",
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog,
|
||||
int id) {
|
||||
FileBrowser firstFragment = new FileBrowser();
|
||||
Bundle args = new Bundle();
|
||||
// args.putBoolean("ImgBrowse", false);
|
||||
// specify ImgBrowse option. true = images,
|
||||
// false = folders only
|
||||
args.putString("browse_entry",
|
||||
sdcard.toString());
|
||||
// specify a path for selecting folder
|
||||
// options
|
||||
args.putBoolean("games_entry", false);
|
||||
// selecting a BIOS folder, so this is not
|
||||
// games
|
||||
|
||||
firstFragment.setArguments(args);
|
||||
// In case this activity was started with
|
||||
// special instructions from
|
||||
// an Intent, pass the Intent's extras to
|
||||
// the fragment as arguments
|
||||
// firstFragment.setArguments(getIntent().getExtras());
|
||||
|
||||
// Add the fragment to the
|
||||
// 'fragment_container' FrameLayout
|
||||
getSupportFragmentManager()
|
||||
.beginTransaction()
|
||||
.replace(R.id.fragment_container,
|
||||
firstFragment,
|
||||
"MAIN_BROWSER")
|
||||
.addToBackStack(null).commit();
|
||||
}
|
||||
});
|
||||
|
||||
// create alert dialog
|
||||
AlertDialog alertDialog = alertDialogBuilder.create();
|
||||
|
||||
// show it
|
||||
alertDialog.show();
|
||||
if (GenerateLogs.readOutput("uname -a").equals(getString(R.string.error_kernel))) {
|
||||
Toast.makeText(MainActivity.this, R.string.unsupported,
|
||||
Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD && !Config.nonative) {
|
||||
startActivity(new Intent(Intent.ACTION_VIEW, uri, getBaseContext(),
|
||||
GL2JNINative.class));
|
||||
String msg = null;
|
||||
if (!isBiosExisting())
|
||||
msg = getString(R.string.missing_bios, home_directory);
|
||||
else if (!isFlashExisting())
|
||||
msg = getString(R.string.missing_flash, home_directory);
|
||||
|
||||
if (msg != null) {
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
|
||||
this);
|
||||
|
||||
// set title
|
||||
alertDialogBuilder.setTitle("You have to provide the BIOS");
|
||||
|
||||
// set dialog message
|
||||
alertDialogBuilder
|
||||
.setMessage(msg)
|
||||
.setCancelable(false)
|
||||
.setPositiveButton("Dismiss",
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog,
|
||||
int id) {
|
||||
// if this button is clicked, close
|
||||
// current activity
|
||||
// MainActivity.this.finish();
|
||||
}
|
||||
})
|
||||
.setNegativeButton("Options",
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog,
|
||||
int id) {
|
||||
FileBrowser firstFragment = new FileBrowser();
|
||||
Bundle args = new Bundle();
|
||||
// args.putBoolean("ImgBrowse", false);
|
||||
// specify ImgBrowse option. true = images,
|
||||
// false = folders only
|
||||
args.putString("browse_entry",
|
||||
sdcard.toString());
|
||||
// specify a path for selecting folder
|
||||
// options
|
||||
args.putBoolean("games_entry", false);
|
||||
// selecting a BIOS folder, so this is not
|
||||
// games
|
||||
|
||||
firstFragment.setArguments(args);
|
||||
// In case this activity was started with
|
||||
// special instructions from
|
||||
// an Intent, pass the Intent's extras to
|
||||
// the fragment as arguments
|
||||
// firstFragment.setArguments(getIntent().getExtras());
|
||||
|
||||
// Add the fragment to the
|
||||
// 'fragment_container' FrameLayout
|
||||
getSupportFragmentManager()
|
||||
.beginTransaction()
|
||||
.replace(R.id.fragment_container,
|
||||
firstFragment,
|
||||
"MAIN_BROWSER")
|
||||
.addToBackStack(null).commit();
|
||||
}
|
||||
});
|
||||
|
||||
// create alert dialog
|
||||
AlertDialog alertDialog = alertDialogBuilder.create();
|
||||
|
||||
// show it
|
||||
alertDialog.show();
|
||||
} else {
|
||||
startActivity(new Intent(Intent.ACTION_VIEW, uri, getBaseContext(),
|
||||
GL2JNIActivity.class));
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD && !Config.nonative) {
|
||||
startActivity(new Intent(Intent.ACTION_VIEW, uri, getBaseContext(),
|
||||
GL2JNINative.class));
|
||||
} else {
|
||||
startActivity(new Intent(Intent.ACTION_VIEW, uri, getBaseContext(),
|
||||
GL2JNIActivity.class));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue