diff --git a/mainApk.pas b/mainApk.pas index bcaa751..bca4b29 100644 --- a/mainApk.pas +++ b/mainApk.pas @@ -204,6 +204,7 @@ type procedure PatchSelfCheck; {$ENDIF} procedure OpenEntry(AVaultIndex: Integer); + procedure RefuseChange(const AMessage: string); procedure CommitChange(const ALabel, AComment, AReopenUuid: string; const APatch: TFunc); procedure SaveEntryPassword(const ANewValue: string); @@ -606,6 +607,17 @@ end; /// tout - y compris le dechiffrement, parce que le contenu a change. Trois /// essais : au-dela, c'est que l'autre appareil publie en boucle, et insister /// n'y changerait rien. +/// REFUSER, ET RENDRE LA MAIN. Les deux, toujours, et c'est pour cela que ca +/// tient en une procedure plutot qu'en deux appels cote a cote : la page +/// desactive son bouton en envoyant, donc un refus qui se contente de parler +/// laisse un formulaire mort avec la saisie derriere. La regle s'est deja fait +/// oublier trois fois - a l'editeur, puis au formulaire de creation. +procedure TForm8.RefuseChange(const AMessage: string); +begin + WebCall('PM.toast(' + JsArg(AMessage) + ')'); + WebCall('PM.editDone()'); +end; + /// ENREGISTRER UNE MODIFICATION - un seul chemin, deux transports. /// /// La regle qui tranche : SI UN CONTENEUR LOCAL EXISTE, C'EST LUI L'AUTORITE. @@ -626,14 +638,12 @@ begin // Cancel lui-meme ne repondait plus - un cul-de-sac dont rien ne sortait. if FBusy then begin - WebCall('PM.toast("Busy - wait for the current operation")'); - WebCall('PM.editDone()'); + RefuseChange('Busy - wait for the current operation'); Exit; end; if FSyncPwd = '' then begin - WebCall('PM.toast("Master password missing - open the vault first")'); - WebCall('PM.editDone()'); + RefuseChange('Master password missing - open the vault first'); Exit; end; SetBusy(True); @@ -792,8 +802,7 @@ var begin if FCurrent.Uuid = '' then begin - WebCall('PM.toast("This entry has no uuid - cannot be updated")'); - WebCall('PM.editDone()'); + RefuseChange('This entry has no uuid - cannot be updated'); Exit; end; LUuid := FCurrent.Uuid; @@ -811,7 +820,7 @@ begin // liste, et rien ne permettrait de la retrouver pour la corriger. if (ATitle = '') and (ASite = '') and (AUser = '') then begin - WebCall('PM.toast("Give it at least a name")'); + RefuseChange('Give it at least a name'); Exit; end; CommitChange('Added: ' + ATitle, 'new entry from phone', '',