[gnome-bluetooth/meego-1.0] moblin: start gnome-user-share when the adaptor is powered



commit 1bd50331994bb056de746b006cad5e576534f370
Author: Ross Burton <ross linux intel com>
Date:   Wed Jun 16 16:49:09 2010 +0100

    moblin: start gnome-user-share when the adaptor is powered

 moblin/Makefile.am    |    3 ++-
 moblin/moblin-panel.c |   13 +++++++++++++
 2 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/moblin/Makefile.am b/moblin/Makefile.am
index 1b9713c..9ce344a 100644
--- a/moblin/Makefile.am
+++ b/moblin/Makefile.am
@@ -10,7 +10,8 @@ bluetooth_panel_LDADD = $(top_builddir)/lib/libcommon.la $(top_builddir)/lib/lib
 			$(top_builddir)/moblin/moblin-copy-n-paste/libmoblin.la \
 			$(top_builddir)/wizard/libwizard.la $(MOBLIN_LIBS)
 
-AM_CFLAGS = $(MOBLIN_CFLAGS) $(WARN_CFLAGS) $(DISABLE_DEPRECATED) -DPKGDATADIR="\"$(pkgdatadir)\""
+AM_CFLAGS = $(MOBLIN_CFLAGS) $(WARN_CFLAGS) $(DISABLE_DEPRECATED) \
+	-DPKGDATADIR="\"$(pkgdatadir)\"" -DLIBEXECDIR="\"$(LIBEXECDIR)\""
 
 INCLUDES = -I$(top_srcdir)/lib -I$(top_srcdir)/wizard -I$(top_srcdir)/moblin/moblin-copy-n-paste
 
diff --git a/moblin/moblin-panel.c b/moblin/moblin-panel.c
index 7dfc8d5..fad26a8 100644
--- a/moblin/moblin-panel.c
+++ b/moblin/moblin-panel.c
@@ -293,6 +293,18 @@ enable_send_file (MoblinPanel *self)
 }
 
 static void
+start_user_share (MoblinPanel *self)
+{
+	char *argv[] = { LIBEXECDIR "/gnome-user-share", NULL};
+	GError *error = NULL;
+
+	if (!g_spawn_async (NULL, argv, NULL, 0, NULL, NULL, NULL, &error)) {
+		g_message ("Cannot start gnome-user-share: %s", error->message);
+		g_error_free (error);
+	}
+}
+
+static void
 powerswitch_state_changed_cb (BluetoothPowerswitch *powerswitch,
                              PowerswitchState      state,
                              gpointer             user_data)
@@ -315,6 +327,7 @@ powerswitch_state_changed_cb (BluetoothPowerswitch *powerswitch,
 		gtk_widget_set_sensitive (priv->visible_button, TRUE);
 		gtk_widget_set_sensitive (priv->add_new_button, TRUE);
 		enable_send_file (self);
+		start_user_share (self);
 	} else if (state == POWERSWITCH_STATE_NO_ADAPTER) {
 		gtk_widget_set_sensitive (priv->power_switch, FALSE);
 		gtk_widget_set_sensitive (priv->visible_button, FALSE);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]