File evolution-tray-git-00c08ae8.patch of Package evolution-tray

From 9552a51355675f4b483fe739314f7c87ec918ee0 Mon Sep 17 00:00:00 2001
From: Lucian Langa <lucilanga@gnome.org>
Date: Fri, 21 Oct 2011 00:35:06 +0200
Subject: [PATCH 1/6] adapt to latest evolution changes

---
 src/tray.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/tray.c b/src/tray.c
index dae0f63..d74e5a1 100644
--- a/src/tray.c
+++ b/src/tray.c
@@ -785,9 +785,17 @@ status_icon_activate_cb (void)
 	GtkAction *action;
 	GList *list;
 	const gchar *uri;
+#if (EVOLUTION_VERSION >= 30101)
+	GtkApplication *application;
+#endif
 
 	shell = e_shell_get_default ();
+#if (EVOLUTION_VERSION >= 30301)
+	application = GTK_APPLICATION(shell);
+	list = gtk_application_get_windows (application);
+#else
 	list = e_shell_get_watched_windows (shell);
+#endif
 
 	/* Find the first EShellWindow in the list. */
 	while (list != NULL && !E_IS_SHELL_WINDOW (list->data))
-- 
1.7.9


From 21950dd21a5e375ecb52cbb33be851ce01f0d812 Mon Sep 17 00:00:00 2001
From: Volodymyr Kulpa <kulpick@gmail.com>
Date: Fri, 21 Oct 2011 00:43:09 +0200
Subject: [PATCH 2/6] added minimize to tray ability

---
 src/tray.c |   45 +++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 41 insertions(+), 4 deletions(-)

diff --git a/src/tray.c b/src/tray.c
index d74e5a1..c88f21c 100644
--- a/src/tray.c
+++ b/src/tray.c
@@ -65,6 +65,7 @@
 #define GCONF_KEY_NOTIF_ROOT                 "/apps/evolution/eplugin/mail-notification/"
 #define GCONF_KEY_TRAY_ROOT                 "/apps/evolution/eplugin/tray/"
 #define GCONF_KEY_HIDDEN_ON_STARTUP GCONF_KEY_TRAY_ROOT "hidden-on-startup"
+#define GCONF_KEY_HIDE_ON_MINIMIZE GCONF_KEY_TRAY_ROOT "hide-on-minimize"
 #define GCONF_KEY_STATUS_NOTIFICATION GCONF_KEY_NOTIF_ROOT "status-notification"
 #define GCONF_KEY_NOTIFY_ONLY_INBOX     GCONF_KEY_NOTIF_ROOT "notify-only-inbox"
 #define GCONF_KEY_ENABLED_DBUS          GCONF_KEY_NOTIF_ROOT "dbus-enabled"
@@ -155,6 +156,13 @@ toggled_hidden_on_startup_cb (GtkWidget *widget, gpointer data)
 	set_part_enabled (GCONF_KEY_HIDDEN_ON_STARTUP, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)));
 }
 
+static void
+toggled_hidde_on_minimize_cb (GtkWidget *widget, gpointer data)
+{
+	g_return_if_fail (widget != NULL);
+	set_part_enabled (GCONF_KEY_HIDE_ON_MINIMIZE, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)));
+}
+
 #define GCONF_KEY_SOUND_BEEP            GCONF_KEY_NOTIF_ROOT "sound-beep"
 #define GCONF_KEY_SOUND_FILE            GCONF_KEY_NOTIF_ROOT "sound-file"
 #define GCONF_KEY_SOUND_PLAY_FILE       GCONF_KEY_NOTIF_ROOT "sound-play-file"
@@ -516,9 +524,13 @@ get_original_cfg_widget (void)
 static GtkWidget *
 get_cfg_widget (void)
 {
-	GtkWidget *cfg, *vbox, *check;
+	GtkWidget *container, *vbox, *check;
 
 	vbox = gtk_vbox_new (FALSE, 6);
+	gtk_widget_show (vbox);
+	
+	container = vbox;
+	
 	check = gtk_check_button_new_with_mnemonic (_("Hidden on startup"));
 
 	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check),
@@ -527,11 +539,20 @@ get_cfg_widget (void)
 		"toggled",
 		G_CALLBACK (toggled_hidden_on_startup_cb), NULL);
 	gtk_widget_show (check);
-	gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0);
+	gtk_box_pack_start (GTK_BOX (container), check, FALSE, FALSE, 0);
 
