[gnome-shell/eos3.8: 181/255] paygManager: Update iface for ImpendingShutdown signal
- From: Matthew Leeds <mwleeds src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/eos3.8: 181/255] paygManager: Update iface for ImpendingShutdown signal
- Date: Wed, 10 Jun 2020 19:13:12 +0000 (UTC)
commit a4e24227af297ac666d67c2bf4a3f04cb219fcef
Author: Matthew Leeds <matthew leeds endlessm com>
Date: Tue Oct 8 16:20:04 2019 -0500
paygManager: Update iface for ImpendingShutdown signal
eos-paygd now emits an ImpendingShutdown signal before initiating a
forced shutdown.[1] Update the D-Bus introspection with the new signal;
this will later be used to give the user warning of the shutdown.[2]
[1] https://github.com/endlessm/eos-payg/pull/65
[2] https://phabricator.endlessm.com/T27134
https://phabricator.endlessm.com/T27133
data/dbus-interfaces/com.endlessm.Payg1.xml | 4 ++++
js/misc/paygManager.js | 6 ++++++
2 files changed, 10 insertions(+)
---
diff --git a/data/dbus-interfaces/com.endlessm.Payg1.xml b/data/dbus-interfaces/com.endlessm.Payg1.xml
index 842f029608..be7ce279da 100644
--- a/data/dbus-interfaces/com.endlessm.Payg1.xml
+++ b/data/dbus-interfaces/com.endlessm.Payg1.xml
@@ -6,6 +6,10 @@
</method>
<method name="ClearCode" />
<signal name="Expired" />
+ <signal name="ImpendingShutdown">
+ <arg type="i" name="seconds_remaining"/>
+ <arg type="s" name="shutdown_reason"/>
+ </signal>
<property name="ExpiryTime" type="t" access="read"/>
<property name="Enabled" type="b" access="read"/>
<property name="RateLimitEndTime" type="t" access="read"/>
diff --git a/js/misc/paygManager.js b/js/misc/paygManager.js
index 3f965e0469..74b72bd0e1 100644
--- a/js/misc/paygManager.js
+++ b/js/misc/paygManager.js
@@ -99,6 +99,7 @@ var PaygManager = GObject.registerClass({
this._proxyInfo = Gio.DBusInterfaceInfo.new_for_xml(EOS_PAYG_IFACE);
this._codeExpiredId = 0;
+ this._impendingShutdownId = 0;
this._propertiesChangedId = 0;
this._expirationReminderId = 0;
@@ -136,6 +137,7 @@ var PaygManager = GObject.registerClass({
this._propertiesChangedId = this._proxy.connect('g-properties-changed',
this._onPropertiesChanged.bind(this));
this._codeExpiredId = this._proxy.connectSignal('Expired', this._onCodeExpired.bind(this));
+ this._impendingShutdownId = this._proxy.connectSignal('ImpendingShutdown',
this._onImpendingShutdown.bind(this));
this._maybeNotifyUser();
this._updateExpirationReminders();
@@ -210,6 +212,10 @@ var PaygManager = GObject.registerClass({
this.emit('code-expired');
}
+ _onImpendingShutdown(proxy, sender, [secondsRemaining, shutdownReason]) {
+ // TODO notify the user https://phabricator.endlessm.com/T27134
+ }
+
_clockUpdated() {
this._updateExpirationReminders();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]