diff --git a/js/ui/endSessionDialog.js b/js/ui/endSessionDialog.js index 0257b4bfd..70b6a6917 100644 --- a/js/ui/endSessionDialog.js +++ b/js/ui/endSessionDialog.js @@ -61,18 +61,16 @@ const EndSessionDialogIface = 0) || (this._sessions.length > 0); - }, - _sync: function() { let open = (this.state == ModalDialog.State.OPENING || this.state == ModalDialog.State.OPENED); if (!open) @@ -321,33 +311,27 @@ const EndSessionDialog = new Lang.Class({ let subject = dialogContent.subject; let description; - if (this._hasInhibitors()) { - description = dialogContent.inhibitedDescription; - } else if (this._secondsLeft > 0) { - let displayTime = _roundSecondsToInterval(this._totalSecondsToStayOpen, - this._secondsLeft, - 10); + let displayTime = _roundSecondsToInterval(this._totalSecondsToStayOpen, + this._secondsLeft, + 10); - if (this._user.is_loaded) { - let realName = this._user.get_real_name(); + if (this._user.is_loaded) { + let realName = this._user.get_real_name(); - if (realName != null) { - if (dialogContent.subjectWithUser) - subject = dialogContent.subjectWithUser.format(realName); + if (realName != null) { + if (dialogContent.subjectWithUser) + subject = dialogContent.subjectWithUser.format(realName); - if (dialogContent.uninhibitedDescriptionWithUser) - description = dialogContent.uninhibitedDescriptionWithUser(realName, displayTime); - else - description = dialogContent.uninhibitedDescription(displayTime); - } + if (dialogContent.descriptionWithUser) + description = dialogContent.descriptionWithUser(realName, displayTime); + else + description = dialogContent.description(displayTime); } - - if (!description) - description = dialogContent.uninhibitedDescription(displayTime); - } else { - description = dialogContent.endDescription; } + if (!description) + description = dialogContent.description(displayTime); + _setLabelText(this._descriptionLabel, description); _setLabelText(this._subjectLabel, subject); @@ -363,11 +347,6 @@ const EndSessionDialog = new Lang.Class({ this._iconBin.child = avatarWidget.actor; avatarWidget.update(); } - - if (this._hasInhibitors()) - this._stopTimer(); - else - this._startTimer(); }, _updateButtons: function() { @@ -551,6 +530,7 @@ const EndSessionDialog = new Lang.Class({ return; } + this._startTimer(); this._sync(); let signalId = this.connect('opened',