-	gtk_widget_show (vbox);
+	// MINIMIZE
+	check = gtk_check_button_new_with_mnemonic (_("Hide on minimize"));
 
-	return vbox;
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check),
+		is_part_enabled (GCONF_KEY_HIDE_ON_MINIMIZE));
+	g_signal_connect (G_OBJECT (check),
+		"toggled",
+		G_CALLBACK (toggled_hidde_on_minimize_cb), NULL);
+	gtk_widget_show (check);
+	gtk_box_pack_start (GTK_BOX (container), check, FALSE, FALSE, 0);
+
+	return container;
 }
 
 void gtkut_window_popup(GtkWidget *window)
@@ -1115,6 +1136,17 @@ void get_shell(void *ep, ESEventTargetShell *t)
 #endif
 
 #if EVOLUTION_VERSION >= 22900
+static gboolean window_state_event (GtkWidget *widget, GdkEventWindowState *event)
+{
+	if (is_part_enabled(GCONF_KEY_HIDE_ON_MINIMIZE) && event->changed_mask == GDK_WINDOW_STATE_ICONIFIED 
+	    && (event->new_window_state == GDK_WINDOW_STATE_ICONIFIED 
+		|| event->new_window_state == (GDK_WINDOW_STATE_ICONIFIED | GDK_WINDOW_STATE_MAXIMIZED)))
+	{
+		gtk_widget_hide (widget);
+	}
+	return TRUE;
+}
+
 gboolean
 e_plugin_ui_init (
 	GtkUIManager *ui_manager,
@@ -1127,6 +1159,11 @@ e_plugin_ui_init (
 				"show",
 				G_CALLBACK (shown_first_time_cb), NULL);
 	}
+    
+	g_signal_connect (G_OBJECT (evo_window),
+		"window-state-event",
+		G_CALLBACK (window_state_event), NULL);
+    
 	return TRUE;
 }
 #endif
-- 
1.7.9


From 72d6fc4aec549db6a39e5dee0390105456922596 Mon Sep 17 00:00:00 2001
From: Lucian Langa <lucilanga@gnome.org>
Date: Wed, 23 Nov 2011 11:53:05 +0100
Subject: [PATCH 3/6] pick evolution-shell package for proper cflags

---
 configure.ac |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/configure.ac b/configure.ac
index c8a53a7..a5cc633 100644
--- a/configure.ac
+++ b/configure.ac
@@ -42,6 +42,7 @@ AC_SUBST(LIBGCONFBRIDGE_LIBS)
 PKG_CHECK_MODULES(TRAY_EPLUGIN,
   [gtk+-3.0 >= $LIBGTK_REQUIRED dnl
    evolution-plugin$EVOLUTION_BASE_VERSION_S >= $EVOLUTION_REQUIRED dnl
+   evolution-shell$EVOLUTION_BASE_VERSION_S >= $EVOLUTION_REQUIRED dnl
 ])
 
 dnl Evolution plugin install directory
-- 
1.7.9


From 27d6cf89f4cb380695571d6722f8f08c93cbd4c5 Mon Sep 17 00:00:00 2001
From: Lucian Langa <lucilanga@gnome.org>
Date: Mon, 9 Jan 2012 18:10:43 +0100
Subject: [PATCH 4/6] initial gsettings porting

---
 configure.ac                                       |    2 +
 src/Makefile.am                                    |   16 ++-
 src/evolution-tray.convert                         |    7 +
 src/evolution-tray.schemas.in                      |   33 ++++
 ....evolution.plugin.evolution-tray.gschema.xml.in |   14 ++
 src/tray.c                                         |  193 ++++++++++++++++++--
 6 files changed, 244 insertions(+), 21 deletions(-)
 create mode 100644 src/evolution-tray.convert
 create mode 100644 src/evolution-tray.schemas.in
 create mode 100644 src/org.gnome.evolution.plugin.evolution-tray.gschema.xml.in

diff --git a/configure.ac b/configure.ac
index a5cc633..d77181c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -11,6 +11,8 @@ AM_MAINTAINER_MODE
 dnl make sure we keep ACLOCAL_FLAGS around for maintainer builds to work
 AC_SUBST(ACLOCAL_AMFLAGS, "\${ACLOCAL_FLAGS}")
 
+GLIB_GSETTINGS
+
 AC_PROG_INTLTOOL([0.21])
 
 AC_PROG_CC
