View | Details | Raw Unified | Return to bug 49835
Collapse All | Expand All

(-)a/data/sm.puri.phosh.gschema.xml (+12 lines)
Lines 108-113 Link Here
108
    </key>
108
    </key>
109
  </schema>
109
  </schema>
110
110
111
  <schema id="sm.puri.phosh.poweroff-on-lockscreen"
112
          path="/sm/puri/phosh/poweroff-on-lockscreen/">
113
    <key name="enabled" type="b">
114
      <default>false</default>
115
      <summary>Enable poweroff button on lockscreen</summary>
116
      <description>
117
        When this is disabled the you can't poweroff your phone
118
        on lockscreen.
119
      </description>
120
    </key>
121
  </schema>
122
111
  <schema id="sm.puri.phosh.lockscreen"
123
  <schema id="sm.puri.phosh.lockscreen"
112
          path="/sm/puri/phosh/lockscreen/">
124
          path="/sm/puri/phosh/lockscreen/">
113
    <key name="shuffle-keypad" type="b">
125
    <key name="shuffle-keypad" type="b">
(-)a/src/power-menu-manager.c (-1 / +9 lines)
Lines 11-16 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
 *
Lines 141-147 on_shell_state_changed (PhoshPowerMenuManager *self, GParamSpec *pspec, PhoshShe 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
Lines 187-192 phosh_power_menu_manager_init (PhoshPowerMenuManager *self) 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),

Return to bug 49835