ALT Linux Bugzilla
– Attachment 15759 Details for
Bug 49835
phosh: Добавить возможность выключать устройство на заблокированном экране.
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
патч
phosh-0.37-alt-enable-poweroff-on-lockscreen.patch (text/plain), 2.05 KB, created by
Egor Shestakov
on 2024-03-29 14:05:14 MSK
(
hide
)
Description:
патч
Filename:
MIME Type:
Creator:
Egor Shestakov
Created:
2024-03-29 14:05:14 MSK
Size:
2.05 KB
patch
obsolete
>diff --git a/data/sm.puri.phosh.gschema.xml b/data/sm.puri.phosh.gschema.xml >index fd03388a..2d07b795 100644 >--- a/data/sm.puri.phosh.gschema.xml >+++ b/data/sm.puri.phosh.gschema.xml >@@ -108,6 +108,18 @@ > </key> > </schema> > >+ <schema id="sm.puri.phosh.poweroff-on-lockscreen" >+ path="/sm/puri/phosh/poweroff-on-lockscreen/"> >+ <key name="enabled" type="b"> >+ <default>false</default> >+ <summary>Enable poweroff button on lockscreen</summary> >+ <description> >+ When this is disabled the you can't poweroff your phone >+ on lockscreen. >+ </description> >+ </key> >+ </schema> >+ > <schema id="sm.puri.phosh.lockscreen" > path="/sm/puri/phosh/lockscreen/"> > <key name="shuffle-keypad" type="b"> >diff --git a/src/power-menu-manager.c b/src/power-menu-manager.c >index 04b2abed..e766c463 100644 >--- a/src/power-menu-manager.c >+++ b/src/power-menu-manager.c >@@ -11,6 +11,8 @@ > #include "shell.h" > #include "util.h" > >+#define POWEROFF_ON_LOCKSCREEN "sm.puri.phosh.poweroff-on-lockscreen" >+ > /** > * PhoshPowerMenuManager: > * >@@ -141,7 +143,11 @@ on_shell_state_changed (PhoshPowerMenuManager *self, GParamSpec *pspec, PhoshShe > action = g_action_map_lookup_action (G_ACTION_MAP (self->menu_actions), "screen-lock"); > g_simple_action_set_enabled (G_SIMPLE_ACTION (action), enable); > action = g_action_map_lookup_action (G_ACTION_MAP (self->menu_actions), "poweroff"); >- g_simple_action_set_enabled (G_SIMPLE_ACTION (action), enable); >+ if (g_settings_get_boolean (self->settings, "enabled") == TRUE) { >+ g_simple_action_set_enabled (G_SIMPLE_ACTION (action), TRUE); >+ } else { >+ g_simple_action_set_enabled (G_SIMPLE_ACTION (action), enable); >+ } > } > > >@@ -187,6 +193,8 @@ phosh_power_menu_manager_init (PhoshPowerMenuManager *self) > { > GAction *src_action, *dst_action; > >+ self->settings = g_settings_new(POWEROFF_ON_LOCKSCREEN); >+ > g_action_map_add_action_entries (G_ACTION_MAP (phosh_shell_get_default ()), > entries, > G_N_ELEMENTS (entries),
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 49835
: 15759