key_ns_receive_profile_store default true to fetch NS profiles in setup wizard
This commit is contained in:
parent
1b87522a4b
commit
5411f4fb3c
4 changed files with 28 additions and 16 deletions
|
@ -74,7 +74,10 @@ class LoopDialog : DaggerDialogFragment() {
|
||||||
|
|
||||||
override fun onStart() {
|
override fun onStart() {
|
||||||
super.onStart()
|
super.onStart()
|
||||||
dialog?.window?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
|
dialog?.window?.setLayout(
|
||||||
|
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||||
|
ViewGroup.LayoutParams.WRAP_CONTENT
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onSaveInstanceState(savedInstanceState: Bundle) {
|
override fun onSaveInstanceState(savedInstanceState: Bundle) {
|
||||||
|
@ -159,7 +162,7 @@ class LoopDialog : DaggerDialogFragment() {
|
||||||
val lgsEnabled = constraintChecker.isLgsAllowed(Constraint(true))
|
val lgsEnabled = constraintChecker.isLgsAllowed(Constraint(true))
|
||||||
val apsMode = sp.getString(R.string.key_aps_mode, "open")
|
val apsMode = sp.getString(R.string.key_aps_mode, "open")
|
||||||
if (profileFunction.isProfileValid("LoopDialogUpdateGUI")) {
|
if (profileFunction.isProfileValid("LoopDialogUpdateGUI")) {
|
||||||
if (loopPlugin.isEnabled(PluginType.LOOP)) {
|
if (loopPlugin.isEnabled()) {
|
||||||
when {
|
when {
|
||||||
closedLoopAllowed.value() -> {
|
closedLoopAllowed.value() -> {
|
||||||
binding.overviewCloseloop.visibility = (apsMode != "closed").toVisibility()
|
binding.overviewCloseloop.visibility = (apsMode != "closed").toVisibility()
|
||||||
|
@ -167,6 +170,12 @@ class LoopDialog : DaggerDialogFragment() {
|
||||||
binding.overviewOpenloop.visibility = (apsMode != "open").toVisibility()
|
binding.overviewOpenloop.visibility = (apsMode != "open").toVisibility()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
apsMode == "open" -> {
|
||||||
|
binding.overviewCloseloop.visibility = View.VISIBLE
|
||||||
|
binding.overviewLgsloop.visibility = View.GONE
|
||||||
|
binding.overviewOpenloop.visibility = View.GONE
|
||||||
|
}
|
||||||
|
|
||||||
lgsEnabled.value() -> {
|
lgsEnabled.value() -> {
|
||||||
binding.overviewCloseloop.visibility = View.GONE
|
binding.overviewCloseloop.visibility = View.GONE
|
||||||
binding.overviewLgsloop.visibility = (apsMode != "lgs").toVisibility()
|
binding.overviewLgsloop.visibility = (apsMode != "lgs").toVisibility()
|
||||||
|
@ -199,11 +208,12 @@ class LoopDialog : DaggerDialogFragment() {
|
||||||
binding.overviewEnable.visibility = View.VISIBLE
|
binding.overviewEnable.visibility = View.VISIBLE
|
||||||
binding.overviewDisable.visibility = View.GONE
|
binding.overviewDisable.visibility = View.GONE
|
||||||
binding.overviewSuspend.visibility = View.GONE
|
binding.overviewSuspend.visibility = View.GONE
|
||||||
}
|
|
||||||
if (!loopPlugin.isDisconnected) {
|
if (!loopPlugin.isDisconnected) {
|
||||||
binding.overviewPumpHeader.text = resourceHelper.gs(R.string.disconnectpump)
|
binding.overviewPumpHeader.text = resourceHelper.gs(R.string.disconnectpump)
|
||||||
binding.overviewDisconnect15m.visibility = pumpDescription.tempDurationStep15mAllowed.toVisibility()
|
binding.overviewDisconnect15m.visibility =
|
||||||
binding.overviewDisconnect30m.visibility = pumpDescription.tempDurationStep30mAllowed.toVisibility()
|
pumpDescription.tempDurationStep15mAllowed.toVisibility()
|
||||||
|
binding.overviewDisconnect30m.visibility =
|
||||||
|
pumpDescription.tempDurationStep30mAllowed.toVisibility()
|
||||||
binding.overviewDisconnectButtons.visibility = View.VISIBLE
|
binding.overviewDisconnectButtons.visibility = View.VISIBLE
|
||||||
binding.overviewReconnect.visibility = View.GONE
|
binding.overviewReconnect.visibility = View.GONE
|
||||||
} else {
|
} else {
|
||||||
|
@ -213,6 +223,7 @@ class LoopDialog : DaggerDialogFragment() {
|
||||||
}
|
}
|
||||||
binding.overviewLoop.visibility = (!loopPlugin.isSuspended && !loopPlugin.isDisconnected).toVisibility()
|
binding.overviewLoop.visibility = (!loopPlugin.isSuspended && !loopPlugin.isDisconnected).toVisibility()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
val profile = profileFunction.getProfile()
|
val profile = profileFunction.getProfile()
|
||||||
val profileStore = activePlugin.activeProfileSource.profile
|
val profileStore = activePlugin.activeProfileSource.profile
|
||||||
|
|
||||||
|
|
|
@ -73,6 +73,7 @@ class MaintenancePlugin @Inject constructor(
|
||||||
val files = logDir.listFiles { _: File?, name: String ->
|
val files = logDir.listFiles { _: File?, name: String ->
|
||||||
(name.startsWith("AndroidAPS") && name.endsWith(".zip"))
|
(name.startsWith("AndroidAPS") && name.endsWith(".zip"))
|
||||||
}
|
}
|
||||||
|
if (files.isEmpty()) return
|
||||||
Arrays.sort(files) { f1: File, f2: File -> f2.name.compareTo(f1.name) }
|
Arrays.sort(files) { f1: File, f2: File -> f2.name.compareTo(f1.name) }
|
||||||
var delFiles = listOf(*files)
|
var delFiles = listOf(*files)
|
||||||
val amount = sp.getInt(R.string.key_logshipper_amount, keep)
|
val amount = sp.getInt(R.string.key_logshipper_amount, keep)
|
||||||
|
|
|
@ -410,7 +410,7 @@ class LocalProfilePlugin @Inject constructor(
|
||||||
override fun doWork(): Result {
|
override fun doWork(): Result {
|
||||||
val profileJson = dataWorker.pickupJSONObject(inputData.getLong(DataWorker.STORE_KEY, -1))
|
val profileJson = dataWorker.pickupJSONObject(inputData.getLong(DataWorker.STORE_KEY, -1))
|
||||||
?: return Result.failure(workDataOf("Error" to "missing input data"))
|
?: return Result.failure(workDataOf("Error" to "missing input data"))
|
||||||
if (sp.getBoolean(R.string.key_ns_receive_profile_store, false) || config.NSCLIENT) {
|
if (sp.getBoolean(R.string.key_ns_receive_profile_store, true) || config.NSCLIENT) {
|
||||||
val store = ProfileStore(injector, profileJson, dateUtil)
|
val store = ProfileStore(injector, profileJson, dateUtil)
|
||||||
val startDate = store.getStartDate()
|
val startDate = store.getStartDate()
|
||||||
val lastLocalChange = sp.getLong(R.string.key_local_profile_last_change, 0)
|
val lastLocalChange = sp.getLong(R.string.key_local_profile_last_change, 0)
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
android:title="@string/ns_receive_cgm" />
|
android:title="@string/ns_receive_cgm" />
|
||||||
|
|
||||||
<SwitchPreference
|
<SwitchPreference
|
||||||
android:defaultValue="false"
|
android:defaultValue="true"
|
||||||
android:key="@string/key_ns_receive_profile_store"
|
android:key="@string/key_ns_receive_profile_store"
|
||||||
android:summary="@string/ns_receive_profile_store_summary"
|
android:summary="@string/ns_receive_profile_store_summary"
|
||||||
android:title="@string/ns_receive_profile_store" />
|
android:title="@string/ns_receive_profile_store" />
|
||||||
|
|
Loading…
Reference in a new issue