commit d8c4d4f1c0101b61d0291dbaf6a442ac4237040c
Author: Stanislav Brabec <sbrabec@suse.cz>
Date:   Wed Nov 25 17:21:51 2009 +0100

    Usability: Announce OBEX server in the applet menu (#602860).

diff --git a/applet/main.c b/applet/main.c
index d719e3e..bbb49ad 100644
--- a/applet/main.c
+++ b/applet/main.c
@@ -68,6 +68,7 @@ static GtkActionGroup *devices_action_group = NULL;
 
 /* Signal callbacks */
 void settings_callback(GObject *widget, gpointer user_data);
+void receive_callback(GObject *widget, gpointer user_data);
 void quit_callback(GObject *widget, gpointer user_data);
 void browse_callback(GObject *widget, gpointer user_data);
 void bluetooth_status_callback (GObject *widget, gpointer user_data);
@@ -90,6 +91,36 @@ void settings_callback(GObject *widget, gpointer user_data)
 		g_printerr("Couldn't execute command: %s\n", command);
 }
 
+void receive_callback(GObject *widget, gpointer user_data)
+{
+	GtkWidget *dialog, *hbox, *image, *label;
+	const char *command = "gnome-file-share-properties";
+
+	if (!g_spawn_command_line_async(command, NULL)) {
+		dialog = gtk_dialog_new_with_buttons(_("Missing component!"), NULL,
+						     GTK_DIALOG_NO_SEPARATOR,
+						     GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL);
+
+		hbox = gtk_hbox_new (FALSE, 4);
+
+		image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_ERROR, GTK_ICON_SIZE_MENU);
+		gtk_box_pack_start(GTK_BOX (hbox), image, FALSE, FALSE, 4);
+
+		label = gtk_label_new (_("Install gnome-user-share package to enable this feature."));
+		gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+		gtk_box_pack_start(GTK_BOX (hbox), label, TRUE, TRUE, 4);
+
+		gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 2);
+
+		gtk_widget_show_all(hbox);
+		gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
+		gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), hbox);
+
+		gtk_dialog_run (GTK_DIALOG (dialog));
+		gtk_widget_destroy (dialog);
+	}
+}
+
 static void
 select_device_changed(BluetoothChooser *sel,
 		      char *address,
diff --git a/applet/popup-menu.ui b/applet/popup-menu.ui
index f167c1a..0fbac0c 100644
--- a/applet/popup-menu.ui
+++ b/applet/popup-menu.ui
@@ -76,6 +76,13 @@
 						<signal name="activate" handler="quit_callback"/>
 					</object>
 				</child>
+				<child>
+					<object class="GtkAction" id="receive">
+						<property name="label" translatable="yes">Receive and share files...</property>
+						<property name="stock-id">gtk-save-as</property>
+						<signal name="activate" handler="receive_callback"/>
+					</object>
+				</child>
 			</object>
 		</child>
 		<ui>
@@ -106,6 +113,8 @@
 
 				<menuitem name="preferences" action="preferences"/>
 
+				<menuitem name="receive" action="receive"/>
+
 				<menuitem name="quit" action="quit"/>
 			</popup>
 		</ui>
