Commit 0ce60e84 authored by Richard Hughes's avatar Richard Hughes

Add a 'Power' panel that matches the mockups

parent d08cfeae
......@@ -96,6 +96,7 @@ PKG_CHECK_MODULES(DEFAULT_APPLICATIONS_CAPPLET, libxml-2.0)
PKG_CHECK_MODULES(GSD_DBUS, gnome-settings-daemon)
PKG_CHECK_MODULES(GIO, gio-2.0 gio-unix-2.0)
PKG_CHECK_MODULES(XML, libxml-2.0)
PKG_CHECK_MODULES(UPOWER, upower-glib >= 0.9.1)
PKG_CHECK_MODULES(CANBERRA, libcanberra-gtk3 >= $CANBERRA_REQUIRED_VERSION)
AC_SUBST(CANBERRA_CFLAGS)
AC_SUBST(CANBERRA_LIBS)
......@@ -369,6 +370,8 @@ panels/sound/data/icons/scalable/devices/Makefile
panels/sound/data/sounds/Makefile
panels/screen/Makefile
panels/screen/gnome-screen-panel.desktop.in
panels/power/Makefile
panels/power/gnome-power-panel.desktop.in
panels/universal-access/Makefile
panels/universal-access/gnome-universal-access-panel.desktop.in
panels/user-accounts/Makefile
......
SUBDIRS= \
background \
screen \
power \
display \
mouse \
region \
......
INCLUDES = \
$(PANEL_CFLAGS) \
$(GNOMECC_CAPPLETS_CFLAGS) \
-DGNOMECC_UI_DIR="\"$(uidir)\"" \
-DGNOMELOCALEDIR="\"$(datadir)/locale\"" \
-DGNOMECC_DATA_DIR="\"$(pkgdatadir)\"" \
$(NULL)
ccpanelsdir = $(PANELS_DIR)
ccpanels_LTLIBRARIES = libpower.la
libpower_la_SOURCES = \
power-module.c \
cc-power-panel.c \
cc-power-panel.h
libpower_la_LIBADD = $(PANEL_LIBS) $(UPOWER_LIBS)
libpower_la_LDFLAGS = $(PANEL_LDFLAGS)
uidir = $(pkgdatadir)/ui
dist_ui_DATA = power.ui
@INTLTOOL_DESKTOP_RULE@
desktopdir = $(datadir)/applications
desktop_in_files = gnome-power-panel.desktop.in
desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
CLEANFILES = $(desktop_in_files) $(desktop_DATA)
-include $(top_srcdir)/git.mk
This diff is collapsed.
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
*
* Copyright (C) 2010 Red Hat, Inc
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
#ifndef _CC_POWER_PANEL_H
#define _CC_POWER_PANEL_H
#include <libgnome-control-center/cc-panel.h>
G_BEGIN_DECLS
#define CC_TYPE_POWER_PANEL cc_power_panel_get_type()
#define CC_POWER_PANEL(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), \
CC_TYPE_POWER_PANEL, CcPowerPanel))
#define CC_POWER_PANEL_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), \
CC_TYPE_POWER_PANEL, CcPowerPanelClass))
#define CC_IS_POWER_PANEL(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
CC_TYPE_POWER_PANEL))
#define CC_IS_POWER_PANEL_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), \
CC_TYPE_POWER_PANEL))
#define CC_POWER_PANEL_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), \
CC_TYPE_POWER_PANEL, CcPowerPanelClass))
typedef struct _CcPowerPanel CcPowerPanel;
typedef struct _CcPowerPanelClass CcPowerPanelClass;
typedef struct _CcPowerPanelPrivate CcPowerPanelPrivate;
struct _CcPowerPanel
{
CcPanel parent;
CcPowerPanelPrivate *priv;
};
struct _CcPowerPanelClass
{
CcPanelClass parent_class;
};
GType cc_power_panel_get_type (void) G_GNUC_CONST;
void cc_power_panel_register (GIOModule *module);
G_END_DECLS
#endif /* _CC_POWER_PANEL_H */
[Desktop Entry]
_Name=Power
_Comment=Power management settings
Exec=gnome-control-center power
Icon=gnome-power-manager
Terminal=false
Type=Application
StartupNotify=true
Categories=GNOME;GTK;Settings;DesktopSettings;X-GNOME-Settings-Panel;
OnlyShowIn=GNOME;
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=gnome-control-center
X-GNOME-Bugzilla-Component=power
X-GNOME-Bugzilla-Version=@VERSION@
X-GNOME-Settings-Panel=power
# Translators: those are keywords for the power control-center panel
_X-GNOME-Keywords=Power;Sleep;Suspend;Hibernate;
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
*
* Copyright (C) 2010 Red Hat, Inc
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*
*/
#include <config.h>
#include "cc-power-panel.h"
#include <glib/gi18n-lib.h>
void
g_io_module_load (GIOModule *module)
{
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
/* register the panel */
cc_power_panel_register (module);
}
void
g_io_module_unload (GIOModule *module)
{
}
......@@ -2,6 +2,72 @@
<interface>
<requires lib="gtk+" version="2.20"/>
<!-- interface-naming-policy project-wide -->
<object class="GtkListStore" id="liststore_sleep">
<columns>
<!-- column-name name -->
<column type="gchararray"/>
<!-- column-name value -->
<column type="gint"/>
</columns>
<data>
<row>
<col id="0" translatable="yes">Suspend</col>
<col id="1">1</col>
</row>
<row>
<col id="0" translatable="yes">Hibernate</col>
<col id="1">3</col>
</row>
</data>
</object>
<object class="GtkListStore" id="liststore_power">
<columns>
<!-- column-name name -->
<column type="gchararray"/>
<!-- column-name value -->
<column type="gint"/>
</columns>
<data>
<row>
<col id="0" translatable="yes">Suspend</col>
<col id="1">1</col>
</row>
<row>
<col id="0" translatable="yes">Hibernate</col>
<col id="1">3</col>
</row>
<row>
<col id="0" translatable="yes">Do nothing</col>
<col id="1">5</col>
</row>
<row>
<col id="0" translatable="yes">Ask me</col>
<col id="1">4</col>
</row>
<row>
<col id="0" translatable="yes">Shutdown</col>
<col id="1">2</col>
</row>
</data>
</object>
<object class="GtkListStore" id="liststore_critical">
<columns>
<!-- column-name name -->
<column type="gchararray"/>
<!-- column-name gint1 -->
<column type="gint"/>
</columns>
<data>
<row>
<col id="0" translatable="yes">Hibernate</col>
<col id="1">3</col>
</row>
<row>
<col id="0" translatable="yes">Shutdown</col>
<col id="1">2</col>
</row>
</data>
</object>
<object class="GtkSizeGroup" id="sizegroup_combos">
<widgets>
<widget name="combobox_critical"/>
......@@ -15,7 +81,7 @@
<object class="GtkWindow" id="window_power">
<property name="resizable">False</property>
<child>
<object class="GtkVBox" id="vbox1">
<object class="GtkVBox" id="vbox_power">
<property name="visible">True</property>
<property name="border_width">12</property>
<property name="spacing">12</property>
......@@ -80,8 +146,9 @@
</packing>
</child>
<child>
<object class="GtkComboBox" id="combobox_sleep_ac">
<object class="GtkComboBoxText" id="combobox_sleep_ac">
<property name="visible">True</property>
<property name="model">liststore_time</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -123,8 +190,9 @@
</packing>
</child>
<child>
<object class="GtkComboBox" id="combobox_sleep_battery">
<object class="GtkComboBoxText" id="combobox_sleep_battery">
<property name="visible">True</property>
<property name="model">liststore_time</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -179,8 +247,9 @@
</packing>
</child>
<child>
<object class="GtkComboBox" id="combobox_sleep">
<object class="GtkComboBoxText" id="combobox_sleep">
<property name="visible">True</property>
<property name="model">liststore_time</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -230,8 +299,9 @@
</packing>
</child>
<child>
<object class="GtkComboBox" id="combobox_critical">
<object class="GtkComboBoxText" id="combobox_critical">
<property name="visible">True</property>
<property name="model">liststore_critical</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -282,8 +352,9 @@
</packing>
</child>
<child>
<object class="GtkComboBox" id="combobox_button_power">
<object class="GtkComboBoxText" id="combobox_button_power">
<property name="visible">True</property>
<property name="model">liststore_power</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -324,8 +395,9 @@
</packing>
</child>
<child>
<object class="GtkComboBox" id="combobox_button_sleep">
<object class="GtkComboBoxText" id="combobox_button_sleep">
<property name="visible">True</property>
<property name="model">liststore_sleep</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -352,6 +424,7 @@
<object class="GtkHBox" id="hbox2">
<property name="visible">True</property>
<property name="border_width">12</property>
<property name="spacing">6</property>
<child>
<object class="GtkImage" id="image_status">
<property name="visible">True</property>
......@@ -368,12 +441,21 @@
<object class="GtkVBox" id="vbox4">
<property name="visible">True</property>
<child>
<object class="GtkLabel" id="label_title">
<object class="GtkHBox" id="hbox3">
<property name="visible">True</property>
<property name="label">Battery charging</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
<child>
<object class="GtkLabel" id="label_title">
<property name="visible">True</property>
<property name="label">Battery charging</property>
<attributes>
<attribute name="scale" value="1.500000"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="position">0</property>
......@@ -418,4 +500,30 @@
<widget name="hbox14"/>
</widgets>
</object>
<object class="GtkListStore" id="liststore_time">
<columns>
<!-- column-name name -->
<column type="gchararray"/>
<!-- column-name value -->
<column type="gint"/>
</columns>
<data>
<row>
<col id="0" translatable="yes">5 minutes</col>
<col id="1">300</col>
</row>
<row>
<col id="0" translatable="yes">10 minutes</col>
<col id="1">600</col>
</row>
<row>
<col id="0" translatable="yes">30 minutes</col>
<col id="1">1800</col>
</row>
<row>
<col id="0" translatable="yes">1 hour</col>
<col id="1">3600</col>
</row>
</data>
</object>
</interface>
......@@ -45,6 +45,8 @@ panels/network/gnome-network-panel.desktop.in.in
[type: gettext/glade]panels/network/gnome-network-properties.ui
panels/screen/gnome-screen-panel.desktop.in.in
panels/screen/screen.ui
panels/power/gnome-power-panel.desktop.in.in
panels/power/screen.ui
panels/sound/applet-main.c
panels/sound/cc-sound-panel.c
panels/sound/gvc-applet.c
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment