[Commits] [SCM] claws branch, master, updated. 3.13.0-31-gffd9bc6

mones at claws-mail.org mones at claws-mail.org
Wed Oct 21 22:55:44 CEST 2015


The branch, master has been updated
       via  ffd9bc6151435337ee70f87496ef5d5def24d20c (commit)
      from  cfb4a36cbde339f1bb3f4361adbb941b2fb336db (commit)

Summary of changes:
 src/plugins/vcalendar/plugin.c     |   10 +++++++---
 src/plugins/vcalendar/vcal_dbus.c  |    2 ++
 src/plugins/vcalendar/vcal_prefs.c |   26 ++++++++++++++++++++++++++
 src/plugins/vcalendar/vcal_prefs.h |    1 +
 4 files changed, 36 insertions(+), 3 deletions(-)


- Log -----------------------------------------------------------------
commit ffd9bc6151435337ee70f87496ef5d5def24d20c
Author: Ricardo Mones <ricardo at mones.org>
Date:   Wed Oct 21 22:54:47 2015 +0200

    Fix bug #3151 ‘loaded vCalendar plugin "disables"…
    
    …gnome-shells calendar view entries’

diff --git a/src/plugins/vcalendar/plugin.c b/src/plugins/vcalendar/plugin.c
index 023620b..90de166 100644
--- a/src/plugins/vcalendar/plugin.c
+++ b/src/plugins/vcalendar/plugin.c
@@ -36,6 +36,7 @@
 #include "plugin.h"
 
 #include "vcal_dbus.h"
+#include "vcal_prefs.h"
 
 gint plugin_init(gchar **error)
 {
@@ -47,15 +48,18 @@ gint plugin_init(gchar **error)
 
 	curl_global_init(CURL_GLOBAL_DEFAULT);
 	vcalendar_init();
-	connect_dbus();
+	if (vcalprefs.calendar_server)
+		connect_dbus();
 
-	return 0;	
+	return 0;
 }
 
 gboolean plugin_done(void)
 {
-	disconnect_dbus();
+	if (vcalprefs.calendar_server)
+		disconnect_dbus();
 	vcalendar_done();
+
 	return TRUE;
 }
 
diff --git a/src/plugins/vcalendar/vcal_dbus.c b/src/plugins/vcalendar/vcal_dbus.c
index 8cb1854..38d86b3 100644
--- a/src/plugins/vcalendar/vcal_dbus.c
+++ b/src/plugins/vcalendar/vcal_dbus.c
@@ -176,6 +176,7 @@ static void bus_acquired(GDBusConnection *connection,
 
 void connect_dbus(void)
 {
+	debug_print("connect_dbus() invoked\n");
 	introspection_data = g_dbus_node_info_new_for_xml(
 				introspection_xml, NULL);
 	if (introspection_data == NULL) {
@@ -198,6 +199,7 @@ void connect_dbus(void)
 
 void disconnect_dbus(void)
 {
+	debug_print("disconnect_dbus() invoked\n");
 	g_bus_unown_name(dbus_own_id);
 }
 
diff --git a/src/plugins/vcalendar/vcal_prefs.c b/src/plugins/vcalendar/vcal_prefs.c
index 859b893..64ea6da 100644
--- a/src/plugins/vcalendar/vcal_prefs.c
+++ b/src/plugins/vcalendar/vcal_prefs.c
@@ -38,6 +38,7 @@
 #include "vcalendar.h"
 #include "vcal_prefs.h"
 #include "vcal_folder.h"
+#include "vcal_dbus.h"
 
 #define PREFS_BLOCK_NAME "VCalendar"
 
@@ -70,6 +71,7 @@ struct VcalendarPage
 	GtkWidget *freebusy_get_url_entry;
 	
 	GtkWidget *ssl_verify_peer_checkbtn;
+	GtkWidget *calendar_server_checkbtn;
 };
 
 VcalendarPrefs vcalprefs;
@@ -115,6 +117,9 @@ static PrefParam param[] = {
 	{"ssl_verify_peer", "TRUE", &vcalprefs.ssl_verify_peer, P_BOOL,
 	 NULL, NULL, NULL},
 
+	{"calendar_server", "FALSE", &vcalprefs.calendar_server, P_BOOL,
+	 NULL, NULL, NULL},
+
 	{NULL, NULL, NULL, P_OTHER, NULL, NULL, NULL}
 };
 
@@ -208,6 +213,16 @@ void register_orage_checkbtn_toggled(GtkToggleButton	*toggle_btn,
 	vcalprefs.orage_registered = gtk_toggle_button_get_active(toggle_btn);
 }
 
+void calendar_server_checkbtn_toggled(GtkToggleButton *toggle, GtkWidget *widget)
+{
+	gboolean active = gtk_toggle_button_get_active(toggle);
+	if (active)
+		connect_dbus();
+	else
+		disconnect_dbus();
+	vcalprefs.calendar_server = active;
+}
+
 static void vcal_prefs_create_widget_func(PrefsPage * _page,
 					   GtkWindow * window,
 					   gpointer data)
@@ -230,6 +245,7 @@ static void vcal_prefs_create_widget_func(PrefsPage * _page,
 	GtkWidget *export_command_label;
 	GtkWidget *export_command_entry;
 	GtkWidget *register_orage_checkbtn;
+	GtkWidget *calendar_server_checkbtn;
 
 	GtkWidget *export_user_label;
 	GtkWidget *export_user_entry;
@@ -399,6 +415,16 @@ static void vcal_prefs_create_widget_func(PrefsPage * _page,
 	gtk_widget_show (register_orage_checkbtn);
 	gtk_box_pack_start(GTK_BOX (hbox3), register_orage_checkbtn, TRUE, TRUE, 0);
 
+	calendar_server_checkbtn = gtk_check_button_new_with_label(_("Export as GNOME shell calendar server"));
+	CLAWS_SET_TIP(calendar_server_checkbtn,
+		      _("Register D-Bus calendar server interface to export Claws Mail's calendar"));
+	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(calendar_server_checkbtn),
+				     vcalprefs.calendar_server);
+	g_signal_connect(G_OBJECT(calendar_server_checkbtn), "toggled",
+			 G_CALLBACK(calendar_server_checkbtn_toggled), NULL);
+	gtk_widget_show(calendar_server_checkbtn);
+	gtk_box_pack_start(GTK_BOX(hbox3), calendar_server_checkbtn, TRUE, TRUE, 0);
+
 /* freebusy export */
 /* export enable + path stuff */
 	PACK_FRAME(vbox2, frame_freebusy_export, _("Free/Busy information"));
diff --git a/src/plugins/vcalendar/vcal_prefs.h b/src/plugins/vcalendar/vcal_prefs.h
index fd4637a..11475fa 100644
--- a/src/plugins/vcalendar/vcal_prefs.h
+++ b/src/plugins/vcalendar/vcal_prefs.h
@@ -43,6 +43,7 @@ struct _VcalendarPrefs
 	gchar		*export_freebusy_pass;
 	gboolean	 orage_registered;
 	gboolean	 ssl_verify_peer;
+	gboolean	 calendar_server;
 };
 
 extern VcalendarPrefs vcalprefs;

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list