Fix activity indicator during on-connect-checks.
This commit is contained in:
parent
c7cccf3220
commit
3db7aedb06
1 changed files with 9 additions and 6 deletions
|
@ -735,17 +735,15 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf
|
|||
/**
|
||||
* Runs a command, sets an activity if provided, retries if requested and updates fields
|
||||
* concerned with last connection.
|
||||
* NO history, reservoir level fields are updated, this make be done separately if desired.
|
||||
* Local cache (history, reservoir level, pump state) are updated via #updateLocalData()
|
||||
* if returned by a command.
|
||||
*/
|
||||
private synchronized CommandResult runCommand(String activity, int retries, CommandExecution commandExecution) {
|
||||
CommandResult commandResult;
|
||||
try {
|
||||
if (activity != null) {
|
||||
pump.activity = activity;
|
||||
MainApp.bus().post(new EventComboPumpUpdateGUI());
|
||||
}
|
||||
|
||||
if (!ruffyScripter.isConnected()) {
|
||||
pump.activity = MainApp.gs(R.string.combo_activity_checking_pump_state);
|
||||
MainApp.bus().post(new EventComboPumpUpdateGUI());
|
||||
CommandResult preCheckError = runOnConnectChecks();
|
||||
if (preCheckError != null) {
|
||||
updateLocalData(preCheckError);
|
||||
|
@ -753,6 +751,11 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf
|
|||
}
|
||||
}
|
||||
|
||||
if (activity != null) {
|
||||
pump.activity = activity;
|
||||
MainApp.bus().post(new EventComboPumpUpdateGUI());
|
||||
}
|
||||
|
||||
commandResult = commandExecution.execute();
|
||||
|
||||
if (!commandResult.success && retries > 0) {
|
||||
|
|
Loading…
Reference in a new issue