mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-17 23:24:51 +00:00
LoginManager: Add canRebootToBootLoaderMenu and setRebootToBootLoaderMenu methods
Add wrappers for the new logind Manager CanRebootToBootLoaderMenu and SetRebootToBootLoaderMenu dbus methods. https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/199
This commit is contained in:
parent
a96c8d91b5
commit
2af7264cff
2 changed files with 30 additions and 0 deletions
|
|
@ -20,6 +20,12 @@
|
|||
<method name="ListSessions">
|
||||
<arg name="sessions" type="a(susso)" direction="out"/>
|
||||
</method>
|
||||
<method name="CanRebootToBootLoaderMenu">
|
||||
<arg type="s" direction="out"/>
|
||||
</method>
|
||||
<method name="SetRebootToBootLoaderMenu">
|
||||
<arg type="t" direction="in"/>
|
||||
</method>
|
||||
<signal name="PrepareForSleep">
|
||||
<arg type="b" direction="out"/>
|
||||
</signal>
|
||||
|
|
|
|||
|
|
@ -158,6 +158,23 @@ var LoginManagerSystemd = class {
|
|||
});
|
||||
}
|
||||
|
||||
canRebootToBootLoaderMenu(asyncCallback) {
|
||||
this._proxy.CanRebootToBootLoaderMenuRemote((result, error) => {
|
||||
if (error) {
|
||||
asyncCallback(false, false);
|
||||
} else {
|
||||
const needsAuth = result[0] === 'challenge';
|
||||
const canRebootToBootLoaderMenu = needsAuth || result[0] === 'yes';
|
||||
asyncCallback(canRebootToBootLoaderMenu, needsAuth);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
setRebootToBootLoaderMenu() {
|
||||
/* Parameter is timeout in usec, show to menu for 60 seconds */
|
||||
this._proxy.SetRebootToBootLoaderMenuRemote(60000000);
|
||||
}
|
||||
|
||||
listSessions(asyncCallback) {
|
||||
this._proxy.ListSessionsRemote((result, error) => {
|
||||
if (error)
|
||||
|
|
@ -203,6 +220,13 @@ var LoginManagerDummy = class {
|
|||
asyncCallback(false, false);
|
||||
}
|
||||
|
||||
canRebootToBootLoaderMenu(asyncCallback) {
|
||||
asyncCallback(false, false);
|
||||
}
|
||||
|
||||
setRebootToBootLoaderMenu() {
|
||||
}
|
||||
|
||||
listSessions(asyncCallback) {
|
||||
asyncCallback([]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue