[Goodies-commits] r6884 - in xfce4-power-manager/trunk: . settings src
Ali Abdallah
aliov at xfce.org
Wed Mar 11 13:06:57 CET 2009
Author: aliov
Date: 2009-03-11 12:06:57 +0000 (Wed, 11 Mar 2009)
New Revision: 6884
Modified:
xfce4-power-manager/trunk/ChangeLog
xfce4-power-manager/trunk/settings/xfpm-settings.c
xfce4-power-manager/trunk/settings/xfpm-settings.glade
xfce4-power-manager/trunk/src/xfpm-config.h
Log:
Fix infinite loop caused by g_signal_connect+added advanced settings in the dialog
Modified: xfce4-power-manager/trunk/ChangeLog
===================================================================
--- xfce4-power-manager/trunk/ChangeLog 2009-03-11 09:58:10 UTC (rev 6883)
+++ xfce4-power-manager/trunk/ChangeLog 2009-03-11 12:06:57 UTC (rev 6884)
@@ -1,4 +1,7 @@
+2009-03-11 13:06 Ali aliov at xfce.org
+ * : Fix infinite loop caused by g_signal_connect+added advanced settings in the dialog
+
2009-03-10 21:13 Ali aliov at xfce.org
* : properties shutdown,suspend and hibernate are noe strings in xfce4-power-manager channel configuration
Modified: xfce4-power-manager/trunk/settings/xfpm-settings.c
===================================================================
--- xfce4-power-manager/trunk/settings/xfpm-settings.c 2009-03-11 09:58:10 UTC (rev 6883)
+++ xfce4-power-manager/trunk/settings/xfpm-settings.c 2009-03-11 12:06:57 UTC (rev 6884)
@@ -48,6 +48,8 @@
static GtkWidget *on_battery_dpms_off = NULL;
static GtkWidget *on_ac_dpms_sleep = NULL;
static GtkWidget *on_ac_dpms_off = NULL;
+static GtkWidget *sleep_dpms_mode = NULL;
+static GtkWidget *suspend_dpms_mode = NULL;
#endif
/*
@@ -95,7 +97,7 @@
1,
&value,
-1);
-
+
if (!xfconf_channel_set_uint (channel, SHOW_TRAY_ICON_CFG, value) )
{
g_critical ("Cannot set value for property %s\n", SHOW_TRAY_ICON_CFG);
@@ -150,6 +152,24 @@
#ifdef HAVE_DPMS
static void
+set_dpms_sleep_mode (GtkWidget *w, XfconfChannel *channel)
+{
+ if (!xfconf_channel_set_string (channel, DPMS_SLEEP_MODE, "sleep") )
+ {
+ g_critical ("Cannot set value sleep for property %s\n", DPMS_SLEEP_MODE);
+ }
+}
+
+static void
+set_dpms_suspend_mode (GtkWidget *w, XfconfChannel *channel)
+{
+ if (!xfconf_channel_set_string (channel, DPMS_SLEEP_MODE, "suspend") )
+ {
+ g_critical ("Cannot set value sleep for property %s\n", DPMS_SLEEP_MODE);
+ }
+}
+
+static void
dpms_toggled_cb (GtkWidget *w, XfconfChannel *channel)
{
gboolean val = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(w));
@@ -172,7 +192,6 @@
gint off_value = (gint)gtk_range_get_value (GTK_RANGE(on_battery_dpms_off));
gint sleep_value = (gint)gtk_range_get_value (GTK_RANGE(w));
- //g_print("SLEEP off_value=%d sleep_value =%d\n", off_value, sleep_value);
if ( off_value != 0 )
{
if ( sleep_value >= off_value )
@@ -185,7 +204,6 @@
{
g_critical ("Cannot set value for property %s\n", ON_BATT_DPMS_SLEEP);
}
-
}
static void
@@ -194,7 +212,6 @@
gint off_value = (gint)gtk_range_get_value (GTK_RANGE(w));
gint sleep_value = (gint)gtk_range_get_value (GTK_RANGE(on_battery_dpms_sleep));
- //g_print("OFF off_value=%d sleep_value =%d\n", off_value, sleep_value);
if ( sleep_value != 0 )
{
if ( off_value <= sleep_value )
@@ -219,8 +236,6 @@
if ( off_value > 60 || sleep_value > 60 )
return;
- g_print("SLEEP off_value=%d sleep_value =%d\n", off_value, sleep_value);
-
if ( off_value != 0 )
{
if ( sleep_value >= off_value )
@@ -228,7 +243,7 @@
gtk_range_set_value (GTK_RANGE(on_ac_dpms_off), sleep_value + 1 );
}
}
-
+
if (!xfconf_channel_set_uint (channel, ON_AC_DPMS_SLEEP, sleep_value))
{
g_critical ("Cannot set value for property %s\n", ON_AC_DPMS_SLEEP);
@@ -241,8 +256,6 @@
gint off_value = (gint)gtk_range_get_value (GTK_RANGE(w));
gint sleep_value = (gint)gtk_range_get_value (GTK_RANGE(on_ac_dpms_sleep));
- g_print("OFF off_value=%d sleep_value =%d\n", off_value, sleep_value);
-
if ( off_value > 60 || sleep_value > 60 )
return;
@@ -253,12 +266,11 @@
gtk_range_set_value (GTK_RANGE(on_ac_dpms_sleep), off_value -1 );
}
}
-
+
if (!xfconf_channel_set_uint (channel, ON_AC_DPMS_OFF, off_value))
{
g_critical ("Cannot set value for property %s\n", ON_AC_DPMS_OFF);
}
-
}
/*
@@ -594,6 +606,34 @@
}
static void
+xfpm_settings_advanced (XfconfChannel *channel )
+{
+#ifdef HAVE_DPMS
+ sleep_dpms_mode = glade_xml_get_widget (xml, "sleep-dpms-mode");
+ suspend_dpms_mode = glade_xml_get_widget (xml, "suspend-dpms-mode");
+ g_signal_connect (sleep_dpms_mode, "toggled",
+ G_CALLBACK(set_dpms_sleep_mode), channel);
+ g_signal_connect (suspend_dpms_mode, "toggled",
+ G_CALLBACK(set_dpms_suspend_mode), channel);
+
+ gchar *str = xfconf_channel_get_string (channel, DPMS_SLEEP_MODE, "sleep");
+ if ( xfpm_strequal (str, "sleep" ) )
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(sleep_dpms_mode), TRUE);
+ else if ( xfpm_strequal (str, "suspend") )
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(suspend_dpms_mode), TRUE);
+ else
+ {
+ g_critical ("Invalid value %s for property %s\n", str, DPMS_SLEEP_MODE );
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(sleep_dpms_mode), TRUE);
+ }
+
+ g_free (str);
+
+
+#endif
+}
+
+static void
_cursor_changed_cb(GtkIconView *view,gpointer data)
{
GtkTreeSelection *sel;
@@ -692,6 +732,19 @@
}
i++;
+ pix = xfpm_load_icon("applications-other", 48);
+ gtk_list_store_append(list_store, &iter);
+ if ( pix )
+ {
+ gtk_list_store_set(list_store, &iter, 0, pix, 1, _("Advanced"), 2, i, -1);
+ g_object_unref(pix);
+ }
+ else
+ {
+ gtk_list_store_set(list_store, &iter, 1, _("Advance"), 2, i, -1);
+ }
+
+
GtkTreeSelection *sel;
GtkTreePath *path;
@@ -703,111 +756,8 @@
gtk_tree_path_free(path);
g_signal_connect(view,"cursor-changed",G_CALLBACK(_cursor_changed_cb),NULL);
-
}
-//FIXME: Check the values before updating the dialog
-static void
-update_settings_dialog (XfconfChannel *channel, gchar *property, GValue *value, GladeXML *xml)
-{
- if ( G_VALUE_TYPE(value) == G_TYPE_INVALID )
- return;
-
-#ifdef HAVE_DPMS
-
- if ( xfpm_strequal (property, DPMS_ENABLED_CFG) )
- {
- gboolean val = g_value_get_boolean (value );
- GtkWidget *dpms = glade_xml_get_widget (xml, "enable-dpms");
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(dpms), val);
- }
- else if ( xfpm_strequal (property, ON_AC_DPMS_SLEEP) )
- {
- guint val = g_value_get_uint (value);
- gtk_range_set_value (GTK_RANGE(on_ac_dpms_sleep), val);
- }
- else if ( xfpm_strequal (property, ON_AC_DPMS_OFF) )
- {
- guint val = g_value_get_uint (value);
- gtk_range_set_value (GTK_RANGE(on_ac_dpms_off), val);
- }
- else if ( xfpm_strequal (property, ON_BATT_DPMS_SLEEP) )
- {
- guint val = g_value_get_uint (value);
- gtk_range_set_value (GTK_RANGE(on_ac_dpms_sleep), val);
- }
- else if ( xfpm_strequal (property, ON_BATT_DPMS_OFF) )
- {
- guint val = g_value_get_uint (value);
- gtk_range_set_value (GTK_RANGE(on_ac_dpms_off), val);
- }
-#endif /* HAVE_DPMS */
- else if ( xfpm_strequal (property, POWER_SAVE_ON_BATTERY ) )
- {
- GtkWidget *widget = glade_xml_get_widget (xml, "power-save");
- gboolean val = g_value_get_boolean (value);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(widget), val);
- }
- else if ( xfpm_strequal (property, SLEEP_SWITCH_CFG ) )
- {
- GtkWidget *widget = glade_xml_get_widget (xml, "sleep-combox");
- const gchar *str = g_value_get_string (value);
- gint val = xfpm_shutdown_string_to_int (str);
- if ( val == -1)
- {
- g_warning ("Invalid value %s for property, using default %s\n", str, SLEEP_SWITCH_CFG);
- gtk_combo_box_set_active (GTK_COMBO_BOX(widget), 0);
- }
- else
- gtk_combo_box_set_active (GTK_COMBO_BOX(widget), val);
- }
- else if ( xfpm_strequal (property, LID_SWITCH_ON_AC_CFG ) )
- {
- GtkWidget *widget = glade_xml_get_widget (xml, "on-ac-lid");
- const gchar *str = g_value_get_string (value);
- gint val = xfpm_shutdown_string_to_int (str);
- if ( val == -1 || val == 3 /*we don't do shutdown here */)
- {
- g_warning ("Invalid value %s for property %s\n", str, LID_SWITCH_ON_AC_CFG);
- gtk_combo_box_set_active (GTK_COMBO_BOX(widget), 0);
- }
- else
- gtk_combo_box_set_active (GTK_COMBO_BOX(widget), val);
- }
- else if ( xfpm_strequal (property, LID_SWITCH_ON_BATTERY_CFG ) )
- {
- GtkWidget *widget = glade_xml_get_widget (xml, "on-battery-lid");
- const gchar *str = g_value_get_string (value);
- gint val = xfpm_shutdown_string_to_int (str);
- if ( val == -1 || val == 3 /*we don't do shutdown here */)
- {
- g_warning ("Invalid value %s for property %s\n", str, LID_SWITCH_ON_BATTERY_CFG);
- gtk_combo_box_set_active (GTK_COMBO_BOX(widget), 0);
- }
- else
- gtk_combo_box_set_active (GTK_COMBO_BOX(widget), val);
- }
- else if ( xfpm_strequal (property, CRITICAL_BATT_ACTION_CFG ) )
- {
- GtkWidget *widget = glade_xml_get_widget (xml, "battery-critical-combox");
- const gchar *str = g_value_get_string (value);
- gint val = xfpm_shutdown_string_to_int (str);
- if ( val == -1 || val == 3 /*we don't do shutdown here */)
- {
- g_warning ("Invalid value %s for property %s\n", str, CRITICAL_BATT_ACTION_CFG);
- gtk_combo_box_set_active (GTK_COMBO_BOX(widget), 0);
- }
- else
- gtk_combo_box_set_active (GTK_COMBO_BOX(widget), val);
- }
- if ( xfpm_strequal (property, GENERAL_NOTIFICATION_CFG ) )
- {
- GtkWidget *widget = glade_xml_get_widget (xml, "notification");
- guint val = g_value_get_boolean (value);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(widget), val);
- }
-}
-
static void dialog_response_cb (GtkDialog *dialog, gint response, gpointer data)
{
XfconfChannel *channel = (XfconfChannel *)data;
@@ -838,14 +788,8 @@
xfpm_settings_on_battery (channel);
xfpm_settings_tree_view (channel);
xfpm_settings_general (channel);
+ xfpm_settings_advanced (channel);
- /*
- * Connect property-changed to the channel in case the settings changed
- * somehow, say with xfconf-query so we can update the settings dialog
- */
- g_signal_connect (channel, "property-changed",
- G_CALLBACK (update_settings_dialog), xml);
-
g_signal_connect (dialog, "response", G_CALLBACK(dialog_response_cb), channel);
return dialog;
Modified: xfce4-power-manager/trunk/settings/xfpm-settings.glade
===================================================================
--- xfce4-power-manager/trunk/settings/xfpm-settings.glade 2009-03-11 09:58:10 UTC (rev 6883)
+++ xfce4-power-manager/trunk/settings/xfpm-settings.glade 2009-03-11 12:06:57 UTC (rev 6884)
@@ -2,7 +2,7 @@
<glade-interface>
<!-- interface-requires gtk+ 2.16 -->
<requires lib="xfce4"/>
- <!-- interface-requires xfce4 2243.42112 -->
+ <!-- interface-requires xfce4 2360.6128 -->
<!-- interface-naming-policy toplevel-contextual -->
<widget class="XfceTitledDialog" id="xfpm-settings-dialog">
<property name="border_width">5</property>
@@ -13,14 +13,14 @@
<property name="has_separator">False</property>
<property name="subtitle" translatable="yes">Power manager settings</property>
<child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox1">
+ <widget class="GtkVBox" id="dialog-vbox">
<property name="visible">True</property>
<property name="spacing">2</property>
<child>
- <widget class="GtkVBox" id="vbox1">
+ <widget class="GtkVBox" id="vbox">
<property name="visible">True</property>
<child>
- <widget class="GtkHBox" id="hbox1">
+ <widget class="GtkHBox" id="hbox">
<property name="visible">True</property>
<child>
<widget class="GtkTreeView" id="treeview">
@@ -38,155 +38,168 @@
<property name="can_focus">True</property>
<property name="show_tabs">False</property>
<child>
- <widget class="GtkFrame" id="frame4">
+ <widget class="GtkVBox" id="vbox16">
<property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">none</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">10</property>
<child>
- <widget class="GtkAlignment" id="alignment6">
+ <widget class="GtkFrame" id="frame">
<property name="visible">True</property>
- <property name="left_padding">12</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
<child>
- <widget class="GtkVBox" id="vbox13">
+ <widget class="GtkAlignment" id="alignment">
<property name="visible">True</property>
- <property name="spacing">10</property>
+ <property name="left_padding">12</property>
<child>
- <widget class="GtkTable" id="table1">
+ <widget class="GtkVBox" id="vbox17">
<property name="visible">True</property>
- <property name="n_rows">3</property>
- <property name="n_columns">2</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">10</property>
<child>
- <widget class="GtkHBox" id="hbox10">
+ <widget class="GtkTable" id="table3">
<property name="visible">True</property>
+ <property name="n_rows">3</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">10</property>
+ <property name="row_spacing">10</property>
<child>
- <widget class="GtkComboBox" id="sleep-combox">
+ <widget class="GtkHBox" id="hbox13">
<property name="visible">True</property>
- <property name="items" translatable="yes"></property>
+ <child>
+ <widget class="GtkComboBox" id="sleep-combox">
+ <property name="visible">True</property>
+ <property name="items" translatable="yes">Nothing</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
</widget>
<packing>
- <property name="expand">False</property>
- <property name="position">0</property>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
</packing>
</child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHBox" id="hbox9">
- <property name="visible">True</property>
<child>
- <widget class="GtkComboBox" id="tray-combox">
+ <widget class="GtkHBox" id="hbox14">
<property name="visible">True</property>
- <property name="items" translatable="yes"></property>
+ <child>
+ <widget class="GtkComboBox" id="tray-combox">
+ <property name="visible">True</property>
+ <property name="items" translatable="yes">Always show icon</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
</widget>
<packing>
- <property name="expand">False</property>
- <property name="position">0</property>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
</packing>
</child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHBox" id="hbox7">
- <property name="visible">True</property>
<child>
- <widget class="GtkLabel" id="label4">
+ <widget class="GtkHBox" id="hbox15">
<property name="visible">True</property>
- <property name="label" translatable="yes">System tray icon: </property>
+ <child>
+ <widget class="GtkLabel" id="label24">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">System tray icon: </property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
</widget>
- <packing>
- <property name="expand">False</property>
- <property name="position">0</property>
- </packing>
</child>
- </widget>
- </child>
- <child>
- <widget class="GtkHBox" id="hbox8">
- <property name="visible">True</property>
<child>
- <widget class="GtkLabel" id="label2">
+ <widget class="GtkHBox" id="hbox16">
<property name="visible">True</property>
- <property name="label" translatable="yes">When sleep button is pressed:</property>
+ <child>
+ <widget class="GtkLabel" id="label25">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">When sleep button is pressed:</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
</widget>
<packing>
- <property name="expand">False</property>
- <property name="position">0</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
</packing>
</child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="expand">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <placeholder/>
+ <widget class="GtkCheckButton" id="enable-dpms">
+ <property name="label" translatable="yes">Enable monitor power management control</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
</child>
<child>
- <placeholder/>
+ <widget class="GtkCheckButton" id="notification">
+ <property name="label" translatable="yes">Enable notification</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">2</property>
+ </packing>
</child>
</widget>
- <packing>
- <property name="expand">False</property>
- <property name="position">0</property>
- </packing>
</child>
- <child>
- <widget class="GtkCheckButton" id="enable-dpms">
- <property name="label" translatable="yes">Enable monitor power management control</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkCheckButton" id="notification">
- <property name="label" translatable="yes">Enable notification</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="position">2</property>
- </packing>
- </child>
</widget>
</child>
+ <child>
+ <widget class="GtkLabel" id="label26">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"><b>General Options</b></property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
</widget>
- </child>
- <child>
- <widget class="GtkLabel" id="label12">
- <property name="visible">True</property>
- <property name="label" translatable="yes"><b>General Options</b></property>
- <property name="use_markup">True</property>
- </widget>
<packing>
- <property name="type">label_item</property>
+ <property name="position">0</property>
</packing>
</child>
</widget>
</child>
<child>
- <widget class="GtkLabel" id="on-ac-tab">
+ <widget class="GtkLabel" id="General">
<property name="visible">True</property>
- <property name="label" translatable="yes">General Options</property>
+ <property name="label" translatable="yes">General</property>
</widget>
<packing>
<property name="tab_fill">False</property>
@@ -194,26 +207,30 @@
</packing>
</child>
<child>
- <widget class="GtkVBox" id="vbox2">
+ <widget class="GtkVBox" id="vbox18">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">10</property>
<child>
- <widget class="GtkFrame" id="frame5">
+ <widget class="GtkFrame" id="frame7">
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
- <widget class="GtkAlignment" id="alignment5">
+ <widget class="GtkAlignment" id="alignment9">
<property name="visible">True</property>
<property name="top_padding">5</property>
<property name="left_padding">15</property>
<child>
- <widget class="GtkVBox" id="vbox4">
+ <widget class="GtkVBox" id="vbox19">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
<child>
- <widget class="GtkHBox" id="hbox4">
+ <widget class="GtkHBox" id="hbox17">
<property name="visible">True</property>
+ <property name="spacing">10</property>
<child>
- <widget class="GtkLabel" id="label14">
+ <widget class="GtkLabel" id="label27">
<property name="visible">True</property>
<property name="label" translatable="yes">When laptop lid is closed:</property>
</widget>
@@ -225,7 +242,7 @@
<child>
<widget class="GtkComboBox" id="on-ac-lid">
<property name="visible">True</property>
- <property name="items" translatable="yes"></property>
+ <property name="items" translatable="yes">Nothing</property>
</widget>
<packing>
<property name="expand">False</property>
@@ -267,19 +284,21 @@
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
- <widget class="GtkAlignment" id="alignment7">
+ <widget class="GtkAlignment" id="alignment10">
<property name="visible">True</property>
<property name="top_padding">5</property>
<property name="left_padding">15</property>
<child>
- <widget class="GtkVBox" id="vbox8">
+ <widget class="GtkVBox" id="vbox20">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
<property name="spacing">20</property>
<child>
- <widget class="GtkVBox" id="vbox11">
+ <widget class="GtkVBox" id="vbox21">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
<child>
- <widget class="GtkLabel" id="label9">
+ <widget class="GtkLabel" id="label28">
<property name="visible">True</property>
<property name="label" translatable="yes">Put display to sleep when computer is inactive for:</property>
</widget>
@@ -306,10 +325,11 @@
</packing>
</child>
<child>
- <widget class="GtkVBox" id="vbox12">
+ <widget class="GtkVBox" id="vbox22">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
<child>
- <widget class="GtkLabel" id="label10">
+ <widget class="GtkLabel" id="label29">
<property name="visible">True</property>
<property name="label" translatable="yes">Switch off display when computer is inactive for:</property>
</widget>
@@ -340,7 +360,7 @@
</widget>
</child>
<child>
- <widget class="GtkLabel" id="label11">
+ <widget class="GtkLabel" id="label30">
<property name="visible">True</property>
<property name="label" translatable="yes"><b>Monitor</b></property>
<property name="use_markup">True</property>
@@ -356,20 +376,21 @@
</packing>
</child>
<child>
- <widget class="GtkFrame" id="frame6">
+ <widget class="GtkFrame" id="frame8">
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
- <widget class="GtkAlignment" id="alignment8">
+ <widget class="GtkAlignment" id="alignment11">
<property name="visible">True</property>
<property name="top_padding">5</property>
<property name="left_padding">15</property>
<child>
- <widget class="GtkVBox" id="vbox14">
+ <widget class="GtkVBox" id="vbox23">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
<child>
- <widget class="GtkLabel" id="label15">
+ <widget class="GtkLabel" id="label31">
<property name="visible">True</property>
<property name="label" translatable="yes">Reduce screen brightness when computer is inactive for:</property>
</widget>
@@ -378,7 +399,7 @@
</packing>
</child>
<child>
- <widget class="GtkHScale" id="hscale2">
+ <widget class="GtkHScale" id="hscale3">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="adjustment">0 0 100 1 10 10</property>
@@ -400,7 +421,7 @@
</widget>
</child>
<child>
- <widget class="GtkLabel" id="label16">
+ <widget class="GtkLabel" id="label32">
<property name="visible">True</property>
<property name="label" translatable="yes"><b>Brightness</b></property>
<property name="use_markup">True</property>
@@ -421,9 +442,9 @@
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label7">
+ <widget class="GtkLabel" id="label8">
<property name="visible">True</property>
- <property name="label" translatable="yes">Running on AC</property>
+ <property name="label" translatable="yes">On AC</property>
</widget>
<packing>
<property name="position">1</property>
@@ -432,37 +453,43 @@
</packing>
</child>
<child>
- <widget class="GtkVBox" id="vbox15">
+ <widget class="GtkVBox" id="vbox24">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">10</property>
<child>
- <widget class="GtkVBox" id="vbox3">
+ <widget class="GtkVBox" id="vbox25">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
<child>
- <widget class="GtkFrame" id="frame2">
+ <widget class="GtkFrame" id="frame9">
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
- <widget class="GtkAlignment" id="alignment3">
+ <widget class="GtkAlignment" id="alignment12">
<property name="visible">True</property>
<property name="top_padding">5</property>
<property name="left_padding">15</property>
<child>
- <widget class="GtkVBox" id="vbox6">
+ <widget class="GtkVBox" id="vbox26">
<property name="visible">True</property>
- <property name="spacing">2</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">10</property>
<child>
- <widget class="GtkTable" id="table2">
+ <widget class="GtkTable" id="table4">
<property name="visible">True</property>
<property name="n_rows">2</property>
<property name="n_columns">2</property>
+ <property name="column_spacing">10</property>
+ <property name="row_spacing">10</property>
<child>
- <widget class="GtkHBox" id="hbox12">
+ <widget class="GtkHBox" id="hbox18">
<property name="visible">True</property>
<child>
<widget class="GtkComboBox" id="on-battery-lid">
<property name="visible">True</property>
- <property name="items" translatable="yes"></property>
+ <property name="items" translatable="yes">Nothing</property>
</widget>
<packing>
<property name="expand">False</property>
@@ -478,12 +505,12 @@
</packing>
</child>
<child>
- <widget class="GtkHBox" id="hbox11">
+ <widget class="GtkHBox" id="hbox19">
<property name="visible">True</property>
<child>
<widget class="GtkComboBox" id="battery-critical-combox">
<property name="visible">True</property>
- <property name="items" translatable="yes"></property>
+ <property name="items" translatable="yes">Nothing</property>
</widget>
<packing>
<property name="expand">False</property>
@@ -497,10 +524,10 @@
</packing>
</child>
<child>
- <widget class="GtkHBox" id="hbox5">
+ <widget class="GtkHBox" id="hbox20">
<property name="visible">True</property>
<child>
- <widget class="GtkLabel" id="label13">
+ <widget class="GtkLabel" id="label33">
<property name="visible">True</property>
<property name="label" translatable="yes">When laptop lid is closed:</property>
</widget>
@@ -516,10 +543,10 @@
</packing>
</child>
<child>
- <widget class="GtkHBox" id="hbox2">
+ <widget class="GtkHBox" id="hbox21">
<property name="visible">True</property>
<child>
- <widget class="GtkLabel" id="label1">
+ <widget class="GtkLabel" id="label34">
<property name="visible">True</property>
<property name="label" translatable="yes">When battery power is critical:</property>
</widget>
@@ -545,6 +572,7 @@
<property name="draw_indicator">True</property>
</widget>
<packing>
+ <property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
@@ -553,7 +581,7 @@
</widget>
</child>
<child>
- <widget class="GtkLabel" id="label6">
+ <widget class="GtkLabel" id="label35">
<property name="visible">True</property>
<property name="label" translatable="yes"><b>Actions</b></property>
<property name="use_markup">True</property>
@@ -574,19 +602,21 @@
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
- <widget class="GtkAlignment" id="alignment2">
+ <widget class="GtkAlignment" id="alignment13">
<property name="visible">True</property>
<property name="top_padding">5</property>
<property name="left_padding">15</property>
<child>
- <widget class="GtkVBox" id="vbox5">
+ <widget class="GtkVBox" id="vbox27">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
<property name="spacing">20</property>
<child>
- <widget class="GtkVBox" id="vbox9">
+ <widget class="GtkVBox" id="vbox28">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
<child>
- <widget class="GtkLabel" id="label17">
+ <widget class="GtkLabel" id="label36">
<property name="visible">True</property>
<property name="label" translatable="yes">Put display to sleep when computer is inactive for:</property>
</widget>
@@ -613,10 +643,11 @@
</packing>
</child>
<child>
- <widget class="GtkVBox" id="vbox10">
+ <widget class="GtkVBox" id="vbox29">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
<child>
- <widget class="GtkLabel" id="label18">
+ <widget class="GtkLabel" id="label37">
<property name="visible">True</property>
<property name="label" translatable="yes">Switch off display when computer is inactive for:</property>
</widget>
@@ -647,7 +678,7 @@
</widget>
</child>
<child>
- <widget class="GtkLabel" id="label19">
+ <widget class="GtkLabel" id="label38">
<property name="visible">True</property>
<property name="label" translatable="yes"><b>Monitor</b></property>
<property name="use_markup">True</property>
@@ -663,20 +694,21 @@
</packing>
</child>
<child>
- <widget class="GtkFrame" id="frame3">
+ <widget class="GtkFrame" id="frame10">
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
- <widget class="GtkAlignment" id="alignment4">
+ <widget class="GtkAlignment" id="alignment14">
<property name="visible">True</property>
<property name="top_padding">5</property>
<property name="left_padding">15</property>
<child>
- <widget class="GtkVBox" id="vbox7">
+ <widget class="GtkVBox" id="vbox30">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
<child>
- <widget class="GtkLabel" id="label20">
+ <widget class="GtkLabel" id="label39">
<property name="visible">True</property>
<property name="label" translatable="yes">Reduce screen brightness when computer is inactive for:</property>
</widget>
@@ -685,7 +717,7 @@
</packing>
</child>
<child>
- <widget class="GtkHScale" id="hscale1">
+ <widget class="GtkHScale" id="hscale4">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="adjustment">0 0 100 1 10 10</property>
@@ -697,7 +729,7 @@
</packing>
</child>
<child>
- <widget class="GtkHBox" id="hbox3">
+ <widget class="GtkHBox" id="hbox22">
<property name="visible">True</property>
<child>
<placeholder/>
@@ -712,7 +744,7 @@
</packing>
</child>
<child>
- <widget class="GtkHBox" id="hbox6">
+ <widget class="GtkHBox" id="hbox23">
<property name="visible">True</property>
<child>
<placeholder/>
@@ -731,7 +763,7 @@
</widget>
</child>
<child>
- <widget class="GtkLabel" id="label21">
+ <widget class="GtkLabel" id="label40">
<property name="visible">True</property>
<property name="label" translatable="yes"><b>Brightness</b></property>
<property name="use_markup">True</property>
@@ -757,9 +789,9 @@
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label3">
+ <widget class="GtkLabel" id="label22">
<property name="visible">True</property>
- <property name="label" translatable="yes">Running on battery</property>
+ <property name="label" translatable="yes">On battery</property>
</widget>
<packing>
<property name="position">2</property>
@@ -767,8 +799,143 @@
<property name="type">tab</property>
</packing>
</child>
+ <child>
+ <widget class="GtkFrame" id="frame1">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <widget class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="left_padding">12</property>
+ <child>
+ <widget class="GtkVBox" id="vbox2">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">10</property>
+ <child>
+ <widget class="GtkHBox" id="hbox1">
+ <property name="visible">True</property>
+ <property name="spacing">10</property>
+ <child>
+ <widget class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Set monitor sleep mode:</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkVBox" id="vbox3">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <widget class="GtkRadioButton" id="sleep-dpms-mode">
+ <property name="label" translatable="yes">Sleep</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkRadioButton" id="suspend-dpms-mode">
+ <property name="label" translatable="yes">Suspend</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">sleep-dpms-mode</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox2">
+ <property name="visible">True</property>
+ <property name="spacing">10</property>
+ <child>
+ <widget class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Considre the computer on low power when the main power reaches:</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkSpinButton" id="spinbutton1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"><b>Advanced Options</b></property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label23">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Advanced</property>
+ </widget>
+ <packing>
+ <property name="position">3</property>
+ <property name="tab_fill">False</property>
+ <property name="type">tab</property>
+ </packing>
+ </child>
</widget>
<packing>
+ <property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
@@ -784,7 +951,7 @@
</packing>
</child>
<child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area1">
+ <widget class="GtkHButtonBox" id="dialog-action_area">
<property name="visible">True</property>
<property name="layout_style">edge</property>
<child>
Modified: xfce4-power-manager/trunk/src/xfpm-config.h
===================================================================
--- xfce4-power-manager/trunk/src/xfpm-config.h 2009-03-11 09:58:10 UTC (rev 6883)
+++ xfce4-power-manager/trunk/src/xfpm-config.h 2009-03-11 12:06:57 UTC (rev 6884)
@@ -29,34 +29,35 @@
G_BEGIN_DECLS
/* Configuration */
-#define XFPM_CHANNEL_CFG "xfce4-power-manager"
-#define CRITICAL_BATT_ACTION_CFG "/xfce4-power-manager/critical-battery-action" /* default 0 nothing, 1 = shutdown, 2 = hibernate if supported) */
+#define XFPM_CHANNEL_CFG "xfce4-power-manager"
+#define CRITICAL_BATT_ACTION_CFG "/xfce4-power-manager/critical-battery-action"
-#define POWER_SAVE_ON_BATTERY "/xfce4-power-manager/power-save-on-battery"
+#define POWER_SAVE_ON_BATTERY "/xfce4-power-manager/power-save-on-battery"
-#define LCD_BRIGHTNESS_CFG "/xfce4-power-manager/lcd-brightness"
-#define LID_SWITCH_ON_AC_CFG "/xfce4-power-manager/lid-action-on-ac"
-#define LID_SWITCH_ON_BATTERY_CFG "/xfce4-power-manager/lid-action-on-battery"
-#define SLEEP_SWITCH_CFG "/xfce4-power-manager/sleep-switch-action"
-#define POWER_SWITCH_CFG "/xfce4-power-manager/power-switch-action"
+#define LCD_BRIGHTNESS_CFG "/xfce4-power-manager/lcd-brightness"
+#define LID_SWITCH_ON_AC_CFG "/xfce4-power-manager/lid-action-on-ac"
+#define LID_SWITCH_ON_BATTERY_CFG "/xfce4-power-manager/lid-action-on-battery"
+#define SLEEP_SWITCH_CFG "/xfce4-power-manager/sleep-switch-action"
+#define POWER_SWITCH_CFG "/xfce4-power-manager/power-switch-action"
-#define GENERAL_NOTIFICATION_CFG "/xfce4-power-manager/general-notification"
+#define GENERAL_NOTIFICATION_CFG "/xfce4-power-manager/general-notification"
#ifdef HAVE_LIBNOTIFY
-#define BATT_STATE_NOTIFICATION_CFG "/xfce4-power-manager/battery-state-notification" /* default TRUE */
+#define BATT_STATE_NOTIFICATION_CFG "/xfce4-power-manager/battery-state-notification" /* default TRUE */
-#define SHOW_SLEEP_ERRORS_CFG "/xfce4-power-manager/show-sleep-errors"
-#define SHOW_POWER_MANAGEMENT_ERROR "/xfce4-power-manager/show-power-management-error"
+#define SHOW_SLEEP_ERRORS_CFG "/xfce4-power-manager/show-sleep-errors"
+#define SHOW_POWER_MANAGEMENT_ERROR "/xfce4-power-manager/show-power-management-error"
#endif
-#define SHOW_TRAY_ICON_CFG "/xfce4-power-manager/show-tray-icon" /* default 0 = always,1 = when charging or discharging, 2 = when battery is present */
+#define SHOW_TRAY_ICON_CFG "/xfce4-power-manager/show-tray-icon" /* default 0 = always,1 = when charging or discharging, 2 = when battery is present */
#ifdef HAVE_DPMS
-#define DPMS_ENABLED_CFG "/xfce4-power-manager/dpms-enabled"
-#define ON_BATT_DPMS_SLEEP "/xfce4-power-manager/on-battery-dpms-sleep"
-#define ON_BATT_DPMS_OFF "/xfce4-power-manager/on-battery-dpms-off"
-#define ON_AC_DPMS_SLEEP "/xfce4-power-manager/on-ac-dpms-sleep"
-#define ON_AC_DPMS_OFF "/xfce4-power-manager/on-ac-dpms-off"
+#define DPMS_ENABLED_CFG "/xfce4-power-manager/dpms-enabled"
+#define ON_BATT_DPMS_SLEEP "/xfce4-power-manager/on-battery-dpms-sleep"
+#define ON_BATT_DPMS_OFF "/xfce4-power-manager/on-battery-dpms-off"
+#define ON_AC_DPMS_SLEEP "/xfce4-power-manager/on-ac-dpms-sleep"
+#define ON_AC_DPMS_OFF "/xfce4-power-manager/on-ac-dpms-off"
+#define DPMS_SLEEP_MODE "/xfce4-power-manager/dpms-sleep-mode" /* 0= sleep, 1=suspend */
#endif
G_END_DECLS
More information about the Goodies-commits
mailing list