~indicator-applet-developers/indicator-session/trunk.15.10

« back to all changes in this revision

Viewing changes to src/backend-dbus/actions.c

  • Committer: CI Train Bot
  • Author(s): Marco Trevisan (Treviño)
  • Date: 2016-04-12 11:58:28 UTC
  • mfrom: (469.1.2 indicator-session)
  • Revision ID: ci-train-bot@canonical.com-20160412115828-gzr663lk8o5qj4a2
Ensure we request the UI to verify restart availability on unity state changes

add force-restart-menuitem option to make it visible in any environments Fixes: #1365208
Approved by: PS Jenkins bot, Andrea Azzarone

Show diffs side-by-side

added added

removed removed

Lines of Context:
350
350
    {
351
351
      INDICATOR_SESSION_ACTIONS_DBUS(gself)->priv->end_session_dialog = end_session_dialog;
352
352
 
 
353
      g_signal_connect_swapped (end_session_dialog, "notify::g-name-owner",
 
354
                                G_CALLBACK(indicator_session_actions_notify_can_switch), gself);
 
355
 
353
356
      indicator_session_actions_notify_can_prompt (INDICATOR_SESSION_ACTIONS(gself));
354
357
      indicator_session_actions_notify_can_reboot (INDICATOR_SESSION_ACTIONS(gself));
355
358
    }
388
391
{
389
392
  IndicatorSessionActionsDbus * self = INDICATOR_SESSION_ACTIONS_DBUS(actions);
390
393
  priv_t * p = self->priv;
391
 
  
 
394
 
392
395
  if (g_settings_get_boolean (p->indicator_settings, "suppress-restart-menuitem"))
393
396
    return FALSE;
394
397
 
 
398
  if (g_settings_get_boolean (p->indicator_settings, "force-restart-menuitem"))
 
399
    return TRUE;
 
400
 
395
401
  /* Shutdown and Restart are the same dialog prompt in Unity,
396
402
     so disable the redundant 'Restart' menuitem in that mode */
397
403
  if (!g_settings_get_boolean (p->indicator_settings, "suppress-shutdown-menuitem"))
1103
1109
                            G_CALLBACK(indicator_session_actions_notify_can_reboot), self);
1104
1110
  g_signal_connect_swapped (s, "changed::suppress-shutdown-menuitem",
1105
1111
                            G_CALLBACK(indicator_session_actions_notify_can_reboot), self);
 
1112
  g_signal_connect_swapped (s, "changed::force-restart-menuitem",
 
1113
                            G_CALLBACK(indicator_session_actions_notify_can_reboot), self);
1106
1114
  p->indicator_settings = s;
1107
1115
 
1108
1116
  gnome_screen_saver_proxy_new_for_bus (G_BUS_TYPE_SESSION,