/* configurationGUI.c generated by valac 0.16.0, the Vala compiler
 * generated from configurationGUI.vala, do not modify */

/*

this is a part of vattery
copyright 2011 jezra lickter http://www.jezra.net

vattery is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

vattery is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with vattery.	If not, see <http://www.gnu.org/licenses/>.

*/

#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <glib/gi18n-lib.h>
#include <float.h>
#include <math.h>
#include <gdk/gdk.h>
#include <stdlib.h>
#include <string.h>


#define TYPE_PREFERENCES (preferences_get_type ())
#define PREFERENCES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PREFERENCES, Preferences))
#define PREFERENCES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PREFERENCES, PreferencesClass))
#define IS_PREFERENCES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PREFERENCES))
#define IS_PREFERENCES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PREFERENCES))
#define PREFERENCES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PREFERENCES, PreferencesClass))

typedef struct _Preferences Preferences;
typedef struct _PreferencesClass PreferencesClass;
typedef struct _PreferencesPrivate PreferencesPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#define TYPE_ICON_MENU (icon_menu_get_type ())
#define ICON_MENU(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ICON_MENU, IconMenu))
#define ICON_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ICON_MENU, IconMenuClass))
#define IS_ICON_MENU(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ICON_MENU))
#define IS_ICON_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ICON_MENU))
#define ICON_MENU_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ICON_MENU, IconMenuClass))

typedef struct _IconMenu IconMenu;
typedef struct _IconMenuClass IconMenuClass;
typedef struct _IconMenuPrivate IconMenuPrivate;

struct _Preferences {
	GtkWindow parent_instance;
	PreferencesPrivate * priv;
};

struct _PreferencesClass {
	GtkWindowClass parent_class;
};

struct _PreferencesPrivate {
	GtkColorButton* borderButton;
	GtkColorButton* chargingButton;
	GtkColorButton* chargedButton;
	GtkColorButton* drainingButton;
	GtkColorButton* backgroundButton;
	GtkSpinButton* warningPercent;
	GtkSpinButton* criticalPercent;
	GtkEntry* warningCommand;
	GtkEntry* criticalCommand;
	GtkCheckButton* text_modeButton;
};

struct _IconMenu {
	GtkMenu parent_instance;
	IconMenuPrivate * priv;
};

struct _IconMenuClass {
	GtkMenuClass parent_class;
};


static gpointer preferences_parent_class = NULL;
static gpointer icon_menu_parent_class = NULL;

GType preferences_get_type (void) G_GNUC_CONST;
#define PREFERENCES_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_PREFERENCES, PreferencesPrivate))
enum  {
	PREFERENCES_DUMMY_PROPERTY
};
Preferences* preferences_new (void);
Preferences* preferences_construct (GType object_type);
void preferences_update_app (Preferences* self);
static void _preferences_update_app_gtk_button_clicked (GtkButton* _sender, gpointer self);
void preferences_do_destroy (Preferences* self);
static void _preferences_do_destroy_gtk_button_clicked (GtkButton* _sender, gpointer self);
void preferences_destruct (Preferences* self);
static void _preferences_destruct_gtk_object_destroy (GtkObject* _sender, gpointer self);
void preferences_set_colors (Preferences* self, const gchar* charging, const gchar* charged, const gchar* draining, const gchar* border, const gchar* background);
void preferences_set_warnings (Preferences* self, const gchar* wp, const gchar* wc, const gchar* cp, const gchar* cc);
void preferences_set_text_mode (Preferences* self, gboolean mode);
void preferences_display (Preferences* self);
static void g_cclosure_user_marshal_VOID__BOXED_BOXED_BOXED_BOXED_BOXED_STRING_STRING_STRING_STRING_BOOLEAN (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);
static GObject * preferences_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
static void preferences_finalize (GObject* obj);
GType icon_menu_get_type (void) G_GNUC_CONST;
enum  {
	ICON_MENU_DUMMY_PROPERTY
};
IconMenu* icon_menu_new (void);
IconMenu* icon_menu_construct (GType object_type);
static void __lambda2_ (IconMenu* self, GtkMenuItem* source);
static void ___lambda2__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
static void __lambda3_ (IconMenu* self, GtkMenuItem* source);
static void ___lambda3__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);


static void _preferences_update_app_gtk_button_clicked (GtkButton* _sender, gpointer self) {
	preferences_update_app (self);
}


static void _preferences_do_destroy_gtk_button_clicked (GtkButton* _sender, gpointer self) {
	preferences_do_destroy (self);
}


static void _preferences_destruct_gtk_object_destroy (GtkObject* _sender, gpointer self) {
	preferences_destruct (self);
}


