diff options
author | Javier Jardón <javier.jardon@codethink.co.uk> | 2011-07-04 16:41:09 +0100 |
---|---|---|
committer | Javier Jardón <javier.jardon@codethink.co.uk> | 2011-07-04 16:41:09 +0100 |
commit | a6b0041b51d6679a8e1525c980eeaa958660a334 (patch) | |
tree | 3e87cce51a0b17c2c3f2c3a2857e8b825afc41b8 | |
parent | dd26fa313af6d2f18609b0afa958d62b0181853d (diff) | |
download | ayatana-indicator-power-a6b0041b51d6679a8e1525c980eeaa958660a334.tar.gz ayatana-indicator-power-a6b0041b51d6679a8e1525c980eeaa958660a334.tar.bz2 ayatana-indicator-power-a6b0041b51d6679a8e1525c980eeaa958660a334.zip |
Move callbacks to the beginning of the file
-rw-r--r-- | src/indicator-power.c | 64 |
1 files changed, 32 insertions, 32 deletions
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 @@ -115,6 +115,38 @@ indicator_power_class_init (IndicatorPowerClass *klass) } 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, gchar **detailed_timestring) @@ -416,38 +448,6 @@ service_proxy_cb (GObject *object, } 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) { IndicatorPowerPrivate *priv = self->priv; |