Link Here
|
11 |
#include "shell.h" |
11 |
#include "shell.h" |
12 |
#include "util.h" |
12 |
#include "util.h" |
13 |
|
13 |
|
|
|
14 |
#define POWEROFF_ON_LOCKSCREEN "sm.puri.phosh.poweroff-on-lockscreen" |
15 |
|
14 |
/** |
16 |
/** |
15 |
* PhoshPowerMenuManager: |
17 |
* PhoshPowerMenuManager: |
16 |
* |
18 |
* |
Link Here
|
141 |
action = g_action_map_lookup_action (G_ACTION_MAP (self->menu_actions), "screen-lock"); |
143 |
action = g_action_map_lookup_action (G_ACTION_MAP (self->menu_actions), "screen-lock"); |
142 |
g_simple_action_set_enabled (G_SIMPLE_ACTION (action), enable); |
144 |
g_simple_action_set_enabled (G_SIMPLE_ACTION (action), enable); |
143 |
action = g_action_map_lookup_action (G_ACTION_MAP (self->menu_actions), "poweroff"); |
145 |
action = g_action_map_lookup_action (G_ACTION_MAP (self->menu_actions), "poweroff"); |
144 |
g_simple_action_set_enabled (G_SIMPLE_ACTION (action), enable); |
146 |
if (g_settings_get_boolean (self->settings, "enabled") == TRUE) { |
|
|
147 |
g_simple_action_set_enabled (G_SIMPLE_ACTION (action), TRUE); |
148 |
} else { |
149 |
g_simple_action_set_enabled (G_SIMPLE_ACTION (action), enable); |
150 |
} |
145 |
} |
151 |
} |
146 |
|
152 |
|
147 |
|
153 |
|
Link Here
|
187 |
{ |
193 |
{ |
188 |
GAction *src_action, *dst_action; |
194 |
GAction *src_action, *dst_action; |
189 |
|
195 |
|
|
|
196 |
self->settings = g_settings_new(POWEROFF_ON_LOCKSCREEN); |
197 |
|
190 |
g_action_map_add_action_entries (G_ACTION_MAP (phosh_shell_get_default ()), |
198 |
g_action_map_add_action_entries (G_ACTION_MAP (phosh_shell_get_default ()), |
191 |
entries, |
199 |
entries, |
192 |
G_N_ELEMENTS (entries), |
200 |
G_N_ELEMENTS (entries), |