Bug #359755 - Support for CalDAV collections
This commit is contained in:
@ -3,18 +3,25 @@
|
||||
plugin_DATA = org-gnome-evolution-caldav.eplug
|
||||
plugin_LTLIBRARIES = liborg-gnome-evolution-caldav.la
|
||||
|
||||
liborg_gnome_evolution_caldav_la_CPPFLAGS = \
|
||||
$(AM_CPPFLAGS) \
|
||||
-I . \
|
||||
-I$(top_srcdir) \
|
||||
-DCALDAV_UIDIR=\""$(uidir)"\" \
|
||||
$(EVOLUTION_CALENDAR_CFLAGS)
|
||||
liborg_gnome_evolution_caldav_la_CPPFLAGS = \
|
||||
$(AM_CPPFLAGS) \
|
||||
-I . \
|
||||
-I$(top_srcdir) \
|
||||
-DCALDAV_UIDIR=\""$(uidir)"\" \
|
||||
$(EVOLUTION_CALENDAR_CFLAGS) \
|
||||
$(LIBSOUP_CFLAGS)
|
||||
|
||||
liborg_gnome_evolution_caldav_la_SOURCES = caldav-source.c
|
||||
liborg_gnome_evolution_caldav_la_SOURCES = \
|
||||
caldav-source.c \
|
||||
caldav-browse-server.h \
|
||||
caldav-browse-server.c
|
||||
|
||||
liborg_gnome_evolution_caldav_la_LIBADD = \
|
||||
$(top_builddir)/e-util/libeutil.la \
|
||||
$(top_builddir)/widgets/misc/libemiscwidgets.la \
|
||||
$(EVOLUTION_CALENDAR_LIBS) \
|
||||
$(EPLUGIN_LIBS)
|
||||
$(EPLUGIN_LIBS) \
|
||||
$(LIBSOUP_LIBS)
|
||||
|
||||
liborg_gnome_evolution_caldav_la_LDFLAGS = -module -avoid-version $(NO_UNDEFINED)
|
||||
|
||||
|
||||
1341
plugins/caldav/caldav-browse-server.c
Normal file
1341
plugins/caldav/caldav-browse-server.c
Normal file
File diff suppressed because it is too large
Load Diff
32
plugins/caldav/caldav-browse-server.h
Normal file
32
plugins/caldav/caldav-browse-server.h
Normal file
@ -0,0 +1,32 @@
|
||||
/*
|
||||
* caldav-browse-server.h
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) version 3.
|
||||
*
|
||||
* 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with the program; if not, see <http://www.gnu.org/licenses/>
|
||||
*
|
||||
*
|
||||
* Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CALDAV_BROWSE_SERVER_H
|
||||
#define CALDAV_BROWSE_SERVER_H
|
||||
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
/* Opens a window with a list of available calendars for a given server;
|
||||
Returns server URL of a calendar user chose, or NULL to let it be as is. */
|
||||
gchar *caldav_browse_server (GtkWindow *parent, const gchar *server_url, const gchar *username, gboolean use_ssl, gint source_type);
|
||||
|
||||
#endif /* CALDAV_BROWSE_SERVER_H */
|
||||
@ -38,6 +38,8 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "caldav-browse-server.h"
|
||||
|
||||
#define d(x)
|
||||
|
||||
/*****************************************************************************/
|
||||
@ -303,6 +305,39 @@ combobox_changed (GtkComboBox *combobox, ESource *source)
|
||||
g_free (refresh_str);
|
||||
}
|
||||
|
||||
static void
|
||||
browse_cal_clicked_cb (GtkButton *button, gpointer user_data)
|
||||
{
|
||||
GtkEntry *url, *username;
|
||||
GtkToggleButton *ssl;
|
||||
gchar *new_url;
|
||||
|
||||
g_return_if_fail (button != NULL);
|
||||
|
||||
url = g_object_get_data (G_OBJECT (button), "caldav-url");
|
||||
username = g_object_get_data (G_OBJECT (button), "caldav-username");
|
||||
ssl = g_object_get_data (G_OBJECT (button), "caldav-ssl");
|
||||
|
||||
g_return_if_fail (url != NULL);
|
||||
g_return_if_fail (GTK_IS_ENTRY (url));
|
||||
g_return_if_fail (username != NULL);
|
||||
g_return_if_fail (GTK_IS_ENTRY (username));
|
||||
g_return_if_fail (ssl != NULL);
|
||||
g_return_if_fail (GTK_IS_TOGGLE_BUTTON (ssl));
|
||||
|
||||
new_url = caldav_browse_server (
|
||||
GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (button))),
|
||||
gtk_entry_get_text (url),
|
||||
gtk_entry_get_text (username),
|
||||
gtk_toggle_button_get_active (ssl),
|
||||
GPOINTER_TO_INT (user_data));
|
||||
|
||||
if (new_url) {
|
||||
gtk_entry_set_text (url, new_url);
|
||||
g_free (new_url);
|
||||
}
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
oge_caldav (EPlugin *epl,
|
||||
EConfigHookItemFactoryData *data)
|
||||
@ -318,6 +353,7 @@ oge_caldav (EPlugin *epl,
|
||||
GtkWidget *widget;
|
||||
GtkWidget *luser;
|
||||
GtkWidget *user;
|
||||
GtkWidget *browse_cal;
|
||||
GtkWidget *label, *hbox, *spin, *combobox;
|
||||
gchar *uri;
|
||||
gchar *username;
|
||||
@ -429,6 +465,17 @@ oge_caldav (EPlugin *epl,
|
||||
g_free (uri);
|
||||
g_free (username);
|
||||
|
||||
browse_cal = gtk_button_new_with_mnemonic (_("Brows_e server for a calendar"));
|
||||
gtk_widget_show (browse_cal);
|
||||
gtk_table_attach (GTK_TABLE (parent), browse_cal, 1, 2, row, row + 1, GTK_FILL, 0, 0, 0);
|
||||
|
||||
g_object_set_data (G_OBJECT (browse_cal), "caldav-url", location);
|
||||
g_object_set_data (G_OBJECT (browse_cal), "caldav-username", user);
|
||||
g_object_set_data (G_OBJECT (browse_cal), "caldav-ssl", cssl);
|
||||
g_signal_connect (G_OBJECT (browse_cal), "clicked", G_CALLBACK (browse_cal_clicked_cb), GINT_TO_POINTER (t->source_type));
|
||||
|
||||
row++;
|
||||
|
||||
/* add refresh option */
|
||||
label = gtk_label_new_with_mnemonic (_("Re_fresh:"));
|
||||
gtk_widget_show (label);
|
||||
|
||||
Reference in New Issue
Block a user