keyring: Cancel active prompts on disable()

Since commit 1242a16265, we will use a fake prompt which
cancels alls requests without dialog when the keyring component
is disabled. However this does only apply to new requests, dialogs
that are already active when the session mode changes are kept
open. This is not quite as expected, so cancel the prompt in that
case.

https://bugzilla.gnome.org/show_bug.cgi?id=708910
This commit is contained in:
Florian Müllner 2013-09-27 16:04:25 +02:00
parent 3d28836f2c
commit 627f3ef36b

View File

@ -246,11 +246,13 @@ const KeyringPrompter = new Lang.Class({
function() {
let dialog = this._enabled ? new KeyringDialog()
: new KeyringDummyDialog();
return dialog.prompt;
this._currentPrompt = dialog.prompt;
return this._currentPrompt;
}));
this._dbusId = null;
this._registered = false;
this._enabled = false;
this._currentPrompt = null;
},
enable: function() {
@ -265,6 +267,10 @@ const KeyringPrompter = new Lang.Class({
disable: function() {
this._enabled = false;
if (this._prompter.prompting)
this._currentPrompt.cancel();
this._currentPrompt = null;
}
});