Compare commits

...

17 Commits

Author SHA1 Message Date
Matthias Clasen
973600207a power: Don't use never,never scrolled windows
We can use frames for the visual grouping here, and not using
scrolled windows avoids size allocation problems where we end
up with clipped lists.
2012-12-12 06:28:09 -05:00
Matthias Clasen
8eea4cee06 power: Fix criticals when tearing down the panel
Another instance of death-by-floating-reference.
2012-12-11 00:42:43 -05:00
Matthias Clasen
1d70968944 power: More generous horizontal padding
This was requested in review.
2012-12-07 22:22:17 -05:00
Matthias Clasen
f902e5fe6b power: Fix top padding
Pointed out in review.
2012-12-07 21:59:43 -05:00
Matthias Clasen
2331b2d789 power: Make the panel larger
For now, just set a height of 490 pixels. To do much better here,
2012-12-07 21:33:19 -05:00
Matthias Clasen
6d4d2d05bb Shell: Allow panels to go up to the edge
This is necessary for new scrolling panel designs, where we
expect the scrollbar to sit directly at the edge of the window.

https://bugzilla.gnome.org/show_bug.cgi?id=689878
2012-12-07 21:28:42 -05:00
Matthias Clasen
051cb44e0b Make secondary battery test easier available
No need for double-if-oh.
2012-12-04 23:05:12 -05:00
Matthias Clasen
d2220083d9 Incorporate review feedback
Add a scrollbar for the whole panel, add frames around each
section, make all rows the same height, make level bars and
scale the same width, fix clipping of combo boxes and reword
some labels.

https://bugzilla.gnome.org/show_bug.cgi?id=689614
2012-12-04 22:58:53 -05:00
Matthias Clasen
9802472793 power: add a wifi switch
This is using NMClient. The exact semantics of what the switch
should do are still up for discussion, I think. For now, it
turns off wireless by calling nm_client_set_wireless_enabled().
2012-12-02 16:30:00 -05:00
Matthias Clasen
29d31a7bef power: fix some ltr issues 2012-12-02 16:30:00 -05:00
Matthias Clasen
8a29facacf power: Add a bluetooth switch
This is using gnome-bluetooth.
2012-12-02 16:30:00 -05:00
Matthias Clasen
f8ccbeb57e handle secondary batteries 2012-12-02 16:30:00 -05:00
Matthias Clasen
65bc75b5fb Cleanups 2012-12-02 16:30:00 -05:00
Matthias Clasen
c25892a5f0 power: complete new design
Mostly done; whats missing is handling of secondary batteries
and the wifi/bluetooth power saving.
2012-12-02 16:30:00 -05:00
Matthias Clasen
4aa8454a71 Make 'Screen Power Saving' just a switch
The 'smart' behaviour still has to be implemented, for now this
just sets idle-dim-battery.
2012-12-02 16:30:00 -05:00
Matthias Clasen
fe455cb2ac Don't link a separate egglistbox copy 2012-12-02 16:30:00 -05:00
Matthias Clasen
aecdc4dc5a Power: Move screen-related settings here
This is a partial implementation of the new power panel design:
https://live.gnome.org/Design/SystemSettings/Power

https://bugzilla.gnome.org/show_bug.cgi?id=689063
2012-12-02 16:30:00 -05:00
5 changed files with 1167 additions and 571 deletions

View File