diff --git a/src/Makefile.am b/src/Makefile.am
index e961af0..e854e0a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -33,11 +33,23 @@ liborg_gnome_evolution_tray_la_SOURCES = tray.c
 liborg_gnome_evolution_tray_la_LIBADD = $(LIBGCONFBRIDGE_LIBS) $(LIBNOTIFY_LIBS)
 liborg_gnome_evolution_tray_la_LDFLAGS = -module -avoid-version -rpath $(PLUGIN_INSTALL_DIR)
 
+gsettings_SCHEMAS =                            \
+	org.gnome.evolution.plugin.evolution-tray.gschema.xml
+
+@INTLTOOL_XML_NOMERGE_RULE@
+
+@GSETTINGS_RULES@
+
+convertdir = $(datadir)/GConf/gsettings
+convert_DATA = evolution-tray.convert
+
 EXTRA_DIST = 	org-gnome-evolution-tray.eplug.xml	\
-		$(schema_in_files)
+		$(convert_DATA)                         \
+		$(gsettings_SCHEMAS:.xml=.xml.in.in)
+
 
 BUILT_SOURCES = org-gnome-evolution-tray.eplug
 
 CLEANFILES = $(BUILT_SOURCES)
 
-DISTCLEANFILES = $(schema_DATA)
+DISTCLEANFILES = $(gsettings_SCHEMAS)
diff --git a/src/evolution-tray.convert b/src/evolution-tray.convert
new file mode 100644
index 0000000..ac49ac1
--- /dev/null
+++ b/src/evolution-tray.convert
@@ -0,0 +1,7 @@
+[org.gnome.evolution]
+version = /apps/evolution/version
+last-upgraded-version = /apps/evolution/last_version
+
+[org.gnome.evolution.plugin.evolution-tray]
+hidden-on-startup = /apps/evolution/plugin/evolution-tray/hidden-on-startup
+hide-on-minimize = /apps/evolution/plugin/evolution-tray/hide-on-minimize
diff --git a/src/evolution-tray.schemas.in b/src/evolution-tray.schemas.in
new file mode 100644
index 0000000..90bda00
--- /dev/null
+++ b/src/evolution-tray.schemas.in
@@ -0,0 +1,33 @@
+<gconfschemafile>
+  <schemalist>
+  
+    <schema>
+      <key>/schemas/apps/evolution/eplugin/tray/hidden-on-startup</key>
+      <applyto>/apps/evolution/eplugin/tray/hidden-on-startup</applyto>
+      <owner>tray</owner>
+      <type>bool</type>
+      <default>false</default>
+      <locale name="C">
+        <short>Start Evolution Mail minimized.</short>
+        <long>
+            On startup Evolution Mail will start minimized to tray
+        </long>
+      </locale>
+    </schema>
+    
+    <schema>
+      <key>/schemas/apps/evolution/eplugin/tray/hide-on-minimize</key>
+      <applyto>/apps/evolution/eplugin/tray/hide-on-minimize</applyto>
+      <owner>tray</owner>
+      <type>bool</type>
+      <default>false</default>
+      <locale name="C">
+        <short>Hide Evolution Mail on minimize.</short>
+        <long>
+	    When pressing minimize button Evolution Mail window is automatically hidden
+        </long>
+      </locale>
+    </schema>
+
+  </schemalist>
+</gconfschemafile>
diff --git a/src/org.gnome.evolution.plugin.evolution-tray.gschema.xml.in b/src/org.gnome.evolution.plugin.evolution-tray.gschema.xml.in
new file mode 100644
index 0000000..9f1cbf3
--- /dev/null
+++ b/src/org.gnome.evolution.plugin.evolution-tray.gschema.xml.in
@@ -0,0 +1,14 @@
+<schemalist>
+  <schema id="org.gnome.evolution.plugin.evolution-tray" path="/apps/evolution/">
+    <key name="hidden-on-startup" type="b">
+      <default>false</default>
+      <summary>Start Evolution Mail minimized.</summary>
+      <description>On startup Evolution Mail will start minimized to tray</description>
+    </key>
+    <key name="hide-on-minimize" type="b">
+      <default>false</default>
+      <summary>Hide Evolution Mail on minimize.</summary>
+      <description>When pressing minimize button Evolution Mail window is automatically hidden</description>
+    </key>
+  </schema>
+</schemalist>
diff --git a/src/tray.c b/src/tray.c
index c88f21c..a3ec240 100644
--- a/src/tray.c
+++ b/src/tray.c
@@ -26,11 +26,13 @@
 #include <string.h>
 
 #include <gconf/gconf-client.h>