Preferences* preferences_construct (GType object_type) {
	Preferences * self = NULL;
	gint table_l;
	gint table_t;
	gint table_r;
	gint table_b;
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	GtkCheckButton* _tmp2_;
	GtkCheckButton* _tmp3_;
	GtkVBox* _tmp4_;
	GtkVBox* _tmp5_;
	GtkVBox* topVbox;
	GtkCheckButton* _tmp6_;
	GtkTable* _tmp7_;
	GtkTable* _tmp8_;
	GtkTable* table;
	GtkTable* _tmp9_;
	GtkTable* _tmp10_;
	GtkTable* _tmp11_;
	const gchar* _tmp12_ = NULL;
	GtkFrame* _tmp13_;
	GtkFrame* _tmp14_;
	GtkFrame* colorsFrame;
	GtkTable* _tmp15_;
	GtkColorButton* _tmp16_;
	GtkColorButton* _tmp17_;
	GtkColorButton* _tmp18_;
	GtkColorButton* _tmp19_;
	GtkColorButton* _tmp20_;
	GtkColorButton* _tmp21_;
	GtkColorButton* _tmp22_;
	GtkColorButton* _tmp23_;
	GtkColorButton* _tmp24_;
	GtkColorButton* _tmp25_;
	GtkAlignment* align = NULL;
	const gchar* _tmp26_ = NULL;
	GtkLabel* _tmp27_;
	GtkLabel* _tmp28_;
	GtkLabel* chargingLabel;
	GtkTable* _tmp29_;
	gint _tmp30_;
	gint _tmp31_;
	GtkAlignment* _tmp32_;
	GtkAlignment* _tmp33_;
	GtkAlignment* _tmp34_;
	GtkColorButton* _tmp35_;
	GtkTable* _tmp36_;
	GtkAlignment* _tmp37_;
	gint _tmp38_;
	gint _tmp39_;
	gint _tmp40_;
	gint _tmp41_;
	const gchar* _tmp42_ = NULL;
	GtkLabel* _tmp43_;
	GtkLabel* _tmp44_;
	GtkLabel* chargedLabel;
	GtkTable* _tmp45_;
	gint _tmp46_;
	gint _tmp47_;
	GtkAlignment* _tmp48_;
	GtkAlignment* _tmp49_;
	GtkAlignment* _tmp50_;
	GtkColorButton* _tmp51_;
	GtkTable* _tmp52_;
	GtkAlignment* _tmp53_;
	gint _tmp54_;
	gint _tmp55_;
	gint _tmp56_;
	gint _tmp57_;
	const gchar* _tmp58_ = NULL;
	GtkLabel* _tmp59_;
	GtkLabel* _tmp60_;
	GtkLabel* drainingLabel;
	GtkTable* _tmp61_;
	gint _tmp62_;
	gint _tmp63_;
	GtkAlignment* _tmp64_;
	GtkAlignment* _tmp65_;
	GtkAlignment* _tmp66_;
	GtkColorButton* _tmp67_;
	GtkTable* _tmp68_;
	GtkAlignment* _tmp69_;
	gint _tmp70_;
	gint _tmp71_;
	gint _tmp72_;
	gint _tmp73_;
	const gchar* _tmp74_ = NULL;
	GtkLabel* _tmp75_;
	GtkLabel* _tmp76_;
	GtkLabel* borderLabel;
	GtkTable* _tmp77_;
	gint _tmp78_;
	gint _tmp79_;
	GtkAlignment* _tmp80_;
	GtkAlignment* _tmp81_;
	GtkAlignment* _tmp82_;
	GtkColorButton* _tmp83_;
	GtkTable* _tmp84_;
	GtkAlignment* _tmp85_;
	gint _tmp86_;
	gint _tmp87_;
	gint _tmp88_;
	gint _tmp89_;
	const gchar* _tmp90_ = NULL;
	GtkLabel* _tmp91_;
	GtkLabel* _tmp92_;
	GtkLabel* backgroundLabel;
	GtkTable* _tmp93_;
	gint _tmp94_;
	gint _tmp95_;
	GtkAlignment* _tmp96_;
	GtkAlignment* _tmp97_;
	GtkAlignment* _tmp98_;
	GtkColorButton* _tmp99_;
	GtkTable* _tmp100_;
	GtkAlignment* _tmp101_;
	gint _tmp102_;
	gint _tmp103_;
	const gchar* _tmp104_ = NULL;
	GtkFrame* _tmp105_;
	GtkFrame* _tmp106_;
	GtkFrame* warningFrame;
	GtkTable* _tmp107_;
	GtkTable* _tmp108_;
	GtkTable* _tmp109_;
	GtkTable* _tmp110_;
	GtkTable* _tmp111_;
	GtkTable* _tmp112_;
	const gchar* _tmp113_ = NULL;
	GtkLabel* _tmp114_;
	GtkLabel* _tmp115_;
	GtkLabel* percentLabel;
	GtkLabel* _tmp116_;
	GtkTable* _tmp117_;
	GtkLabel* _tmp118_;
	GtkSpinButton* _tmp119_;
	GtkSpinButton* _tmp120_;
	GtkAlignment* _tmp121_;
	GtkAlignment* _tmp122_;
	GtkAlignment* _tmp123_;
	GtkSpinButton* _tmp124_;
	GtkTable* _tmp125_;
	GtkAlignment* _tmp126_;
	const gchar* _tmp127_ = NULL;
	GtkLabel* _tmp128_;
	GtkLabel* _tmp129_;
	GtkLabel* commandLabel;
	GtkLabel* _tmp130_;
	GtkTable* _tmp131_;
	GtkLabel* _tmp132_;
	GtkEntry* _tmp133_;
	GtkEntry* _tmp134_;
	GtkTable* _tmp135_;
	GtkEntry* _tmp136_;
	const gchar* _tmp137_ = NULL;
	GtkFrame* _tmp138_;
	GtkFrame* _tmp139_;
	GtkFrame* criticalFrame;
	GtkTable* _tmp140_;
	GtkTable* _tmp141_;
	GtkTable* _tmp142_;
	GtkTable* _tmp143_;
	GtkTable* _tmp144_;
	GtkTable* _tmp145_;
	const gchar* _tmp146_ = NULL;
	GtkLabel* _tmp147_;
	GtkLabel* _tmp148_;
	GtkLabel* _tmp149_;
	GtkTable* _tmp150_;
	GtkLabel* _tmp151_;
	GtkSpinButton* _tmp152_;
	GtkSpinButton* _tmp153_;
	GtkAlignment* _tmp154_;
	GtkAlignment* _tmp155_;
	GtkAlignment* _tmp156_;
	GtkSpinButton* _tmp157_;
	GtkTable* _tmp158_;
	GtkAlignment* _tmp159_;
	const gchar* _tmp160_ = NULL;
	GtkLabel* _tmp161_;
	GtkLabel* _tmp162_;
	GtkLabel* _tmp163_;
	GtkTable* _tmp164_;
	GtkLabel* _tmp165_;
	GtkEntry* _tmp166_;
	GtkEntry* _tmp167_;
	GtkTable* _tmp168_;
	GtkEntry* _tmp169_;
	GtkHButtonBox* _tmp170_;
	GtkHButtonBox* _tmp171_;
	GtkHButtonBox* bbox;
	GtkButton* _tmp172_;
	GtkButton* _tmp173_;
	GtkButton* OKButton;
	GtkButton* _tmp174_;
	GtkButton* _tmp175_;
	GtkButton* cancelButton;
	self = (Preferences*) g_object_new (object_type, NULL);
	table_l = 0;
	table_t = 0;
	table_r = 1;
	table_b = 1;
	gtk_window_set_modal ((GtkWindow*) self, TRUE);
	gtk_window_set_resizable ((GtkWindow*) self, FALSE);
	_tmp0_ = _ ("Preferences");
	gtk_window_set_title ((GtkWindow*) self, _tmp0_);
	gtk_window_set_deletable ((GtkWindow*) self, FALSE);
	_tmp1_ = _ ("Text Mode");
	_tmp2_ = (GtkCheckButton*) gtk_check_button_new_with_label (_tmp1_);
	_tmp3_ = g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->priv->text_modeButton);
	self->priv->text_modeButton = _tmp3_;
	_tmp4_ = (GtkVBox*) gtk_vbox_new (FALSE, 5);
	_tmp5_ = g_object_ref_sink (_tmp4_);
	topVbox = _tmp5_;
	_tmp6_ = self->priv->text_modeButton;
	gtk_container_add ((GtkContainer*) topVbox, (GtkWidget*) _tmp6_);
	gtk_container_set_border_width ((GtkContainer*) topVbox, (guint) 3);
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) topVbox);
	_tmp7_ = (GtkTable*) gtk_table_new ((guint) 4, (guint) 2, FALSE);
	_tmp8_ = g_object_ref_sink (_tmp7_);
	table = _tmp8_;
	_tmp9_ = table;
	gtk_container_set_border_width ((GtkContainer*) _tmp9_, (guint) 3);
	_tmp10_ = table;
	gtk_table_set_col_spacings (_tmp10_, (guint) 3);
	_tmp11_ = table;
	gtk_table_set_row_spacings (_tmp11_, (guint) 3);
	_tmp12_ = _ ("Colors");
	_tmp13_ = (GtkFrame*) gtk_frame_new (_tmp12_);
	_tmp14_ = g_object_ref_sink (_tmp13_);
	colorsFrame = _tmp14_;
	_tmp15_ = table;
	gtk_container_add ((GtkContainer*) colorsFrame, (GtkWidget*) _tmp15_);
	_tmp16_ = (GtkColorButton*) gtk_color_button_new ();
	_tmp17_ = g_object_ref_sink (_tmp16_);
	_g_object_unref0 (self->priv->borderButton);
	self->priv->borderButton = _tmp17_;
	_tmp18_ = (GtkColorButton*) gtk_color_button_new ();
	_tmp19_ = g_object_ref_sink (_tmp18_);
	_g_object_unref0 (self->priv->chargingButton);
	self->priv->chargingButton = _tmp19_;
	_tmp20_ = (GtkColorButton*) gtk_color_button_new ();
	_tmp21_ = g_object_ref_sink (_tmp20_);
	_g_object_unref0 (self->priv->chargedButton);
	self->priv->chargedButton = _tmp21_;
	_tmp22_ = (GtkColorButton*) gtk_color_button_new ();
	_tmp23_ = g_object_ref_sink (_tmp22_);
	_g_object_unref0 (self->priv->drainingButton);
	self->priv->drainingButton = _tmp23_;
	_tmp24_ = (GtkColorButton*) gtk_color_button_new ();
	_tmp25_ = g_object_ref_sink (_tmp24_);
	_g_object_unref0 (self->priv->backgroundButton);
	self->priv->backgroundButton = _tmp25_;
	_tmp26_ = _ ("Charging:");
	_tmp27_ = (GtkLabel*) gtk_label_new (_tmp26_);
	_tmp28_ = g_object_ref_sink (_tmp27_);
	chargingLabel = _tmp28_;
	gtk_misc_set_alignment ((GtkMisc*) chargingLabel, (gfloat) 0, (gfloat) 0.5);
	_tmp29_ = table;
	_tmp30_ = table_t;
	_tmp31_ = table_b;
	gtk_table_attach (_tmp29_, (GtkWidget*) chargingLabel, (guint) table_l, (guint) table_r, (guint) _tmp30_, (guint) _tmp31_, GTK_FILL, GTK_FILL, (guint) 0, (guint) 0);
	_tmp32_ = (GtkAlignment*) gtk_alignment_new ((gfloat) 0, (gfloat) 0, (gfloat) 0, (gfloat) 0);
	_tmp33_ = g_object_ref_sink (_tmp32_);
	_g_object_unref0 (align);
	align = _tmp33_;
	_tmp34_ = align;
	_tmp35_ = self->priv->chargingButton;
	gtk_container_add ((GtkContainer*) _tmp34_, (GtkWidget*) _tmp35_);
	_tmp36_ = table;
	_tmp37_ = align;
	_tmp38_ = table_t;
	_tmp39_ = table_b;
	gtk_table_attach (_tmp36_, (GtkWidget*) _tmp37_, (guint) (table_l + 1), (guint) (table_r + 1), (guint) _tmp38_, (guint) _tmp39_, GTK_FILL, GTK_FILL, (guint) 0, (guint) 0);
	_tmp40_ = table_t;
	table_t = _tmp40_ + 1;
	_tmp41_ = table_b;
	table_b = _tmp41_ + 1;
	_tmp42_ = _ ("Charged:");
	_tmp43_ = (GtkLabel*) gtk_label_new (_tmp42_);
	_tmp44_ = g_object_ref_sink (_tmp43_);
	chargedLabel = _tmp44_;
	gtk_misc_set_alignment ((GtkMisc*) chargedLabel, (gfloat) 0, (gfloat) 0.5);
	_tmp45_ = table;
	_tmp46_ = table_t;
	_tmp47_ = table_b;
	gtk_table_attach (_tmp45_, (GtkWidget*) chargedLabel, (guint) table_l, (guint) table_r, (guint) _tmp46_, (guint) _tmp47_, GTK_FILL, GTK_FILL, (guint) 0, (guint) 0);
	_tmp48_ = (GtkAlignment*) gtk_alignment_new ((gfloat) 0, (gfloat) 0, (gfloat) 0, (gfloat) 0);
	_tmp49_ = g_object_ref_sink (_tmp48_);
	_g_object_unref0 (align);
	align = _tmp49_;
	_tmp50_ = align;
	_tmp51_ = self->priv->chargedButton;
	gtk_container_add ((GtkContainer*) _tmp50_, (GtkWidget*) _tmp51_);
	_tmp52_ = table;
	_tmp53_ = align;
	_tmp54_ = table_t;
	_tmp55_ = table_b;
	gtk_table_attach (_tmp52_, (GtkWidget*) _tmp53_, (guint) (table_l + 1), (guint) (table_r + 1), (guint) _tmp54_, (guint) _tmp55_, GTK_FILL, GTK_FILL, (guint) 0, (guint) 0);
	_tmp56_ = table_t;
	table_t = _tmp56_ + 1;
	_tmp57_ = table_b;
	table_b = _tmp57_ + 1;
	_tmp58_ = _ ("Draining:");
	_tmp59_ = (GtkLabel*) gtk_label_new (_tmp58_);
	_tmp60_ = g_object_ref_sink (_tmp59_);
	drainingLabel = _tmp60_;
	gtk_misc_set_alignment ((GtkMisc*) drainingLabel, (gfloat) 0, (gfloat) 0.5);
	_tmp61_ = table;
	_tmp62_ = table_t;
	_tmp63_ = table_b;
	gtk_table_attach (_tmp61_, (GtkWidget*) drainingLabel, (guint) table_l, (guint) table_r, (guint) _tmp62_, (guint) _tmp63_, GTK_FILL, GTK_FILL, (guint) 0, (guint) 0);
	_tmp64_ = (GtkAlignment*) gtk_alignment_new ((gfloat) 0, (gfloat) 0, (gfloat) 0, (gfloat) 0);
	_tmp65_ = g_object_ref_sink (_tmp64_);
	_g_object_unref0 (align);
	align = _tmp65_;
	_tmp66_ = align;
	_tmp67_ = self->priv->drainingButton;
	gtk_container_add ((GtkContainer*) _tmp66_, (GtkWidget*) _tmp67_);
	_tmp68_ = table;
	_tmp69_ = align;
	_tmp70_ = table_t;
	_tmp71_ = table_b;
	gtk_table_attach (_tmp68_, (GtkWidget*) _tmp69_, (guint) (table_l + 1), (guint) (table_r + 1), (guint) _tmp70_, (guint) _tmp71_, GTK_FILL, GTK_FILL, (guint) 0, (guint) 0);
	_tmp72_ = table_t;
	table_t = _tmp72_ + 1;
	_tmp73_ = table_b;
	table_b = _tmp73_ + 1;
	_tmp74_ = _ ("Border:");
	_tmp75_ = (GtkLabel*) gtk_label_new (_tmp74_);
	_tmp76_ = g_object_ref_sink (_tmp75_);
	borderLabel = _tmp76_;
	gtk_misc_set_alignment ((GtkMisc*) borderLabel, (gfloat) 0, (gfloat) 0.5);
	_tmp77_ = table;
	_tmp78_ = table_t;
	_tmp79_ = table_b;
	gtk_table_attach (_tmp77_, (GtkWidget*) borderLabel, (guint) table_l, (guint) table_r, (guint) _tmp78_, (guint) _tmp79_, GTK_FILL, GTK_FILL, (guint) 0, (guint) 0);
	_tmp80_ = (GtkAlignment*) gtk_alignment_new ((gfloat) 0, (gfloat) 0, (gfloat) 0, (gfloat) 0);
	_tmp81_ = g_object_ref_sink (_tmp80_);
	_g_object_unref0 (align);
	align = _tmp81_;
	_tmp82_ = align;
	_tmp83_ = self->priv->borderButton;
	gtk_container_add ((GtkContainer*) _tmp82_, (GtkWidget*) _tmp83_);
	_tmp84_ = table;
	_tmp85_ = align;
	_tmp86_ = table_t;
	_tmp87_ = table_b;
	gtk_table_attach (_tmp84_, (GtkWidget*) _tmp85_, (guint) (table_l + 1), (guint) (table_r + 1), (guint) _tmp86_, (guint) _tmp87_, GTK_FILL, GTK_FILL, (guint) 0, (guint) 0);
	_tmp88_ = table_t;
	table_t = _tmp88_ + 1;
	_tmp89_ = table_b;
	table_b = _tmp89_ + 1;
	_tmp90_ = _ ("Background:");
	_tmp91_ = (GtkLabel*) gtk_label_new (_tmp90_);
	_tmp92_ = g_object_ref_sink (_tmp91_);
	backgroundLabel = _tmp92_;
	gtk_misc_set_alignment ((GtkMisc*) backgroundLabel, (gfloat) 0, (gfloat) 0.5);
	_tmp93_ = table;
	_tmp94_ = table_t;
	_tmp95_ = table_b;
	gtk_table_attach (_tmp93_, (GtkWidget*) backgroundLabel, (guint) table_l, (guint) table_r, (guint) _tmp94_, (guint) _tmp95_, GTK_FILL, GTK_FILL, (guint) 0, (guint) 0);
	_tmp96_ = (GtkAlignment*) gtk_alignment_new ((gfloat) 0, (gfloat) 0, (gfloat) 0, (gfloat) 0);
	_tmp97_ = g_object_ref_sink (_tmp96_);
	_g_object_unref0 (align);
	align = _tmp97_;
	_tmp98_ = align;
	_tmp99_ = self->priv->backgroundButton;
	gtk_container_add ((GtkContainer*) _tmp98_, (GtkWidget*) _tmp99_);
	_tmp100_ = table;
	_tmp101_ = align;
	_tmp102_ = table_t;
	_tmp103_ = table_b;
	gtk_table_attach (_tmp100_, (GtkWidget*) _tmp101_, (guint) (table_l + 1), (guint) (table_r + 1), (guint) _tmp102_, (guint) _tmp103_, GTK_FILL, GTK_FILL, (guint) 0, (guint) 0);
	gtk_container_add ((GtkContainer*) topVbox, (GtkWidget*) colorsFrame);
	_tmp104_ = _ ("Warning");
	_tmp105_ = (GtkFrame*) gtk_frame_new (_tmp104_);
	_tmp106_ = g_object_ref_sink (_tmp105_);
	warningFrame = _tmp106_;
	gtk_container_add ((GtkContainer*) topVbox, (GtkWidget*) warningFrame);
	_tmp107_ = (GtkTable*) gtk_table_new ((guint) 2, (guint) 2, FALSE);
	_tmp108_ = g_object_ref_sink (_tmp107_);
	_g_object_unref0 (table);
	table = _tmp108_;
	_tmp109_ = table;
	gtk_container_set_border_width ((GtkContainer*) _tmp109_, (guint) 3);
	_tmp110_ = table;
	gtk_table_set_col_spacings (_tmp110_, (guint) 3);
	_tmp111_ = table;
	gtk_table_set_row_spacings (_tmp111_, (guint) 3);
	_tmp112_ = table;
	gtk_container_add ((GtkContainer*) warningFrame, (GtkWidget*) _tmp112_);
	_tmp113_ = _ ("Percent:");
	_tmp114_ = (GtkLabel*) gtk_label_new (_tmp113_);
	_tmp115_ = g_object_ref_sink (_tmp114_);
	percentLabel = _tmp115_;
	_tmp116_ = percentLabel;
	gtk_misc_set_alignment ((GtkMisc*) _tmp116_, (gfloat) 0, (gfloat) 0.5);
	_tmp117_ = table;
	_tmp118_ = percentLabel;
	gtk_table_attach (_tmp117_, (GtkWidget*) _tmp118_, (guint) 0, (guint) 1, (guint) 0, (guint) 1, GTK_FILL, GTK_FILL, (guint) 0, (guint) 0);
	_tmp119_ = (GtkSpinButton*) gtk_spin_button_new_with_range ((gdouble) 0, (gdouble) 100, (gdouble) 1);
	_tmp120_ = g_object_ref_sink (_tmp119_);
	_g_object_unref0 (self->priv->warningPercent);
	self->priv->warningPercent = _tmp120_;
	_tmp121_ = (GtkAlignment*) gtk_alignment_new ((gfloat) 0, (gfloat) 0, (gfloat) 0, (gfloat) 0);
	_tmp122_ = g_object_ref_sink (_tmp121_);
	_g_object_unref0 (align);
	align = _tmp122_;
	_tmp123_ = align;
	_tmp124_ = self->priv->warningPercent;
	gtk_container_add ((GtkContainer*) _tmp123_, (GtkWidget*) _tmp124_);
	_tmp125_ = table;
	_tmp126_ = align;
	gtk_table_attach (_tmp125_, (GtkWidget*) _tmp126_, (guint) 1, (guint) 2, (guint) 0, (guint) 1, GTK_FILL, GTK_FILL, (guint) 0, (guint) 0);
	_tmp127_ = _ ("Command:");
	_tmp128_ = (GtkLabel*) gtk_label_new (_tmp127_);
	_tmp129_ = g_object_ref_sink (_tmp128_);
	commandLabel = _tmp129_;
	_tmp130_ = commandLabel;
	gtk_misc_set_alignment ((GtkMisc*) _tmp130_, (gfloat) 0, (gfloat) 0);
	_tmp131_ = table;
	_tmp132_ = commandLabel;
	gtk_table_attach (_tmp131_, (GtkWidget*) _tmp132_, (guint) 0, (guint) 1, (guint) 1, (guint) 2, GTK_EXPAND, GTK_EXPAND, (guint) 0, (guint) 0);
	_tmp133_ = (GtkEntry*) gtk_entry_new ();
	_tmp134_ = g_object_ref_sink (_tmp133_);
	_g_object_unref0 (self->priv->warningCommand);
	self->priv->warningCommand = _tmp134_;
	_tmp135_ = table;
	_tmp136_ = self->priv->warningCommand;
	gtk_table_attach (_tmp135_, (GtkWidget*) _tmp136_, (guint) 1, (guint) 2, (guint) 1, (guint) 2, GTK_FILL, GTK_FILL, (guint) 0, (guint) 0);
	_tmp137_ = _ ("Critical");
	_tmp138_ = (GtkFrame*) gtk_frame_new (_tmp137_);
	_tmp139_ = g_object_ref_sink (_tmp138_);
	criticalFrame = _tmp139_;
	gtk_container_add ((GtkContainer*) topVbox, (GtkWidget*) criticalFrame);
	_tmp140_ = (GtkTable*) gtk_table_new ((guint) 2, (guint) 2, FALSE);
	_tmp141_ = g_object_ref_sink (_tmp140_);
	_g_object_unref0 (table);
	table = _tmp141_;
	_tmp142_ = table;
	gtk_container_set_border_width ((GtkContainer*) _tmp142_, (guint) 3);
	_tmp143_ = table;
	gtk_table_set_col_spacings (_tmp143_, (guint) 3);
	_tmp144_ = table;
	gtk_table_set_row_spacings (_tmp144_, (guint) 3);
	_tmp145_ = table;
	gtk_container_add ((GtkContainer*) criticalFrame, (GtkWidget*) _tmp145_);
	_tmp146_ = _ ("Percent:");
	_tmp147_ = (GtkLabel*) gtk_label_new (_tmp146_);
	_tmp148_ = g_object_ref_sink (_tmp147_);
	_g_object_unref0 (percentLabel);
	percentLabel = _tmp148_;
	_tmp149_ = percentLabel;
	gtk_misc_set_alignment ((GtkMisc*) _tmp149_, (gfloat) 0, (gfloat) 0.5);
	_tmp150_ = table;
	_tmp151_ = percentLabel;
	gtk_table_attach (_tmp150_, (GtkWidget*) _tmp151_, (guint) 0, (guint) 1, (guint) 0, (guint) 1, GTK_FILL, GTK_FILL, (guint) 0, (guint) 0);
	_tmp152_ = (GtkSpinButton*) gtk_spin_button_new_with_range ((gdouble) 0, (gdouble) 100, (gdouble) 1);
	_tmp153_ = g_object_ref_sink (_tmp152_);
	_g_object_unref0 (self->priv->criticalPercent);
	self->priv->criticalPercent = _tmp153_;
	_tmp154_ = (GtkAlignment*) gtk_alignment_new ((gfloat) 0, (gfloat) 0, (gfloat) 0, (gfloat) 0);
	_tmp155_ = g_object_ref_sink (_tmp154_);
	_g_object_unref0 (align);
	align = _tmp155_;
	_tmp156_ = align;
	_tmp157_ = self->priv->criticalPercent;
	gtk_container_add ((GtkContainer*) _tmp156_, (GtkWidget*) _tmp157_);
	_tmp158_ = table;
	_tmp159_ = align;
	gtk_table_attach (_tmp158_, (GtkWidget*) _tmp159_, (guint) 1, (guint) 2, (guint) 0, (guint) 1, GTK_FILL, GTK_FILL, (guint) 0, (guint) 0);
	_tmp160_ = _ ("Command:");
	_tmp161_ = (GtkLabel*) gtk_label_new (_tmp160_);
	_tmp162_ = g_object_ref_sink (_tmp161_);
	_g_object_unref0 (commandLabel);
	commandLabel = _tmp162_;
	_tmp163_ = commandLabel;
	gtk_misc_set_alignment ((GtkMisc*) _tmp163_, (gfloat) 0, (gfloat) 0);
	_tmp164_ = table;
	_tmp165_ = commandLabel;
	gtk_table_attach (_tmp164_, (GtkWidget*) _tmp165_, (guint) 0, (guint) 1, (guint) 1, (guint) 2, GTK_EXPAND, GTK_EXPAND, (guint) 0, (guint) 0);
	_tmp166_ = (GtkEntry*) gtk_entry_new ();
	_tmp167_ = g_object_ref_sink (_tmp166_);
	_g_object_unref0 (self->priv->criticalCommand);
	self->priv->criticalCommand = _tmp167_;
	_tmp168_ = table;
	_tmp169_ = self->priv->criticalCommand;
	gtk_table_attach (_tmp168_, (GtkWidget*) _tmp169_, (guint) 1, (guint) 2, (guint) 1, (guint) 2, GTK_FILL, GTK_FILL, (guint) 0, (guint) 0);
	_tmp170_ = (GtkHButtonBox*) gtk_hbutton_box_new ();
	_tmp171_ = g_object_ref_sink (_tmp170_);
	bbox = _tmp171_;
	gtk_button_box_set_layout ((GtkButtonBox*) bbox, GTK_BUTTONBOX_END);
	gtk_container_add ((GtkContainer*) topVbox, (GtkWidget*) bbox);
	_tmp172_ = (GtkButton*) gtk_button_new_from_stock (GTK_STOCK_OK);
	_tmp173_ = g_object_ref_sink (_tmp172_);
	OKButton = _tmp173_;
	g_signal_connect_object (OKButton, "clicked", (GCallback) _preferences_update_app_gtk_button_clicked, self, 0);
	gtk_container_add ((GtkContainer*) bbox, (GtkWidget*) OKButton);
	_tmp174_ = (GtkButton*) gtk_button_new_from_stock (GTK_STOCK_CANCEL);
	_tmp175_ = g_object_ref_sink (_tmp174_);
	cancelButton = _tmp175_;
	g_signal_connect_object (cancelButton, "clicked", (GCallback) _preferences_do_destroy_gtk_button_clicked, self, 0);
	gtk_container_add ((GtkContainer*) bbox, (GtkWidget*) cancelButton);
	gtk_container_set_border_width ((GtkContainer*) self, (guint) 5);
	gtk_widget_show_all ((GtkWidget*) self);
	g_signal_connect_object ((GtkObject*) self, "destroy", (GCallback) _preferences_destruct_gtk_object_destroy, self, 0);
	_g_object_unref0 (cancelButton);
	_g_object_unref0 (OKButton);
	_g_object_unref0 (bbox);
	_g_object_unref0 (criticalFrame);
	_g_object_unref0 (commandLabel);
	_g_object_unref0 (percentLabel);
	_g_object_unref0 (warningFrame);
	_g_object_unref0 (backgroundLabel);
	_g_object_unref0 (borderLabel);
	_g_object_unref0 (drainingLabel);
	_g_object_unref0 (chargedLabel);
	_g_object_unref0 (chargingLabel);
	_g_object_unref0 (align);
	_g_object_unref0 (colorsFrame);
	_g_object_unref0 (table);
	_g_object_unref0 (topVbox);
	return self;
}