@@ -177,11 +177,17 @@ if test "x$have_networkmanager" = xno ; then
AC_MSG_WARN(*** Network panel will not be built (NetworkManager ~0.9 or newer not found) ***)
fi
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
PKG_CHECK_MODULES(BLUETOOTH, $COMMON_MODULES gnome-bluetooth-1.0 >= 3.5.5,
[have_bluetooth=yes], have_bluetooth=no)
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
AC_ARG_ENABLE([cups],

View File

@@ -22,6 +22,16 @@ libpower_la_SOURCES = \
libpower_la_LIBADD = $(PANEL_LIBS) $(POWER_PANEL_LIBS)
libpower_la_LDFLAGS = $(PANEL_LDFLAGS)
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
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="1">3600</col>
</row>
<row>
<col id="0" translatable="yes">Don't suspend</col>
<col id="1">0</col>
</row>
</data>
</object>
<object class="GtkWindow" id="window_power">
@@ -62,299 +58,194 @@
<property name="can_focus">False</property>
<property name="border_width">12</property>
<property name="spacing">3</property>
<child>
<object class="GtkGrid" id="grid_combos">
<property name="visible">True</property>
</object>
</child>
</object>
<object class="GtkDialog" id="automatic_suspend_dialog">
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="title" translatable="yes">Automatic Suspend</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="spacing">2</property>
<child internal-child="action_area">
<object class="GtkButtonBox" id="dialog-action_area1">
<property name="can_focus">False</property>
<property name="margin_left">53</property>
<property name="margin_right">60</property>
<property name="margin_bottom">24</property>
<property name="orientation">vertical</property>
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
<property name="layout_style">end</property>
<child>
<object class="GtkLabel" id="label_header_battery">
<object class="GtkButton" id="automatic_suspend_close">
<property name="label" translatable="yes">_Close</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">On battery power</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>
<object class="GtkLabel" id="label_header_ac">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">When plugged in</property>
<property name="halign">center</property>
<attributes>
<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="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">combobox_critical</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="combobox_critical">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="model">liststore_critical</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
<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="fill">True</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box_primary">
<object class="GtkGrid" id="grid1">
<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>
<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="GtkBox" id="box_primary_header">
<object class="GtkSwitch" id="suspend_on_battery_switch">
<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="can_focus">False</property>
<property name="xalign">0</property>
<property name="label">55 minutes until fully charged</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box_battery_addon">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">3</property>
<child>
<object class="GtkImage" id="image_battery_addon">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="stock">gtk-info</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_addon">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label">Your secondary battery is empty</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">2</property>
</packing>
</child>
<property name="can_focus">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLevelBar" id="levelbar_primary">
<property name="can_focus">False</property>
<object class="GtkSwitch" id="suspend_on_ac_switch">
<property name="visible">True</property>
<property name="can_focus">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
<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="can_focus">False</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>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="suspend_on_ac_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</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>
<packing>
<property name="left_attach">1</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_delay_label">
<property name="visible">True</property>
<property name="can_focus">False</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>
<object class="GtkLabel" id="suspend_on_ac_delay_label">
<property name="visible">True</property>
<property name="can_focus">False</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">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="suspend_on_battery_delay_combo">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="entry_text_column">0</property>
<property name="model">liststore_time</property>
<property name="margin_left">4</property>
<property name="margin_right">4</property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="suspend_on_ac_delay_combo">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="entry_text_column">0</property>
<property name="model">liststore_time</property>
<property name="margin_left">4</property>
<property name="margin_right">4</property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_screen_settings">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">53</property>
<property name="margin_right">40</property>
<property name="xalign">0</property>
<property name="yalign">0.49000000953674316</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>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</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>
<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">3</property>
</packing>
</child>
</object>
</child>
</object>
<object class="GtkSizeGroup" id="sizegroup_combos">
<widgets>
<widget name="combobox_critical"/>
<widget name="combobox_sleep_battery"/>
<widget name="combobox_sleep_ac"/>
</widgets>
<action-widgets>
<action-widget response="0">automatic_suspend_close</action-widget>
</action-widgets>
</object>
</interface>

View File

@@ -227,7 +227,6 @@ activate_panel (GnomeControlCenter *shell,
cc_panel_get_permission (CC_PANEL (priv->current_panel)));
box = gtk_alignment_new (0, 0, 1, 1);
gtk_alignment_set_padding (GTK_ALIGNMENT (box), 6, 6, 6, 6);
gtk_container_add (GTK_CONTAINER (box), priv->current_panel);