+#if EVOLUTION_VERSION < 30304
 #ifdef HAVE_LIBGCONFBRIDGE
 #include <libgconf-bridge/gconf-bridge.h>
 #else
 #include <e-util/gconf-bridge.h>
 #endif
+#endif
 
 #include <e-util/e-config.h>
 
@@ -64,13 +66,25 @@
 
 #define GCONF_KEY_NOTIF_ROOT                 "/apps/evolution/eplugin/mail-notification/"
 #define GCONF_KEY_TRAY_ROOT                 "/apps/evolution/eplugin/tray/"
-#define GCONF_KEY_HIDDEN_ON_STARTUP GCONF_KEY_TRAY_ROOT "hidden-on-startup"
-#define GCONF_KEY_HIDE_ON_MINIMIZE GCONF_KEY_TRAY_ROOT "hide-on-minimize"
-#define GCONF_KEY_STATUS_NOTIFICATION GCONF_KEY_NOTIF_ROOT "status-notification"
+#if EVOLUTION_VERSION < 30304
+#define GCONF_KEY_HIDDEN_ON_STARTUP	GCONF_KEY_TRAY_ROOT "hidden-on-startup"
+#define GCONF_KEY_HIDE_ON_MINIMIZE	GCONF_KEY_TRAY_ROOT "hide-on-minimize"
 #define GCONF_KEY_NOTIFY_ONLY_INBOX     GCONF_KEY_NOTIF_ROOT "notify-only-inbox"
 #define GCONF_KEY_ENABLED_DBUS          GCONF_KEY_NOTIF_ROOT "dbus-enabled"
 #define GCONF_KEY_ENABLED_STATUS        GCONF_KEY_NOTIF_ROOT "status-enabled"
 #define GCONF_KEY_ENABLED_SOUND         GCONF_KEY_NOTIF_ROOT "sound-enabled"
+#define GCONF_KEY_STATUS_NOTIFICATION	GCONF_KEY_NOTIF_ROOT "status-notification"
+#else
+#define NOTIF_SCHEMA			"org.gnome.evolution.plugin.mail-notification"
+#define TRAY_SCHEMA			"org.gnome.evolution.plugin.evolution-tray"
+#define CONF_KEY_HIDDEN_ON_STARTUP	"hidden-on-startup"
+#define CONF_KEY_HIDE_ON_MINIMIZE	"hide-on-minimize"
+#define CONF_KEY_NOTIFY_ONLY_INBOX	"notify-only-inbox"
+#define CONF_KEY_ENABLED_DBUS		"notify-dbus-enabled"
+#define CONF_KEY_ENABLED_STATUS		"notify-status-enabled"
+#define CONF_KEY_ENABLED_SOUND		"notify-sound-enabled"
+#define CONF_KEY_STATUS_NOTIFICATION	"notify-status-notification"
+#endif
 
 static guint status_count = 0;
 static gboolean winstatus;
@@ -116,57 +130,97 @@ static void status_icon_activate_cb (void);
 
 //Query GConf
 static gboolean
+#if EVOLUTION_VERSION < 30304
 is_part_enabled (const gchar *gconf_key)
+#else
+is_part_enabled (gchar *schema, const gchar *key)
+#endif
 {
 	/* the part is not enabled by default */
 	gboolean res = FALSE;
+#if EVOLUTION_VERSION < 30304
 	GConfClient *client;
 	GConfValue  *is_key;
+#else
+	GSettings *settings;
+#endif
 
+#if EVOLUTION_VERSION < 30304
 	client = gconf_client_get_default ();
+#else
+	settings = g_settings_new (schema);
+#endif
 
+#if EVOLUTION_VERSION < 30304
 	is_key = gconf_client_get (client, gconf_key, NULL);
 	if (is_key) {
 		res = gconf_client_get_bool (client, gconf_key, NULL);
 		gconf_value_free (is_key);
 	}
-
 	g_object_unref (client);
+#else
+	res = g_settings_get_boolean (settings, key);
+	g_object_unref (settings);
+#endif
+
 
 	return res;
 }
 
-//Set GConf
 static void
