Power: Implement the new power panel design

The design can be found here:
https://live.gnome.org/Design/SystemSettings/Power

https://bugzilla.gnome.org/show_bug.cgi?id=689614
This commit is contained in:
Matthias Clasen 2012-11-26 00:51:26 -05:00 committed by Bastien Nocera
parent 2f84b20c77
commit a9683772d9
4 changed files with 1167 additions and 569 deletions

View file

@ -180,6 +180,9 @@ else
AC_DEFINE(BUILD_NETWORK, 1, [Define to 1 to build the Network panel]) AC_DEFINE(BUILD_NETWORK, 1, [Define to 1 to build the Network panel])
fi fi
AM_CONDITIONAL(BUILD_NETWORK, [test x$have_networkmanager = xyes]) AM_CONDITIONAL(BUILD_NETWORK, [test x$have_networkmanager = xyes])
if test x${have_networkmanager} = xyes; then
AC_DEFINE(HAVE_NETWORK_MANAGER, 1, [Define to 1 if NetworkManager is available])
fi
# Check for gnome-bluetooth # Check for gnome-bluetooth
PKG_CHECK_MODULES(BLUETOOTH, $COMMON_MODULES gnome-bluetooth-1.0 >= 3.5.5, PKG_CHECK_MODULES(BLUETOOTH, $COMMON_MODULES gnome-bluetooth-1.0 >= 3.5.5,
@ -188,6 +191,9 @@ if test "x$have_bluetooth" = xyes ; then
AC_DEFINE(BUILD_BLUETOOTH, 1, [Define to 1 to build the Network panel]) AC_DEFINE(BUILD_BLUETOOTH, 1, [Define to 1 to build the Network panel])
fi fi
AM_CONDITIONAL(BUILD_BLUETOOTH, [test x$have_bluetooth = xyes]) AM_CONDITIONAL(BUILD_BLUETOOTH, [test x$have_bluetooth = xyes])
if test x${have_bluetooth} = xyes; then
AC_DEFINE(HAVE_BLUETOOTH, 1, [Define to 1 if bluetooth support is available])
fi
# Check for CUPS 1.4 or newer # Check for CUPS 1.4 or newer
AC_ARG_ENABLE([cups], AC_ARG_ENABLE([cups],

View file

@ -19,6 +19,16 @@ libpower_la_SOURCES = \
libpower_la_LIBADD = $(PANEL_LIBS) $(POWER_PANEL_LIBS) libpower_la_LIBADD = $(PANEL_LIBS) $(POWER_PANEL_LIBS)
if BUILD_BLUETOOTH
INCLUDES += $(BLUETOOTH_CFLAGS)
libpower_la_LIBADD += $(BLUETOOTH_LIBS)
endif
if BUILD_NETWORK
INCLUDES += $(NETWORK_MANAGER_CFLAGS)
libpower_la_LIBADD += $(NETWORK_MANAGER_LIBS)
endif
uidir = $(pkgdatadir)/ui uidir = $(pkgdatadir)/ui
dist_ui_DATA = power.ui dist_ui_DATA = power.ui

File diff suppressed because it is too large Load diff

View file

@ -47,10 +47,6 @@
<col id="0" translatable="yes">1 hour</col> <col id="0" translatable="yes">1 hour</col>
<col id="1">3600</col> <col id="1">3600</col>
</row> </row>
<row>
<col id="0" translatable="yes">Don't suspend</col>
<col id="1">0</col>
</row>
</data> </data>
</object> </object>
<object class="GtkWindow" id="window_power"> <object class="GtkWindow" id="window_power">
@ -62,277 +58,182 @@
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="border_width">12</property> <property name="border_width">12</property>
<property name="spacing">3</property> <property name="spacing">3</property>
<child> </object>
<object class="GtkGrid" id="grid_combos"> </child>
<property name="visible">True</property> </object>
<object class="GtkDialog" id="automatic_suspend_dialog">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="margin_left">53</property> <property name="border_width">5</property>
<property name="margin_right">60</property> <property name="title" translatable="yes">Automatic Suspend</property>
<property name="margin_bottom">24</property> <property name="type_hint">dialog</property>
<property name="resizable">False</property>
<child internal-child="vbox">
<object class="GtkBox" id="asdf">
<property name="can_focus">False</property>
<property name="resize_mode">immediate</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="row_spacing">6</property> <property name="spacing">2</property>
<property name="column_spacing">12</property> <child internal-child="action_area">
<child> <object class="GtkButtonBox" id="dialog-action_area1">
<object class="GtkLabel" id="label_header_battery">
<property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="label" translatable="yes">On battery power</property> <property name="layout_style">end</property>
<property name="halign">center</property>
<attributes>
<attribute name="scale" value="0.82999999999999996"/>
</attributes>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
<child> <child>
<object class="GtkLabel" id="label_header_ac"> <object class="GtkButton" id="automatic_suspend_close">
<property name="label" translatable="yes">_Close</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="label" translatable="yes">When plugged in</property> <property name="can_default">True</property>
<property name="halign">center</property> <property name="has_default">True</property>
<attributes> <property name="receives_default">True</property>
<attribute name="scale" value="0.82999999999999996"/>
</attributes>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label7">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="label" translatable="yes">Suspend when inactive for</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="combobox_sleep_battery">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="model">liststore_time</property>
<property name="hexpand">True</property>
<accessibility>
<relation type="labelled-by" target="label_header_battery"/>
<relation type="labelled-by" target="label7"/>
</accessibility>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="combobox_sleep_ac">
<property name="width_request">150</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="model">liststore_time</property>
<property name="hexpand">True</property>
<accessibility>
<relation type="labelled-by" target="label_header_ac"/>
<relation type="labelled-by" target="label7"/>
</accessibility>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_critical">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="label" translatable="yes">When power is _critically low</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="mnemonic_widget">combobox_critical</property> </object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">12</property>
<property name="margin_right">6</property>
<property name="margin_top">12</property>
<property name="margin_bottom">12</property>
<property name="row_spacing">12</property>
<property name="column_spacing">6</property>
<child>
<object class="GtkSwitch" id="suspend_on_battery_switch">
<property name="visible">True</property>
<property name="can_focus">True</property>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
<property name="top_attach">2</property> <property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkComboBox" id="combobox_critical"> <object class="GtkSwitch" id="suspend_on_ac_switch">
<property name="visible">True</property>
<property name="can_focus">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="suspend_on_battery_label">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="model">liststore_critical</property> <property name="xalign">0</property>
<property name="label" translatable="yes">When on _Battery Power</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">suspend_on_battery_switch</property>
</object> </object>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="top_attach">2</property> <property name="top_attach">0</property>
</packing> <property name="width">1</property>
</child> <property name="height">1</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkBox" id="box_primary"> <object class="GtkLabel" id="suspend_on_ac_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">53</property>
<property name="margin_right">60</property>
<property name="orientation">vertical</property>
<property name="spacing">3</property>
<child>
<object class="GtkBox" id="box_primary_header">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">3</property>
<child>
<object class="GtkImage" id="image_primary_warning">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">dialog-warning-symbolic</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_battery_primary">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="label">55 minutes until fully charged</property> <property name="label" translatable="yes">When _Plugged In</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">suspend_on_ac_switch</property>
</object> </object>
<packing> <packing>
<property name="expand">True</property> <property name="left_attach">1</property>
<property name="fill">True</property> <property name="top_attach">1</property>
<property name="position">1</property> <property name="width">1</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkBox" id="box_battery_addon"> <object class="GtkLabel" id="suspend_on_battery_delay_label">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="spacing">3</property> <property name="label" translatable="yes">Delay</property>
<property name="margin-left">20</property>
<style>
<class name="dim-label"/>
</style>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child> <child>
<object class="GtkImage" id="image_battery_addon"> <object class="GtkLabel" id="suspend_on_ac_delay_label">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="xalign">1</property> <property name="label" translatable="yes">Delay</property>
<property name="stock">gtk-info</property> <property name="margin-left">20</property>
<style>
<class name="dim-label"/>
</style>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="left_attach">2</property>
<property name="fill">True</property> <property name="top_attach">1</property>
<property name="position">0</property> <property name="width">1</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkLabel" id="label_battery_addon"> <object class="GtkComboBoxText" id="suspend_on_battery_delay_combo">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="xalign">1</property> <property name="entry_text_column">0</property>
<property name="label">Your secondary battery is empty</property> <property name="model">liststore_time</property>
<property name="margin_left">4</property>
<property name="margin_right">4</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="left_attach">3</property>
<property name="fill">True</property> <property name="top_attach">0</property>
<property name="position">1</property> <property name="width">1</property>
</packing> <property name="height">1</property>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkLevelBar" id="levelbar_primary"> <object class="GtkComboBoxText" id="suspend_on_ac_delay_combo">
<property name="can_focus">False</property>
<property name="visible">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_screen_settings">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="margin_left">53</property> <property name="entry_text_column">0</property>
<property name="margin_right">40</property> <property name="model">liststore_time</property>
<property name="xalign">0</property> <property name="margin_left">4</property>
<property name="yalign">0.49000000953674316</property> <property name="margin_right">4</property>
<property name="ypad">4</property>
<property name="label">Tip: &lt;a href="moo"&gt;Screen Settings&lt;/a&gt; affect how much power is used</property>
<property name="use_markup">True</property>
<property name="track_visited_links">False</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="left_attach">3</property>
<property name="fill">False</property> <property name="top_attach">1</property>
<property name="position">2</property> <property name="width">1</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkBox" id="box_secondary">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_top">15</property>
<property name="orientation">vertical</property>
<property name="spacing">24</property>
<child>
<object class="GtkSeparator" id="separator_secondary">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkGrid" id="grid_secondary">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">9</property>
<property name="margin_right">28</property>
<property name="margin_bottom">15</property>
<property name="row_spacing">18</property>
<property name="column_spacing">6</property>
<property name="column_homogeneous">True</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -341,20 +242,10 @@
</packing> </packing>
</child> </child>
</object> </object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">3</property>
</packing>
</child> </child>
</object> <action-widgets>
</child> <action-widget response="0">automatic_suspend_close</action-widget>
</object> </action-widgets>
<object class="GtkSizeGroup" id="sizegroup_combos">
<widgets>
<widget name="combobox_critical"/>
<widget name="combobox_sleep_battery"/>
<widget name="combobox_sleep_ac"/>
</widgets>
</object> </object>
</interface> </interface>