~indicator-applet-developers/indicator-power/trunk.14.10

« back to all changes in this revision

Viewing changes to src/service.c

  • Committer: CI bot
  • Author(s): Iain Lane
  • Date: 2014-06-11 17:21:08 UTC
  • mfrom: (241.2.3 indicator-power)
  • Revision ID: ps-jenkins@lists.canonical.com-20140611172108-bmrbp7l77ziw2wp1
Remove the brightness slider from the phone menu. Fixes: 1289470

Show diffs side-by-side

added added

removed removed

Lines of Context:
491
491
  return (int)(lo + (percentage*(hi-lo)));
492
492
}
493
493
 
494
 
static GMenuItem *
495
 
create_brightness_menuitem (IndicatorPowerService * self)
496
 
{
497
 
  int lo, hi;
498
 
  GMenuItem * item;
499
 
 
500
 
  get_brightness_range (self,  &lo, &hi);
501
 
 
502
 
  item = g_menu_item_new (NULL, "indicator.brightness");
503
 
  g_menu_item_set_attribute (item, "x-canonical-type", "s", "com.canonical.unity.slider");
504
 
  g_menu_item_set_attribute (item, "min-value", "d", brightness_to_percentage (self, lo));
505
 
  g_menu_item_set_attribute (item, "max-value", "d", brightness_to_percentage (self, hi));
506
 
  g_menu_item_set_attribute (item, "min-icon", "s", "torch-off" );
507
 
  g_menu_item_set_attribute (item, "max-icon", "s", "torch-on" );
508
 
 
509
 
  return item;
510
 
}
511
 
 
512
494
static GVariant *
513
495
action_state_for_brightness (IndicatorPowerService * self)
514
496
{
574
556
}
575
557
 
576
558
static GMenuModel *
577
 
create_phone_settings_section (IndicatorPowerService * self G_GNUC_UNUSED)
 
559
create_phone_settings_section (IndicatorPowerService * self)
578
560
{
579
561
  GMenu * section;
580
 
  GMenuItem * item;
581
562
 
582
563
  section = g_menu_new ();
583
 
 
584
 
  item = create_brightness_menuitem (self);
585
 
  g_menu_append_item (section, item);
586
564
  update_brightness_action_state (self);
587
 
  g_object_unref (item);
588
 
 
589
565
  g_menu_append (section, _("Battery settings…"), "indicator.activate-phone-settings");
590
566
 
591
567
  return G_MENU_MODEL (section);