From a6b0041b51d6679a8e1525c980eeaa958660a334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jard=C3=B3n?= Date: Mon, 4 Jul 2011 16:41:09 +0100 Subject: Move callbacks to the beginning of the file --- src/indicator-power.c | 64 +++++++++++++++++++++++++-------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) (limited to 'src/indicator-power.c') diff --git a/src/indicator-power.c b/src/indicator-power.c index 723d7f4..3863719 100644 --- a/src/indicator-power.c +++ b/src/indicator-power.c @@ -114,6 +114,38 @@ indicator_power_class_init (IndicatorPowerClass *klass) g_type_class_add_private (klass, sizeof (IndicatorPowerPrivate)); } +static void +show_info_cb (GtkMenuItem *item, + gpointer data) +{ + /*TODO: show the statistics of the specific device*/ + const gchar *command = "gnome-power-statistics"; + + if (g_spawn_command_line_async (command, NULL) == FALSE) + g_warning ("Couldn't execute command: %s", command); +} + +static void +option_toggled_cb (GtkCheckMenuItem *item, + gpointer user_data) +{ + IndicatorPower *self = INDICATOR_POWER (user_data); + IndicatorPowerPrivate *priv = self->priv; + + gtk_widget_set_visible (GTK_WIDGET (priv->label), + gtk_check_menu_item_get_active (item)); +} + +static void +show_preferences_cb (GtkMenuItem *item, + gpointer data) +{ + const gchar *command = "gnome-control-center power"; + + if (g_spawn_command_line_async (command, NULL) == FALSE) + g_warning ("Couldn't execute command: %s", command); +} + static void get_timestring (guint64 time_secs, gchar **short_timestring, @@ -415,38 +447,6 @@ service_proxy_cb (GObject *object, user_data); } -static void -show_info_cb (GtkMenuItem *item, - gpointer data) -{ - /*TODO: show the statistics of the specific device*/ - const gchar *command = "gnome-power-statistics"; - - if (g_spawn_command_line_async (command, NULL) == FALSE) - g_warning ("Couldn't execute command: %s", command); -} - -static void -option_toggled_cb (GtkCheckMenuItem *item, - gpointer user_data) -{ - IndicatorPower *self = INDICATOR_POWER (user_data); - IndicatorPowerPrivate *priv = self->priv; - - gtk_widget_set_visible (GTK_WIDGET (priv->label), - gtk_check_menu_item_get_active (item)); -} - -static void -show_preferences_cb (GtkMenuItem *item, - gpointer data) -{ - const gchar *command = "gnome-control-center power"; - - if (g_spawn_command_line_async (command, NULL) == FALSE) - g_warning ("Couldn't execute command: %s", command); -} - static void build_menu (IndicatorPower *self) { -- cgit v1.2.3