check minimum update interval

remotes/nogy/http_proxy_broken
Georg Lukas 2010-03-07 23:47:13 +01:00
rodzic 3247b9c570
commit e676ce6bd2
2 zmienionych plików z 13 dodań i 4 usunięć

Wyświetl plik

@ -4,6 +4,7 @@
<!-- APRSdroid activity -->
<string name="firstrun">You need to configure APRSdroid with your callsign and passcode!</string>
<string name="wrongpasscode">Your passcode does not match your callsign!</string>
<string name="mininterval">Minimum update time is 1 minute!</string>
<string name="singlelog">Single Shot</string>
<string name="startlog">Start Logging</string>
<string name="stoplog">Stop Logging</string>

Wyświetl plik

@ -102,18 +102,26 @@ class APRSdroid extends Activity with OnClickListener
true
}
def openPrefs(toastId : Int) {
startActivity(new Intent(this, classOf[PrefsAct]));
Toast.makeText(this, toastId, Toast.LENGTH_SHORT).show()
}
def checkConfig() : Boolean = {
val callsign = prefs.getString("callsign", "")
val passcode = prefs.getString("passcode", "")
if (callsign == "" || passcode == "") {
startActivity(new Intent(this, classOf[PrefsAct]));
Toast.makeText(this, R.string.firstrun, Toast.LENGTH_SHORT).show()
openPrefs(R.string.firstrun)
return false
}
val genpasscode = AprsPacket.passcode(callsign)
if (passcode != genpasscode.toString()) {
startActivity(new Intent(this, classOf[PrefsAct]));
Toast.makeText(this, R.string.wrongpasscode, Toast.LENGTH_SHORT).show()
openPrefs(R.string.wrongpasscode)
return false
}
val intval = prefs.getString("interval", "10")
if (intval == "" || intval.toInt < 1) {
openPrefs(R.string.mininterval)
return false
}
true