loginManager: Remove login manager versions of PowerOff/Reboot

These don't go through gnome-session, so they don't properly update
its state machine. We should use these in the future when we want to
use logind user sessions, but for now, they're just a trap.

https://bugzilla.gnome.org/show_bug.cgi?id=706612
This commit is contained in:
Jasper St. Pierre 2013-08-22 15:38:28 -04:00
parent 5f9e50175f
commit ce768241da

View File

@ -8,21 +8,9 @@ const Shell = imports.gi.Shell;
const Signals = imports.signals; const Signals = imports.signals;
const SystemdLoginManagerIface = <interface name='org.freedesktop.login1.Manager'> const SystemdLoginManagerIface = <interface name='org.freedesktop.login1.Manager'>
<method name='PowerOff'>
<arg type='b' direction='in'/>
</method>
<method name='Reboot'>
<arg type='b' direction='in'/>
</method>
<method name='Suspend'> <method name='Suspend'>
<arg type='b' direction='in'/> <arg type='b' direction='in'/>
</method> </method>
<method name='CanPowerOff'>
<arg type='s' direction='out'/>
</method>
<method name='CanReboot'>
<arg type='s' direction='out'/>
</method>
<method name='CanSuspend'> <method name='CanSuspend'>
<arg type='s' direction='out'/> <arg type='s' direction='out'/>
</method> </method>
@ -159,24 +147,6 @@ const LoginManagerSystemd = new Lang.Class({
})); }));
}, },
canPowerOff: function(asyncCallback) {
this._proxy.CanPowerOffRemote(function(result, error) {
if (error)
asyncCallback(false);
else
asyncCallback(result[0] != 'no');
});
},
canReboot: function(asyncCallback) {
this._proxy.CanRebootRemote(function(result, error) {
if (error)
asyncCallback(false);
else
asyncCallback(result[0] != 'no');
});
},
canSuspend: function(asyncCallback) { canSuspend: function(asyncCallback) {
this._proxy.CanSuspendRemote(function(result, error) { this._proxy.CanSuspendRemote(function(result, error) {
if (error) if (error)
@ -195,14 +165,6 @@ const LoginManagerSystemd = new Lang.Class({
}); });
}, },
powerOff: function() {
this._proxy.PowerOffRemote(true);
},
reboot: function() {
this._proxy.RebootRemote(true);
},
suspend: function() { suspend: function() {
this._proxy.SuspendRemote(true); this._proxy.SuspendRemote(true);
}, },
@ -264,24 +226,6 @@ const LoginManagerConsoleKit = new Lang.Class({
})); }));
}, },
canPowerOff: function(asyncCallback) {
this._proxy.CanStopRemote(function(result, error) {
if (error)
asyncCallback(false);
else
asyncCallback(result[0]);
});
},
canReboot: function(asyncCallback) {
this._proxy.CanRestartRemote(function(result, error) {
if (error)
asyncCallback(false);
else
asyncCallback(result[0]);
});
},
canSuspend: function(asyncCallback) { canSuspend: function(asyncCallback) {
asyncCallback(false); asyncCallback(false);
}, },
@ -290,14 +234,6 @@ const LoginManagerConsoleKit = new Lang.Class({
asyncCallback([]); asyncCallback([]);
}, },
powerOff: function() {
this._proxy.StopRemote();
},
reboot: function() {
this._proxy.RestartRemote();
},
suspend: function() { suspend: function() {
this.emit('prepare-for-sleep', true); this.emit('prepare-for-sleep', true);
this.emit('prepare-for-sleep', false); this.emit('prepare-for-sleep', false);