resourceHelper -> rh

This commit is contained in:
Milos Kozak 2021-11-04 09:32:34 +01:00
parent b592054c18
commit d06ae6b0bc
6 changed files with 8 additions and 8 deletions

View file

@ -30,7 +30,7 @@ class CommandBolus(
}
override fun status(): String {
return (if (detailedBolusInfo.insulin > 0) "BOLUS " + resourceHelper.gs(R.string.formatinsulinunits, detailedBolusInfo.insulin) else "") +
if (detailedBolusInfo.carbs > 0) "CARBS " + resourceHelper.gs(R.string.format_carbs, detailedBolusInfo.carbs.toInt()) else ""
return (if (detailedBolusInfo.insulin > 0) "BOLUS " + rh.gs(R.string.formatinsulinunits, detailedBolusInfo.insulin) else "") +
if (detailedBolusInfo.carbs > 0) "CARBS " + rh.gs(R.string.format_carbs, detailedBolusInfo.carbs.toInt()) else ""
}
}

View file

@ -37,5 +37,5 @@ class CommandSMBBolus(
callback?.result(r)?.run()
}
override fun status(): String = "SMB BOLUS ${resourceHelper.gs(R.string.formatinsulinunits, detailedBolusInfo.insulin)}"
override fun status(): String = "SMB BOLUS ${rh.gs(R.string.formatinsulinunits, detailedBolusInfo.insulin)}"
}

View file

@ -41,7 +41,7 @@ class CommandSetProfile constructor(
val profileSwitch = repository.getEffectiveProfileSwitchActiveAt(dateUtil.now()).blockingGet()
if (profileSwitch is ValueWrapper.Existing && r.enacted && hasNsId && !config.NSCLIENT) {
if (smsCommunicatorPlugin.isEnabled(PluginType.GENERAL))
smsCommunicatorPlugin.sendNotificationToAllNumbers(resourceHelper.gs(R.string.profile_set_ok))
smsCommunicatorPlugin.sendNotificationToAllNumbers(rh.gs(R.string.profile_set_ok))
}
}

View file

@ -75,7 +75,7 @@ class CommandQueueTest : TestBaseWithProfile() {
AndroidInjector {
if (it is Command) {
it.aapsLogger = aapsLogger
it.resourceHelper = resourceHelper
it.rh = resourceHelper
}
if (it is CommandTempBasalPercent) {
it.activePlugin = activePlugin

View file

@ -37,7 +37,7 @@ class QueueThreadTest : TestBaseWithProfile() {
AndroidInjector {
if (it is Command) {
it.aapsLogger = aapsLogger
it.resourceHelper = resourceHelper
it.rh = resourceHelper
}
if (it is CommandTempBasalAbsolute) {
it.activePlugin = activePlugin

View file

@ -17,7 +17,7 @@ abstract class Command(
) {
@Inject lateinit var aapsLogger: AAPSLogger
@Inject lateinit var resourceHelper: ResourceHelper
@Inject lateinit var rh: ResourceHelper
@Inject lateinit var repository: AppRepository
enum class CommandType {
@ -49,7 +49,7 @@ abstract class Command(
fun cancel() {
val result = PumpEnactResult(injector)
result.success = false
result.comment = resourceHelper.gs(R.string.connectiontimedout)
result.comment = rh.gs(R.string.connectiontimedout)
aapsLogger.debug(LTag.PUMPQUEUE, "Result cancel")
callback?.result(result)?.run()
}