Preferences* preferences_new (void) {
	return preferences_construct (TYPE_PREFERENCES);
}


static gchar* double_to_string (gdouble self) {
	gchar* result = NULL;
	gchar* _tmp0_ = NULL;
	gchar* _tmp1_;
	gint _tmp1__length1;
	const gchar* _tmp2_ = NULL;
	gchar* _tmp3_;
	gchar* _tmp4_;
	_tmp0_ = g_new0 (gchar, G_ASCII_DTOSTR_BUF_SIZE);
	_tmp1_ = _tmp0_;
	_tmp1__length1 = G_ASCII_DTOSTR_BUF_SIZE;
	_tmp2_ = g_ascii_dtostr (_tmp1_, G_ASCII_DTOSTR_BUF_SIZE, self);
	_tmp3_ = g_strdup (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp1_ = (g_free (_tmp1_), NULL);
	result = _tmp4_;
	return result;
}


void preferences_update_app (Preferences* self) {
	GdkColor charging = {0};
	GdkColor charged = {0};
	GdkColor draining = {0};
	GdkColor border = {0};
	GdkColor background = {0};
	GtkColorButton* _tmp0_;
	GdkColor _tmp1_ = {0};
	GtkColorButton* _tmp2_;
	GdkColor _tmp3_ = {0};
	GtkColorButton* _tmp4_;
	GdkColor _tmp5_ = {0};
	GtkColorButton* _tmp6_;
	GdkColor _tmp7_ = {0};
	GtkColorButton* _tmp8_;
	GdkColor _tmp9_ = {0};
	GtkSpinButton* _tmp10_;
	gdouble _tmp11_ = 0.0;
	gchar* _tmp12_ = NULL;
	gchar* wp;
	GtkEntry* _tmp13_;
	const gchar* _tmp14_ = NULL;
	gchar* _tmp15_;
	gchar* wc;
	GtkSpinButton* _tmp16_;
	gdouble _tmp17_ = 0.0;
	gchar* _tmp18_ = NULL;
	gchar* cp;
	GtkEntry* _tmp19_;
	const gchar* _tmp20_ = NULL;
	gchar* _tmp21_;
	gchar* cc;
	GtkCheckButton* _tmp22_;
	gboolean _tmp23_ = FALSE;
	gboolean text_mode;
	GdkColor _tmp24_;
	GdkColor _tmp25_;
	GdkColor _tmp26_;
	GdkColor _tmp27_;
	GdkColor _tmp28_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->chargingButton;
	gtk_color_button_get_color (_tmp0_, &_tmp1_);
	charging = _tmp1_;
	_tmp2_ = self->priv->chargedButton;
	gtk_color_button_get_color (_tmp2_, &_tmp3_);
	charged = _tmp3_;
	_tmp4_ = self->priv->drainingButton;
	gtk_color_button_get_color (_tmp4_, &_tmp5_);
	draining = _tmp5_;
	_tmp6_ = self->priv->borderButton;
	gtk_color_button_get_color (_tmp6_, &_tmp7_);
	border = _tmp7_;
	_tmp8_ = self->priv->backgroundButton;
	gtk_color_button_get_color (_tmp8_, &_tmp9_);
	background = _tmp9_;
	_tmp10_ = self->priv->warningPercent;
	_tmp11_ = gtk_spin_button_get_value (_tmp10_);
	_tmp12_ = double_to_string (_tmp11_);
	wp = _tmp12_;
	_tmp13_ = self->priv->warningCommand;
	_tmp14_ = gtk_entry_get_text (_tmp13_);
	_tmp15_ = g_strdup (_tmp14_);
	wc = _tmp15_;
	_tmp16_ = self->priv->criticalPercent;
	_tmp17_ = gtk_spin_button_get_value (_tmp16_);
	_tmp18_ = double_to_string (_tmp17_);
	cp = _tmp18_;
	_tmp19_ = self->priv->criticalCommand;
	_tmp20_ = gtk_entry_get_text (_tmp19_);
	_tmp21_ = g_strdup (_tmp20_);
	cc = _tmp21_;
	_tmp22_ = self->priv->text_modeButton;
	_tmp23_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp22_);
	text_mode = _tmp23_;
	_tmp24_ = charging;
	_tmp25_ = charged;
	_tmp26_ = draining;
	_tmp27_ = border;
	_tmp28_ = background;
	g_signal_emit_by_name (self, "emit-preferences", &_tmp24_, &_tmp25_, &_tmp26_, &_tmp27_, &_tmp28_, wp, wc, cp, cc, text_mode);
	gtk_object_destroy ((GtkObject*) self);
	_g_free0 (cc);
	_g_free0 (cp);
	_g_free0 (wc);
	_g_free0 (wp);
}


