startup: switch to proto prefs for passcode

markdownfixes
Georg Lukas 2016-09-21 12:42:13 +02:00
rodzic fedea544f4
commit 5c4beab41b
1 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -48,12 +48,12 @@ trait UIHelper extends Activity
startActivity(new Intent(this, classOf[MapAct]).setData(Uri.parse(call))) startActivity(new Intent(this, classOf[MapAct]).setData(Uri.parse(call)))
} }
def openPrefs(toastId : Int) { def openPrefs(toastId : Int, act : Class[_]) {
if (openedPrefs) { if (openedPrefs) {
// only open prefs once, exit app afterwards // only open prefs once, exit app afterwards
finish() finish()
} else { } else {
startActivity(new Intent(this, classOf[PrefsAct])); startActivity(new Intent(this, act));
Toast.makeText(this, toastId, Toast.LENGTH_SHORT).show() Toast.makeText(this, toastId, Toast.LENGTH_SHORT).show()
openedPrefs = true openedPrefs = true
} }
@ -170,12 +170,12 @@ trait UIHelper extends Activity
return false return false
} }
if (passcodeConfigRequired(callsign, passcode)) { if (passcodeConfigRequired(callsign, passcode)) {
openPrefs(R.string.wrongpasscode) openPrefs(R.string.wrongpasscode, classOf[BackendPrefs])
return false return false
} }
if (prefs.getStringInt("interval", 10) < 1) { if (prefs.getStringInt("interval", 10) < 1) {
openPrefs(R.string.mininterval) openPrefs(R.string.mininterval, classOf[PrefsAct])
return false return false
} }
true true