+#if EVOLUTION_VERSION < 30304
+//Set GConf
 set_part_enabled (const gchar *gconf_key, gboolean enable)
 {
-	GConfClient *client;
-
-	client = gconf_client_get_default ();
+	GConfClient *client = gconf_client_get_default ();
 
 	gconf_client_set_bool (client, gconf_key, enable, NULL);
 	g_object_unref (client);
 }
+#else
+set_part_enabled (gchar *schema, const gchar *key, gboolean enable)
+{
+	GSettings *settings = g_settings_new (schema);
+	g_settings_set_boolean (settings, key, enable);
+	g_object_unref (settings);
+}
+#endif
 
 //Callback for Configuration Widget
 static void
 toggled_hidden_on_startup_cb (GtkWidget *widget, gpointer data)
 {
 	g_return_if_fail (widget != NULL);
-	set_part_enabled (GCONF_KEY_HIDDEN_ON_STARTUP, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)));
+#if EVOLUTION_VERSION < 30304
+	set_part_enabled (GCONF_KEY_HIDDEN_ON_STARTUP,
+#else
+	set_part_enabled (TRAY_SCHEMA, CONF_KEY_HIDDEN_ON_STARTUP,
+#endif
+		gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)));
 }
 
 static void
 toggled_hidde_on_minimize_cb (GtkWidget *widget, gpointer data)
 {
 	g_return_if_fail (widget != NULL);
-	set_part_enabled (GCONF_KEY_HIDE_ON_MINIMIZE, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)));
+#if EVOLUTION_VERSION < 30304
+	set_part_enabled (GCONF_KEY_HIDE_ON_MINIMIZE,
+#else
+	set_part_enabled (TRAY_SCHEMA, CONF_KEY_HIDE_ON_MINIMIZE,
+#endif
+		gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)));
 }
 
+#if EVOLUTION_VERSION < 30304
 #define GCONF_KEY_SOUND_BEEP            GCONF_KEY_NOTIF_ROOT "sound-beep"
-#define GCONF_KEY_SOUND_FILE            GCONF_KEY_NOTIF_ROOT "sound-file"
-#define GCONF_KEY_SOUND_PLAY_FILE       GCONF_KEY_NOTIF_ROOT "sound-play-file"
 #define GCONF_KEY_SOUND_USE_THEME       GCONF_KEY_NOTIF_ROOT "sound-use-theme"
+#define CONF_KEY_SOUND_PLAY_FILE	GCONF_KEY_NOTIF_ROOT "sound-play-file"
+#else
+#define CONF_KEY_SOUND_BEEP		"notify-sound-beep"
+#define CONF_KEY_SOUND_USE_THEME	"notify-sound-use-theme"
+#define CONF_KEY_SOUND_PLAY_FILE	"notify-sound-play-file"
+#endif
+#define GCONF_KEY_SOUND_FILE            GCONF_KEY_NOTIF_ROOT "sound-file"
 
 static void
 do_play_sound (gboolean beep, gboolean use_theme, const gchar *file)
@@ -248,8 +302,14 @@ sound_notify_idle_cb (gpointer user_data)
 	client = gconf_client_get_default ();
 	file = gconf_client_get_string (client, GCONF_KEY_SOUND_FILE, NULL);
 