void preferences_do_destroy (Preferences* self) {
	g_return_if_fail (self != NULL);
	gtk_object_destroy ((GtkObject*) self);
}


void preferences_destruct (Preferences* self) {
	g_return_if_fail (self != NULL);
	g_signal_emit_by_name (self, "gui-destroyed");
}


void preferences_set_colors (Preferences* self, const gchar* charging, const gchar* charged, const gchar* draining, const gchar* border, const gchar* background) {
	GdkColor color = {0};
	const gchar* _tmp0_;
	GdkColor _tmp1_ = {0};
	GtkColorButton* _tmp2_;
	GdkColor _tmp3_;
	const gchar* _tmp4_;
	GdkColor _tmp5_ = {0};
	GtkColorButton* _tmp6_;
	GdkColor _tmp7_;
	const gchar* _tmp8_;
	GdkColor _tmp9_ = {0};
	GtkColorButton* _tmp10_;
	GdkColor _tmp11_;
	const gchar* _tmp12_;
	GdkColor _tmp13_ = {0};
	GtkColorButton* _tmp14_;
	GdkColor _tmp15_;
	const gchar* _tmp16_;
	GdkColor _tmp17_ = {0};
	GtkColorButton* _tmp18_;
	GdkColor _tmp19_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (charging != NULL);
	g_return_if_fail (charged != NULL);
	g_return_if_fail (draining != NULL);
	g_return_if_fail (border != NULL);
	g_return_if_fail (background != NULL);
	_tmp0_ = charging;
	gdk_color_parse (_tmp0_, &_tmp1_);
	color = _tmp1_;
	_tmp2_ = self->priv->chargingButton;
	_tmp3_ = color;
	gtk_color_button_set_color (_tmp2_, &_tmp3_);
	_tmp4_ = charged;
	gdk_color_parse (_tmp4_, &_tmp5_);
	color = _tmp5_;
	_tmp6_ = self->priv->chargedButton;
	_tmp7_ = color;
	gtk_color_button_set_color (_tmp6_, &_tmp7_);
	_tmp8_ = draining;
	gdk_color_parse (_tmp8_, &_tmp9_);
	color = _tmp9_;
	_tmp10_ = self->priv->drainingButton;
	_tmp11_ = color;
	gtk_color_button_set_color (_tmp10_, &_tmp11_);
	_tmp12_ = border;
	gdk_color_parse (_tmp12_, &_tmp13_);
	color = _tmp13_;
	_tmp14_ = self->priv->borderButton;
	_tmp15_ = color;
	gtk_color_button_set_color (_tmp14_, &_tmp15_);
	_tmp16_ = background;
	gdk_color_parse (_tmp16_, &_tmp17_);
	color = _tmp17_;
	_tmp18_ = self->priv->backgroundButton;
	_tmp19_ = color;
	gtk_color_button_set_color (_tmp18_, &_tmp19_);
}


