Accepting request 77402 from home:gary_lin:branches:GNOME:Factory
- Rebase gnome-settings-daemon-system-proxy-configuration.diff and gnome-settings-daemon-bnc462640-mute-action.patch and enable the the call to autoreconf. - Add gnome-settings-daemon-stop-reload-proxy-settings.patch to stop the g-s-d packagekit plugin, to pop up the authentication for reloading the proxy settings (bnc#689592#c1 for bnc#538353) - Rebase gnome-packagekit-fate302445.patch and migrate to gsettings OBS-URL: https://build.opensuse.org/request/show/77402 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/gnome-settings-daemon?expand=0&rev=97
This commit is contained in:
parent
7114b69f98
commit
224deb0f47
@ -1,120 +1,133 @@
|
||||
Index: gnome-packagekit-2.91.4/src/gpk-update-icon.c
|
||||
===================================================================
|
||||
--- gnome-packagekit-2.91.4.orig/src/gpk-update-icon.c
|
||||
+++ gnome-packagekit-2.91.4/src/gpk-update-icon.c
|
||||
@@ -48,6 +48,78 @@ static GpkFirmware *firmware = NULL;
|
||||
static GpkHardware *hardware = NULL;
|
||||
static guint timer_id = 0;
|
||||
static gboolean timed_exit = FALSE;
|
||||
+static GSettings *settings = NULL;
|
||||
diff --git a/data/gnome-settings-daemon.convert b/data/gnome-settings-daemon.convert
|
||||
index 9ecc65f..5a6efbc 100644
|
||||
--- a/data/gnome-settings-daemon.convert
|
||||
+++ b/data/gnome-settings-daemon.convert
|
||||
@@ -93,6 +93,9 @@ priority = /apps/gnome_settings_daemon/plugins/smartcard/priority
|
||||
active = /apps/gnome_settings_daemon/plugins/sound/active
|
||||
priority = /apps/gnome_settings_daemon/plugins/sound/priority
|
||||
|
||||
+[org.gnome.settings-daemon.plugins.updates]
|
||||
+asked-to-collect-hardware-info = /apps/gnome-packagekit/updater_asked_to_collect_hardware_information
|
||||
+
|
||||
+#define GPK_UPDATE_HARDWARE_SEND_ACTION "gpk-update-icon hardware info - send "
|
||||
+#define GPK_UPDATE_HARDWARE_DONT_PROMPT_ACTION "gpk-update-icon hardware info - don't ask again"
|
||||
[org.gnome.settings-daemon.plugins.xrandr]
|
||||
active = /apps/gnome_settings_daemon/plugins/xrandr/active
|
||||
default-configuration-file = /apps/gnome_settings_daemon/xrandr/default_configuration_file
|
||||
diff --git a/data/org.gnome.settings-daemon.plugins.updates.gschema.xml.in.in b/data/org.gnome.settings-daemon.plugins.updates.gschema.xml.in.in
|
||||
index c09096a..67081e2 100644
|
||||
--- a/data/org.gnome.settings-daemon.plugins.updates.gschema.xml.in.in
|
||||
+++ b/data/org.gnome.settings-daemon.plugins.updates.gschema.xml.in.in
|
||||
@@ -120,5 +120,10 @@
|
||||
<_summary>The filenames on removable media that designate it a software source.</_summary>
|
||||
<_description>When removable media is inserted, it is checked to see if it contains any important filenames in the root directory. If the filename matches, then an updates check is performed. This allows post-install disks to be used to update running systems.</_description>
|
||||
</key>
|
||||
+ <key name="asked-to-collect-hardware-info" type="b">
|
||||
+ <default>false</default>
|
||||
+ <_summary>Whether the hardware information collection is asked</_summary>
|
||||
+ <_description>Whether the hardware information collection is asked</_description>
|
||||
+ </key>
|
||||
</schema>
|
||||
</schemalist>
|
||||
diff --git a/plugins/updates/gsd-updates-manager.c b/plugins/updates/gsd-updates-manager.c
|
||||
index 5c193e9..b1abcc5 100644
|
||||
--- a/plugins/updates/gsd-updates-manager.c
|
||||
+++ b/plugins/updates/gsd-updates-manager.c
|
||||
@@ -35,6 +35,10 @@
|
||||
#include "gsd-updates-common.h"
|
||||
#include "gnome-settings-profile.h"
|
||||
|
||||
+#define GSD_UPDATES_HARDWARE_SEND_ACTION "gsd-updates hardware info - send "
|
||||
+#define GSD_UPDATES_HARDWARE_DONT_PROMPT_ACTION "gsd-updates hardware info - don't ask again"
|
||||
+#define GSD_SETTINGS_HARDWARE_ASKED_TO_COLLECT "asked-to-collect-hardware-info"
|
||||
+
|
||||
#define GSD_UPDATES_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSD_TYPE_UPDATES_MANAGER, GsdUpdatesManagerPrivate))
|
||||
|
||||
#define MAX_FAILED_GET_UPDATES 10 /* the maximum number of tries */
|
||||
@@ -1308,6 +1312,79 @@ on_bus_gotten (GObject *source_object,
|
||||
NULL);
|
||||
}
|
||||
|
||||
+static void
|
||||
+gpk_update_libnotify_cb (NotifyNotification *notification, gchar *action, gpointer data)
|
||||
+gsd_updates_libnotify_cb (NotifyNotification *notification,
|
||||
+ gchar *action,
|
||||
+ gpointer data)
|
||||
+{
|
||||
+ if (g_strcmp0 (action, GPK_UPDATE_HARDWARE_SEND_ACTION ) == 0) {
|
||||
+ gboolean retval = g_spawn_command_line_async ("/usr/bin/smoltGui", NULL);
|
||||
+ if (!retval) {
|
||||
+ g_debug ("Failure launching smoltGui");
|
||||
+ }
|
||||
+ g_debug ("set %s to TRUE because done", GPK_SETTINGS_HARDWARE_ASKED_TO_COLLECT);
|
||||
+ g_settings_set_boolean (settings, GPK_SETTINGS_HARDWARE_ASKED_TO_COLLECT, TRUE);
|
||||
+ } else if (g_strcmp0 (action, GPK_UPDATE_HARDWARE_DONT_PROMPT_ACTION) == 0) {
|
||||
+ g_debug ("set %s to TRUE because user said no", GPK_SETTINGS_HARDWARE_ASKED_TO_COLLECT);
|
||||
+ g_settings_set_boolean (settings, GPK_SETTINGS_HARDWARE_ASKED_TO_COLLECT, TRUE);
|
||||
+ } else {
|
||||
+ g_warning ("unknown action id: %s", action);
|
||||
+ }
|
||||
+ GsdUpdatesManager *manager = GSD_UPDATES_MANAGER (data);
|
||||
+
|
||||
+ if (g_strcmp0 (action, GSD_UPDATES_HARDWARE_SEND_ACTION ) == 0) {
|
||||
+ gboolean retval = g_spawn_command_line_async ("/usr/bin/smoltGui", NULL);
|
||||
+ if (!retval) {
|
||||
+ g_debug ("Failure launching smoltGui");
|
||||
+ }
|
||||
+ g_debug ("set %s to TRUE because done", GSD_SETTINGS_HARDWARE_ASKED_TO_COLLECT);
|
||||
+ g_settings_set_boolean (manager->priv->settings_gsd, GSD_SETTINGS_HARDWARE_ASKED_TO_COLLECT, TRUE);
|
||||
+ } else if (g_strcmp0 (action, GSD_UPDATES_HARDWARE_DONT_PROMPT_ACTION) == 0) {
|
||||
+ g_debug ("set %s to TRUE because user said no", GSD_SETTINGS_HARDWARE_ASKED_TO_COLLECT);
|
||||
+ g_settings_set_boolean (manager->priv->settings_gsd, GSD_SETTINGS_HARDWARE_ASKED_TO_COLLECT, TRUE);
|
||||
+ } else {
|
||||
+ g_warning ("unknown action id: %s", action);
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
+
|
||||
+static gboolean
|
||||
+check_for_collect_hardware_information (gpointer data)
|
||||
+check_for_collect_hardware_information (gpointer *data)
|
||||
+{
|
||||
+ gboolean asked_to_collect = FALSE;
|
||||
+ GsdUpdatesManager *manager = GSD_UPDATES_MANAGER (data);
|
||||
+ gboolean asked_to_collect = FALSE;
|
||||
+
|
||||
+ NotifyNotification *notification;
|
||||
+ GError *error = NULL;
|
||||
+ gchar *body, *summary;
|
||||
+ //gchar *body2;
|
||||
+ gboolean ret;
|
||||
+ NotifyNotification *notification;
|
||||
+ GError *error = NULL;
|
||||
+ gchar *body, *summary;
|
||||
+ //gchar *body2;
|
||||
+ gboolean ret;
|
||||
+
|
||||
+ asked_to_collect = g_settings_get_boolean (settings, GPK_SETTINGS_HARDWARE_ASKED_TO_COLLECT);
|
||||
+ asked_to_collect = g_settings_get_boolean (manager->priv->settings_gsd, GSD_SETTINGS_HARDWARE_ASKED_TO_COLLECT);
|
||||
+
|
||||
+ if (asked_to_collect) {
|
||||
+ g_debug ("don't collect hardware info because already done");
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+ if (asked_to_collect) {
|
||||
+ g_debug ("don't collect hardware info because already done");
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ if (! g_file_test ("/var/run/smolt_do_opensuse_run", G_FILE_TEST_EXISTS)) {
|
||||
+ g_debug ("don't collect hardware info yet until smolt is updated - BNC#450105");
|
||||
+ return TRUE;
|
||||
+ }
|
||||
+ if (! g_file_test ("/usr/bin/smoltGui", G_FILE_TEST_EXISTS)) {
|
||||
+ g_debug ("don't collect hardware info because smoltGui is not installed");
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+ if (! g_file_test ("/var/run/smolt_do_opensuse_run", G_FILE_TEST_EXISTS)) {
|
||||
+ g_debug ("don't collect hardware info yet until smolt is updated - BNC#450105");
|
||||
+ return TRUE;
|
||||
+ }
|
||||
+ if (! g_file_test ("/usr/bin/smoltGui", G_FILE_TEST_EXISTS)) {
|
||||
+ g_debug ("don't collect hardware info because smoltGui is not installed");
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ summary = g_strdup_printf ("%s", _("openSUSE Updater"));
|
||||
+ //body = g_strdup_printf ("%s", _("Driver development is prioritized based on hardware popularity.<br>Please send your system profile to influence this work."));
|
||||
+ body = g_strdup_printf ("%s", _("Driver development is prioritized based on hardware popularity. Please send your system profile to influence this work."));
|
||||
+ //body2 = g_markup_escape_text (body, -1);
|
||||
+ notification = notify_notification_new (summary, body, "help-browser");
|
||||
+ notify_notification_set_timeout (notification, NOTIFY_EXPIRES_NEVER);
|
||||
+ notify_notification_set_urgency (notification, NOTIFY_URGENCY_LOW);
|
||||
+ notify_notification_add_action (notification, GPK_UPDATE_HARDWARE_SEND_ACTION,
|
||||
+ _("Send now"), gpk_update_libnotify_cb, NULL, NULL);
|
||||
+ notify_notification_add_action (notification, GPK_UPDATE_HARDWARE_DONT_PROMPT_ACTION,
|
||||
+ _("Do not show this again"), gpk_update_libnotify_cb, NULL, NULL);
|
||||
+ ret = notify_notification_show (notification, &error);
|
||||
+ if (!ret) {
|
||||
+ g_warning ("error: %s", error->message);
|
||||
+ g_error_free (error);
|
||||
+ }
|
||||
+ summary = g_strdup_printf ("%s", _("openSUSE Updater"));
|
||||
+ //body = g_strdup_printf ("%s", _("Driver development is prioritized based on hardware popularity.<br>Please send your system profile to influence this work."));
|
||||
+ body = g_strdup_printf ("%s", _("Driver development is prioritized based on hardware popularity. Please send your system profile to influence this work."));
|
||||
+ //body2 = g_markup_escape_text (body, -1);
|
||||
+ notification = notify_notification_new (summary, body, "help-browser");
|
||||
+ notify_notification_set_timeout (notification, NOTIFY_EXPIRES_NEVER);
|
||||
+ notify_notification_set_urgency (notification, NOTIFY_URGENCY_LOW);
|
||||
+ notify_notification_add_action (notification, GSD_UPDATES_HARDWARE_SEND_ACTION,
|
||||
+ _("Send now"), gsd_updates_libnotify_cb, (gpointer)manager, NULL);
|
||||
+ notify_notification_add_action (notification, GSD_UPDATES_HARDWARE_DONT_PROMPT_ACTION,
|
||||
+ _("Do not show this again"), gsd_updates_libnotify_cb, (gpointer)manager, NULL);
|
||||
+ ret = notify_notification_show (notification, &error);
|
||||
+ if (!ret) {
|
||||
+ g_warning ("error: %s", error->message);
|
||||
+ g_error_free (error);
|
||||
+ }
|
||||
+
|
||||
+ g_free (summary);
|
||||
+ g_free (body);
|
||||
+ return FALSE;
|
||||
+ g_free (summary);
|
||||
+ g_free (body);
|
||||
+ return FALSE;
|
||||
+}
|
||||
+
|
||||
gboolean
|
||||
gsd_updates_manager_start (GsdUpdatesManager *manager,
|
||||
GError **error)
|
||||
@@ -1406,6 +1483,8 @@ gsd_updates_manager_start (GsdUpdatesManager *manager,
|
||||
(GAsyncReadyCallback) on_bus_gotten,
|
||||
manager);
|
||||
|
||||
/**
|
||||
* gpk_icon_timed_exit_cb:
|
||||
@@ -70,11 +142,14 @@ gpk_icon_startup_cb (GtkApplication *app
|
||||
watch = gpk_watch_new ();
|
||||
firmware = gpk_firmware_new ();
|
||||
hardware = gpk_hardware_new ();
|
||||
+ settings = g_settings_new (GPK_SETTINGS_SCHEMA);
|
||||
|
||||
/* Only timeout if we have specified iton the command line */
|
||||
if (timed_exit) {
|
||||
timer_id = g_timeout_add_seconds (120, (GSourceFunc) gpk_icon_timed_exit_cb, application);
|
||||
g_source_set_name_by_id (timer_id, "[GpkUpdateIcon] timed exit");
|
||||
+ } else {
|
||||
+ g_timeout_add_seconds (5 * 60, check_for_collect_hardware_information, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
Index: gnome-packagekit-2.91.4/data/org.gnome.packagekit.gschema.migrate
|
||||
===================================================================
|
||||
--- gnome-packagekit-2.91.4.orig/data/org.gnome.packagekit.gschema.migrate
|
||||
+++ gnome-packagekit-2.91.4/data/org.gnome.packagekit.gschema.migrate
|
||||
@@ -45,4 +45,4 @@ dbus-default-interaction = /apps/gnome-p
|
||||
dbus-enforced-interaction = /apps/gnome-packagekit/dbus_enforced_interaction
|
||||
install-root = /apps/gnome-packagekit/install_root
|
||||
media-repo-filenames = /apps/gnome-packagekit/media_repo_filenames
|
||||
-
|
||||
+updater-asked-to-collect-hardware-information = /apps/gnome-packagekit/updater_asked_to_collect_hardware_information
|
||||
Index: gnome-packagekit-2.91.4/src/gpk-common.h
|
||||
===================================================================
|
||||
--- gnome-packagekit-2.91.4.orig/src/gpk-common.h
|
||||
+++ gnome-packagekit-2.91.4/src/gpk-common.h
|
||||
@@ -53,6 +53,7 @@ G_BEGIN_DECLS
|
||||
#define GPK_SETTINGS_FREQUENCY_GET_UPDATES "frequency-get-updates"
|
||||
#define GPK_SETTINGS_FREQUENCY_GET_UPGRADES "frequency-get-upgrades"
|
||||
#define GPK_SETTINGS_FREQUENCY_REFRESH_CACHE "frequency-refresh-cache"
|
||||
+#define GPK_SETTINGS_HARDWARE_ASKED_TO_COLLECT "updater-asked-to-collect-hardware-information"
|
||||
#define GPK_SETTINGS_IGNORED_DBUS_REQUESTS "ignored-dbus-requests"
|
||||
#define GPK_SETTINGS_IGNORED_DEVICES "ignored-devices"
|
||||
#define GPK_SETTINGS_IGNORED_MESSAGES "ignored-messages"
|
||||
+ g_timeout_add_seconds (5 * 60, check_for_collect_hardware_information, manager);
|
||||
+
|
||||
/* success */
|
||||
ret = TRUE;
|
||||
g_debug ("Started updates manager");
|
||||
|
@ -1,61 +1,52 @@
|
||||
Index: data/apps_gnome_settings_daemon_keybindings.schemas.in
|
||||
===================================================================
|
||||
--- data/apps_gnome_settings_daemon_keybindings.schemas.in.orig
|
||||
+++ data/apps_gnome_settings_daemon_keybindings.schemas.in
|
||||
@@ -25,6 +25,17 @@
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
+ <key>/schemas/apps/gnome_settings_daemon/toggle_mute</key>
|
||||
+ <applyto>/apps/gnome_settings_daemon/toggle_mute</applyto>
|
||||
+ <type>bool</type>
|
||||
+ <default>TRUE</default>
|
||||
+ <locale name="C">
|
||||
+ <short>Toggle Mute</short>
|
||||
+ <long>Toggle the sound mixer's mute status when then mute button is pressed.</long>
|
||||
+ </locale>
|
||||
+ </schema>
|
||||
+
|
||||
+ <schema>
|
||||
<key>/schemas/apps/gnome_settings_daemon/keybindings/volume_mute</key>
|
||||
<applyto>/apps/gnome_settings_daemon/keybindings/volume_mute</applyto>
|
||||
<type>string</type>
|
||||
Index: plugins/media-keys/gsd-media-keys-manager.c
|
||||
===================================================================
|
||||
--- plugins/media-keys/gsd-media-keys-manager.c.orig
|
||||
+++ plugins/media-keys/gsd-media-keys-manager.c
|
||||
@@ -681,9 +681,11 @@ do_sound_action (GsdMediaKeysManager *ma
|
||||
int type)
|
||||
@@ -637,6 +637,7 @@ do_sound_action (GsdMediaKeysManager *ma
|
||||
gboolean quiet)
|
||||
{
|
||||
gboolean muted;
|
||||
gboolean old_muted, new_muted;
|
||||
+ gboolean toggle_mute;
|
||||
guint vol, norm_vol_step;
|
||||
int vol_step;
|
||||
guint old_vol, new_vol, max_vol, norm_vol_step;
|
||||
gboolean sound_changed;
|
||||
+ GError *error;
|
||||
|
||||
if (manager->priv->stream == NULL)
|
||||
return;
|
||||
@@ -704,7 +706,21 @@ do_sound_action (GsdMediaKeysManager *ma
|
||||
@@ -653,7 +654,11 @@ do_sound_action (GsdMediaKeysManager *ma
|
||||
|
||||
switch (type) {
|
||||
case MUTE_KEY:
|
||||
- muted = !muted;
|
||||
+ error = NULL;
|
||||
+ toggle_mute = gconf_client_get_bool (manager->priv->conf_client,
|
||||
+ GCONF_MISC_DIR "/toggle_mute",
|
||||
+ &error);
|
||||
+
|
||||
+ if (error) {
|
||||
+ toggle_mute = TRUE;
|
||||
+ g_error_free (error);
|
||||
+ }
|
||||
+
|
||||
- new_muted = !old_muted;
|
||||
+ toggle_mute = g_settings_get_boolean (manager->priv->settings, "toggle-mute");
|
||||
+ if (toggle_mute)
|
||||
+ muted = !muted;
|
||||
+ new_muted = !old_muted;
|
||||
+ else
|
||||
+ muted = TRUE;
|
||||
+
|
||||
gvc_mixer_stream_change_is_muted (manager->priv->stream, muted);
|
||||
sound_changed = TRUE;
|
||||
+ new_muted = TRUE;
|
||||
break;
|
||||
case VOLUME_DOWN_KEY:
|
||||
if (old_vol <= norm_vol_step) {
|
||||
Index: data/gnome-settings-daemon.convert
|
||||
===================================================================
|
||||
--- data/gnome-settings-daemon.convert.orig
|
||||
+++ data/gnome-settings-daemon.convert
|
||||
@@ -66,6 +66,7 @@ volume-down = /apps/gnome_settings_daemo
|
||||
volume-mute = /apps/gnome_settings_daemon/keybindings/volume_mute
|
||||
volume-up = /apps/gnome_settings_daemon/keybindings/volume_up
|
||||
www = /apps/gnome_settings_daemon/keybindings/www
|
||||
+toggle-mute = /apps/gnome_settings_daemon/toggle_mute
|
||||
|
||||
[org.gnome.settings-daemon.plugins.mouse]
|
||||
active = /apps/gnome_settings_daemon/plugins/mouse/active
|
||||
Index: data/org.gnome.settings-daemon.plugins.media-keys.gschema.xml.in.in
|
||||
===================================================================
|
||||
--- data/org.gnome.settings-daemon.plugins.media-keys.gschema.xml.in.in.orig
|
||||
+++ data/org.gnome.settings-daemon.plugins.media-keys.gschema.xml.in.in
|
||||
@@ -145,5 +145,10 @@
|
||||
<_summary>Magnifier zoom out</_summary>
|
||||
<_description>Binding for the magnifier to zoom out</_description>
|
||||
</key>
|
||||
+ <key name="toggle-mute" type="b">
|
||||
+ <default>true</default>
|
||||
+ <_summary>Toggle Mute</_summary>
|
||||
+ <_description>Toggle the sound mixer's mute status when then mute button is pressed.</_description>
|
||||
+ </key>
|
||||
</schema>
|
||||
</schemalist>
|
||||
|
20
gnome-settings-daemon-stop-reload-proxy-settings.patch
Normal file
20
gnome-settings-daemon-stop-reload-proxy-settings.patch
Normal file
@ -0,0 +1,20 @@
|
||||
diff --git a/plugins/updates/gsd-updates-manager.c b/plugins/updates/gsd-updates-manager.c
|
||||
index a81aa1f..5c193e9 100644
|
||||
--- a/plugins/updates/gsd-updates-manager.c
|
||||
+++ b/plugins/updates/gsd-updates-manager.c
|
||||
@@ -995,6 +995,7 @@ set_proxy_cb (GObject *object, GAsyncResult *res, gpointer user_data)
|
||||
static void
|
||||
reload_proxy_settings (GsdUpdatesManager *manager)
|
||||
{
|
||||
+#if 0
|
||||
gchar *proxy_http;
|
||||
gchar *proxy_ftp;
|
||||
|
||||
@@ -1011,6 +1012,7 @@ reload_proxy_settings (GsdUpdatesManager *manager)
|
||||
|
||||
g_free (proxy_http);
|
||||
g_free (proxy_ftp);
|
||||
+#endif
|
||||
}
|
||||
|
||||
static void
|
@ -24,8 +24,8 @@ GNOME's GConf keys.
|
||||
|
||||
Index: plugins/proxy/Makefile.am
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ plugins/proxy/Makefile.am 2010-01-13 16:44:52.000000000 +1100
|
||||
--- /dev/null
|
||||
+++ plugins/proxy/Makefile.am
|
||||
@@ -0,0 +1,57 @@
|
||||
+NULL =
|
||||
+
|
||||
@ -86,9 +86,9 @@ Index: plugins/proxy/Makefile.am
|
||||
+@GSD_INTLTOOL_PLUGIN_RULE@
|
||||
Index: plugins/proxy/gsd-proxy-manager.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ plugins/proxy/gsd-proxy-manager.c 2010-01-13 16:44:52.000000000 +1100
|
||||
@@ -0,0 +1,731 @@
|
||||
--- /dev/null
|
||||
+++ plugins/proxy/gsd-proxy-manager.c
|
||||
@@ -0,0 +1,733 @@
|
||||
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
|
||||
+ *
|
||||
+ * Copyright (C) 2008 Rodrigo Moya <rodrigo@gnome-db.org>
|
||||
@ -127,7 +127,6 @@ Index: plugins/proxy/gsd-proxy-manager.c
|
||||
+#include <gdk/gdk.h>
|
||||
+#include <gdk/gdkx.h>
|
||||
+#include <gtk/gtk.h>
|
||||
+#include <gconf/gconf-client.h>
|
||||
+
|
||||
+#include "gnome-settings-profile.h"
|
||||
+#include "gsd-proxy-manager.h"
|
||||
@ -135,7 +134,8 @@ Index: plugins/proxy/gsd-proxy-manager.c
|
||||
+#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 */
|
||||
+#define GSD_SETTINGS_PROXY_SCHEMA "org.gnome.settings-daemon.plugins.proxy"
|
||||
+#define KEY_USE_SYSTEM_SETTINGS "use-system-settings" /* string */
|
||||
+#define VAL_USE_SYSTEM_SETTINGS_ONLY_IF_NOT_SET "only_if_mode_not_set"
|
||||
+#define VAL_USE_SYSTEM_SETTINGS_SYSTEM_VALUES "system_values"
|
||||
+#define VAL_USE_SYSTEM_SETTINGS_USER_VALUES "user_values"
|
||||
@ -143,30 +143,24 @@ Index: plugins/proxy/gsd-proxy-manager.c
|
||||
+#define ETC_SYSCONFIG_PROXY_URI "file:///etc/sysconfig/proxy"
|
||||
+
|
||||
+/* Gnome keys */
|
||||
+#define DIR_PROXY "/system/proxy"
|
||||
+#define KEY_USE_HTTP_PROXY "/system/http_proxy/use_http_proxy" /* bool */
|
||||
+#define KEY_HTTP_HOST "/system/http_proxy/host" /* string */
|
||||
+#define KEY_HTTP_PORT "/system/http_proxy/port" /* int */
|
||||
+#define KEY_HTTP_USE_AUTHENTICATION "/system/http_proxy/use_authentication" /* bool */
|
||||
+#define KEY_HTTP_AUTHENTICATION_USER "/system/http_proxy/authentication_user" /* string */
|
||||
+#define KEY_HTTP_AUTHENTICATION_PASSWORD "/system/http_proxy/authentication_password" /* string */
|
||||
+#define KEY_HTTP_IGNORE_HOSTS "/system/http_proxy/ignore_hosts" /* list-of-string */
|
||||
+#define KEY_MODE "/system/proxy/mode" /* string */
|
||||
+#define KEY_SECURE_HOST "/system/proxy/secure_host" /* string */
|
||||
+#define KEY_SECURE_PORT "/system/proxy/secure_port" /* int */
|
||||
+#define KEY_FTP_HOST "/system/proxy/ftp_host" /* string */
|
||||
+#define KEY_FTP_PORT "/system/proxy/ftp_port" /* int */
|
||||
+#define KEY_SOCKS_HOST "/system/proxy/socks_host" /* string */
|
||||
+#define KEY_SOCKS_PORT "/system/proxy/socks_port" /* int */
|
||||
+#define KEY_AUTOCONFIG_URL "/system/proxy/autoconfig_url" /* string */
|
||||
+#define GNOME_SETTINGS_PROXY_SCHEMA "org.gnome.system.proxy"
|
||||
+#define KEY_PROXY_AUTOCONFIG_URL "autoconfig-url" /* string */
|
||||
+#define KEY_PROXY_HTTP_IGNORE_HOSTS "ignore-hosts" /* list-of-string */
|
||||
+#define KEY_PROXY_MODE "mode" /* string */
|
||||
+#define KEY_HTTP_AUTHENTICATION_USER "authentication-user" /* string */
|
||||
+#define KEY_HTTP_AUTHENTICATION_PASSWORD "authentication-password" /* string */
|
||||
+#define KEY_HTTP_PROXY_ENABLED "enabled" /* bool */
|
||||
+#define KEY_HTTP_USE_AUTHENTICATION "use-authentication" /* bool */
|
||||
+#define KEY_HOST "host" /* string */
|
||||
+#define KEY_PORT "port" /* bool */
|
||||
+
|
||||
+struct GsdProxyManagerPrivate
|
||||
+{
|
||||
+ /* This is to avoid "sizeof (GsdProxyManagerPrivate) == 0" when adding
|
||||
+ * the private struct with g_type_class_add_private(). Feel free to
|
||||
+ * remove this dummy field if you add real fields here.
|
||||
+ */
|
||||
+ int dummy;
|
||||
+ GSettings *settings;
|
||||
+ GSettings *settings_sys;
|
||||
+ GSettings *settings_ftp;
|
||||
+ GSettings *settings_http;
|
||||
+ GSettings *settings_https;
|
||||
+};
|
||||
+
|
||||
+typedef struct {
|
||||
@ -191,21 +185,23 @@ Index: plugins/proxy/gsd-proxy-manager.c
|
||||
+
|
||||
+static gpointer manager_object = NULL;
|
||||
+
|
||||
+/* Returns whether the /system/proxy/mode key has ever been set by the user */
|
||||
+/* Returns whether the org.gnome.system.proxy.mode key has ever been set by the user */
|
||||
+static gboolean
|
||||
+user_mode_is_set (GConfClient *config_client)
|
||||
+user_mode_is_set (GsdProxyManager *manager)
|
||||
+{
|
||||
+ GConfValue *value;
|
||||
+ char *value;
|
||||
+
|
||||
+ value = gconf_client_get_without_default (config_client, KEY_MODE, NULL);
|
||||
+ value = g_settings_get_string (manager->priv->settings_sys, KEY_PROXY_MODE);
|
||||
+
|
||||
+ if (value)
|
||||
+ /* FIXME Poke the default value */
|
||||
+ if (value && strcmp (value, "none") != 0)
|
||||
+ {
|
||||
+ gconf_value_free (value);
|
||||
+ g_free (value);
|
||||
+ return TRUE;
|
||||
+ }
|
||||
+ else
|
||||
+ return FALSE;
|
||||
+
|
||||
+ g_free (value);
|
||||
+ return FALSE;
|
||||
+}
|
||||
+
|
||||
+static const char *
|
||||
@ -301,10 +297,10 @@ Index: plugins/proxy/gsd-proxy-manager.c
|
||||
+
|
||||
+/* Disables the proxy in the user's settings */
|
||||
+static void
|
||||
+copy_proxy_disabled (GConfClient *config_client)
|
||||
+copy_proxy_disabled (GsdProxyManager *manager)
|
||||
+{
|
||||
+ gconf_client_set_bool (config_client, KEY_USE_HTTP_PROXY, FALSE, NULL);
|
||||
+ gconf_client_set_string (config_client, KEY_MODE, "none", NULL);
|
||||
+ g_settings_set_boolean (manager->priv->settings_http, KEY_HTTP_PROXY_ENABLED, FALSE);
|
||||
+ g_settings_set_string (manager->priv->settings_sys, KEY_PROXY_MODE, "none");
|
||||
+}
|
||||
+
|
||||
+
|
||||
@ -485,65 +481,67 @@ Index: plugins/proxy/gsd-proxy-manager.c
|
||||
+
|
||||
+/* Copies the (enabled) system proxy settings in the user's settings */
|
||||
+static void
|
||||
+copy_proxy_enabled (GConfClient *config_client, SystemSettings *settings)
|
||||
+copy_proxy_enabled (GsdProxyManager *manager, SystemSettings *settings)
|
||||
+{
|
||||
+ GsdProxyManagerPrivate *priv;
|
||||
+ gchar *host;
|
||||
+ guint port;
|
||||
+
|
||||
+ gconf_client_set_string (config_client, KEY_MODE, "manual", NULL);
|
||||
+ priv = manager->priv;
|
||||
+ g_settings_set_string (priv->settings_sys, KEY_PROXY_MODE, "manual");
|
||||
+
|
||||
+ /* 1. HTTP proxy */
|
||||
+
|
||||
+ /* Yast2 currently doesn't support a public username/password */
|
||||
+ gconf_client_set_bool (config_client, KEY_HTTP_USE_AUTHENTICATION, FALSE, NULL);
|
||||
+ gconf_client_set_string (config_client, KEY_HTTP_AUTHENTICATION_USER, "", NULL);
|
||||
+ gconf_client_set_string (config_client, KEY_HTTP_AUTHENTICATION_PASSWORD, "", NULL);
|
||||
+ g_settings_set_boolean (priv->settings_http, KEY_HTTP_USE_AUTHENTICATION, FALSE);
|
||||
+ g_settings_set_string (priv->settings_http, KEY_HTTP_AUTHENTICATION_USER, "");
|
||||
+ g_settings_set_string (priv->settings_http, KEY_HTTP_AUTHENTICATION_PASSWORD, "");
|
||||
+
|
||||
+ if (parse_uri (settings->http_proxy, &host, &port))
|
||||
+ {
|
||||
+ gconf_client_set_bool (config_client, KEY_USE_HTTP_PROXY, TRUE, NULL);
|
||||
+ g_settings_set_boolean (priv->settings_http, KEY_HTTP_PROXY_ENABLED, TRUE);
|
||||
+
|
||||
+ gconf_client_set_string (config_client, KEY_HTTP_HOST, host, NULL);
|
||||
+ gconf_client_set_int (config_client, KEY_HTTP_PORT, (int) port, NULL);
|
||||
+ g_settings_set_string (priv->settings_http, KEY_HOST, host);
|
||||
+ g_settings_set_int (priv->settings_http, KEY_PORT, (int) port);
|
||||
+
|
||||
+ g_free (host);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ gconf_client_set_bool (config_client, KEY_USE_HTTP_PROXY, FALSE, NULL);
|
||||
+ gconf_client_set_string (config_client, KEY_HTTP_HOST, "", NULL);
|
||||
+ gconf_client_set_int (config_client, KEY_HTTP_PORT, 0, NULL);
|
||||
+ gconf_client_set_list (config_client, KEY_HTTP_IGNORE_HOSTS, GCONF_VALUE_STRING, NULL, NULL);
|
||||
+ g_settings_set_boolean (priv->settings_http, KEY_HTTP_PROXY_ENABLED, FALSE);
|
||||
+ g_settings_set_string (priv->settings_http, KEY_HOST, "");
|
||||
+ g_settings_set_int (priv->settings_http, KEY_PORT, 0);
|
||||
+ g_settings_set_strv (priv->settings_sys, KEY_PROXY_HTTP_IGNORE_HOSTS, NULL);
|
||||
+ }
|
||||
+
|
||||
+ /* 2. HTTPS proxy */
|
||||
+
|
||||
+ if (parse_uri (settings->https_proxy, &host, &port))
|
||||
+ {
|
||||
+ gconf_client_set_string (config_client, KEY_SECURE_HOST, host, NULL);
|
||||
+ gconf_client_set_int (config_client, KEY_SECURE_PORT, (int) port, NULL);
|
||||
+ g_settings_set_string (priv->settings_https, KEY_HOST, host);
|
||||
+ g_settings_set_int (priv->settings_https, KEY_PORT, (int) port);
|
||||
+
|
||||
+ g_free (host);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ gconf_client_set_string (config_client, KEY_SECURE_HOST, "", NULL);
|
||||
+ gconf_client_set_int (config_client, KEY_SECURE_PORT, 0, NULL);
|
||||
+ g_settings_set_string (priv->settings_https, KEY_HOST, "");
|
||||
+ g_settings_set_int (priv->settings_https, KEY_PORT, 0);
|
||||
+ }
|
||||
+
|
||||
+ /* 3. FTP proxy */
|
||||
+
|
||||
+ if (parse_uri (settings->ftp_proxy, &host, &port))
|
||||
+ {
|
||||
+ gconf_client_set_string (config_client, KEY_FTP_HOST, host, NULL);
|
||||
+ gconf_client_set_int (config_client, KEY_FTP_PORT, (int) port, NULL);
|
||||
+ g_settings_set_string (priv->settings_ftp, KEY_HOST, host);
|
||||
+ g_settings_set_int (priv->settings_ftp, KEY_PORT, (int) port);
|
||||
+
|
||||
+ g_free (host);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ gconf_client_set_string (config_client, KEY_FTP_HOST, "", NULL);
|
||||
+ gconf_client_set_int (config_client, KEY_FTP_PORT, 0, NULL);
|
||||
+ g_settings_set_string (priv->settings_ftp, KEY_HOST, "");
|
||||
+ g_settings_set_int (priv->settings_ftp, KEY_PORT, 0);
|
||||
+ }
|
||||
+
|
||||
+ /* 4. No-proxy hosts */
|
||||
@ -551,60 +549,42 @@ Index: plugins/proxy/gsd-proxy-manager.c
|
||||
+ if (settings->no_proxy != NULL)
|
||||
+ {
|
||||
+ char **tokens;
|
||||
+ int i;
|
||||
+ GSList *list;
|
||||
+
|
||||
+ tokens = g_strsplit_set (settings->no_proxy, ", ", 0);
|
||||
+
|
||||
+ list = NULL;
|
||||
+
|
||||
+ for (i = 0; tokens[i] != NULL; i++)
|
||||
+ {
|
||||
+ char *s;
|
||||
+
|
||||
+ s = tokens[i];
|
||||
+ if (strlen (s) != 0)
|
||||
+ list = g_slist_prepend (list, s);
|
||||
+ }
|
||||
+
|
||||
+ list = g_slist_reverse (list);
|
||||
+
|
||||
+ gconf_client_set_list (config_client, KEY_HTTP_IGNORE_HOSTS, GCONF_VALUE_STRING, list, NULL);
|
||||
+
|
||||
+ g_slist_free (list);
|
||||
+ g_settings_set_strv (priv->settings_sys, KEY_PROXY_HTTP_IGNORE_HOSTS, (const gchar * const*)tokens);
|
||||
+ g_strfreev (tokens);
|
||||
+ }
|
||||
+ else
|
||||
+ gconf_client_set_list (config_client, KEY_HTTP_IGNORE_HOSTS, GCONF_VALUE_STRING, NULL, NULL);
|
||||
+ g_settings_set_strv (priv->settings_sys, KEY_PROXY_HTTP_IGNORE_HOSTS, NULL);
|
||||
+}
|
||||
+
|
||||
+/* Copies the system's proxy settings to the user's settings */
|
||||
+static void
|
||||
+copy_system_to_user (GConfClient *config_client)
|
||||
+copy_system_to_user (GsdProxyManager *manager)
|
||||
+{
|
||||
+ SystemSettings settings;
|
||||
+
|
||||
+ read_system_settings (&settings);
|
||||
+
|
||||
+ if (settings.proxy_enabled == NULL)
|
||||
+ copy_proxy_disabled (config_client);
|
||||
+ copy_proxy_disabled (manager);
|
||||
+ else
|
||||
+ {
|
||||
+ if (strcmp (settings.proxy_enabled, "no") == 0)
|
||||
+ copy_proxy_disabled (config_client);
|
||||
+ copy_proxy_disabled (manager);
|
||||
+ else if (strcmp (settings.proxy_enabled, "yes") == 0)
|
||||
+ copy_proxy_enabled (config_client, &settings);
|
||||
+ copy_proxy_enabled (manager, &settings);
|
||||
+ }
|
||||
+
|
||||
+ system_settings_free (&settings);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+use_system_settings_change (GConfClient *config_client, const char *value)
|
||||
+use_system_settings_change (GsdProxyManager *manager, const char *value)
|
||||
+{
|
||||
+ if (strcmp (value, VAL_USE_SYSTEM_SETTINGS_SYSTEM_VALUES) == 0)
|
||||
+ {
|
||||
+ copy_system_to_user (config_client);
|
||||
+ copy_system_to_user (manager);
|
||||
+ }
|
||||
+ else if (strcmp (value, VAL_USE_SYSTEM_SETTINGS_USER_VALUES) == 0)
|
||||
+ {
|
||||
@ -613,26 +593,27 @@ Index: plugins/proxy/gsd-proxy-manager.c
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+dir_proxy_key_changed_cb (GConfEntry *entry)
|
||||
+{
|
||||
+ 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
|
||||
+copy_system_values_if_needed (GConfClient *client)
|
||||
+settings_key_changed_cb (GSettings *gsettings, char *key, GsdProxyManager *manager)
|
||||
+{
|
||||
+ char *value;
|
||||
+
|
||||
+ value = gconf_client_get_string (client, KEY_USE_SYSTEM_SETTINGS, NULL);
|
||||
+ if (strcmp (key, KEY_USE_SYSTEM_SETTINGS) == 0) {
|
||||
+ value = g_settings_get_string (gsettings, key);
|
||||
+ use_system_settings_change (manager, value);
|
||||
+ g_free (value);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+copy_system_values_if_needed (GsdProxyManager *manager)
|
||||
+{
|
||||
+ char *value;
|
||||
+
|
||||
+ value = g_settings_get_string (manager->priv->settings, KEY_USE_SYSTEM_SETTINGS);
|
||||
+ if (!value)
|
||||
+ return;
|
||||
+
|
||||
+ use_system_settings_change (client, value);
|
||||
+ use_system_settings_change (manager, value);
|
||||
+ g_free (value);
|
||||
+}
|
||||
+
|
||||
@ -642,64 +623,57 @@ Index: plugins/proxy/gsd-proxy-manager.c
|
||||
+ GFile *file,
|
||||
+ GFile *other_file,
|
||||
+ GFileMonitorEvent event_type,
|
||||
+ gpointer data)
|
||||
+ GsdProxyManager *manager)
|
||||
+{
|
||||
+ GConfClient *client;
|
||||
+
|
||||
+ if (event_type != G_FILE_MONITOR_EVENT_CHANGED)
|
||||
+ return;
|
||||
+
|
||||
+ client = gconf_client_get_default ();
|
||||
+ copy_system_values_if_needed (client);
|
||||
+ g_object_unref (G_OBJECT (client));
|
||||
+ copy_system_values_if_needed (manager);
|
||||
+}
|
||||
+
|
||||
+gboolean
|
||||
+gsd_proxy_manager_start (GsdProxyManager *manager,
|
||||
+ GError **error)
|
||||
+{
|
||||
+ GConfClient *config_client;
|
||||
+ GsdProxyManagerPrivate *priv;
|
||||
+ GFile *sysconfig_proxy;
|
||||
+ GFileMonitor *monitor;
|
||||
+ char *use_system_settings;
|
||||
+
|
||||
+ priv = manager->priv;
|
||||
+
|
||||
+ 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 (config_client, KEY_USE_SYSTEM_SETTINGS, NULL);
|
||||
+ use_system_settings = g_settings_get_string (priv->settings, KEY_USE_SYSTEM_SETTINGS);
|
||||
+ 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 (config_client, KEY_USE_SYSTEM_SETTINGS, VAL_USE_SYSTEM_SETTINGS_USER_VALUES, NULL);
|
||||
+ if (user_mode_is_set (manager))
|
||||
+ g_settings_set_string (priv->settings, KEY_USE_SYSTEM_SETTINGS, VAL_USE_SYSTEM_SETTINGS_USER_VALUES);
|
||||
+ else
|
||||
+ {
|
||||
+ copy_system_to_user (config_client);
|
||||
+ gconf_client_set_string (config_client, KEY_USE_SYSTEM_SETTINGS, VAL_USE_SYSTEM_SETTINGS_SYSTEM_VALUES, NULL);
|
||||
+ copy_system_to_user (manager);
|
||||
+ g_settings_set_string (priv->settings, KEY_USE_SYSTEM_SETTINGS, VAL_USE_SYSTEM_SETTINGS_SYSTEM_VALUES);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (use_system_settings)
|
||||
+ g_free (use_system_settings);
|
||||
+
|
||||
+ 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);
|
||||
+ g_signal_connect (priv->settings, "changed", G_CALLBACK (settings_key_changed_cb), manager);
|
||||
+
|
||||
+ 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);
|
||||
+ g_signal_connect (monitor, "changed", G_CALLBACK (monitor_cb), manager);
|
||||
+
|
||||
+ copy_system_values_if_needed (manager);
|
||||
+
|
||||
+ g_object_unref (config_client);
|
||||
+
|
||||
+ gnome_settings_profile_end (NULL);
|
||||
+
|
||||
+ return TRUE;
|
||||
@ -766,8 +740,31 @@ Index: plugins/proxy/gsd-proxy-manager.c
|
||||
+gsd_proxy_manager_dispose (GObject *object)
|
||||
+{
|
||||
+ GsdProxyManager *proxy_manager;
|
||||
+ GsdProxyManagerPrivate *priv;
|
||||
+
|
||||
+ proxy_manager = GSD_PROXY_MANAGER (object);
|
||||
+ priv = proxy_manager->priv;
|
||||
+
|
||||
+ if (priv->settings) {
|
||||
+ g_object_unref (priv->settings);
|
||||
+ priv->settings = NULL;
|
||||
+ }
|
||||
+ if (priv->settings_sys) {
|
||||
+ g_object_unref (priv->settings_sys);
|
||||
+ priv->settings_sys = NULL;
|
||||
+ }
|
||||
+ if (priv->settings_ftp) {
|
||||
+ g_object_unref (priv->settings_ftp);
|
||||
+ priv->settings_ftp = NULL;
|
||||
+ }
|
||||
+ if (priv->settings_http) {
|
||||
+ g_object_unref (priv->settings_http);
|
||||
+ priv->settings_http = NULL;
|
||||
+ }
|
||||
+ if (priv->settings_https) {
|
||||
+ g_object_unref (priv->settings_https);
|
||||
+ priv->settings_https = NULL;
|
||||
+ }
|
||||
+
|
||||
+ G_OBJECT_CLASS (gsd_proxy_manager_parent_class)->dispose (object);
|
||||
+}
|
||||
@ -790,6 +787,11 @@ Index: plugins/proxy/gsd-proxy-manager.c
|
||||
+gsd_proxy_manager_init (GsdProxyManager *manager)
|
||||
+{
|
||||
+ manager->priv = GSD_PROXY_MANAGER_GET_PRIVATE (manager);
|
||||
+ manager->priv->settings = g_settings_new (GSD_SETTINGS_PROXY_SCHEMA);
|
||||
+ manager->priv->settings_sys = g_settings_new (GNOME_SETTINGS_PROXY_SCHEMA);
|
||||
+ manager->priv->settings_ftp = g_settings_get_child (manager->priv->settings_sys, "ftp");
|
||||
+ manager->priv->settings_http = g_settings_get_child (manager->priv->settings_sys, "http");
|
||||
+ manager->priv->settings_https = g_settings_get_child (manager->priv->settings_sys, "https");
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
@ -822,8 +824,8 @@ Index: plugins/proxy/gsd-proxy-manager.c
|
||||
+}
|
||||
Index: plugins/proxy/gsd-proxy-manager.h
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ plugins/proxy/gsd-proxy-manager.h 2010-01-13 16:44:52.000000000 +1100
|
||||
--- /dev/null
|
||||
+++ plugins/proxy/gsd-proxy-manager.h
|
||||
@@ -0,0 +1,57 @@
|
||||
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
|
||||
+ *
|
||||
@ -884,9 +886,9 @@ Index: plugins/proxy/gsd-proxy-manager.h
|
||||
+#endif /* __GSD_PROXY_MANAGER_H */
|
||||
Index: plugins/proxy/gsd-proxy-plugin.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ plugins/proxy/gsd-proxy-plugin.c 2010-01-13 16:44:52.000000000 +1100
|
||||
@@ -0,0 +1,103 @@
|
||||
--- /dev/null
|
||||
+++ plugins/proxy/gsd-proxy-plugin.c
|
||||
@@ -0,0 +1,109 @@
|
||||
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
|
||||
+ *
|
||||
+ * Copyright (C) 2008 Rodrigo Moya <rodrigo@gnome-db.org>
|
||||
@ -975,6 +977,7 @@ Index: plugins/proxy/gsd-proxy-plugin.c
|
||||
+impl_deactivate (GnomeSettingsPlugin *plugin)
|
||||
+{
|
||||
+ g_debug ("Deactivating proxy plugin");
|
||||
+ gsd_proxy_manager_stop (GSD_PROXY_PLUGIN (plugin)->priv->manager);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
@ -990,10 +993,15 @@ Index: plugins/proxy/gsd-proxy-plugin.c
|
||||
+
|
||||
+ g_type_class_add_private (klass, sizeof (GsdProxyPluginPrivate));
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+gsd_proxy_plugin_class_finalize (GsdProxyPluginClass *klass)
|
||||
+{
|
||||
+}
|
||||
Index: plugins/proxy/gsd-proxy-plugin.h
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ plugins/proxy/gsd-proxy-plugin.h 2010-01-13 16:44:52.000000000 +1100
|
||||
--- /dev/null
|
||||
+++ plugins/proxy/gsd-proxy-plugin.h
|
||||
@@ -0,0 +1,59 @@
|
||||
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
|
||||
+ *
|
||||
@ -1056,8 +1064,8 @@ Index: plugins/proxy/gsd-proxy-plugin.h
|
||||
+#endif /* __GSD_PROXY_PLUGIN_H__ */
|
||||
Index: plugins/proxy/novell-sysconfig-proxy-helper
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ plugins/proxy/novell-sysconfig-proxy-helper 2010-01-13 16:44:52.000000000 +1100
|
||||
--- /dev/null
|
||||
+++ plugins/proxy/novell-sysconfig-proxy-helper
|
||||
@@ -0,0 +1,19 @@
|
||||
+#!/bin/sh
|
||||
+
|
||||
@ -1080,8 +1088,8 @@ Index: plugins/proxy/novell-sysconfig-proxy-helper
|
||||
+echo "NO_PROXY $NO_PROXY"
|
||||
Index: plugins/proxy/proxy.gnome-settings-plugin.in
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ plugins/proxy/proxy.gnome-settings-plugin.in 2010-01-13 16:44:52.000000000 +1100
|
||||
--- /dev/null
|
||||
+++ plugins/proxy/proxy.gnome-settings-plugin.in
|
||||
@@ -0,0 +1,8 @@
|
||||
+[GNOME Settings Plugin]
|
||||
+Module=proxy
|
||||
@ -1091,105 +1099,87 @@ Index: plugins/proxy/proxy.gnome-settings-plugin.in
|
||||
+Authors=Rodrigo Moya <rodrigo@gnome-db.org>
|
||||
+Copyright=
|
||||
+Website=
|
||||
Index: data/system_proxy.schemas.in
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ data/system_proxy.schemas.in 2010-01-13 16:44:52.000000000 +1100
|
||||
@@ -0,0 +1,26 @@
|
||||
+<?xml version="1.0"?>
|
||||
+<gconfschemafile>
|
||||
+ <schemalist>
|
||||
+ <schema>
|
||||
+ <key>/schemas/system/proxy/use_system_settings</key>
|
||||
+ <applyto>/system/proxy/use_system_settings</applyto>
|
||||
+ <type>string</type>
|
||||
+ <default>only_if_mode_not_set</default>
|
||||
+ <locale name="C">
|
||||
+ <short>Use the system's proxy settings</short>
|
||||
+ <long>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.</long>
|
||||
+ </locale>
|
||||
+ </schema>
|
||||
+ </schemalist>
|
||||
+</gconfschemafile>
|
||||
Index: plugins/Makefile.am
|
||||
===================================================================
|
||||
--- plugins/Makefile.am.orig 2009-06-16 20:17:13.000000000 +1000
|
||||
+++ plugins/Makefile.am 2010-01-13 16:44:52.000000000 +1100
|
||||
@@ -12,6 +12,7 @@ SUBDIRS = \
|
||||
--- plugins/Makefile.am.orig
|
||||
+++ plugins/Makefile.am
|
||||
@@ -15,6 +15,7 @@ enabled_plugins = \
|
||||
keyboard \
|
||||
media-keys \
|
||||
mouse \
|
||||
+ proxy \
|
||||
sound \
|
||||
typing-break \
|
||||
wacom \
|
||||
xrandr \
|
||||
Index: configure.ac
|
||||
===================================================================
|
||||
--- configure.ac.orig 2010-01-13 02:52:55.000000000 +1100
|
||||
+++ configure.ac 2010-01-13 16:44:52.000000000 +1100
|
||||
@@ -359,6 +359,7 @@ plugins/keyboard/Makefile
|
||||
plugins/media-keys/Makefile
|
||||
plugins/media-keys/cut-n-paste/Makefile
|
||||
--- configure.ac.orig
|
||||
+++ configure.ac
|
||||
@@ -575,6 +575,7 @@ plugins/media-keys/cut-n-paste/Makefile
|
||||
plugins/mouse/Makefile
|
||||
plugins/orientation/Makefile
|
||||
plugins/print-notifications/Makefile
|
||||
+plugins/proxy/Makefile
|
||||
plugins/smartcard/Makefile
|
||||
plugins/sound/Makefile
|
||||
plugins/typing-break/Makefile
|
||||
plugins/updates/Makefile
|
||||
@@ -598,6 +599,7 @@ data/org.gnome.settings-daemon.plugins.u
|
||||
data/org.gnome.settings-daemon.plugins.xrandr.gschema.xml.in
|
||||
data/org.gnome.settings-daemon.peripherals.wacom.gschema.xml.in
|
||||
data/org.gnome.settings-daemon.plugins.print-notifications.gschema.xml.in
|
||||
+data/org.gnome.settings-daemon.plugins.proxy.gschema.xml.in
|
||||
po/Makefile.in
|
||||
])
|
||||
|
||||
Index: data/Makefile.am
|
||||
===================================================================
|
||||
--- data/Makefile.am.orig 2009-07-28 07:37:28.000000000 +1000
|
||||
+++ data/Makefile.am 2010-01-13 16:44:52.000000000 +1100
|
||||
@@ -11,6 +11,7 @@ schemas_in_files = \
|
||||
apps_gnome_settings_daemon_xrandr.schemas.in \
|
||||
desktop_gnome_peripherals_touchpad.schemas.in \
|
||||
desktop_gnome_peripherals_smartcard.schemas.in \
|
||||
+ system_proxy.schemas.in \
|
||||
$(NULL)
|
||||
--- data/Makefile.am.orig
|
||||
+++ data/Makefile.am
|
||||
@@ -16,6 +16,7 @@ gsettings_SCHEMAS = \
|
||||
org.gnome.settings-daemon.plugins.xsettings.gschema.xml \
|
||||
org.gnome.settings-daemon.plugins.housekeeping.gschema.xml \
|
||||
org.gnome.settings-daemon.plugins.print-notifications.gschema.xml \
|
||||
+ org.gnome.settings-daemon.plugins.proxy.gschema.xml \
|
||||
org.gnome.settings-daemon.peripherals.wacom.gschema.xml \
|
||||
org.gnome.settings-daemon.plugins.xrandr.gschema.xml
|
||||
|
||||
schemas_DATA = $(schemas_in_files:.schemas.in=.schemas)
|
||||
Index: data/gnome-settings-daemon.schemas.in
|
||||
Index: data/gnome-settings-daemon.convert
|
||||
===================================================================
|
||||
--- data/gnome-settings-daemon.schemas.in.orig 2009-06-16 20:17:13.000000000 +1000
|
||||
+++ data/gnome-settings-daemon.schemas.in 2010-01-13 16:44:52.000000000 +1100
|
||||
@@ -210,6 +210,30 @@
|
||||
</schema>
|
||||
--- data/gnome-settings-daemon.convert.orig
|
||||
+++ data/gnome-settings-daemon.convert
|
||||
@@ -79,6 +79,11 @@ left-handed = /desktop/gnome/peripherals
|
||||
motion-acceleration = /desktop/gnome/peripherals/mouse/motion_acceleration
|
||||
motion-threshold = /desktop/gnome/peripherals/mouse/motion_threshold
|
||||
|
||||
<schema>
|
||||
+ <key>/schemas/apps/gnome_settings_daemon/plugins/proxy/active</key>
|
||||
+ <applyto>/apps/gnome_settings_daemon/plugins/proxy/active</applyto>
|
||||
+ <owner>gnome-settings-daemon</owner>
|
||||
+ <type>bool</type>
|
||||
+ <default>TRUE</default>
|
||||
+ <locale name="C">
|
||||
+ <short>Enable system-proxy plugin</short>
|
||||
+ <long>Set to True to enable the plugin to manage the system
|
||||
+ proxy settings.</long>
|
||||
+ </locale>
|
||||
+ </schema>
|
||||
+ <schema>
|
||||
+ <key>/schemas/apps/gnome_settings_daemon/plugins/proxy/priority</key>
|
||||
+ <applyto>/apps/gnome_settings_daemon/plugins/proxy/priority</applyto>
|
||||
+ <owner>gnome-settings-daemon</owner>
|
||||
+ <type>int</type>
|
||||
+ <default>7</default>
|
||||
+ <locale name="C">
|
||||
+ <short></short>
|
||||
+ <long></long>
|
||||
+ </locale>
|
||||
+ </schema>
|
||||
+[org.gnome.settings-daemon.plugins.proxy]
|
||||
+active = /apps/gnome_settings_daemon/plugins/proxy/active
|
||||
+priority = /apps/gnome_settings_daemon/plugins/proxy/priority
|
||||
+use-system-settings = /system/proxy/use_system_settings
|
||||
+
|
||||
+ <schema>
|
||||
<key>/schemas/apps/gnome_settings_daemon/plugins/sound/active</key>
|
||||
<applyto>/apps/gnome_settings_daemon/plugins/sound/active</applyto>
|
||||
<owner>gnome-settings-daemon</owner>
|
||||
[org.gnome.settings-daemon.plugins.smartcard]
|
||||
active = /apps/gnome_settings_daemon/plugins/smartcard/active
|
||||
priority = /apps/gnome_settings_daemon/plugins/smartcard/priority
|
||||
Index: data/org.gnome.settings-daemon.plugins.proxy.gschema.xml.in.in
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ data/org.gnome.settings-daemon.plugins.proxy.gschema.xml.in.in
|
||||
@@ -0,0 +1,19 @@
|
||||
+<schemalist>
|
||||
+ <schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.settings-daemon.plugins.proxy" path="/org/gnome/settings-daemon/plugins/proxy/">
|
||||
+ <key name="active" type="b">
|
||||
+ <default>true</default>
|
||||
+ <_summary>Activation of this plugin</_summary>
|
||||
+ <_description>Whether this plugin would be activated by gnome-settings-daemon or not</_description>
|
||||
+ </key>
|
||||
+ <key name="priority" type="i">
|
||||
+ <default>7</default>
|
||||
+ <_summary>Priority to use for this plugin</_summary>
|
||||
+ <_description>Priority to use for this plugin in gnome-settings-daemon startup queue</_description>
|
||||
+ </key>
|
||||
+ <key name="use-system-settings" type="s">
|
||||
+ <default>'only_if_mode_not_set'</default>
|
||||
+ <summary>Use the system's proxy settings</summary>
|
||||
+ <description>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 org.gnome.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.</description>
|
||||
+ </key>
|
||||
+ </schema>
|
||||
+</schemalist>
|
||||
|
@ -1,3 +1,14 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Jul 29 04:19:01 UTC 2011 - glin@suse.com
|
||||
|
||||
- Rebase gnome-settings-daemon-system-proxy-configuration.diff and
|
||||
gnome-settings-daemon-bnc462640-mute-action.patch and enable the
|
||||
the call to autoreconf.
|
||||
- Add gnome-settings-daemon-stop-reload-proxy-settings.patch to
|
||||
stop the g-s-d packagekit plugin, to pop up the authentication
|
||||
for reloading the proxy settings (bnc#689592#c1 for bnc#538353)
|
||||
- Rebase gnome-packagekit-fate302445.patch and migrate to gsettings
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Jul 25 12:54:49 CEST 2011 - vuntz@opensuse.org
|
||||
|
||||
|
@ -25,11 +25,11 @@ Summary: Settings daemon for the GNOME desktop
|
||||
Url: http://www.gnome.org
|
||||
Group: System/GUI/GNOME
|
||||
Source: http://download.gnome.org/sources/gnome-settings-daemon/3.1/%{name}-%{version}.tar.bz2
|
||||
# PATCH-NEEDS-REBASE gnome-settings-daemon-system-proxy-configuration.diff (was PATCH-FEATURE-OPENSUSE)
|
||||
# PATCH-FEATURE-OPENSUSE gnome-settings-daemon-system-proxy-configuration.diff
|
||||
Patch2: gnome-settings-daemon-system-proxy-configuration.diff
|
||||
# PATCH-NEEDS-REBASE gnome-settings-daemon-apport-monitor.patch bnc439203 jblunck@novell.com -- Add apport monitoring plugin. (was PATCH-FEATURE-UPSTREAM)
|
||||
Patch8: gnome-settings-daemon-apport-monitor.patch
|
||||
# PATCH-NEEDS-REBASE gnome-settings-daemon-bnc462640-mute-action.patch bnc462640 bgo572365 vuntz@novell.com -- Mute button should always mute sound instead of toggling mute status (was PATCH-FEATURE-UPSTREAM)
|
||||
# PATCH-FEATURE-UPSTREAM gnome-settings-daemon-bnc462640-mute-action.patch bnc462640 bgo572365 vuntz@novell.com -- Mute button should always mute sound instead of toggling mute status
|
||||
Patch10: gnome-settings-daemon-bnc462640-mute-action.patch
|
||||
# PATCH-NEEDS-REBASE gnome-settings-daemon-bnc461755-randr-rotate-wacom.diff bnc461755 federico@novell.com - Add the option of rotating a Wacom tablet when rotating the monitor with RANDR (was PATCH-FEATURE-OPENSUSE)
|
||||
Patch11: gnome-settings-daemon-bnc461755-randr-rotate-wacom.diff
|
||||
@ -41,6 +41,8 @@ Patch14: gnome-packagekit-fate302445.patch
|
||||
Patch15: gnome-packagekit-BNC383261.patch
|
||||
# PATCH-FIX-UPSTREAM bgo#654970 bnc#675969 gnome-settings-daemon-ntp-support.patch vuntz@opensuse.org -- Add SUSE support for datetime polkit helper
|
||||
Patch16: gnome-settings-daemon-ntp-support.patch
|
||||
# PATCH-FIX-OPENSUSE gnome-settings-daemon-stop-reload-proxy-settings.patch bnc689592#c1, bnc#538353 glin@suse.com -- Stop g-s-d poping up the authentication dialog for reloading the proxy settings
|
||||
Patch17: gnome-settings-daemon-stop-reload-proxy-settings.patch
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: gnome-common
|
||||
# Disabled because of the non-rebased patches
|
||||
@ -125,9 +127,9 @@ translation-update-upstream
|
||||
%if !0%{?BUILD_FROM_VCS}
|
||||
# Disabled because of the non-rebased patches
|
||||
#gnome-patch-translation-prepare
|
||||
#%patch2 -p0
|
||||
%patch2 -p0
|
||||
#%patch8 -p0
|
||||
#%patch10 -p0
|
||||
%patch10 -p0
|
||||
# PATCH-NEEDS-REBASE
|
||||
#%patch11 -p1
|
||||
# PATCH-NEEDS-REBASE
|
||||
@ -137,6 +139,7 @@ translation-update-upstream
|
||||
# PATCH-NEEDS-REBASE
|
||||
#%patch15 -p0
|
||||
%patch16 -p1
|
||||
%patch17 -p1
|
||||
%endif
|
||||
|
||||
%if 0%{?BUILD_FROM_VCS}
|
||||
@ -144,8 +147,7 @@ NOCONFIGURE=1 /usr/bin/gnome-autogen.sh
|
||||
%endif
|
||||
|
||||
%build
|
||||
# Disabled because of the non-rebased patches
|
||||
#autoreconf -f -i
|
||||
autoreconf -f -i
|
||||
%configure\
|
||||
--libexecdir=%{_libexecdir}/gnome-settings-daemon-3.0 \
|
||||
--enable-gconf-bridge \
|
||||
@ -187,6 +189,7 @@ rm -rf %{buildroot}
|
||||
%{_libexecdir}/gnome-settings-daemon-3.0/gnome-settings-daemon
|
||||
%{_libexecdir}/gnome-settings-daemon-3.0/gsd-locate-pointer
|
||||
%{_libexecdir}/gnome-settings-daemon-3.0/gsd-printer
|
||||
%{_libexecdir}/gnome-settings-daemon-3.0/novell-sysconfig-proxy-helper
|
||||
%if "%{_libdir}" != "%{_libexecdir}"
|
||||
%dir %{_libdir}/gnome-settings-daemon-3.0/
|
||||
%endif
|
||||
@ -204,6 +207,7 @@ rm -rf %{buildroot}
|
||||
%{_datadir}/glib-2.0/schemas/org.gnome.settings-daemon.plugins.orientation.gschema.xml
|
||||
%{_datadir}/glib-2.0/schemas/org.gnome.settings-daemon.plugins.power.gschema.xml
|
||||
%{_datadir}/glib-2.0/schemas/org.gnome.settings-daemon.plugins.print-notifications.gschema.xml
|
||||
%{_datadir}/glib-2.0/schemas/org.gnome.settings-daemon.plugins.proxy.gschema.xml
|
||||
%{_datadir}/glib-2.0/schemas/org.gnome.settings-daemon.plugins.updates.gschema.xml
|
||||
%{_datadir}/glib-2.0/schemas/org.gnome.settings-daemon.plugins.xrandr.gschema.xml
|
||||
%{_datadir}/glib-2.0/schemas/org.gnome.settings-daemon.plugins.xsettings.gschema.xml
|
||||
|
Loading…
Reference in New Issue
Block a user