summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/gpm-prefs.ui919
-rw-r--r--src/gpm-prefs-core.c210
2 files changed, 556 insertions, 573 deletions
diff --git a/data/gpm-prefs.ui b/data/gpm-prefs.ui
index 7ee19a7..81638ff 100644
--- a/data/gpm-prefs.ui
+++ b/data/gpm-prefs.ui
@@ -1,272 +1,319 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.22.1 -->
<interface>
- <requires lib="gtk+" version="2.16"/>
- <!-- interface-naming-policy toplevel-contextual -->
- <object class="GtkAdjustment" id="adjustment1">
- <property name="value">1</property>
- <property name="lower">1</property>
- <property name="upper">61</property>
- <property name="step_increment">1</property>
- <property name="page_increment">5</property>
- </object>
- <object class="GtkAdjustment" id="adjustment2">
- <property name="value">23</property>
- <property name="lower">1</property>
- <property name="upper">61</property>
- <property name="step_increment">1</property>
- <property name="page_increment">5</property>
- </object>
+ <requires lib="gtk+" version="3.22"/>
<object class="GtkAdjustment" id="adjustment3">
- <property name="value">41</property>
<property name="upper">100</property>
+ <property name="value">41</property>
<property name="step_increment">1</property>
- <property name="page_increment">5</property>
- </object>
- <object class="GtkAdjustment" id="adjustment4">
- <property name="value">1</property>
- <property name="lower">1</property>
- <property name="upper">61</property>
- <property name="step_increment">1</property>
- <property name="page_increment">5</property>
- </object>
- <object class="GtkAdjustment" id="adjustment5">
- <property name="value">23</property>
- <property name="lower">1</property>
- <property name="upper">61</property>
- <property name="step_increment">1</property>
- <property name="page_increment">5</property>
+ <property name="page_increment">500</property>
</object>
- <object class="GtkAdjustment" id="adjustment6">
- <property name="value">1</property>
- <property name="lower">1</property>
- <property name="upper">61</property>
- <property name="step_increment">1</property>
- <property name="page_increment">5</property>
+ <object class="GtkImage" id="image_close">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="icon_name">window-close</property>
</object>
- <object class="GtkAdjustment" id="adjustment7">
- <property name="value">23</property>
- <property name="lower">1</property>
- <property name="upper">61</property>
- <property name="step_increment">1</property>
- <property name="page_increment">5</property>
+ <object class="GtkImage" id="image_help">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="icon_name">help-browser</property>
</object>
<object class="GtkDialog" id="dialog_preferences">
- <property name="border_width">5</property>
+ <property name="can_focus">False</property>
<property name="title" translatable="yes">Power Management Preferences</property>
- <property name="resizable">False</property>
- <property name="window_position">center-on-parent</property>
+ <property name="icon_name">mate-power-manager</property>
<property name="type_hint">dialog</property>
+ <signal name="delete-event" handler="on_dialog_preferences_delete_event" swapped="no"/>
+ <child>
+ <placeholder/>
+ </child>
<child internal-child="vbox">
- <object class="GtkVBox" id="dialog-vbox1">
- <property name="visible">True</property>
+ <object class="GtkBox">
+ <property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox">
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="button_help">
+ <property name="label" translatable="yes">_Help</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="image">image_help</property>
+ <property name="use_underline">True</property>
+ <property name="always_show_image">True</property>
+ <signal name="clicked" handler="on_button_help_clicked" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="button_defaults">
+ <property name="label" translatable="yes">Make Default</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="button_close">
+ <property name="label" translatable="yes">_Close</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="image">image_close</property>
+ <property name="use_underline">True</property>
+ <property name="always_show_image">True</property>
+ <signal name="clicked" handler="on_button_close_clicked" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
<child>
<object class="GtkNotebook" id="notebook_preferences">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="border_width">6</property>
+ <property name="margin_left">12</property>
+ <property name="margin_right">12</property>
+ <property name="margin_top">12</property>
+ <property name="margin_bottom">12</property>
<child>
- <object class="GtkVBox" id="vbox_ac">
+ <object class="GtkBox" id="box_ac">
<property name="visible">True</property>
- <property name="border_width">12</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">12</property>
+ <property name="margin_right">12</property>
+ <property name="margin_top">12</property>
+ <property name="margin_bottom">12</property>
<property name="orientation">vertical</property>
- <property name="spacing">12</property>
<child>
- <object class="GtkVBox" id="vbox_ac_actions">
+ <object class="GtkFrame" id="frame_ac_actions">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkLabel" id="label_ac_actions_sect">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">&lt;b&gt;Actions&lt;/b&gt;</property>
- <property name="use_markup">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
<child>
- <object class="GtkAlignment" id="alignment45">
+ <object class="GtkAlignment">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="left_padding">12</property>
<child>
- <object class="GtkVBox" id="vbox79">
+ <object class="GtkBox">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_top">6</property>
+ <property name="margin_bottom">6</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
- <object class="GtkHBox" id="hbox_ac_computer">
+ <object class="GtkBox" id="box_ac_computer">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="spacing">12</property>
- <property name="homogeneous">True</property>
<child>
<object class="GtkLabel" id="label_ac_computer">
<property name="visible">True</property>
- <property name="xalign">0</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes">Put computer to _sleep when inactive for:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">combobox_ac_computer</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="combobox_ac_computer">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
</object>
<packing>
+ <property name="expand">True</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="position">0</property>
</packing>
</child>
<child>
- <object class="GtkHBox" id="hbox_ac_lid">
+ <object class="GtkBox" id="box_ac_lid">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="spacing">12</property>
- <property name="homogeneous">True</property>
<child>
<object class="GtkLabel" id="label_ac_lid">
<property name="visible">True</property>
- <property name="xalign">0</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes">When laptop lid is cl_osed:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">combobox_ac_lid</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="combobox_ac_lid">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
</object>
<packing>
+ <property name="expand">True</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="position">1</property>
</packing>
</child>
</object>
</child>
</object>
- <packing>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label_ac_actions_sect">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Actions</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
</child>
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkVBox" id="vbox_ac_display">
+ <object class="GtkFrame" id="frame_ac_display">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
<child>
- <object class="GtkLabel" id="label_ac_display_sect">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">&lt;b&gt;Display&lt;/b&gt;</property>
- <property name="use_markup">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkAlignment" id="alignment46">
+ <object class="GtkAlignment">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="left_padding">12</property>
<child>
- <object class="GtkVBox" id="vbox83">
+ <object class="GtkBox">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="orientation">vertical</property>
- <property name="spacing">5</property>
+ <property name="spacing">6</property>
<child>
- <object class="GtkHBox" id="hbox_ac_display">
+ <object class="GtkBox" id="box_ac_display">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="spacing">12</property>
- <property name="homogeneous">True</property>
<child>
<object class="GtkLabel" id="label_ac_display">
<property name="visible">True</property>
- <property name="xalign">0</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes">Put _display to sleep when inactive for:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">combobox_ac_display</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="combobox_ac_display">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
</object>
<packing>
+ <property name="expand">True</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="position">0</property>
</packing>
</child>
<child>
- <object class="GtkHBox" id="hbox_ac_brightness">
+ <object class="GtkBox" id="box_ac_brightness">
<property name="visible">True</property>
- <property name="spacing">12</property>
- <property name="homogeneous">True</property>
+ <property name="can_focus">False</property>
<child>
<object class="GtkLabel" id="label_ac_brightness">
<property name="visible">True</property>
- <property name="xalign">0</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes">Set display _brightness to:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">hscale_ac_brightness</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkHScale" id="hscale_ac_brightness">
+ <object class="GtkScale" id="hscale_ac_brightness">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="adjustment">adjustment3</property>
- <property name="digits">0</property>
- <property name="value_pos">bottom</property>
+ <property name="round_digits">1</property>
</object>
<packing>
+ <property name="expand">True</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="position">1</property>
</packing>
</child>
@@ -276,6 +323,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
+ <property name="halign">start</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
</object>
@@ -288,13 +336,21 @@
</object>
</child>
</object>
- <packing>
- <property name="position">1</property>
- </packing>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label_ac_display_sect">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Display</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
</child>
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
@@ -303,6 +359,7 @@
<child type="tab">
<object class="GtkLabel" id="label_tab_ac">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes">On AC Power</property>
</object>
<packing>
@@ -310,202 +367,222 @@
</packing>
</child>
<child>
- <object class="GtkVBox" id="vbox_battery">
+ <object class="GtkBox" id="box_battery">
<property name="visible">True</property>
- <property name="border_width">12</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">12</property>
+ <property name="margin_right">12</property>
+ <property name="margin_top">12</property>
+ <property name="margin_bottom">12</property>
<property name="orientation">vertical</property>
- <property name="spacing">12</property>
<child>
- <object class="GtkVBox" id="vbox_battery_actions">
+ <object class="GtkFrame" id="frame_battery_actions">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkLabel" id="label_battery_actions_sect">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">&lt;b&gt;Actions&lt;/b&gt;</property>
- <property name="use_markup">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
<child>
- <object class="GtkAlignment" id="alignment47">
+ <object class="GtkAlignment">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="left_padding">12</property>
<child>
- <object class="GtkVBox" id="vbox86">
+ <object class="GtkBox">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_top">6</property>
+ <property name="margin_bottom">6</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
- <object class="GtkHBox" id="hbox_battery_computer">
+ <object class="GtkBox" id="box_battery_computer">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="spacing">12</property>
- <property name="homogeneous">True</property>
<child>
<object class="GtkLabel" id="label_battery_computer">
<property name="visible">True</property>
- <property name="xalign">0</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes">Put computer to _sleep when inactive for:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">combobox_battery_computer</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="combobox_battery_computer">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
</object>
<packing>
+ <property name="expand">True</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="position">0</property>
</packing>
</child>
<child>
- <object class="GtkHBox" id="hbox_battery_lid">
+ <object class="GtkBox" id="box_battery_lid">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="spacing">12</property>
- <property name="homogeneous">True</property>
<child>
<object class="GtkLabel" id="label_battery_lid">
<property name="visible">True</property>
- <property name="xalign">0</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes">When laptop lid is cl_osed:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">combobox_battery_lid</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="combobox_battery_lid">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
</object>
<packing>
+ <property name="expand">True</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="position">1</property>
</packing>
</child>
<child>
- <object class="GtkHBox" id="hbox20">
+ <object class="GtkBox">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="spacing">12</property>
- <property name="homogeneous">True</property>
<child>
<object class="GtkLabel" id="label121">
<property name="visible">True</property>
- <property name="xalign">0</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes">When battery po_wer is critically low:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">combobox_battery_critical</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="combobox_battery_critical">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
</object>
<packing>
+ <property name="expand">True</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="position">2</property>
</packing>
</child>
</object>
</child>
</object>
- <packing>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label_battery_actions_sect">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Actions</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
</child>
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkVBox" id="vbox_battery_display">
+ <object class="GtkFrame" id="frame_battery_display">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
<child>
- <object class="GtkLabel" id="label_battery_display_sect">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">&lt;b&gt;Display&lt;/b&gt;</property>
- <property name="use_markup">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkAlignment" id="alignment48">
+ <object class="GtkAlignment">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="left_padding">12</property>
<child>
- <object class="GtkVBox" id="vbox88">
+ <object class="GtkBox">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_top">6</property>
+ <property name="margin_bottom">6</property>
<property name="orientation">vertical</property>
- <property name="spacing">5</property>
+ <property name="spacing">6</property>
<child>
- <object class="GtkHBox" id="hbox_battery_display">
+ <object class="GtkBox">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="spacing">12</property>
- <property name="homogeneous">True</property>
<child>
<object class="GtkLabel" id="label_battery_display">
<property name="visible">True</property>
- <property name="xalign">0</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes">Put _display to sleep when inactive for:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">combobox_battery_display</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="combobox_battery_display">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
</object>
<packing>
+ <property name="expand">True</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="position">0</property>
</packing>
</child>
@@ -515,6 +592,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
+ <property name="halign">start</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
</object>
@@ -530,6 +608,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
+ <property name="halign">start</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
</object>
@@ -542,13 +621,21 @@
</object>
</child>
</object>
- <packing>
- <property name="position">1</property>
- </packing>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label_battery_display_sect">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Display</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
</child>
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
@@ -560,6 +647,7 @@
<child type="tab">
<object class="GtkLabel" id="label_tab_battery">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes">On Battery Power</property>
</object>
<packing>
@@ -568,215 +656,191 @@
</packing>
</child>
<child>
- <object class="GtkVBox" id="vbox_ups">
+ <object class="GtkBox" id="box_ups">
<property name="visible">True</property>
- <property name="border_width">12</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">12</property>
+ <property name="margin_right">12</property>
+ <property name="margin_top">12</property>
+ <property name="margin_bottom">12</property>
<property name="orientation">vertical</property>
- <property name="spacing">12</property>
<child>
- <object class="GtkVBox" id="vbox_ups_actions">
+ <object class="GtkFrame">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
<child>
- <object class="GtkLabel" id="label_ups_actions_sect">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">&lt;b&gt;Actions&lt;/b&gt;</property>
- <property name="use_markup">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkAlignment" id="alignment49">
+ <object class="GtkAlignment">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="left_padding">12</property>
<child>
- <object class="GtkVBox" id="vbox91">
+ <object class="GtkGrid">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
+ <property name="can_focus">False</property>
+ <property name="margin_top">6</property>
+ <property name="margin_bottom">6</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">12</property>
<child>
- <object class="GtkHBox" id="hbox_ups_computer">
+ <object class="GtkLabel" id="label_ups_computer">
<property name="visible">True</property>
- <property name="spacing">12</property>
- <property name="homogeneous">True</property>
- <child>
- <object class="GtkLabel" id="label_ups_computer">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Put computer to _sleep when inactive for:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">combobox_ups_computer</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBoxText" id="combobox_ups_computer">
- <property name="visible">True</property>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Put computer to _sleep when inactive for:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">combobox_ups_computer</property>
+ <property name="xalign">0</property>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
</packing>
</child>
<child>
- <object class="GtkHBox" id="hbox18">
+ <object class="GtkLabel" id="label_ups_low">
<property name="visible">True</property>
- <property name="spacing">12</property>
- <property name="homogeneous">True</property>
- <child>
- <object class="GtkLabel" id="label_ups_low">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">When UPS power is l_ow:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">combobox_ups_low</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBoxText" id="combobox_ups_low">
- <property name="visible">True</property>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">When UPS power is l_ow:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">combobox_ups_low</property>
+ <property name="xalign">0</property>
</object>
<packing>
- <property name="position">1</property>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
</packing>
</child>
<child>
- <object class="GtkHBox" id="hbox19">
+ <object class="GtkLabel" id="label_ups_critical">
<property name="visible">True</property>
- <property name="spacing">12</property>
- <property name="homogeneous">True</property>
- <child>
- <object class="GtkLabel" id="label_ups_critical">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">When UPS power is _critically low:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">combobox_ups_critical</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBoxText" id="combobox_ups_critical">
- <property name="visible">True</property>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">When UPS power is _critically low:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">combobox_ups_critical</property>
+ <property name="xalign">0</property>
</object>
<packing>
- <property name="position">2</property>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBoxText" id="combobox_ups_computer">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBoxText" id="combobox_ups_low">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBoxText" id="combobox_ups_critical">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">2</property>
</packing>
</child>
</object>
</child>
</object>
- <packing>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label_ups_actions_sect">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Actions</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
</child>
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkVBox" id="vbox_ups_display">
+ <object class="GtkFrame">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkLabel" id="label_ups_display_sect">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">&lt;b&gt;Display&lt;/b&gt;</property>
- <property name="use_markup">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
<child>
- <object class="GtkAlignment" id="alignment50">
+ <object class="GtkAlignment">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="left_padding">12</property>
<child>
- <object class="GtkVBox" id="vbox93">
+ <object class="GtkGrid">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">5</property>
+ <property name="can_focus">False</property>
+ <property name="margin_top">6</property>
+ <property name="margin_bottom">6</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">12</property>
<child>
- <object class="GtkHBox" id="hbox_ups_display">
+ <object class="GtkLabel" id="label_ups_display">
<property name="visible">True</property>
- <property name="spacing">12</property>
- <property name="homogeneous">True</property>
- <child>
- <object class="GtkLabel" id="label_ups_display">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Put _display to sleep when inactive for:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">combobox_ups_display</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBoxText" id="combobox_ups_display">
- <property name="visible">True</property>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Put _display to sleep when inactive for:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">combobox_ups_display</property>
+ <property name="xalign">0</property>
</object>
<packing>
- <property name="position">0</property>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBoxText" id="combobox_ups_display">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
</packing>
</child>
</object>
</child>
</object>
- <packing>
- <property name="position">1</property>
- </packing>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label_ups_display_sect">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Display</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
</child>
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
@@ -788,6 +852,7 @@
<child type="tab">
<object class="GtkLabel" id="label_tab_ups">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes">On UPS Power</property>
</object>
<packing>
@@ -796,141 +861,147 @@
</packing>
</child>
<child>
- <object class="GtkVBox" id="vbox_general">
+ <object class="GtkBox" id="box_general">
<property name="visible">True</property>
- <property name="border_width">12</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">12</property>
+ <property name="margin_right">12</property>
+ <property name="margin_top">12</property>
+ <property name="margin_bottom">12</property>
<property name="orientation">vertical</property>
- <property name="spacing">12</property>
<child>
- <object class="GtkVBox" id="vbox75">
+ <object class="GtkFrame">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
<child>
- <object class="GtkLabel" id="label122">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">&lt;b&gt;Actions&lt;/b&gt;</property>
- <property name="use_markup">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkAlignment" id="alignment44">
+ <object class="GtkAlignment">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="left_padding">12</property>
<child>
- <object class="GtkVBox" id="vbox76">
+ <object class="GtkBox">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_top">6</property>
+ <property name="margin_bottom">6</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
- <object class="GtkHBox" id="hbox_general_power">
+ <object class="GtkBox" id="box_general_power">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="spacing">12</property>
- <property name="homogeneous">True</property>
<child>
<object class="GtkLabel" id="label_general_power">
<property name="visible">True</property>
- <property name="xalign">0</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes">When the power _button is pressed:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">combobox_general_power</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="combobox_general_power">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
</object>
<packing>
+ <property name="expand">True</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="position">0</property>
</packing>
</child>
<child>
- <object class="GtkHBox" id="hbox_general_suspend">
+ <object class="GtkBox" id="box_general_suspend">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="spacing">12</property>
- <property name="homogeneous">True</property>
<child>
<object class="GtkLabel" id="label_general_suspend">
<property name="visible">True</property>
- <property name="xalign">0</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes">When the _suspend button is pressed:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">combobox_general_suspend</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="combobox_general_suspend">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
</object>
<packing>
+ <property name="expand">True</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="position">1</property>
</packing>
</child>
</object>
</child>
</object>
- <packing>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
+ </child>
+ <child type="label">
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Actions</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
</child>
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkVBox" id="vbox_notification">
+ <object class="GtkFrame">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
<child>
- <object class="GtkLabel" id="label_notification_area_sect">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">&lt;b&gt;Notification Area&lt;/b&gt;</property>
- <property name="use_markup">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkAlignment" id="alignment37">
+ <object class="GtkAlignment">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="left_padding">12</property>
<child>
- <object class="GtkVBox" id="vbox62">
+ <object class="GtkBox" id="box_general_notification">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_top">6</property>
+ <property name="margin_bottom">6</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
@@ -939,8 +1010,11 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
+ <property name="halign">start</property>
<property name="use_underline">True</property>
+ <property name="active">True</property>
<property name="draw_indicator">True</property>
+ <signal name="clicked" handler="on_radiobutton_notification_never_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
@@ -954,9 +1028,11 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
+ <property name="halign">start</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
<property name="group">radiobutton_notification_never</property>
+ <signal name="clicked" handler="on_radiobutton_notification_low_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
@@ -970,9 +1046,11 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
+ <property name="halign">start</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
<property name="group">radiobutton_notification_never</property>
+ <signal name="clicked" handler="on_radiobutton_notification_charge_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
@@ -986,9 +1064,11 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
+ <property name="halign">start</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
<property name="group">radiobutton_notification_never</property>
+ <signal name="clicked" handler="on_radiobutton_notification_present_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
@@ -1002,9 +1082,11 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
+ <property name="halign">start</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
<property name="group">radiobutton_notification_never</property>
+ <signal name="clicked" handler="on_radiobutton_notification_always_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
@@ -1015,13 +1097,21 @@
</object>
</child>
</object>
- <packing>
- <property name="position">1</property>
- </packing>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label_notification_area_sect">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Notification Area</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
</child>
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
@@ -1033,6 +1123,7 @@
<child type="tab">
<object class="GtkLabel" id="label_tab_general">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes">General</property>
</object>
<packing>
@@ -1042,75 +1133,17 @@
</child>
</object>
<packing>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child internal-child="action_area">
- <object class="GtkHButtonBox" id="dialog-action_area1">
- <property name="visible">True</property>
- <property name="layout_style">end</property>
- <child>
- <object class="GtkButton" id="button_help">
- <property name="label">gtk-help</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip_text" translatable="yes">Provides help about this program</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- <property name="secondary">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="button_defaults">
- <property name="label" translatable="yes">Make Default</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="tooltip_text" translatable="yes">Sets this policy to be used by all users</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="button_close">
- <property name="label">gtk-close</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip_text" translatable="yes">Closes the program</property>
- <property name="use_stock">True</property>
- </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="pack_type">end</property>
- <property name="position">0</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
</packing>
</child>
</object>
</child>
<action-widgets>
- <action-widget response="0">button_help</action-widget>
- <action-widget response="0">button_defaults</action-widget>
- <action-widget response="0">button_close</action-widget>
+ <action-widget response="-11">button_help</action-widget>
+ <action-widget response="-10">button_defaults</action-widget>
+ <action-widget response="-7">button_close</action-widget>
</action-widgets>
</object>
</interface>
diff --git a/src/gpm-prefs-core.c b/src/gpm-prefs-core.c
index e51e367..44467ff 100644
--- a/src/gpm-prefs-core.c
+++ b/src/gpm-prefs-core.c
@@ -41,6 +41,10 @@
#include "gpm-icon-names.h"
#include "gpm-brightness.h"
+#define GET_WIDGET(x) (GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder, (x))))
+#define GET_NOTEBOOK(x) (GTK_NOTEBOOK (gtk_builder_get_object (prefs->priv->builder, (x))))
+#define GET_WINDOW(x) (GTK_WINDOW (gtk_builder_get_object (prefs->priv->builder, (x))))
+
static void gpm_prefs_finalize (GObject *object);
struct GpmPrefsPrivate
@@ -109,7 +113,7 @@ void
gpm_prefs_activate_window (GtkApplication *app, GpmPrefs *prefs)
{
GtkWindow *window;
- window = GTK_WINDOW (gtk_builder_get_object (prefs->priv->builder, "dialog_preferences"));
+ window = GET_WINDOW ("dialog_preferences");
gtk_application_add_window (GTK_APPLICATION (app), window);
gtk_window_present (window);
}
@@ -218,7 +222,7 @@ gpm_prefs_setup_action_combo (GpmPrefs *prefs, const gchar *widget_name,
GPtrArray *array;
GpmActionPolicy *actions_added;
- widget = GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder, widget_name));
+ widget = GET_WIDGET (widget_name);
value = g_settings_get_enum (prefs->priv->settings, gpm_pref_key);
is_writable = g_settings_is_writable (prefs->priv->settings, gpm_pref_key);
@@ -296,7 +300,7 @@ gpm_prefs_setup_time_combo (GpmPrefs *prefs, const gchar *widget_name,
gboolean is_writable;
GtkWidget *widget;
- widget = GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder, widget_name));
+ widget = GET_WIDGET (widget_name);
value = g_settings_get_int (prefs->priv->settings, gpm_pref_key);
is_writable = g_settings_is_writable (prefs->priv->settings, gpm_pref_key);
@@ -352,74 +356,6 @@ gpm_prefs_delete_event_cb (GtkWidget *widget, GdkEvent *event, GpmPrefs *prefs)
return FALSE;
}
-/** setup the notification page */
-static void
-prefs_setup_notification (GpmPrefs *prefs)
-{
- gint icon_policy;
- GtkWidget *radiobutton_icon_always;
- GtkWidget *radiobutton_icon_present;
- GtkWidget *radiobutton_icon_charge;
- GtkWidget *radiobutton_icon_low;
- GtkWidget *radiobutton_icon_never;
- gboolean is_writable;
-
- icon_policy = g_settings_get_enum (prefs->priv->settings, GPM_SETTINGS_ICON_POLICY);
-
- radiobutton_icon_always = GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder,
- "radiobutton_notification_always"));
- radiobutton_icon_present = GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder,
- "radiobutton_notification_present"));
- radiobutton_icon_charge = GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder,
- "radiobutton_notification_charge"));
- radiobutton_icon_low = GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder,
- "radiobutton_notification_low"));
- radiobutton_icon_never = GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder,
- "radiobutton_notification_never"));
-
- is_writable = g_settings_is_writable (prefs->priv->settings, GPM_SETTINGS_ICON_POLICY);
- gtk_widget_set_sensitive (radiobutton_icon_always, is_writable);
- gtk_widget_set_sensitive (radiobutton_icon_present, is_writable);
- gtk_widget_set_sensitive (radiobutton_icon_charge, is_writable);
- gtk_widget_set_sensitive (radiobutton_icon_low, is_writable);
- gtk_widget_set_sensitive (radiobutton_icon_never, is_writable);
-
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radiobutton_icon_always),
- icon_policy == GPM_ICON_POLICY_ALWAYS);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radiobutton_icon_present),
- icon_policy == GPM_ICON_POLICY_PRESENT);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radiobutton_icon_charge),
- icon_policy == GPM_ICON_POLICY_CHARGE);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radiobutton_icon_low),
- icon_policy == GPM_ICON_POLICY_LOW);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radiobutton_icon_never),
- icon_policy == GPM_ICON_POLICY_NEVER);
-
- g_object_set_data (G_OBJECT (radiobutton_icon_always), "policy",
- GINT_TO_POINTER (GPM_ICON_POLICY_ALWAYS));
- g_object_set_data (G_OBJECT (radiobutton_icon_present), "policy",
- GINT_TO_POINTER (GPM_ICON_POLICY_PRESENT));
- g_object_set_data (G_OBJECT (radiobutton_icon_charge), "policy",
- GINT_TO_POINTER (GPM_ICON_POLICY_CHARGE));
- g_object_set_data (G_OBJECT (radiobutton_icon_low), "policy",
- GINT_TO_POINTER (GPM_ICON_POLICY_LOW));
- g_object_set_data (G_OBJECT (radiobutton_icon_never), "policy",
- GINT_TO_POINTER (GPM_ICON_POLICY_NEVER));
-
- /* only connect the callbacks after we set the value, else the settings
- * keys gets written to (for a split second), and the icon flickers. */
- g_signal_connect (radiobutton_icon_always, "clicked",
- G_CALLBACK (gpm_prefs_icon_radio_cb), prefs);
- g_signal_connect (radiobutton_icon_present, "clicked",
- G_CALLBACK (gpm_prefs_icon_radio_cb), prefs);
- g_signal_connect (radiobutton_icon_charge, "clicked",
- G_CALLBACK (gpm_prefs_icon_radio_cb), prefs);
- g_signal_connect (radiobutton_icon_low, "clicked",
- G_CALLBACK (gpm_prefs_icon_radio_cb), prefs);
- g_signal_connect (radiobutton_icon_never, "clicked",
- G_CALLBACK (gpm_prefs_icon_radio_cb), prefs);
-}
-
static void
prefs_setup_ac (GpmPrefs *prefs)
{
@@ -460,7 +396,7 @@ prefs_setup_ac (GpmPrefs *prefs)
button_lid_actions);
/* setup brightness slider */
- widget = GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder, "hscale_ac_brightness"));
+ widget = GET_WIDGET ("hscale_ac_brightness");
g_settings_bind (prefs->priv->settings, GPM_SETTINGS_BRIGHTNESS_AC,
gtk_range_get_adjustment (GTK_RANGE (widget)), "value",
G_SETTINGS_BIND_DEFAULT);
@@ -468,30 +404,22 @@ prefs_setup_ac (GpmPrefs *prefs)
G_CALLBACK (gpm_prefs_format_percentage_cb), NULL);
/* set up the checkboxes */
- widget = GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder, "checkbutton_ac_display_dim"));
g_settings_bind (prefs->priv->settings, GPM_SETTINGS_IDLE_DIM_AC,
- widget, "active",
+ GET_WIDGET ("checkbutton_ac_display_dim"), "active",
G_SETTINGS_BIND_DEFAULT);
if (prefs->priv->has_button_lid == FALSE) {
- widget = GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder, "hbox_ac_lid"));
- gtk_widget_hide(widget);
+ gtk_widget_hide (GET_WIDGET ("box_ac_lid"));
}
if (prefs->priv->has_lcd == FALSE) {
- widget = GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder, "hbox_ac_brightness"));
-
- gtk_widget_hide(widget);
-
- widget = GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder, "checkbutton_ac_display_dim"));
-
- gtk_widget_hide(widget);
+ gtk_widget_hide (GET_WIDGET ("box_ac_brightness"));
+ gtk_widget_hide (GET_WIDGET ("checkbutton_ac_display_dim"));
}
}
static void
prefs_setup_battery (GpmPrefs *prefs)
{
- GtkWidget *widget;
GtkNotebook *notebook;
gint page;
@@ -533,9 +461,8 @@ prefs_setup_battery (GpmPrefs *prefs)
display_times);
if (prefs->priv->has_batteries == FALSE) {
- notebook = GTK_NOTEBOOK (gtk_builder_get_object (prefs->priv->builder, "notebook_preferences"));
- widget = GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder, "vbox_battery"));
- page = gtk_notebook_page_num (notebook, GTK_WIDGET (widget));
+ notebook = GET_NOTEBOOK ("notebook_preferences");
+ page = gtk_notebook_page_num (notebook, GET_WIDGET ("box_battery"));
gtk_notebook_remove_page (notebook, page);
return;
}
@@ -548,30 +475,23 @@ prefs_setup_battery (GpmPrefs *prefs)
battery_critical_actions);
/* set up the checkboxes */
- widget = GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder, "checkbutton_battery_display_reduce"));
g_settings_bind (prefs->priv->settings, GPM_SETTINGS_BACKLIGHT_BATTERY_REDUCE,
- widget, "active",
+ GET_WIDGET ("checkbutton_battery_display_reduce"), "active",
G_SETTINGS_BIND_DEFAULT);
- widget = GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder, "checkbutton_battery_display_dim"));
g_settings_bind (prefs->priv->settings, GPM_SETTINGS_IDLE_DIM_BATT,
- widget, "active",
+ GET_WIDGET ("checkbutton_battery_display_dim"), "active",
G_SETTINGS_BIND_DEFAULT);
- if (prefs->priv->has_button_lid == FALSE) {
- widget = GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder, "hbox_battery_lid"));
+ if (prefs->priv->has_button_lid == FALSE)
+ gtk_widget_hide (GET_WIDGET ("box_battery_lid"));
- gtk_widget_hide(widget);
- }
- if (prefs->priv->has_lcd == FALSE) {
- widget = GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder, "checkbutton_battery_display_dim"));
- gtk_widget_hide(widget);
- }
+ if (prefs->priv->has_lcd == FALSE)
+ gtk_widget_hide (GET_WIDGET ("checkbutton_battery_display_dim"));
}
static void
prefs_setup_ups (GpmPrefs *prefs)
{
- GtkWidget *widget;
GtkWidget *notebook;
GtkWidget *window;
gint page;
@@ -606,15 +526,14 @@ prefs_setup_ups (GpmPrefs *prefs)
display_times);
window = gpm_window (prefs);
- notebook = GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder, "notebook_preferences"));
+ notebook = GET_WIDGET ("notebook_preferences");
gtk_widget_add_events (notebook, GDK_SCROLL_MASK);
g_signal_connect (GTK_NOTEBOOK (notebook), "scroll-event",
G_CALLBACK (gpm_dialog_page_scroll_event_cb),
window);
if (prefs->priv->has_ups == FALSE) {
- widget = GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder, "vbox_ups"));
- page = gtk_notebook_page_num (GTK_NOTEBOOK (notebook), GTK_WIDGET (widget));
+ page = gtk_notebook_page_num (GTK_NOTEBOOK (notebook), GET_WIDGET ("box_ups"));
gtk_notebook_remove_page (GTK_NOTEBOOK (notebook), page);
return;
}
@@ -630,7 +549,6 @@ prefs_setup_ups (GpmPrefs *prefs)
static void
prefs_setup_general (GpmPrefs *prefs)
{
- GtkWidget *widget;
const GpmActionPolicy power_button_actions[] =
{GPM_ACTION_POLICY_INTERACTIVE,
GPM_ACTION_POLICY_SUSPEND,
@@ -651,11 +569,8 @@ prefs_setup_general (GpmPrefs *prefs)
GPM_SETTINGS_BUTTON_SUSPEND,
suspend_button_actions);
- if (prefs->priv->has_button_suspend == FALSE) {
- widget = GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder, "hbox_general_suspend"));
-
- gtk_widget_hide(widget);
- }
+ if (prefs->priv->has_button_suspend == FALSE)
+ gtk_widget_hide (GET_WIDGET ("box_general_suspend"));
}
/**
@@ -665,9 +580,6 @@ prefs_setup_general (GpmPrefs *prefs)
static void
gpm_prefs_init (GpmPrefs *prefs)
{
- GtkWidget *main_window;
- GtkWidget *widget;
- guint retval;
GError *error = NULL;
GPtrArray *devices = NULL;
UpDevice *device;
@@ -822,38 +734,76 @@ gpm_prefs_init (GpmPrefs *prefs)
error = NULL;
prefs->priv->builder = gtk_builder_new ();
- retval = gtk_builder_add_from_resource (prefs->priv->builder, "/org/mate/powermanager/preferences/gpm-prefs.ui", &error);
+ (void) gtk_builder_add_from_resource (prefs->priv->builder, "/org/mate/powermanager/preferences/gpm-prefs.ui", &error);
if (error) {
egg_error ("failed to load ui: %s", error->message);
}
- main_window = GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder, "dialog_preferences"));
-
/* Hide window first so that the dialogue resizes itself without redrawing */
- gtk_widget_hide (main_window);
- gtk_window_set_default_icon_name (GPM_ICON_APP_ICON);
+ gtk_widget_hide (GET_WIDGET ("dialog_preferences"));
- /* Get the main window quit */
- g_signal_connect (main_window, "delete_event",
- G_CALLBACK (gpm_prefs_delete_event_cb), prefs);
+ gtk_widget_hide (GET_WIDGET ("button_defaults"));
- widget = GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder, "button_close"));
- g_signal_connect (widget, "clicked",
- G_CALLBACK (gpm_prefs_close_cb), prefs);
+ /** setup the notification page */
+ gint icon_policy;
+ GtkWidget *radiobutton_icon_always;
+ GtkWidget *radiobutton_icon_present;
+ GtkWidget *radiobutton_icon_charge;
+ GtkWidget *radiobutton_icon_low;
+ GtkWidget *radiobutton_icon_never;
+
+ icon_policy = g_settings_get_enum (prefs->priv->settings, GPM_SETTINGS_ICON_POLICY);
- widget = GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder, "button_help"));
- g_signal_connect (widget, "clicked",
- G_CALLBACK (gpm_prefs_help_cb), prefs);
+ radiobutton_icon_always = GET_WIDGET ("radiobutton_notification_always");
+ radiobutton_icon_present = GET_WIDGET ("radiobutton_notification_present");
+ radiobutton_icon_charge = GET_WIDGET ("radiobutton_notification_charge");
+ radiobutton_icon_low = GET_WIDGET ("radiobutton_notification_low");
+ radiobutton_icon_never = GET_WIDGET ("radiobutton_notification_never");
+
+ gtk_widget_set_sensitive (GET_WIDGET ("box_general_notification"),
+ g_settings_is_writable (prefs->priv->settings, GPM_SETTINGS_ICON_POLICY));
+
+ switch (icon_policy) {
+ case GPM_ICON_POLICY_ALWAYS:
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radiobutton_icon_always), TRUE);
+ break;
+ case GPM_ICON_POLICY_PRESENT:
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radiobutton_icon_present), TRUE);
+ break;
+ case GPM_ICON_POLICY_CHARGE:
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radiobutton_icon_charge), TRUE);
+ break;
+ case GPM_ICON_POLICY_LOW:
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radiobutton_icon_low), TRUE);
+ break;
+ case GPM_ICON_POLICY_NEVER:
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radiobutton_icon_never), TRUE);
+ break;
+ }
- widget = GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder, "button_defaults"));
- gtk_widget_hide (widget);
+ g_object_set_data (G_OBJECT (radiobutton_icon_always), "policy", GINT_TO_POINTER (GPM_ICON_POLICY_ALWAYS));
+ g_object_set_data (G_OBJECT (radiobutton_icon_present), "policy", GINT_TO_POINTER (GPM_ICON_POLICY_PRESENT));
+ g_object_set_data (G_OBJECT (radiobutton_icon_charge), "policy", GINT_TO_POINTER (GPM_ICON_POLICY_CHARGE));
+ g_object_set_data (G_OBJECT (radiobutton_icon_low), "policy", GINT_TO_POINTER (GPM_ICON_POLICY_LOW));
+ g_object_set_data (G_OBJECT (radiobutton_icon_never), "policy", GINT_TO_POINTER (GPM_ICON_POLICY_NEVER));
+
+ gtk_builder_add_callback_symbols (prefs->priv->builder,
+ "on_dialog_preferences_delete_event", G_CALLBACK (gpm_prefs_delete_event_cb),
+ "on_button_help_clicked", G_CALLBACK (gpm_prefs_help_cb),
+ "on_button_close_clicked", G_CALLBACK (gpm_prefs_close_cb),
+ "on_radiobutton_notification_never_clicked", G_CALLBACK (gpm_prefs_icon_radio_cb),
+ "on_radiobutton_notification_low_clicked", G_CALLBACK (gpm_prefs_icon_radio_cb),
+ "on_radiobutton_notification_charge_clicked", G_CALLBACK (gpm_prefs_icon_radio_cb),
+ "on_radiobutton_notification_present_clicked", G_CALLBACK (gpm_prefs_icon_radio_cb),
+ "on_radiobutton_notification_always_clicked", G_CALLBACK (gpm_prefs_icon_radio_cb),
+ NULL);
+ gtk_builder_connect_signals (prefs->priv->builder, prefs);
prefs_setup_ac (prefs);
prefs_setup_battery (prefs);
prefs_setup_ups (prefs);
prefs_setup_general (prefs);
- prefs_setup_notification (prefs);
}
/**
@@ -897,5 +847,5 @@ gpm_prefs_new (void)
GtkWidget *
gpm_window (GpmPrefs *prefs)
{
- return GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder, "dialog_preferences"));
+ return GET_WIDGET ("dialog_preferences");
}