void preferences_set_warnings (Preferences* self, const gchar* wp, const gchar* wc, const gchar* cp, const gchar* cc) {
	GtkSpinButton* _tmp0_;
	const gchar* _tmp1_;
	gint _tmp2_ = 0;
	GtkSpinButton* _tmp3_;
	const gchar* _tmp4_;
	gint _tmp5_ = 0;
	GtkEntry* _tmp6_;
	const gchar* _tmp7_;
	GtkEntry* _tmp8_;
	const gchar* _tmp9_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (wp != NULL);
	g_return_if_fail (wc != NULL);
	g_return_if_fail (cp != NULL);
	g_return_if_fail (cc != NULL);
	_tmp0_ = self->priv->warningPercent;
	_tmp1_ = wp;
	_tmp2_ = atoi (_tmp1_);
	gtk_spin_button_set_value (_tmp0_, (gdouble) _tmp2_);
	_tmp3_ = self->priv->criticalPercent;
	_tmp4_ = cp;
	_tmp5_ = atoi (_tmp4_);
	gtk_spin_button_set_value (_tmp3_, (gdouble) _tmp5_);
	_tmp6_ = self->priv->warningCommand;
	_tmp7_ = wc;
	gtk_entry_set_text (_tmp6_, _tmp7_);
	_tmp8_ = self->priv->criticalCommand;
	_tmp9_ = cc;
	gtk_entry_set_text (_tmp8_, _tmp9_);
}


