[Xfce4-commits] [xfce/xfce4-power-manager] 11/14: Remove backlight tab and fix brightness stuff
noreply at xfce.org
noreply at xfce.org
Sun Jul 27 13:04:13 CEST 2014
This is an automated email from the git hooks/post-receive script.
hjudt pushed a commit to branch master
in repository xfce/xfce4-power-manager.
commit 6deda4beba3fd420f0654ba8fbeb2b312a81414e
Author: Harald Judt <h.judt at gmx.at>
Date: Fri Jul 25 18:05:45 2014 +0200
Remove backlight tab and fix brightness stuff
---
data/interfaces/xfpm-settings.ui | 51 +++++++++++++-------------------------
settings/xfpm-settings.c | 22 ++++++++++------
2 files changed, 32 insertions(+), 41 deletions(-)
diff --git a/data/interfaces/xfpm-settings.ui b/data/interfaces/xfpm-settings.ui
index 665e570..660af9c 100644
--- a/data/interfaces/xfpm-settings.ui
+++ b/data/interfaces/xfpm-settings.ui
@@ -3,12 +3,6 @@
<!-- interface-requires libxfce4ui 4.5 -->
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy toplevel-contextual -->
- <object class="GtkAdjustment" id="adjustment10">
- <property name="lower">1</property>
- <property name="upper">100</property>
- <property name="value">80</property>
- <property name="step_increment">1</property>
- </object>
<object class="GtkAdjustment" id="adjustment2">
<property name="upper">60</property>
<property name="value">17</property>
@@ -66,6 +60,20 @@
<property name="value">10</property>
<property name="step_increment">1</property>
</object>
+ <object class="GtkAdjustment" id="brg-level-on-ac-adjustment">
+ <property name="lower">1</property>
+ <property name="upper">100</property>
+ <property name="value">80</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
+ <object class="GtkAdjustment" id="brg-level-on-battery-adjustment">
+ <property name="lower">1</property>
+ <property name="upper">100</property>
+ <property name="value">20</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
<object class="XfceTitledDialog" id="xfpm-settings-dialog">
<property name="can_focus">False</property>
<property name="title" translatable="yes">Xfce Power Manager</property>
@@ -1203,7 +1211,7 @@
</packing>
</child>
<child>
- <object class="GtkFrame" id="frame3">
+ <object class="GtkFrame" id="frame-brightness">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
@@ -1293,6 +1301,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="update_policy">discontinuous</property>
+ <property name="adjustment">brg-level-on-battery-adjustment</property>
<property name="round_digits">0</property>
<property name="digits">0</property>
<property name="value_pos">bottom</property>
@@ -1335,7 +1344,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="update_policy">discontinuous</property>
- <property name="adjustment">adjustment10</property>
+ <property name="adjustment">brg-level-on-ac-adjustment</property>
<property name="round_digits">0</property>
<property name="digits">0</property>
<property name="value_pos">bottom</property>
@@ -1459,32 +1468,6 @@
<property name="tab_fill">False</property>
</packing>
</child>
- <child>
- <object class="GtkVBox" id="vbox8">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="border_width">12</property>
- <property name="spacing">18</property>
- <child>
- <placeholder/>
- </child>
- </object>
- <packing>
- <property name="position">3</property>
- </packing>
- </child>
- <child type="tab">
- <object class="GtkLabel" id="backlight">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">_Backlight</property>
- <property name="use_underline">True</property>
- </object>
- <packing>
- <property name="position">3</property>
- <property name="tab_fill">False</property>
- </packing>
- </child>
</object>
<packing>
<property name="expand">True</property>
diff --git a/settings/xfpm-settings.c b/settings/xfpm-settings.c
index 1eaa06f..9e98859 100644
--- a/settings/xfpm-settings.c
+++ b/settings/xfpm-settings.c
@@ -932,11 +932,10 @@ xfpm_settings_on_battery (XfconfChannel *channel, gboolean auth_suspend,
/*
* Brightness on battery
*/
- if ( has_lcd_brightness )
- {
brg = GTK_WIDGET (gtk_builder_get_object (xml ,"brg-on-battery"));
brg_level = GTK_WIDGET (gtk_builder_get_object (xml ,"brg-level-on-battery"));
-
+ if ( has_lcd_brightness )
+ {
val = xfconf_channel_get_uint (channel, PROPERTIES_PREFIX BRIGHTNESS_ON_BATTERY, 120);
gtk_range_set_value (GTK_RANGE(brg), val);
@@ -945,7 +944,8 @@ xfpm_settings_on_battery (XfconfChannel *channel, gboolean auth_suspend,
}
else
{
- gtk_widget_hide (gtk_notebook_get_nth_page (GTK_NOTEBOOK (nt), 3));
+ gtk_widget_hide (brg);
+ gtk_widget_hide (brg_level);
}
}
@@ -1111,10 +1111,10 @@ xfpm_settings_on_ac (XfconfChannel *channel, gboolean auth_suspend,
/*
* Brightness on AC power
*/
- if ( has_lcd_brightness )
- {
brg = GTK_WIDGET (gtk_builder_get_object (xml ,"brg-on-ac"));
brg_level = GTK_WIDGET (gtk_builder_get_object (xml ,"brg-level-on-ac"));
+ if ( has_lcd_brightness )
+ {
val = xfconf_channel_get_uint (channel, PROPERTIES_PREFIX BRIGHTNESS_ON_AC, 9);
gtk_range_set_value (GTK_RANGE(brg), val);
@@ -1124,7 +1124,8 @@ xfpm_settings_on_ac (XfconfChannel *channel, gboolean auth_suspend,
}
else
{
- gtk_widget_hide (gtk_notebook_get_nth_page (GTK_NOTEBOOK (nt), 3));
+ gtk_widget_hide (brg);
+ gtk_widget_hide (brg_level);
}
}
@@ -1957,6 +1958,7 @@ xfpm_settings_dialog_new (XfconfChannel *channel, gboolean auth_suspend,
GtkWidget *plugged_box;
GtkWidget *viewport;
GtkWidget *hbox;
+ GtkWidget *frame;
GtkWidget *on_battery_blank, *on_ac_blank;
GtkListStore *list_store;
GtkTreeViewColumn *col;
@@ -2098,6 +2100,12 @@ xfpm_settings_dialog_new (XfconfChannel *channel, gboolean auth_suspend,
xfpm_settings_advanced (channel, auth_suspend, auth_hibernate, can_suspend, can_hibernate, has_battery);
+ if ( !has_lcd_brightness )
+ {
+ frame = GTK_WIDGET (gtk_builder_get_object (xml, "frame-brightness"));
+ gtk_widget_hide (frame);
+ }
+
if ( id != 0 )
{
plugged_box = GTK_WIDGET (gtk_builder_get_object (xml, "plug-child"));
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list