-	do_play_sound (is_part_enabled (GCONF_KEY_SOUND_BEEP),
+	do_play_sound (
+#if EVOLUTION_VERSION < 30304
+			is_part_enabled (GCONF_KEY_SOUND_BEEP),
 			is_part_enabled (GCONF_KEY_SOUND_USE_THEME),
+#else
+			is_part_enabled (NOTIF_SCHEMA, CONF_KEY_SOUND_BEEP),
+			is_part_enabled (NOTIF_SCHEMA, CONF_KEY_SOUND_USE_THEME),
+#endif
 			file);
 
 	g_object_unref (client);
@@ -269,10 +329,18 @@ get_config_widget_status (void)
 	GtkWidget *master;
 	GtkWidget *container;
 	GtkWidget *widget;
+#if EVOLUTION_VERSION < 30304
 	GConfBridge *bridge;
+#else
+	GSettings *settings;
+#endif
 	const gchar *text;
 
+#if EVOLUTION_VERSION < 30304
 	bridge = gconf_bridge_get ();
+#else
+	settings = g_settings_new ("org.gnome.evolution.plugin.mail-notification");
+#endif
 
 	vbox = gtk_vbox_new (FALSE, 6);
 	gtk_widget_show (vbox);
@@ -284,9 +352,15 @@ get_config_widget_status (void)
 	gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
 	gtk_widget_show (widget);
 
+#if EVOLUTION_VERSION < 30304
 	gconf_bridge_bind_property (
 		bridge, GCONF_KEY_ENABLED_STATUS,
 		G_OBJECT (widget), "active");
+#else
+	g_settings_bind (settings, CONF_KEY_ENABLED_STATUS,
+		G_OBJECT (widget),
+		"active", G_SETTINGS_BIND_DEFAULT);
+#endif
 
 	master = widget;
 
@@ -324,9 +398,15 @@ get_config_widget_status (void)
 	gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
 	gtk_widget_show (widget);
 
+#if EVOLUTION_VERSION < 30304
 	gconf_bridge_bind_property (
 		bridge, GCONF_KEY_STATUS_NOTIFICATION,
 		G_OBJECT (widget), "active");
+#else
+	g_settings_bind (settings, CONF_KEY_STATUS_NOTIFICATION,
+		G_OBJECT (widget),
+		"active", G_SETTINGS_BIND_DEFAULT);
+#endif
 #endif
 
 	return vbox;
@@ -341,13 +421,21 @@ get_config_widget_sound (void)
 	GtkWidget *master;
 	GtkWidget *widget;
 	gchar *file;
+#if EVOLUTION_VERSION < 30304
 	GConfBridge *bridge;
+#else
+	GSettings *settings;
+#endif
 	GConfClient *client;
 	GSList *group = NULL;
 	struct _SoundConfigureWidgets *scw;
 	const gchar *text;
 
+#if EVOLUTION_VERSION < 30304
 	bridge = gconf_bridge_get ();
+#else
+	settings = g_settings_new ("org.gnome.evolution.plugin.mail-notification");
+#endif
 
 	scw = g_malloc0 (sizeof (struct _SoundConfigureWidgets));
 
@@ -361,9 +449,15 @@ get_config_widget_sound (void)
 	gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
 	gtk_widget_show (widget);
 
+#if EVOLUTION_VERSION < 30304
 	gconf_bridge_bind_property (
 		bridge, GCONF_KEY_ENABLED_SOUND,
 		G_OBJECT (widget), "active");
+#else
+	g_settings_bind (settings, CONF_KEY_ENABLED_SOUND,
+		G_OBJECT (widget),
+		"active", G_SETTINGS_BIND_DEFAULT);
+#endif
 
 	master = widget;
 	scw->enable = widget;
@@ -401,9 +495,15 @@ get_config_widget_sound (void)
 	gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
 	gtk_widget_show (widget);
 
+#if EVOLUTION_VERSION < 30304
 	gconf_bridge_bind_property (
 		bridge, GCONF_KEY_SOUND_BEEP,
 		G_OBJECT (widget), "active");
+#else
+	g_settings_bind (settings, CONF_KEY_SOUND_BEEP,
+		G_OBJECT (widget),
+		"active", G_SETTINGS_BIND_DEFAULT);
+#endif
 
 	scw->beep = widget;
 
@@ -414,9 +514,15 @@ get_config_widget_sound (void)
 	gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
 	gtk_widget_show (widget);
 
+#if EVOLUTION_VERSION < 30304
 	gconf_bridge_bind_property (
 		bridge, GCONF_KEY_SOUND_USE_THEME,
 		G_OBJECT (widget), "active");
+#else
+	g_settings_bind (settings, CONF_KEY_SOUND_USE_THEME,
+		G_OBJECT (widget),
+		"active", G_SETTINGS_BIND_DEFAULT);
+#endif
 
 	scw->use_theme = widget;
 
@@ -433,9 +539,15 @@ get_config_widget_sound (void)
 	gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
 	gtk_widget_show (widget);
 
+#if EVOLUTION_VERSION < 30304
 	gconf_bridge_bind_property (
 		bridge, GCONF_KEY_SOUND_PLAY_FILE,
 		G_OBJECT (widget), "active");
+#else
+	g_settings_bind (settings, CONF_KEY_SOUND_PLAY_FILE,
+		G_OBJECT (widget),
+		"active", G_SETTINGS_BIND_DEFAULT);
+#endif
 
 	scw->file = widget;
 
@@ -483,10 +595,18 @@ get_original_cfg_widget (void)
 {
 	GtkWidget *container;
 	GtkWidget *widget;
+#if EVOLUTION_VERSION < 30304
 	GConfBridge *bridge;
+#else
+	GSettings *settings;
+#endif
 	const gchar *text;
 
+#if EVOLUTION_VERSION < 30304
 	bridge = gconf_bridge_get ();
+#else
+	settings = g_settings_new ("org.gnome.evolution.plugin.mail-notification");
+#endif
 
 	widget = gtk_vbox_new (FALSE, 12);
 	gtk_widget_show (widget);
@@ -498,18 +618,30 @@ get_original_cfg_widget (void)
 	gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
 	gtk_widget_show (widget);
 
+#if EVOLUTION_VERSION < 30304
 	gconf_bridge_bind_property (
 		bridge, GCONF_KEY_NOTIFY_ONLY_INBOX,
 		G_OBJECT (widget), "active");
+#else
+	g_settings_bind (settings, CONF_KEY_NOTIFY_ONLY_INBOX,
+		G_OBJECT (widget),
+		"active", G_SETTINGS_BIND_DEFAULT);
+#endif
 
 	text = _("Generate a _D-Bus message");
 	widget = gtk_check_button_new_with_mnemonic (text);
 	gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
 	gtk_widget_show (widget);
 
+#if EVOLUTION_VERSION < 30304
 	gconf_bridge_bind_property (
 		bridge, GCONF_KEY_ENABLED_DBUS,
 		G_OBJECT (widget), "active");
+#else
+	g_settings_bind (settings, CONF_KEY_ENABLED_DBUS,
+		G_OBJECT (widget),
+		"active", G_SETTINGS_BIND_DEFAULT);
+#endif
 
 	widget = get_config_widget_status ();
 	gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
@@ -534,7 +666,11 @@ get_cfg_widget (void)
 	check = gtk_check_button_new_with_mnemonic (_("Hidden on startup"));
 
 	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check),
+#if EVOLUTION_VERSION < 30304
 		is_part_enabled (GCONF_KEY_HIDDEN_ON_STARTUP));
