summaryrefslogtreecommitdiff
path: root/battstat
diff options
context:
space:
mode:
authorCallum McKenzie <callum@src.gnome.org>2008-03-15 22:45:30 +0000
committerCallum McKenzie <callum@src.gnome.org>2008-03-15 22:45:30 +0000
commitb7468f4b3b918177d493aa6995533015e12fc3e9 (patch)
treec93c2c66dcc5e42bfeafe4652971c13f8fbf9d0a /battstat
parent6cd7322701d5f93f392c68bab8cb500cf2475497 (diff)
Migrate from glade to gtkbuilder (see bug 521082)
svn path=/trunk/; revision=10756
Diffstat (limited to 'battstat')
-rw-r--r--battstat/ChangeLog8
-rw-r--r--battstat/Makefile.am6
-rw-r--r--battstat/battstat_applet.c3
-rw-r--r--battstat/battstat_applet.ui568
-rw-r--r--battstat/properties.c42
5 files changed, 599 insertions, 28 deletions
diff --git a/battstat/ChangeLog b/battstat/ChangeLog
index 7b0cdf7df..a539ab1cf 100644
--- a/battstat/ChangeLog
+++ b/battstat/ChangeLog
@@ -1,3 +1,11 @@
+2008-03-16 Callum McKenzie <callum@spooky-possum.org>
+
+ * battstat_applet.ui
+ * Makefile.am
+ * battstat_applet.c
+ * properties.c: Convert from glade to gtk-builder. Patch from Jaap
+ Haitsma (bug #521082).
+
2008-03-12 Callum McKenzie <callum@spooky-possum.org>
* docs/C/battstat.xml: Use the "well-known" abbreviation HAL as
diff --git a/battstat/Makefile.am b/battstat/Makefile.am
index a3e98d605..aac54cf12 100644
--- a/battstat/Makefile.am
+++ b/battstat/Makefile.am
@@ -1,5 +1,5 @@
-glade_DATA = battstat_applet.glade
+builder_DATA = battstat_applet.ui
ACPIINC= @ACPIINC@
@@ -25,7 +25,6 @@ DIST_SUBDIRS = docs sounds apmlib
INCLUDES = \
$(GNOME_APPLETS_CFLAGS) \
- $(LIBGLADE_CFLAGS) \
$(LIBNOTIFY_CFLAGS) \
$(HAL_CFLAGS) \
$(APMINC) \
@@ -52,7 +51,6 @@ battstat_applet_2_SOURCES = \
battstat_applet_2_LDADD = \
$(GNOME_APPLETS_LIBS) \
- $(LIBGLADE_LIBS) \
$(LIBNOTIFY_LIBS) \
$(HAL_LIBS) \
$(APMLIB)
@@ -81,7 +79,7 @@ uidir = $(datadir)/gnome-2.0/ui
ui_DATA = GNOME_BattstatApplet.xml
EXTRA_DIST = \
- $(glade_DATA) \
+ $(builder_DATA) \
$(ui_DATA) \
GNOME_BattstatApplet.server.in.in \
$(schemas_in_files)
diff --git a/battstat/battstat_applet.c b/battstat/battstat_applet.c
index 942e9d873..fb6d7cdc3 100644
--- a/battstat/battstat_applet.c
+++ b/battstat/battstat_applet.c
@@ -41,8 +41,6 @@
#include <libgnomeui/libgnomeui.h>
-#include <glade/glade.h>
-
#include <panel-applet.h>
#include <panel-applet-gconf.h>
@@ -321,7 +319,6 @@ static_global_initialisation (int no_hal, ProgressData *battstat)
allocate_battery_colours();
initialise_global_pixmaps();
- glade_init();
err = power_management_initialise (no_hal, status_change_callback);
return err;
diff --git a/battstat/battstat_applet.ui b/battstat/battstat_applet.ui
new file mode 100644
index 000000000..ec98dac6d
--- /dev/null
+++ b/battstat/battstat_applet.ui
@@ -0,0 +1,568 @@
+<?xml version="1.0"?>
+<!--*- mode: xml -*-->
+<interface>
+ <object class="GtkAdjustment" id="adjustment1">
+ <property name="upper">25</property>
+ <property name="lower">1</property>
+ <property name="page_increment">5</property>
+ <property name="step_increment">1</property>
+ <property name="page_size">5</property>
+ <property name="value">1</property>
+ </object>
+ <object class="GtkDialog" id="battstat_properties">
+ <property name="border_width">5</property>
+ <property name="title" translatable="yes">Battery Charge Monitor Preferences</property>
+ <property name="type">GTK_WINDOW_TOPLEVEL</property>
+ <property name="window_position">GTK_WIN_POS_NONE</property>
+ <property name="modal">False</property>
+ <property name="resizable">True</property>
+ <property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="focus_on_map">True</property>
+ <property name="has_separator">False</property>
+ <child internal-child="vbox">
+ <object class="GtkVBox" id="dialog_vbox">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">2</property>
+ <child internal-child="action_area">
+ <object class="GtkHButtonBox" id="hbuttonbox1">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <child>
+ <object class="GtkButton" id="button1">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-help</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkButton" id="button2">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-close</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox6">
+ <property name="border_width">5</property>
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">18</property>
+ <child>
+ <object class="GtkVBox" id="vbox17">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label15">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">&lt;b&gt;Appearance&lt;/b&gt;</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox8">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+ <child>
+ <object class="GtkLabel" id="label21">
+ <property name="visible">True</property>
+ <property name="label"> </property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox19">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">12</property>
+ <child>
+ <object class="GtkVBox" id="vbox21">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+ <child>
+ <object class="GtkRadioButton" id="battery_view">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">_Compact view</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">True</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label24">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">&lt;small&gt;(shows single image for status and charge)&lt;/small&gt;</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">24</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="battery_view_2">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">_Expanded view</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">battery_view</property>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label25">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">&lt;small&gt;(two images: one for status, one for charge)&lt;/small&gt;</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">24</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox22">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkCheckButton" id="show_text_remaining">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">_Show time/percentage:</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">True</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox9">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+ <child>
+ <object class="GtkLabel" id="label22">
+ <property name="visible">True</property>
+ <property name="label"> </property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox20">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkRadioButton" id="show_text_radio">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Show _time remaining</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="show_text_radio_2">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Show _percentage remaining</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">show_text_radio</property>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox12">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label18">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">&lt;b&gt;Notifications&lt;/b&gt;</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox5">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+ <child>
+ <object class="GtkLabel" id="label17">
+ <property name="visible">True</property>
+ <property name="label"> </property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox13">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkCheckButton" id="lowbatt_toggle">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property comments="TRANSLATOR: This is the beginning of the sentence 'Warn when battery charge drops to: [XX] percent/minutes remaining'" name="label" translatable="yes">_Warn when battery charge drops to:</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox_ptr">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">5</property>
+ <child>
+ <object class="GtkLabel" id="label23">
+ <property name="visible">True</property>
+ <property name="label"> </property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="spin_ptr">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="climb_rate">1</property>
+ <property name="digits">0</property>
+ <property name="numeric">False</property>
+ <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+ <property name="snap_to_ticks">False</property>
+ <property name="wrap">False</property>
+ <property name="adjustment">adjustment1</property>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="combo_ptr">
+ <property name="visible">True</property>
+ <property name="add_tearoffs">False</property>
+ <property name="focus_on_click">True</property>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="full_toggle">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">_Notify when battery is fully recharged</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="-11">button1</action-widget>
+ <action-widget response="-7">button2</action-widget>
+ </action-widgets>
+ </object>
+</interface>
diff --git a/battstat/properties.c b/battstat/properties.c
index d2c87229e..42304e63d 100644
--- a/battstat/properties.c
+++ b/battstat/properties.c
@@ -42,8 +42,6 @@
#include <gtk/gtk.h>
-#include <glade/glade.h>
-
#include <gconf/gconf-client.h>
#include <libgnome/libgnome.h>
@@ -253,7 +251,7 @@ prop_cb (BonoboUIComponent *uic,
ProgressData *battstat,
const char *verb)
{
- GladeXML *glade_xml;
+ GtkBuilder *builder;
GtkWidget *combo_ptr, *spin_ptr;
GConfClient *client;
GtkListStore *liststore;
@@ -274,10 +272,10 @@ prop_cb (BonoboUIComponent *uic,
return;
}
- glade_xml = glade_xml_new (GNOME_GLADEDIR "/battstat_applet.glade",
- "battstat_properties", NULL);
-
- battstat->prop_win = GTK_DIALOG (glade_xml_get_widget (glade_xml,
+ builder = gtk_builder_new ();
+ gtk_builder_add_from_file (builder, GTK_BUILDERDIR"/battstat_applet.ui", NULL);
+
+ battstat->prop_win = GTK_DIALOG (gtk_builder_get_object (builder,
"battstat_properties"));
gtk_window_set_screen (GTK_WINDOW (battstat->prop_win),
gtk_widget_get_screen (battstat->applet));
@@ -285,7 +283,7 @@ prop_cb (BonoboUIComponent *uic,
g_signal_connect (G_OBJECT (battstat->prop_win), "delete_event",
G_CALLBACK (gtk_true), NULL);
- battstat->lowbatt_toggle = glade_xml_get_widget (glade_xml, "lowbatt_toggle");
+ battstat->lowbatt_toggle = GTK_WIDGET (gtk_builder_get_object (builder, "lowbatt_toggle"));
g_signal_connect (G_OBJECT (battstat->lowbatt_toggle), "toggled",
G_CALLBACK (lowbatt_toggled), battstat);
@@ -295,10 +293,10 @@ prop_cb (BonoboUIComponent *uic,
hard_set_sensitive (battstat->lowbatt_toggle, FALSE);
}
- battstat->hbox_ptr = glade_xml_get_widget (glade_xml, "hbox_ptr");
+ battstat->hbox_ptr = GTK_WIDGET (gtk_builder_get_object (builder, "hbox_ptr"));
hard_set_sensitive (battstat->hbox_ptr, battstat->lowbattnotification);
- combo_ptr = glade_xml_get_widget (glade_xml, "combo_ptr");
+ combo_ptr = GTK_WIDGET (gtk_builder_get_object (builder, "combo_ptr"));
g_signal_connect (G_OBJECT (combo_ptr), "changed",
G_CALLBACK (combo_ptr_cb), battstat);
@@ -326,7 +324,7 @@ prop_cb (BonoboUIComponent *uic,
*/
gtk_list_store_set (liststore, &iter, 0, _("Minutes Remaining"), -1);
- spin_ptr = glade_xml_get_widget (glade_xml, "spin_ptr");
+ spin_ptr = GTK_WIDGET (gtk_builder_get_object (builder, "spin_ptr"));
gtk_spin_button_set_value (GTK_SPIN_BUTTON (spin_ptr),
battstat->red_val);
g_signal_connect (G_OBJECT (spin_ptr), "value-changed",
@@ -337,7 +335,7 @@ prop_cb (BonoboUIComponent *uic,
else
gtk_combo_box_set_active (GTK_COMBO_BOX (combo_ptr), 0);
- battstat->full_toggle = glade_xml_get_widget (glade_xml, "full_toggle");
+ battstat->full_toggle = GTK_WIDGET (gtk_builder_get_object (builder, "full_toggle"));
g_signal_connect (G_OBJECT (battstat->full_toggle), "toggled",
G_CALLBACK (full_toggled), battstat);
@@ -357,8 +355,8 @@ prop_cb (BonoboUIComponent *uic,
TRUE);
}
- battstat->radio_traditional_battery = glade_xml_get_widget (glade_xml,
- "battery_view_2");
+ battstat->radio_traditional_battery = GTK_WIDGET (gtk_builder_get_object (builder,
+ "battery_view_2"));
g_signal_connect (G_OBJECT (battstat->radio_traditional_battery), "toggled",
G_CALLBACK (radio_traditional_toggled), battstat);
@@ -372,8 +370,8 @@ prop_cb (BonoboUIComponent *uic,
TRUE);
}
- battstat->radio_ubuntu_battery = glade_xml_get_widget (glade_xml,
- "battery_view");
+ battstat->radio_ubuntu_battery = GTK_WIDGET (gtk_builder_get_object (builder,
+ "battery_view"));
g_signal_connect (G_OBJECT (battstat->radio_ubuntu_battery), "toggled",
G_CALLBACK (radio_ubuntu_toggled), battstat);
@@ -386,11 +384,13 @@ prop_cb (BonoboUIComponent *uic,
GTK_TOGGLE_BUTTON (battstat->radio_ubuntu_battery), TRUE);
}
- battstat->radio_text_1 = glade_xml_get_widget (glade_xml, "show_text_radio");
- battstat->radio_text_2 = glade_xml_get_widget (glade_xml,
- "show_text_radio_2");
- battstat->check_text = glade_xml_get_widget (glade_xml,
- "show_text_remaining");
+ battstat->radio_text_1 = GTK_WIDGET (gtk_builder_get_object (builder, "show_text_radio"));
+ battstat->radio_text_2 = GTK_WIDGET (gtk_builder_get_object (builder,
+ "show_text_radio_2"));
+ battstat->check_text = GTK_WIDGET (gtk_builder_get_object (builder,
+ "show_text_remaining"));
+
+ g_object_unref (builder);
g_signal_connect (G_OBJECT (battstat->radio_text_1), "toggled",
G_CALLBACK (show_text_toggled), battstat);