void rb_daap_sharing_init (RBShell *shell) { g_object_ref (shell); if (eel_gconf_get_boolean (CONF_DAAP_ENABLE_SHARING)) { create_share (shell); } enable_sharing_notify_id = eel_gconf_notification_add (CONF_DAAP_ENABLE_SHARING, (GConfClientNotifyFunc) enable_sharing_changed_cb, shell); require_password_notify_id = eel_gconf_notification_add (CONF_DAAP_REQUIRE_PASSWORD, (GConfClientNotifyFunc) require_password_changed_cb, shell); share_name_notify_id = eel_gconf_notification_add (CONF_DAAP_SHARE_NAME, (GConfClientNotifyFunc) share_name_changed_cb, shell); share_password_notify_id = eel_gconf_notification_add (CONF_DAAP_SHARE_PASSWORD, (GConfClientNotifyFunc) share_password_changed_cb, shell); }
static void nautilus_file_background_receive_gconf_changes (EelBackground *background) { guint notification_id; eel_gconf_monitor_add ("/desktop/gnome/background"); notification_id = eel_gconf_notification_add ("/desktop/gnome/background", desktop_background_gconf_notify_cb, background); g_object_set_data (G_OBJECT (background), "desktop_gconf_notification", GUINT_TO_POINTER (notification_id)); g_signal_connect (background, "destroy", G_CALLBACK (desktop_background_destroyed_callback), NULL); }
static GObject * rb_library_browser_constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_properties) { RBLibraryBrowserClass *klass; RBLibraryBrowser *browser; RBLibraryBrowserPrivate *priv; int i; klass = RB_LIBRARY_BROWSER_CLASS (g_type_class_peek (RB_TYPE_LIBRARY_BROWSER)); browser = RB_LIBRARY_BROWSER (G_OBJECT_CLASS (rb_library_browser_parent_class)-> constructor (type, n_construct_properties, construct_properties)); priv = RB_LIBRARY_BROWSER_GET_PRIVATE (browser); for (i = 0; i < num_browser_properties; i++) { RBPropertyView *view; view = rb_property_view_new (priv->db, browser_properties[i].type, _(browser_properties[i].name)); g_hash_table_insert (priv->property_views, (gpointer)(browser_properties[i].type), view); rb_property_view_set_selection_mode (view, GTK_SELECTION_MULTIPLE); g_signal_connect_object (G_OBJECT (view), "properties-selected", G_CALLBACK (view_property_selected_cb), browser, 0); g_signal_connect_object (G_OBJECT (view), "property-selection-reset", G_CALLBACK (view_selection_reset_cb), browser, 0); gtk_widget_show_all (GTK_WIDGET (view)); gtk_widget_set_no_show_all (GTK_WIDGET (view), TRUE); gtk_box_pack_start (GTK_BOX (browser), GTK_WIDGET (view), TRUE, TRUE, 0); } update_browser_views_visibility (browser); priv->browser_view_notify_id = eel_gconf_notification_add (CONF_UI_BROWSER_VIEWS, (GConfClientNotifyFunc) rb_library_browser_views_changed, browser); return G_OBJECT (browser); }
static void rb_library_browser_constructed (GObject *object) { RBLibraryBrowser *browser; RBLibraryBrowserPrivate *priv; int i; RB_CHAIN_GOBJECT_METHOD (rb_library_browser_parent_class, constructed, object); browser = RB_LIBRARY_BROWSER (object); priv = RB_LIBRARY_BROWSER_GET_PRIVATE (browser); for (i = 0; i < num_browser_properties; i++) { RBPropertyView *view; view = rb_property_view_new (priv->db, browser_properties[i].type, _(browser_properties[i].name)); g_hash_table_insert (priv->property_views, (gpointer)(browser_properties[i].type), view); rb_property_view_set_selection_mode (view, GTK_SELECTION_MULTIPLE); g_signal_connect_object (G_OBJECT (view), "properties-selected", G_CALLBACK (view_property_selected_cb), browser, 0); g_signal_connect_object (G_OBJECT (view), "property-selection-reset", G_CALLBACK (view_selection_reset_cb), browser, 0); gtk_widget_show_all (GTK_WIDGET (view)); gtk_widget_set_no_show_all (GTK_WIDGET (view), TRUE); gtk_box_pack_start (GTK_BOX (browser), GTK_WIDGET (view), TRUE, TRUE, 0); } update_browser_views_visibility (browser); priv->browser_view_notify_id = eel_gconf_notification_add (CONF_UI_BROWSER_VIEWS, (GConfClientNotifyFunc) rb_library_browser_views_changed, browser); }
static gboolean rb_plugins_engine_load_cb (GFile *file, gboolean dir, gpointer userdata) { char *plugin_path; RBPluginInfo *info; char *key_name; gboolean activate; const char *sep; plugin_path = g_file_get_path (file); sep = strrchr (plugin_path, G_DIR_SEPARATOR); if (sep == NULL) sep = plugin_path; else sep += 1; /* don't look inside version control system directories. * most are already covered by excluding hidden files/directories. */ if (dir && (g_str_has_prefix (sep, "_darcs") || g_str_has_prefix (sep, "CVS"))) { rb_debug ("not loading plugin from hidden/VCS directory %s", plugin_path); g_free (plugin_path); return FALSE; } if (dir || !g_str_has_suffix (plugin_path, PLUGIN_EXT)) { g_free (plugin_path); return TRUE; } info = rb_plugins_engine_load (plugin_path); g_free (plugin_path); if (info == NULL) return TRUE; if (g_hash_table_lookup (rb_plugins, info->location)) { rb_plugin_info_free (info); return TRUE; } g_hash_table_insert (rb_plugins, info->location, info); rb_debug ("Plugin %s loaded", info->name); key_name = g_strdup_printf (CONF_PLUGIN_ACTIVE_KEY, info->location); info->active_notification_id = eel_gconf_notification_add (key_name, (GConfClientNotifyFunc)rb_plugins_engine_plugin_active_cb, info); activate = eel_gconf_get_boolean (key_name); g_free (key_name); key_name = g_strdup_printf (CONF_PLUGIN_HIDDEN_KEY, info->location); info->visible_notification_id = eel_gconf_notification_add (key_name, (GConfClientNotifyFunc)rb_plugins_engine_plugin_visible_cb, info); info->visible = !eel_gconf_get_boolean (key_name); g_free (key_name); if (activate) rb_plugins_engine_activate_plugin (info); return TRUE; }