+#else
+		is_part_enabled (TRAY_SCHEMA, CONF_KEY_HIDDEN_ON_STARTUP));
+#endif
 	g_signal_connect (G_OBJECT (check),
 		"toggled",
 		G_CALLBACK (toggled_hidden_on_startup_cb), NULL);
@@ -545,7 +681,11 @@ get_cfg_widget (void)
 	check = gtk_check_button_new_with_mnemonic (_("Hide on minimize"));
 
 	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check),
+#if EVOLUTION_VERSION < 30304
 		is_part_enabled (GCONF_KEY_HIDE_ON_MINIMIZE));
+#else
+		is_part_enabled (TRAY_SCHEMA, CONF_KEY_HIDE_ON_MINIMIZE));
+#endif
 	g_signal_connect (G_OBJECT (check),
 		"toggled",
 		G_CALLBACK (toggled_hidde_on_minimize_cb), NULL);
@@ -1030,7 +1170,11 @@ new_notify_status (EMEventTargetFolder *t)
 
 #ifdef HAVE_LIBNOTIFY
 	/* Now check whether we're supposed to send notifications */
+#if EVOLUTION_VERSION < 30304
 	if (is_part_enabled (GCONF_KEY_STATUS_NOTIFICATION)) {
+#else
+	if (is_part_enabled (NOTIF_SCHEMA, CONF_KEY_STATUS_NOTIFICATION)) {
+#endif
 		gchar *safetext;
 
 		safetext = g_markup_escape_text (msg, strlen (msg));
@@ -1126,7 +1270,11 @@ void get_shell(void *ep, ESEventTargetShell *t)
 	EShellPrivate *priv = (EShellPrivate *)shell->priv;
 	evo_window = (GtkWidget *)priv->windows;
 #endif
+#if EVOLUTION_VERSION < 30304
 	if (is_part_enabled(GCONF_KEY_HIDDEN_ON_STARTUP)) {
+#else
+	if (is_part_enabled(TRAY_SCHEMA, CONF_KEY_HIDDEN_ON_STARTUP)) {
+#endif
 		shown_first_time_handle =
 			g_signal_connect (G_OBJECT (evo_window),
 				"show",
@@ -1138,10 +1286,13 @@ void get_shell(void *ep, ESEventTargetShell *t)
 #if EVOLUTION_VERSION >= 22900
 static gboolean window_state_event (GtkWidget *widget, GdkEventWindowState *event)
 {
-	if (is_part_enabled(GCONF_KEY_HIDE_ON_MINIMIZE) && event->changed_mask == GDK_WINDOW_STATE_ICONIFIED 
-	    && (event->new_window_state == GDK_WINDOW_STATE_ICONIFIED 
-		|| event->new_window_state == (GDK_WINDOW_STATE_ICONIFIED | GDK_WINDOW_STATE_MAXIMIZED)))
-	{
+#if EVOLUTION_VERSION < 30304
+	if (is_part_enabled(GCONF_KEY_HIDE_ON_MINIMIZE)
+#else
+	if (is_part_enabled(TRAY_SCHEMA, CONF_KEY_HIDE_ON_MINIMIZE)
+#endif
+	&& event->changed_mask == GDK_WINDOW_STATE_ICONIFIED
+	&& event->new_window_state & GDK_WINDOW_STATE_ICONIFIED) {
 		gtk_widget_hide (widget);
 	}
 	return TRUE;
@@ -1153,17 +1304,21 @@ e_plugin_ui_init (
 	EShellView *shell_view)
 {
 	evo_window = e_shell_view_get_shell_window (shell_view);
+#if EVOLUTION_VERSION < 30304
 	if (is_part_enabled(GCONF_KEY_HIDDEN_ON_STARTUP)) {
+#else
+	if (is_part_enabled(TRAY_SCHEMA, CONF_KEY_HIDDEN_ON_STARTUP)) {
+#endif
 		shown_first_time_handle =
 			g_signal_connect (G_OBJECT (evo_window),
 				"show",
 				G_CALLBACK (shown_first_time_cb), NULL);
 	}
-    
+
 	g_signal_connect (G_OBJECT (evo_window),
 		"window-state-event",
 		G_CALLBACK (window_state_event), NULL);
-    
+
 	return TRUE;
 }
 #endif
-- 
1.7.9


From 0eb47c24e19f141a74b43c58a1af03b8ee17d780 Mon Sep 17 00:00:00 2001
From: Lucian Langa <lucilanga@gnome.org>
Date: Sat, 21 Jan 2012 08:43:31 +0100
Subject: [PATCH 5/6] fix path in schema file

---
 ....evolution.plugin.evolution-tray.gschema.xml.in |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/org.gnome.evolution.plugin.evolution-tray.gschema.xml.in b/src/org.gnome.evolution.plugin.evolution-tray.gschema.xml.in
index 9f1cbf3..eca7744 100644
--- a/src/org.gnome.evolution.plugin.evolution-tray.gschema.xml.in
+++ b/src/org.gnome.evolution.plugin.evolution-tray.gschema.xml.in
@@ -1,5 +1,5 @@
 <schemalist>
-  <schema id="org.gnome.evolution.plugin.evolution-tray" path="/apps/evolution/">
+  <schema id="org.gnome.evolution.plugin.evolution-tray" path="/org/gnome/evolution/plugin/tray/">
     <key name="hidden-on-startup" type="b">
       <default>false</default>
       <summary>Start Evolution Mail minimized.</summary>
-- 
1.7.9


From 00c08ae8813bb8b7266292c6e49ced033429a347 Mon Sep 17 00:00:00 2001
From: Lucian Langa <lucilanga@gnome.org>
Date: Sat, 21 Jan 2012 16:37:15 +0100
Subject: [PATCH 6/6] fix typo

---
 src/tray.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/tray.c b/src/tray.c
index a3ec240..43e9c31 100644
--- a/src/tray.c
+++ b/src/tray.c
@@ -214,7 +214,7 @@ toggled_hidde_on_minimize_cb (GtkWidget *widget, gpointer data)
 #if EVOLUTION_VERSION < 30304
 #define GCONF_KEY_SOUND_BEEP            GCONF_KEY_NOTIF_ROOT "sound-beep"
 #define GCONF_KEY_SOUND_USE_THEME       GCONF_KEY_NOTIF_ROOT "sound-use-theme"
-#define CONF_KEY_SOUND_PLAY_FILE	GCONF_KEY_NOTIF_ROOT "sound-play-file"
+#define GCONF_KEY_SOUND_PLAY_FILE	GCONF_KEY_NOTIF_ROOT "sound-play-file"
 #else
 #define CONF_KEY_SOUND_BEEP		"notify-sound-beep"
 #define CONF_KEY_SOUND_USE_THEME	"notify-sound-use-theme"
-- 
1.7.9