void preferences_set_text_mode (Preferences* self, gboolean mode) {
	GtkCheckButton* _tmp0_;
	gboolean _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->text_modeButton;
	_tmp1_ = mode;
	gtk_toggle_button_set_active ((GtkToggleButton*) _tmp0_, _tmp1_);
}


void preferences_display (Preferences* self) {
	g_return_if_fail (self != NULL);
	gtk_widget_show_all ((GtkWidget*) self);
}


static void g_cclosure_user_marshal_VOID__BOXED_BOXED_BOXED_BOXED_BOXED_STRING_STRING_STRING_STRING_BOOLEAN (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
	typedef void (*GMarshalFunc_VOID__BOXED_BOXED_BOXED_BOXED_BOXED_STRING_STRING_STRING_STRING_BOOLEAN) (gpointer data1, gpointer arg_1, gpointer arg_2, gpointer arg_3, gpointer arg_4, gpointer arg_5, const char* arg_6, const char* arg_7, const char* arg_8, const char* arg_9, gboolean arg_10, gpointer data2);
	register GMarshalFunc_VOID__BOXED_BOXED_BOXED_BOXED_BOXED_STRING_STRING_STRING_STRING_BOOLEAN callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 11);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__BOXED_BOXED_BOXED_BOXED_BOXED_STRING_STRING_STRING_STRING_BOOLEAN) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_boxed (param_values + 1), g_value_get_boxed (param_values + 2), g_value_get_boxed (param_values + 3), g_value_get_boxed (param_values + 4), g_value_get_boxed (param_values + 5), g_value_get_string (param_values + 6), g_value_get_string (param_values + 7), g_value_get_string (param_values + 8), g_value_get_string (param_values + 9), g_value_get_boolean (param_values + 10), data2);
}


