summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2012-09-28 13:56:41 +0200
committerraveit65 <[email protected]>2012-09-28 13:56:41 +0200
commitc0ea7fefe55f518145afd68f201bb6ed07d6e866 (patch)
treefb36698c7c1aef79bcc1fd33cf56596d4cdd4dd9
parent8326e3b51e36244b8ae04f4d8dd010b9fbf25af1 (diff)
downloadmate-user-share-c0ea7fefe55f518145afd68f201bb6ed07d6e866.tar.bz2
mate-user-share-c0ea7fefe55f518145afd68f201bb6ed07d6e866.tar.xz
fix gsettings again
remove g_object_unref add static GSettings* settings add g_signal_connect as substitution for mateconf_client_notify_add
-rw-r--r--src/file-share-properties.c3
-rw-r--r--src/user_share.c45
2 files changed, 45 insertions, 3 deletions
diff --git a/src/file-share-properties.c b/src/file-share-properties.c
index 6d0fbd6..0ec5594 100644
--- a/src/file-share-properties.c
+++ b/src/file-share-properties.c
@@ -46,6 +46,7 @@
#define GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_OBEXPUSH_NOTIFY "bluetooth-notify"
static GtkBuilder* builder;
+static GSettings* settings;
static void
@@ -624,8 +625,6 @@ main (int argc, char *argv[])
- g_object_unref (settings);
-
gtk_widget_show (GTK_WIDGET (gtk_builder_get_object (builder, "user_share_dialog")));
gtk_main ();
diff --git a/src/user_share.c b/src/user_share.c
index 83f005c..ae7b5ff 100644
--- a/src/user_share.c
+++ b/src/user_share.c
@@ -63,7 +63,19 @@ static BluetoothClient *client = NULL;
static gboolean bluetoothd_enabled = FALSE;
#define OBEX_ENABLED (bluetoothd_enabled && has_console)
+
#define GSETTINGS_SCHEMA "org.mate.FileSharing"
+#define GSETTINGS_KEY_FILE_SHARING_ENABLED "enabled"
+#define GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_ENABLED "bluetooth-enabled"
+#define GSETTINGS_KEY_FILE_SHARING_REQUIRE_PASSWORD "require-password"
+#define GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_ALLOW_WRITE "bluetooth-allow-write"
+#define GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_REQUIRE_PAIRING "bluetooth-require-pairing"
+#define GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_OBEXPUSH_ENABLED "bluetooth-obexpush-enabled"
+#define GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_OBEXPUSH_ACCEPT_FILES "bluetooth-accept-files"
+#define GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_OBEXPUSH_NOTIFY "bluetooth-notify"
+
+
+static GSettings* settings;
static void
obex_services_start (void)
@@ -477,7 +489,38 @@ main (int argc, char **argv)
if (obexpush_init () == FALSE)
return 1;
- g_object_unref (client);
+ g_signal_connect (settings,
+ "changed::" GSETTINGS_KEY_FILE_SHARING_ENABLED,
+ G_CALLBACK (file_sharing_enabled_changed), NULL);
+
+ g_signal_connect (settings,
+ "changed::" GSETTINGS_KEY_FILE_SHARING_REQUIRE_PASSWORD,
+ G_CALLBACK (require_password_changed), NULL);
+
+ g_signal_connect (settings,
+ "changed::" GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_ENABLED,
+ G_CALLBACK (file_sharing_bluetooth_enabled_changed), NULL);
+
+ g_signal_connect (settings,
+ "changed::" GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_ALLOW_WRITE,
+ G_CALLBACK (file_sharing_bluetooth_allow_write_changed), NULL);
+
+ g_signal_connect (settings,
+ "changed::" GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_REQUIRE_PAIRING,
+ G_CALLBACK (file_sharing_bluetooth_require_pairing_changed), NULL);
+
+ g_signal_connect (settings,
+ "changed::" GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_OBEXPUSH_ENABLED,
+ G_CALLBACK (file_sharing_bluetooth_obexpush_enabled_changed), NULL);
+
+ g_signal_connect (settings,
+ "changed::" GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_OBEXPUSH_ACCEPT_FILES,
+ G_CALLBACK (file_sharing_bluetooth_obexpush_accept_files_changed), NULL);
+
+ g_signal_connect (settings,
+ "changed::" GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_OBEXPUSH_NOTIFY,
+ G_CALLBACK (file_sharing_bluetooth_obexpush_notify_changed), NULL);
+
bluez_init ();
consolekit_init ();