diff --git a/gnome-settings-daemon-system-proxy-configuration.patch b/gnome-settings-daemon-system-proxy-configuration.patch index b86806e..98b1219 100644 --- a/gnome-settings-daemon-system-proxy-configuration.patch +++ b/gnome-settings-daemon-system-proxy-configuration.patch @@ -1,86 +1,29 @@ -Index: schemas/Makefile.am +Index: plugins/proxy/proxy.gnome-settings-plugin.in =================================================================== ---- schemas/Makefile.am (revision 7885) -+++ schemas/Makefile.am (working copy) -@@ -3,7 +3,8 @@ - apps_gnome_settings_daemon_screensaver.schemas.in \ - apps_gnome_settings_daemon_default_editor.schemas.in \ - desktop_gnome_font_rendering.schemas.in \ -- apps_gnome_settings_daemon_keybindings.schemas.in -+ apps_gnome_settings_daemon_keybindings.schemas.in \ -+ system_proxy.schemas.in - - schema_DATA = $(schema_in_files:.schemas.in=.schemas) - -Index: schemas/system_proxy.schemas.in +--- plugins/proxy/proxy.gnome-settings-plugin.in (revision 0) ++++ plugins/proxy/proxy.gnome-settings-plugin.in (revision 0) +@@ -0,0 +1,8 @@ ++[GNOME Settings Plugin] ++Module=proxy ++IAge=0 ++_Name=Network Proxy ++_Description=Network proxy plugin ++Authors=Rodrigo Moya ++Copyright= ++Website= +Index: plugins/proxy/gsd-proxy-manager.c =================================================================== ---- schemas/system_proxy.schemas.in (revision 0) -+++ schemas/system_proxy.schemas.in (revision 0) -@@ -0,0 +1,26 @@ -+ -+ -+ -+ -+ /schemas/system/proxy/use_system_settings -+ /system/proxy/use_system_settings -+ string -+ only_if_mode_not_set -+ -+ Use the system's proxy settings -+ Whether to use the system's proxy settings. -+ Possible values are "only_if_mode_not_set", "system_values", and -+ "user_values". The first one is the default value; in -+ it, the system's proxy settings will be used if and -+ only if the user has never set his /system/proxy/mode -+ key. Once the user sets that key, use_system_settings -+ will switch to "system_values", which indicates that -+ the system's proxy settings should be used, or -+ "user_values", which indicates that the user's -+ settings should be used. The key will alternate -+ between these last two values in the future and will -+ not go back to the default value. -+ -+ -+ -+ -Index: gnome-settings-daemon/novell-sysconfig-proxy-helper -=================================================================== ---- gnome-settings-daemon/novell-sysconfig-proxy-helper (revision 0) -+++ gnome-settings-daemon/novell-sysconfig-proxy-helper (revision 0) -@@ -0,0 +1,19 @@ -+#!/bin/sh -+ -+if [ ! -f /etc/sysconfig/proxy ] -+then -+ exit 0 -+fi -+ -+source /etc/sysconfig/proxy -+ -+# This may look convoluted, but it's an easy way to let random shell -+# script code appear in /etc/sysconfig/proxy and still let user code -+# read the variables in it easily. -+ -+echo "PROXY_ENABLED $PROXY_ENABLED" -+echo "HTTP_PROXY $HTTP_PROXY" -+echo "HTTPS_PROXY $HTTPS_PROXY" -+echo "FTP_PROXY $FTP_PROXY" -+echo "GOPHER_PROXY $GOPHER_PROXY" -+echo "NO_PROXY $NO_PROXY" -Index: gnome-settings-daemon/gnome-settings-proxy.c -=================================================================== ---- gnome-settings-daemon/gnome-settings-proxy.c (revision 0) -+++ gnome-settings-daemon/gnome-settings-proxy.c (revision 0) -@@ -0,0 +1,494 @@ -+/* -+ * Copyright (C) 2007 Novell, Inc. +--- plugins/proxy/gsd-proxy-manager.c (revision 0) ++++ plugins/proxy/gsd-proxy-manager.c (revision 0) +@@ -0,0 +1,570 @@ ++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * -+ * Authors: Federico Mena-Quintero ++ * Copyright (C) 2008 Rodrigo Moya + * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -89,22 +32,34 @@ Index: gnome-settings-daemon/gnome-settings-proxy.c + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -+ * USA ++ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ * + */ + -+#include -+#include ++#include "config.h" ++ ++#include ++#include ++#include +#include ++#include ++#include ++#include ++ +#include ++ ++#include +#include ++#include ++#include +#include ++#include +#include -+#include + ++#include "gnome-settings-profile.h" ++#include "gsd-proxy-manager.h" + -+#include "gnome-settings-module.h" -+#include "utils.h" ++#define GSD_PROXY_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSD_TYPE_PROXY_MANAGER, GsdProxyManagerPrivate)) + +/* Novell extension */ +#define KEY_USE_SYSTEM_SETTINGS "/system/proxy/use_system_settings" /* string */ @@ -132,75 +87,31 @@ Index: gnome-settings-daemon/gnome-settings-proxy.c +#define KEY_SOCKS_PORT "/system/proxy/socks_port" /* int */ +#define KEY_AUTOCONFIG_URL "/system/proxy/autoconfig_url" /* string */ + ++struct GsdProxyManagerPrivate ++{ ++}; ++ +typedef struct { -+ char *proxy_enabled; /* "yes"/"no" */ -+ char *http_proxy; /* "http://host:port" */ -+ char *https_proxy; /* "http://host:port" */ -+ char *ftp_proxy; /* "http://host:port" */ -+ /* char *gopher_proxy; Gnome doesn't have a Gopher proxy setting as of 2.10 */ -+ char *no_proxy; /* "www.me.de, do.main, localhost" */ -+ /* char *user; -+ * char *password; -+ * Yast2 currently doesn't support a public username/password; they are just -+ * stored in /root/.wgetrc and /root/.curlrc -+ */ ++ char *proxy_enabled; /* "yes"/"no" */ ++ char *http_proxy; /* "http://host:port" */ ++ char *https_proxy; /* "http://host:port" */ ++ char *ftp_proxy; /* "http://host:port" */ ++ /* char *gopher_proxy; Gnome doesn't have a Gopher proxy setting as of 2.10 */ ++ char *no_proxy; /* "www.me.de, do.main, localhost" */ ++ /* char *user; ++ * char *password; ++ * Yast2 currently doesn't support a public username/password; they are just ++ * stored in /root/.wgetrc and /root/.curlrc ++ */ +} SystemSettings; + -+typedef struct { -+ GnomeSettingsModule parent; -+} GnomeSettingsModuleProxy; ++static void gsd_proxy_manager_class_init (GsdProxyManagerClass *klass); ++static void gsd_proxy_manager_init (GsdProxyManager *proxy_manager); ++static void gsd_proxy_manager_finalize (GObject *object); + -+typedef struct { -+ GnomeSettingsModuleClass parent_class; -+} GnomeSettingsModuleProxyClass; ++G_DEFINE_TYPE (GsdProxyManager, gsd_proxy_manager, G_TYPE_OBJECT) + -+static GnomeSettingsModuleRunlevel gnome_settings_module_proxy_get_runlevel (GnomeSettingsModule *module); -+static gboolean gnome_settings_module_proxy_initialize (GnomeSettingsModule *module, GConfClient *config_client); -+static gboolean gnome_settings_module_proxy_start (GnomeSettingsModule *module); -+static gboolean gnome_settings_module_proxy_stop (GnomeSettingsModule *module); -+ -+static void -+gnome_settings_module_proxy_class_init (GnomeSettingsModuleProxyClass *klass) -+{ -+ GnomeSettingsModuleClass *module_class; -+ -+ module_class = (GnomeSettingsModuleClass *) klass; -+ module_class->get_runlevel = gnome_settings_module_proxy_get_runlevel; -+ module_class->initialize = gnome_settings_module_proxy_initialize; -+ module_class->start = gnome_settings_module_proxy_start; -+ module_class->stop = gnome_settings_module_proxy_stop; -+} -+ -+static void -+gnome_settings_module_proxy_init (GnomeSettingsModuleProxy *module) -+{ -+} -+ -+GType -+gnome_settings_module_proxy_get_type (void) -+{ -+ static GType module_type = 0; -+ -+ if (!module_type) { -+ const GTypeInfo module_info = { -+ sizeof (GnomeSettingsModuleProxyClass), -+ NULL, /* base_init */ -+ NULL, /* base_finalize */ -+ (GClassInitFunc) gnome_settings_module_proxy_class_init, -+ NULL, /* class_finalize */ -+ NULL, /* class_data */ -+ sizeof (GnomeSettingsModuleProxy), -+ 0, /* n_preallocs */ -+ (GInstanceInitFunc) gnome_settings_module_proxy_init, -+ }; -+ -+ module_type = g_type_register_static (GNOME_SETTINGS_TYPE_MODULE, -+ "GnomeSettingsModuleProxy", -+ &module_info, 0); -+ } -+ -+ return module_type; -+} ++static gpointer manager_object = NULL; + +/* Returns whether the /system/proxy/mode key has ever been set by the user */ +static gboolean @@ -318,11 +229,32 @@ Index: gnome-settings-daemon/gnome-settings-proxy.c + gconf_client_set_string (config_client, KEY_MODE, "none", NULL); +} + ++/* parses a URI to get the host and port */ ++static gboolean ++parse_uri (const gchar *uri, gchar **host, guint *port) ++{ ++ char **tokens; ++ ++ tokens = g_strsplit_set (uri, ":", 0); ++ if (tokens[1] != NULL) { ++ *host = g_strdup (tokens[1] + 2); ++ } ++ ++ if (tokens[2] != NULL) { ++ *port = (guint) atoi (tokens[2]); ++ } ++ ++ g_debug ("Proxy host: %s:%d", *host, *port); ++ ++ g_strfreev (tokens); ++} ++ +/* Copies the (enabled) system proxy settings in the user's settings */ +static void +copy_proxy_enabled (GConfClient *config_client, SystemSettings *settings) +{ -+ GnomeVFSURI *uri; ++ gchar *host; ++ guint port; + + gconf_client_set_string (config_client, KEY_MODE, "manual", NULL); + @@ -333,21 +265,14 @@ Index: gnome-settings-daemon/gnome-settings-proxy.c + gconf_client_set_string (config_client, KEY_HTTP_AUTHENTICATION_USER, "", NULL); + gconf_client_set_string (config_client, KEY_HTTP_AUTHENTICATION_PASSWORD, "", NULL); + -+ uri = gnome_vfs_uri_new (settings->http_proxy); -+ if (uri) ++ if (parse_uri (settings->http_proxy, &host, &port)) + { -+ const char *host; -+ guint port; -+ + gconf_client_set_bool (config_client, KEY_USE_HTTP_PROXY, TRUE, NULL); + -+ host = gnome_vfs_uri_get_host_name (uri); -+ port = gnome_vfs_uri_get_host_port (uri); -+ + gconf_client_set_string (config_client, KEY_HTTP_HOST, host, NULL); + gconf_client_set_int (config_client, KEY_HTTP_PORT, (int) port, NULL); + -+ gnome_vfs_uri_unref (uri); ++ g_free (host); + } + else + { @@ -359,19 +284,12 @@ Index: gnome-settings-daemon/gnome-settings-proxy.c + + /* 2. HTTPS proxy */ + -+ uri = gnome_vfs_uri_new (settings->https_proxy); -+ if (uri) ++ if (parse_uri (settings->https_proxy, &host, &port)) + { -+ const char *host; -+ guint port; -+ -+ host = gnome_vfs_uri_get_host_name (uri); -+ port = gnome_vfs_uri_get_host_port (uri); -+ + gconf_client_set_string (config_client, KEY_SECURE_HOST, host, NULL); + gconf_client_set_int (config_client, KEY_SECURE_PORT, (int) port, NULL); + -+ gnome_vfs_uri_unref (uri); ++ g_free (host); + } + else + { @@ -381,20 +299,12 @@ Index: gnome-settings-daemon/gnome-settings-proxy.c + + /* 3. FTP proxy */ + -+ uri = gnome_vfs_uri_new (settings->ftp_proxy); -+ -+ if (uri) ++ if (parse_uri (settings->ftp_proxy, &host, &port)) + { -+ const char *host; -+ guint port; -+ -+ host = gnome_vfs_uri_get_host_name (uri); -+ port = gnome_vfs_uri_get_host_port (uri); -+ + gconf_client_set_string (config_client, KEY_FTP_HOST, host, NULL); + gconf_client_set_int (config_client, KEY_FTP_PORT, (int) port, NULL); + -+ gnome_vfs_uri_unref (uri); ++ g_free (host); + } + else + { @@ -471,10 +381,12 @@ Index: gnome-settings-daemon/gnome-settings-proxy.c +static void +dir_proxy_key_changed_cb (GConfEntry *entry) +{ -+ GConfClient *client = gnome_settings_get_config_client (); ++ GConfClient *client = gconf_client_get_default (); + + if (strcmp (entry->key, KEY_USE_SYSTEM_SETTINGS) == 0) + use_system_settings_change (client, gconf_value_get_string (entry->value)); ++ ++ g_object_unref (client); +} + +static void @@ -492,142 +404,572 @@ Index: gnome-settings-daemon/gnome-settings-proxy.c + +/* File monitor callback for /etc/sysconfig/proxy */ +static void -+monitor_cb (GnomeVFSMonitorHandle *handle, -+ const gchar *monitor_uri, -+ const gchar *info_uri, -+ GnomeVFSMonitorEventType event_type, ++monitor_cb (GFileMonitor *monitor, ++ GFile *file, ++ GFile *other_file, ++ GFileMonitorEvent event_type, + gpointer data) +{ -+ if (event_type != GNOME_VFS_MONITOR_EVENT_CHANGED) ++ GConfClient *client; ++ ++ if (event_type != G_FILE_MONITOR_EVENT_CHANGED) + return; + -+ copy_system_values_if_needed ((GConfClient *) data); ++ client = gconf_client_get_default (); ++ copy_system_values_if_needed (client); ++ g_object_unref (G_OBJECT (client)); +} + -+static GnomeSettingsModuleRunlevel -+gnome_settings_module_proxy_get_runlevel (GnomeSettingsModule *module) ++gboolean ++gsd_proxy_manager_start (GsdProxyManager *manager, ++ GError **error) +{ -+ return GNOME_SETTINGS_MODULE_RUNLEVEL_SERVICES; -+} -+ -+ -+static gboolean -+gnome_settings_module_proxy_initialize (GnomeSettingsModule *module, GConfClient *config_client) -+{ -+ GConfClient *client = gnome_settings_module_get_config_client (module); -+ GnomeVFSMonitorHandle *monitor_handle; ++ GConfClient *config_client; ++ GFile *sysconfig_proxy; ++ GFileMonitor *monitor; + char *use_system_settings; + -+ /* The very first time g-s-d is run, we change the user's keys iff the new ++ g_debug ("Starting proxy manager"); ++ gnome_settings_profile_start (NULL); ++ ++ config_client = gconf_client_get_default (); ++ ++ /* The very first time g-s-d is run, we change the user's keys if the new + * use_system_settings key is not set at all or is set to the default. + * Afterwards, that key will be set to reflect what the user had previously + * configured. + */ + -+ use_system_settings = gconf_client_get_string (client, KEY_USE_SYSTEM_SETTINGS, NULL); ++ use_system_settings = gconf_client_get_string (config_client, KEY_USE_SYSTEM_SETTINGS, NULL); + if (!use_system_settings || strcmp (use_system_settings, VAL_USE_SYSTEM_SETTINGS_ONLY_IF_NOT_SET) == 0) + { + if (user_mode_is_set (config_client)) -+ gconf_client_set_string (client, KEY_USE_SYSTEM_SETTINGS, VAL_USE_SYSTEM_SETTINGS_USER_VALUES, NULL); ++ gconf_client_set_string (config_client, KEY_USE_SYSTEM_SETTINGS, VAL_USE_SYSTEM_SETTINGS_USER_VALUES, NULL); + else + { + copy_system_to_user (config_client); -+ gconf_client_set_string (client, KEY_USE_SYSTEM_SETTINGS, VAL_USE_SYSTEM_SETTINGS_SYSTEM_VALUES, NULL); ++ gconf_client_set_string (config_client, KEY_USE_SYSTEM_SETTINGS, VAL_USE_SYSTEM_SETTINGS_SYSTEM_VALUES, NULL); + } + } + + if (use_system_settings) + g_free (use_system_settings); + -+ gnome_settings_register_config_callback (DIR_PROXY, dir_proxy_key_changed_cb); ++ gconf_client_add_dir (config_client, DIR_PROXY, GCONF_CLIENT_PRELOAD_NONE, NULL); ++ gconf_client_notify_add (config_client, DIR_PROXY, dir_proxy_key_changed_cb, NULL, NULL, NULL); + -+ if (gnome_vfs_monitor_add (&monitor_handle, ETC_SYSCONFIG_PROXY_URI, GNOME_VFS_MONITOR_FILE, -+ monitor_cb, client) != GNOME_VFS_OK) -+ { -+ g_warning ("Could not install file monitor for /etc/sysconfig/proxy"); -+ /* Can we do any better than this? */ -+ } ++ sysconfig_proxy = g_file_new_for_uri (ETC_SYSCONFIG_PROXY_URI); ++ monitor = g_file_monitor_file (sysconfig_proxy, 0, NULL, NULL); ++ g_signal_connect (monitor, "changed", G_CALLBACK (monitor_cb), NULL); ++ ++ copy_system_values_if_needed (config_client); + -+ return TRUE; ++ g_object_unref (config_client); ++ ++ gnome_settings_profile_end (NULL); ++ ++ return TRUE; +} + -+static gboolean -+gnome_settings_module_proxy_start (GnomeSettingsModule *module) ++void ++gsd_proxy_manager_stop (GsdProxyManager *manager) +{ -+ GConfClient *client = gnome_settings_module_get_config_client (module); -+ -+ copy_system_values_if_needed (client); -+ -+ return TRUE; ++ g_debug ("Stopping proxy manager"); +} + -+static gboolean -+gnome_settings_module_proxy_stop (GnomeSettingsModule *module) ++static void ++gsd_proxy_manager_set_property (GObject *object, ++ guint prop_id, ++ const GValue *value, ++ GParamSpec *pspec) +{ -+ return TRUE; ++ GsdProxyManager *self; ++ ++ self = GSD_PROXY_MANAGER (object); ++ ++ switch (prop_id) { ++ default: ++ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); ++ break; ++ } +} -Index: gnome-settings-daemon/gnome-settings-daemon.c ++ ++static void ++gsd_proxy_manager_get_property (GObject *object, ++ guint prop_id, ++ GValue *value, ++ GParamSpec *pspec) ++{ ++ GsdProxyManager *self; ++ ++ self = GSD_PROXY_MANAGER (object); ++ ++ switch (prop_id) { ++ default: ++ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); ++ break; ++ } ++} ++ ++static GObject * ++gsd_proxy_manager_constructor (GType type, ++ guint n_construct_properties, ++ GObjectConstructParam *construct_properties) ++{ ++ GsdProxyManager *proxy_manager; ++ GsdProxyManagerClass *klass; ++ ++ klass = GSD_PROXY_MANAGER_CLASS (g_type_class_peek (GSD_TYPE_PROXY_MANAGER)); ++ ++ proxy_manager = GSD_PROXY_MANAGER (G_OBJECT_CLASS (gsd_proxy_manager_parent_class)->constructor (type, ++ n_construct_properties, ++ construct_properties)); ++ ++ return G_OBJECT (proxy_manager); ++} ++ ++static void ++gsd_proxy_manager_dispose (GObject *object) ++{ ++ GsdProxyManager *proxy_manager; ++ ++ proxy_manager = GSD_PROXY_MANAGER (object); ++ ++ G_OBJECT_CLASS (gsd_proxy_manager_parent_class)->dispose (object); ++} ++ ++static void ++gsd_proxy_manager_class_init (GsdProxyManagerClass *klass) ++{ ++ GObjectClass *object_class = G_OBJECT_CLASS (klass); ++ ++ object_class->get_property = gsd_proxy_manager_get_property; ++ object_class->set_property = gsd_proxy_manager_set_property; ++ object_class->constructor = gsd_proxy_manager_constructor; ++ object_class->dispose = gsd_proxy_manager_dispose; ++ object_class->finalize = gsd_proxy_manager_finalize; ++ ++ g_type_class_add_private (klass, sizeof (GsdProxyManagerPrivate)); ++} ++ ++static void ++gsd_proxy_manager_init (GsdProxyManager *manager) ++{ ++ manager->priv = GSD_PROXY_MANAGER_GET_PRIVATE (manager); ++} ++ ++static void ++gsd_proxy_manager_finalize (GObject *object) ++{ ++ GsdProxyManager *proxy_manager; ++ ++ g_return_if_fail (object != NULL); ++ g_return_if_fail (GSD_IS_PROXY_MANAGER (object)); ++ ++ proxy_manager = GSD_PROXY_MANAGER (object); ++ ++ g_return_if_fail (proxy_manager->priv != NULL); ++ ++ G_OBJECT_CLASS (gsd_proxy_manager_parent_class)->finalize (object); ++} ++ ++GsdProxyManager * ++gsd_proxy_manager_new (void) ++{ ++ if (manager_object != NULL) { ++ g_object_ref (manager_object); ++ } else { ++ manager_object = g_object_new (GSD_TYPE_PROXY_MANAGER, NULL); ++ g_object_add_weak_pointer (manager_object, ++ (gpointer *) &manager_object); ++ } ++ ++ return GSD_PROXY_MANAGER (manager_object); ++} +Index: plugins/proxy/gsd-proxy-plugin.c =================================================================== ---- gnome-settings-daemon/gnome-settings-daemon.c (revision 7885) -+++ gnome-settings-daemon/gnome-settings-daemon.c (working copy) -@@ -54,6 +54,7 @@ - GType gnome_settings_module_typing_break_get_type (void); - GType gnome_settings_module_xrdb_get_type (void); - GType gnome_settings_module_xsettings_get_type (void); -+GType gnome_settings_module_proxy_get_type (void); - - static GObject *parent_class = NULL; - XSettingsManager **managers = NULL; -@@ -199,7 +200,8 @@ - || !gnome_settings_module_sound_get_type () - || !gnome_settings_module_typing_break_get_type () - || !gnome_settings_module_xrdb_get_type () -- || !gnome_settings_module_xsettings_get_type ()) -+ || !gnome_settings_module_xsettings_get_type () -+ || !gnome_settings_module_proxy_get_type ()) - return; - - /* create hash table for loaded modules */ -Index: gnome-settings-daemon/Makefile.am +--- plugins/proxy/gsd-proxy-plugin.c (revision 0) ++++ plugins/proxy/gsd-proxy-plugin.c (revision 0) +@@ -0,0 +1,103 @@ ++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- ++ * ++ * Copyright (C) 2008 Rodrigo Moya ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2, or (at your option) ++ * any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ * ++ */ ++ ++#include "config.h" ++ ++#include ++#include ++ ++#include "gnome-settings-plugin.h" ++#include "gsd-proxy-plugin.h" ++#include "gsd-proxy-manager.h" ++ ++struct GsdProxyPluginPrivate { ++ GsdProxyManager *manager; ++}; ++ ++#define GSD_PROXY_PLUGIN_GET_PRIVATE(object) (G_TYPE_INSTANCE_GET_PRIVATE ((object), GSD_TYPE_PROXY_PLUGIN, GsdProxyPluginPrivate)) ++ ++GNOME_SETTINGS_PLUGIN_REGISTER (GsdProxyPlugin, gsd_proxy_plugin) ++ ++static void ++gsd_proxy_plugin_init (GsdProxyPlugin *plugin) ++{ ++ plugin->priv = GSD_PROXY_PLUGIN_GET_PRIVATE (plugin); ++ ++ g_debug ("GsdProxyPlugin initializing"); ++ ++ plugin->priv->manager = gsd_proxy_manager_new (); ++} ++ ++static void ++gsd_proxy_plugin_finalize (GObject *object) ++{ ++ GsdProxyPlugin *plugin; ++ ++ g_return_if_fail (object != NULL); ++ g_return_if_fail (GSD_IS_PROXY_PLUGIN (object)); ++ ++ g_debug ("GsdProxyPlugin finalizing"); ++ ++ plugin = GSD_PROXY_PLUGIN (object); ++ ++ g_return_if_fail (plugin->priv != NULL); ++ ++ if (plugin->priv->manager != NULL) { ++ g_object_unref (plugin->priv->manager); ++ } ++ ++ G_OBJECT_CLASS (gsd_proxy_plugin_parent_class)->finalize (object); ++} ++ ++static void ++impl_activate (GnomeSettingsPlugin *plugin) ++{ ++ gboolean res; ++ GError *error; ++ ++ g_debug ("Activating proxy plugin"); ++ ++ error = NULL; ++ res = gsd_proxy_manager_start (GSD_PROXY_PLUGIN (plugin)->priv->manager, &error); ++ if (! res) { ++ g_warning ("Unable to start proxy manager: %s", error->message); ++ g_error_free (error); ++ } ++} ++ ++static void ++impl_deactivate (GnomeSettingsPlugin *plugin) ++{ ++ g_debug ("Deactivating proxy plugin"); ++} ++ ++static void ++gsd_proxy_plugin_class_init (GsdProxyPluginClass *klass) ++{ ++ GObjectClass *object_class = G_OBJECT_CLASS (klass); ++ GnomeSettingsPluginClass *plugin_class = GNOME_SETTINGS_PLUGIN_CLASS (klass); ++ ++ object_class->finalize = gsd_proxy_plugin_finalize; ++ ++ plugin_class->activate = impl_activate; ++ plugin_class->deactivate = impl_deactivate; ++ ++ g_type_class_add_private (klass, sizeof (GsdProxyPluginPrivate)); ++} +Index: plugins/proxy/Makefile.am =================================================================== ---- gnome-settings-daemon/Makefile.am (revision 7885) -+++ gnome-settings-daemon/Makefile.am (working copy) -@@ -11,7 +11,8 @@ - -DGNOMELOCALEDIR="\"$(datadir)/locale\"" \ - -DGNOMECC_DATA_DIR="\"$(pkgdatadir)\"" \ - -DGNOMECC_GLADE_DIR="\"$(pkgdatadir)/glade\"" \ -- -DGNOMECC_PIXMAPS_DIR="\"$(pkgdatadir)/pixmaps\"" -+ -DGNOMECC_PIXMAPS_DIR="\"$(pkgdatadir)/pixmaps\"" \ -+ -DLIBEXECDIR="\"$(libexecdir)\"" - - libexec_PROGRAMS=gnome-settings-daemon - -@@ -50,6 +51,7 @@ - gnome-settings-xsettings.c \ - gsd-media-keys-window.c \ - gsd-media-keys-window.h \ -+ gnome-settings-proxy.c \ - list.c \ - list.h \ - reaper.c \ -@@ -91,6 +93,11 @@ - Gladedir = $(pkgdatadir)/glade - Glade_DATA = modmap-dialog.glade - +--- plugins/proxy/Makefile.am (revision 0) ++++ plugins/proxy/Makefile.am (revision 0) +@@ -0,0 +1,57 @@ ++NULL = ++ ++plugin_LTLIBRARIES = \ ++ libproxy.la \ ++ $(NULL) ++ ++libproxy_la_SOURCES = \ ++ gsd-proxy-plugin.h \ ++ gsd-proxy-plugin.c \ ++ gsd-proxy-manager.h \ ++ gsd-proxy-manager.c \ ++ $(NULL) ++ ++libproxy_la_CPPFLAGS = \ ++ -I$(top_srcdir)/gnome-settings-daemon \ ++ -DGNOME_SETTINGS_LOCALEDIR=\""$(datadir)/locale"\" \ ++ $(AM_CPPFLAGS) ++ ++libproxy_la_CFLAGS = \ ++ $(SETTINGS_PLUGIN_CFLAGS) \ ++ -DLIBEXECDIR="\"$(libexecdir)\"" \ ++ $(AM_CFLAGS) ++ ++libproxy_la_LDFLAGS = \ ++ $(GSD_PLUGIN_LDFLAGS) \ ++ $(NULL) ++ ++libproxy_la_LIBADD = \ ++ $(SETTINGS_PLUGIN_LIBS) \ ++ $(NULL) ++ ++plugin_in_files = \ ++ proxy.gnome-settings-plugin.in \ ++ $(NULL) ++ ++plugin_DATA = $(plugin_in_files:.gnome-settings-plugin.in=.gnome-settings-plugin) ++ +helperdir = $(libexecdir) +helperfile = novell-sysconfig-proxy-helper + +install-data-hook : + $(INSTALL_SCRIPT) $(srcdir)/$(helperfile) $(DESTDIR)$(libexecdir)/$(helperfile) - Dbusapidir = $(includedir)/gnome-settings-daemon-2.0/gnome-settings-daemon - Dbusapi_DATA = gnome-settings-client.h ++ ++EXTRA_DIST = \ ++ $(plugin_in_files) \ ++ $(helperfile) \ ++ $(NULL) ++ ++CLEANFILES = \ ++ $(plugin_DATA) \ ++ $(NULL) ++ ++DISTCLEANFILES = \ ++ $(plugin_DATA) \ ++ $(NULL) ++ ++@GSD_INTLTOOL_PLUGIN_RULE@ +Index: plugins/proxy/gsd-proxy-manager.h +=================================================================== +--- plugins/proxy/gsd-proxy-manager.h (revision 0) ++++ plugins/proxy/gsd-proxy-manager.h (revision 0) +@@ -0,0 +1,57 @@ ++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- ++ * ++ * Copyright (C) 2008 Rodrigo Moya ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ * ++ */ ++ ++#ifndef __GSD_PROXY_MANAGER_H ++#define __GSD_PROXY_MANAGER_H ++ ++#include ++ ++G_BEGIN_DECLS ++ ++#define GSD_TYPE_PROXY_MANAGER (gsd_proxy_manager_get_type ()) ++#define GSD_PROXY_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSD_TYPE_PROXY_MANAGER, GsdProxyManager)) ++#define GSD_PROXY_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GSD_TYPE_PROXY_MANAGER, GsdProxyManagerClass)) ++#define GSD_IS_PROXY_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSD_TYPE_PROXY_MANAGER)) ++#define GSD_IS_PROXY_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GSD_TYPE_PROXY_MANAGER)) ++#define GSD_PROXY_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GSD_TYPE_PROXY_MANAGER, GsdProxyManagerClass)) ++ ++typedef struct GsdProxyManagerPrivate GsdProxyManagerPrivate; ++ ++typedef struct ++{ ++ GObject parent; ++ GsdProxyManagerPrivate *priv; ++} GsdProxyManager; ++ ++typedef struct ++{ ++ GObjectClass parent_class; ++} GsdProxyManagerClass; ++ ++GType gsd_proxy_manager_get_type (void); ++ ++GsdProxyManager * gsd_proxy_manager_new (void); ++gboolean gsd_proxy_manager_start (GsdProxyManager *manager, ++ GError **error); ++void gsd_proxy_manager_stop (GsdProxyManager *manager); ++ ++G_END_DECLS ++ ++#endif /* __GSD_PROXY_MANAGER_H */ +Index: plugins/proxy/novell-sysconfig-proxy-helper +=================================================================== +--- plugins/proxy/novell-sysconfig-proxy-helper (revision 0) ++++ plugins/proxy/novell-sysconfig-proxy-helper (revision 0) +@@ -0,0 +1,19 @@ ++#!/bin/sh ++ ++if [ ! -f /etc/sysconfig/proxy ] ++then ++ exit 0 ++fi ++ ++source /etc/sysconfig/proxy ++ ++# This may look convoluted, but it's an easy way to let random shell ++# script code appear in /etc/sysconfig/proxy and still let user code ++# read the variables in it easily. ++ ++echo "PROXY_ENABLED $PROXY_ENABLED" ++echo "HTTP_PROXY $HTTP_PROXY" ++echo "HTTPS_PROXY $HTTPS_PROXY" ++echo "FTP_PROXY $FTP_PROXY" ++echo "GOPHER_PROXY $GOPHER_PROXY" ++echo "NO_PROXY $NO_PROXY" +Index: plugins/proxy/gsd-proxy-plugin.h +=================================================================== +--- plugins/proxy/gsd-proxy-plugin.h (revision 0) ++++ plugins/proxy/gsd-proxy-plugin.h (revision 0) +@@ -0,0 +1,59 @@ ++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- ++ * ++ * Copyright (C) 2008 Rodrigo Moya ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2, or (at your option) ++ * any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ * ++ */ ++ ++#ifndef __GSD_PROXY_PLUGIN_H__ ++#define __GSD_PROXY_PLUGIN_H__ ++ ++#include ++#include ++#include ++ ++#include "gnome-settings-plugin.h" ++ ++G_BEGIN_DECLS ++ ++#define GSD_TYPE_PROXY_PLUGIN (gsd_proxy_plugin_get_type ()) ++#define GSD_PROXY_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSD_TYPE_PROXY_PLUGIN, GsdProxyPlugin)) ++#define GSD_PROXY_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GSD_TYPE_PROXY_PLUGIN, GsdProxyPluginClass)) ++#define GSD_IS_PROXY_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSD_TYPE_PROXY_PLUGIN)) ++#define GSD_IS_PROXY_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GSD_TYPE_PROXY_PLUGIN)) ++#define GSD_PROXY_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GSD_TYPE_PROXY_PLUGIN, GsdProxyPluginClass)) ++ ++typedef struct GsdProxyPluginPrivate GsdProxyPluginPrivate; ++ ++typedef struct ++{ ++ GnomeSettingsPlugin parent; ++ GsdProxyPluginPrivate *priv; ++} GsdProxyPlugin; ++ ++typedef struct ++{ ++ GnomeSettingsPluginClass parent_class; ++} GsdProxyPluginClass; ++ ++GType gsd_proxy_plugin_get_type (void) G_GNUC_CONST; ++ ++/* All the plugins must implement this function */ ++G_MODULE_EXPORT GType register_gnome_settings_plugin (GTypeModule *module); ++ ++G_END_DECLS ++ ++#endif /* __GSD_PROXY_PLUGIN_H__ */ +Index: plugins/Makefile.am +=================================================================== +--- plugins/Makefile.am (revision 328) ++++ plugins/Makefile.am (working copy) +@@ -10,6 +10,7 @@ + keyboard \ + media-keys \ + mouse \ ++ proxy \ + screensaver \ + sound \ + typing-break \ +Index: configure.ac +=================================================================== +--- configure.ac (revision 328) ++++ configure.ac (working copy) +@@ -414,6 +414,7 @@ + plugins/media-keys/Makefile + plugins/media-keys/actions/Makefile + plugins/mouse/Makefile ++plugins/proxy/Makefile + plugins/screensaver/Makefile + plugins/sound/Makefile + plugins/sound/libsounds/Makefile +Index: data/Makefile.am +=================================================================== +--- data/Makefile.am (revision 328) ++++ data/Makefile.am (working copy) +@@ -8,6 +8,7 @@ + apps_gnome_settings_daemon_keybindings.schemas.in \ + apps_gnome_settings_daemon_screensaver.schemas.in \ + desktop_gnome_font_rendering.schemas.in \ ++ system_proxy.schemas.in \ + $(NULL) -@@ -116,7 +123,7 @@ - org.gnome.SettingsDaemon.service: org.gnome.SettingsDaemon.service.in Makefile - @sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@ - --EXTRA_DIST = $(Glade_DATA) $(Dbusapi_DATA) \ -+EXTRA_DIST = $(Glade_DATA) $(Dbusapi_DATA) $(helperfile) \ - gnome-settings-daemon.pc.in gsd-infos.xml \ - org.gnome.SettingsDaemon.service.in gnome-settings-marshal.list - CLEANFILES = $(BUILT_SOURCES) $(service_DATA) + schemas_DATA = $(schemas_in_files:.schemas.in=.schemas) +Index: data/system_proxy.schemas.in +=================================================================== +--- data/system_proxy.schemas.in (revision 0) ++++ data/system_proxy.schemas.in (revision 0) +@@ -0,0 +1,26 @@ ++ ++ ++ ++ ++ /schemas/system/proxy/use_system_settings ++ /system/proxy/use_system_settings ++ string ++ only_if_mode_not_set ++ ++ Use the system's proxy settings ++ Whether to use the system's proxy settings. ++ Possible values are "only_if_mode_not_set", "system_values", and ++ "user_values". The first one is the default value; in ++ it, the system's proxy settings will be used if and ++ only if the user has never set his /system/proxy/mode ++ key. Once the user sets that key, use_system_settings ++ will switch to "system_values", which indicates that ++ the system's proxy settings should be used, or ++ "user_values", which indicates that the user's ++ settings should be used. The key will alternate ++ between these last two values in the future and will ++ not go back to the default value. ++ ++ ++ ++ diff --git a/gnome-settings-daemon.changes b/gnome-settings-daemon.changes index 91a53df..d7b14f7 100644 --- a/gnome-settings-daemon.changes +++ b/gnome-settings-daemon.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Apr 30 19:51:08 CEST 2008 - rodrigo@suse.de + +- Updated gnome-settings-daemon-system-proxy-configuration.patch + to make it apply again + ------------------------------------------------------------------- Fri Apr 25 18:44:45 CEST 2008 - federico@novell.com diff --git a/gnome-settings-daemon.spec b/gnome-settings-daemon.spec index d701942..f1587f0 100644 --- a/gnome-settings-daemon.spec +++ b/gnome-settings-daemon.spec @@ -17,10 +17,10 @@ BuildRequires: fdupes gnome-common gnome-desktop-devel gnome-patch-translation License: GPL v2 or later Group: System/GUI/GNOME Version: 2.22.1 -Release: 7 +Release: 11 Summary: Settings daemon for the GNOME desktop Source: %{_name}-%{version}.tar.bz2 -# PATCH-NEEDS-REBASE gnome-settings-daemon-system-proxy-configuration.patch +# PATCH-FEATURE-OPENSUSE gnome-settings-daemon-system-proxy-configuration.patch Patch2: %{name}-system-proxy-configuration.patch # PATCH-FEATURE-UPSTREAM gnome-settings-daemon-1.2.diff -- Add support for RandR 1.2 to the daemon. federico@novell.com Patch3: gnome-settings-daemon-randr-1.2.diff @@ -77,7 +77,7 @@ Authors: %prep %setup -q -n %{_name}-%{version} #gnome-patch-translation-prepare -#%patch2 +%patch2 %patch3 -p1 #gnome-patch-translation-update @@ -130,6 +130,9 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/pkgconfig/*.pc %changelog +* Wed Apr 30 2008 rodrigo@suse.de +- Updated gnome-settings-daemon-system-proxy-configuration.patch + to make it apply again * Fri Apr 25 2008 federico@novell.com - Added gnome-settings-daemon-randr-1.2.diff to integrate the new functionality to configure RandR 1.2.