static GObject * preferences_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
	GObject * obj;
	GObjectClass * parent_class;
	Preferences * self;
	parent_class = G_OBJECT_CLASS (preferences_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = PREFERENCES (obj);
	g_object_set ((GtkWindow*) self, "type", GTK_WINDOW_TOPLEVEL, NULL);
	return obj;
}


static void preferences_class_init (PreferencesClass * klass) {
	preferences_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (PreferencesPrivate));
	G_OBJECT_CLASS (klass)->constructor = preferences_constructor;
	G_OBJECT_CLASS (klass)->finalize = preferences_finalize;
	g_signal_new ("emit_preferences", TYPE_PREFERENCES, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__BOXED_BOXED_BOXED_BOXED_BOXED_STRING_STRING_STRING_STRING_BOOLEAN, G_TYPE_NONE, 10, GDK_TYPE_COLOR, GDK_TYPE_COLOR, GDK_TYPE_COLOR, GDK_TYPE_COLOR, GDK_TYPE_COLOR, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN);
	g_signal_new ("gui_destroyed", TYPE_PREFERENCES, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}


static void preferences_instance_init (Preferences * self) {
	self->priv = PREFERENCES_GET_PRIVATE (self);
}


static void preferences_finalize (GObject* obj) {
	Preferences * self;
	self = PREFERENCES (obj);
	_g_object_unref0 (self->priv->borderButton);
	_g_object_unref0 (self->priv->chargingButton);
	_g_object_unref0 (self->priv->chargedButton);
	_g_object_unref0 (self->priv->drainingButton);
	_g_object_unref0 (self->priv->backgroundButton);
	_g_object_unref0 (self->priv->warningPercent);
	_g_object_unref0 (self->priv->criticalPercent);
	_g_object_unref0 (self->priv->warningCommand);
	_g_object_unref0 (self->priv->criticalCommand);
	_g_object_unref0 (self->priv->text_modeButton);
	G_OBJECT_CLASS (preferences_parent_class)->finalize (obj);
}


