Compare commits
7 Commits
citadel
...
wip/timed-
Author | SHA1 | Date | |
---|---|---|---|
|
0a4be01ab1 | ||
|
a1f117e520 | ||
|
4cd5c2e60f | ||
|
46fcea566d | ||
|
0a54118a52 | ||
|
3454a39590 | ||
|
98a437c38d |
@ -917,9 +917,7 @@ var LoginDialog = GObject.registerClass({
|
||||
}
|
||||
|
||||
_loginScreenSessionActivated() {
|
||||
if (this.opacity == 255 && this._authPrompt.verificationStatus == AuthPrompt.AuthPromptStatus.NOT_VERIFYING)
|
||||
return;
|
||||
|
||||
this._authPrompt.reset();
|
||||
Tweener.addTween(this,
|
||||
{ opacity: 255,
|
||||
time: _FADE_ANIMATION_TIME,
|
||||
@ -932,20 +930,32 @@ var LoginDialog = GObject.registerClass({
|
||||
children[i].opacity = this.opacity;
|
||||
}
|
||||
},
|
||||
onUpdateScope: this,
|
||||
onComplete() {
|
||||
if (this._authPrompt.verificationStatus != AuthPrompt.AuthPromptStatus.NOT_VERIFYING)
|
||||
this._authPrompt.reset();
|
||||
},
|
||||
onCompleteScope: this });
|
||||
onUpdateScope: this });
|
||||
}
|
||||
|
||||
_loginScreenSessionDeactivated() {
|
||||
this._stopTimedLogin();
|
||||
|
||||
if (this._greeter) {
|
||||
this._greeter.run_dispose();
|
||||
this._greeter = null;
|
||||
}
|
||||
|
||||
this._authPrompt.hide();
|
||||
this.actor.opacity = 0;
|
||||
}
|
||||
|
||||
_gotGreeterSessionProxy(proxy) {
|
||||
this._greeterSessionProxy = proxy;
|
||||
this._greeterSessionProxyChangedId =
|
||||
proxy.connect('g-properties-changed', () => {
|
||||
proxy.connect('g-properties-changed', (proxy, properties) => {
|
||||
if (!('Active' in properties.deep_unpack()))
|
||||
return;
|
||||
|
||||
if (proxy.Active)
|
||||
this._loginScreenSessionActivated();
|
||||
else
|
||||
this._loginScreenSessionDeactivated();
|
||||
});
|
||||
}
|
||||
|
||||
@ -970,6 +980,8 @@ var LoginDialog = GObject.registerClass({
|
||||
}
|
||||
|
||||
_onSessionOpened(client, serviceName) {
|
||||
this._stopTimedLogin();
|
||||
|
||||
this._authPrompt.finish(() => { this._startSession(serviceName); });
|
||||
}
|
||||
|
||||
@ -1006,36 +1018,36 @@ var LoginDialog = GObject.registerClass({
|
||||
return hold;
|
||||
}
|
||||
|
||||
_stopTimedLogin() {
|
||||
if (this._timedLoginBatch) {
|
||||
this._timedLoginBatch.cancel();
|
||||
this._timedLoginBatch = null;
|
||||
}
|
||||
|
||||
if (this._timedLoginIdleTimeOutId) {
|
||||
GLib.source_remove(this._timedLoginIdleTimeOutId);
|
||||
this._timedLoginIdleTimeOutId = 0;
|
||||
}
|
||||
}
|
||||
|
||||
_startTimedLogin(userName, delay) {
|
||||
let firstRun = true;
|
||||
|
||||
// Cancel execution of old batch
|
||||
if (this._timedLoginBatch) {
|
||||
this._timedLoginBatch.cancel();
|
||||
this._timedLoginBatch = null;
|
||||
this._stopTimedLogin();
|
||||
firstRun = false;
|
||||
}
|
||||
|
||||
// Reset previous idle-timeout
|
||||
if (this._timedLoginIdleTimeOutId) {
|
||||
GLib.source_remove(this._timedLoginIdleTimeOutId);
|
||||
this._timedLoginIdleTimeOutId = 0;
|
||||
}
|
||||
|
||||
let loginItem = null;
|
||||
let animationTime;
|
||||
|
||||
let tasks = [() => this._waitForItemForUser(userName),
|
||||
|
||||
() => {
|
||||
// If we're just starting out, start on the right item.
|
||||
loginItem = this._userList.getItemFromUserName(userName);
|
||||
|
||||
// If there is an animation running on the item, reset it.
|
||||
loginItem.hideTimedLoginIndicator();
|
||||
},
|
||||
|
||||
() => {
|
||||
// If we're just starting out, start on the right item.
|
||||
if (!this._userManager.is_loaded) {
|
||||
this._userList.jumpToItem(loginItem);
|
||||
}
|
||||
@ -1071,12 +1083,20 @@ var LoginDialog = GObject.registerClass({
|
||||
|
||||
() => {
|
||||
this._timedLoginBatch = null;
|
||||
this._hideUserList();
|
||||
this._greeter.call_begin_auto_login_sync(userName, null);
|
||||
}];
|
||||
|
||||
this._timedLoginBatch = new Batch.ConsecutiveBatch(this, tasks);
|
||||
|
||||
return this._timedLoginBatch.run();
|
||||
let hold = this._timedLoginBatch.run();
|
||||
|
||||
hold.connect('release', () => {
|
||||
if (loginItem)
|
||||
loginItem.hideTimedLoginIndicator();
|
||||
});
|
||||
|
||||
return hold;
|
||||
}
|
||||
|
||||
_onTimedLoginRequested(client, userName, seconds) {
|
||||
|
Loading…
Reference in New Issue
Block a user