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