GType preferences_get_type (void) {
	static volatile gsize preferences_type_id__volatile = 0;
	if (g_once_init_enter (&preferences_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (PreferencesClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) preferences_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Preferences), 0, (GInstanceInitFunc) preferences_instance_init, NULL };
		GType preferences_type_id;
		preferences_type_id = g_type_register_static (GTK_TYPE_WINDOW, "Preferences", &g_define_type_info, 0);
		g_once_init_leave (&preferences_type_id__volatile, preferences_type_id);
	}
	return preferences_type_id__volatile;
}


static void __lambda2_ (IconMenu* self, GtkMenuItem* source) {
	g_return_if_fail (source != NULL);
	g_signal_emit_by_name (self, "show-preferences");
}


static void ___lambda2__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
	__lambda2_ (self, _sender);
}


static void __lambda3_ (IconMenu* self, GtkMenuItem* source) {
	g_return_if_fail (source != NULL);
	g_signal_emit_by_name (self, "show-about");
}


static void ___lambda3__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
	__lambda3_ (self, _sender);
}


IconMenu* icon_menu_construct (GType object_type) {
	IconMenu * self = NULL;
	GtkImageMenuItem* _tmp0_;
	GtkImageMenuItem* _tmp1_;
	GtkImageMenuItem* menuItem;
	GtkImageMenuItem* _tmp2_;
	GtkImageMenuItem* _tmp3_;
	GtkImageMenuItem* _tmp4_;
	GtkImageMenuItem* _tmp5_;
	GtkImageMenuItem* _tmp6_;
	GtkImageMenuItem* _tmp7_;
	self = (IconMenu*) g_object_new (object_type, NULL);
	_tmp0_ = (GtkImageMenuItem*) gtk_image_menu_item_new_from_stock (GTK_STOCK_PREFERENCES, NULL);
	_tmp1_ = g_object_ref_sink (_tmp0_);
	menuItem = _tmp1_;
	_tmp2_ = menuItem;
	g_signal_connect_object ((GtkMenuItem*) _tmp2_, "activate", (GCallback) ___lambda2__gtk_menu_item_activate, self, 0);
	_tmp3_ = menuItem;
	gtk_menu_shell_append ((GtkMenuShell*) self, (GtkWidget*) ((GtkMenuItem*) _tmp3_));
	_tmp4_ = (GtkImageMenuItem*) gtk_image_menu_item_new_from_stock (GTK_STOCK_ABOUT, NULL);
	_tmp5_ = g_object_ref_sink (_tmp4_);
	_g_object_unref0 (menuItem);
	menuItem = _tmp5_;
	_tmp6_ = menuItem;
	g_signal_connect_object ((GtkMenuItem*) _tmp6_, "activate", (GCallback) ___lambda3__gtk_menu_item_activate, self, 0);
	_tmp7_ = menuItem;
	gtk_menu_shell_append ((GtkMenuShell*) self, (GtkWidget*) ((GtkMenuItem*) _tmp7_));
	gtk_widget_show_all ((GtkWidget*) self);
	_g_object_unref0 (menuItem);
	return self;
}


IconMenu* icon_menu_new (void) {
	return icon_menu_construct (TYPE_ICON_MENU);
}


static void icon_menu_class_init (IconMenuClass * klass) {
	icon_menu_parent_class = g_type_class_peek_parent (klass);
	g_signal_new ("show_preferences", TYPE_ICON_MENU, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	g_signal_new ("show_about", TYPE_ICON_MENU, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}


static void icon_menu_instance_init (IconMenu * self) {
}


GType icon_menu_get_type (void) {
	static volatile gsize icon_menu_type_id__volatile = 0;
	if (g_once_init_enter (&icon_menu_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (IconMenuClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) icon_menu_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (IconMenu), 0, (GInstanceInitFunc) icon_menu_instance_init, NULL };
		GType icon_menu_type_id;
		icon_menu_type_id = g_type_register_static (GTK_TYPE_MENU, "IconMenu", &g_define_type_info, 0);
		g_once_init_leave (&icon_menu_type_id__volatile, icon_menu_type_id);
	}
	return icon_menu_type_id__volatile;
}



