gnome-user-share r202 - trunk



Author: hadess
Date: Fri Feb 22 11:54:52 2008
New Revision: 202
URL: http://svn.gnome.org/viewvc/gnome-user-share?rev=202&view=rev

Log:
2008-02-22  Bastien Nocera  <hadess hadess net>

	* file-share-properties.c:
	(bluetooth_require_pairing_check_toggled), (main):
	Make the toggle button for "require pairing" actually work

	* user_share.c: (file_sharing_bluetooth_require_pairing_changed):
	Fully restart the obex manager, as we need to tear down to
	use "require pairing"

	* obexftp.c: (obexftp_up), (obexftp_stop): Call "Close" instead
	of "Stop" to tear down the server object



Modified:
   trunk/ChangeLog
   trunk/file-share-properties.c
   trunk/obexftp.c
   trunk/user_share.c

Modified: trunk/file-share-properties.c
==============================================================================
--- trunk/file-share-properties.c	(original)
+++ trunk/file-share-properties.c	Fri Feb 22 11:54:52 2008
@@ -335,6 +335,24 @@
 	g_object_unref (client);
 }
 
+static void
+bluetooth_require_pairing_check_toggled (GtkWidget *check)
+{
+	GConfClient *client;
+	gboolean enabled;
+
+	enabled = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check));
+
+	client = gconf_client_get_default ();
+
+	gconf_client_set_bool (client,
+			       FILE_SHARING_BLUETOOTH_REQUIRE_PAIRING,
+			       enabled,
+			       NULL);
+
+	g_object_unref (client);
+}
+
 int
 main (int argc, char *argv[])
 {
@@ -344,6 +362,7 @@
     GtkWidget *password_entry;
     GtkWidget *bluetooth_check;
     GtkWidget *bluetooth_allow_write_check;
+    GtkWidget *require_pairing_check;
     GtkWidget *window;
     GtkListStore *store;
     GtkCellRenderer *cell;
@@ -374,6 +393,7 @@
     password_entry = glade_xml_get_widget (ui, "password_entry");
     bluetooth_check = glade_xml_get_widget (ui, "enable_bluetooth_check");
     bluetooth_allow_write_check = glade_xml_get_widget (ui, "allow_write_bluetooth_check");
+    require_pairing_check = glade_xml_get_widget (ui, "require_pairing_check");
 
     store = gtk_list_store_new (1, G_TYPE_STRING);
     gtk_combo_box_set_model (GTK_COMBO_BOX (password_combo),
@@ -413,6 +433,8 @@
     		      "toggled", G_CALLBACK (enable_bluetooth_check_toggled), NULL);
     g_signal_connect (bluetooth_allow_write_check,
     		      "toggled", G_CALLBACK (bluetooth_allow_write_check_toggled), NULL);
+    g_signal_connect (require_pairing_check,
+    		      "toggled", G_CALLBACK (bluetooth_require_pairing_check_toggled), NULL);
 
     g_signal_connect (glade_xml_get_widget (ui, "close_button"),
 		      "clicked", G_CALLBACK (gtk_main_quit), NULL);

Modified: trunk/obexftp.c
==============================================================================
--- trunk/obexftp.c	(original)
+++ trunk/obexftp.c	Fri Feb 22 11:54:52 2008
@@ -101,7 +101,7 @@
 	if (server_proxy == NULL)
 		return;
 
-	if (dbus_g_proxy_call (server_proxy, "Stop", &err, G_TYPE_INVALID, G_TYPE_INVALID) == FALSE) {
+	if (dbus_g_proxy_call (server_proxy, "Close", &err, G_TYPE_INVALID, G_TYPE_INVALID) == FALSE) {
 		const gchar *error_name = NULL;
 
 		if (err != NULL && err->code == DBUS_GERROR_REMOTE_EXCEPTION)

Modified: trunk/user_share.c
==============================================================================
--- trunk/user_share.c	(original)
+++ trunk/user_share.c	Fri Feb 22 11:54:52 2008
@@ -147,7 +147,10 @@
 						GConfEntry *entry,
 						gpointer data)
 {
-	obexftp_restart ();
+	/* We need to fully reset the session,
+	 * otherwise the new setting isn't taken into account */
+	obexftp_down ();
+	obexftp_up ();
 }
 
 static void



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