aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2008-10-25 07:52:05 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2008-10-25 07:52:05 +0800
commit85b2913a380c69f14ae0254ad23b10fabfb33667 (patch)
treec1cf143e37294dd9dd3667ebbe0a1d0c00b04b56 /calendar/gui
parente7a31c5035a0afeed6c1675e30487c1e2bdc139f (diff)
downloadgsoc2013-evolution-85b2913a380c69f14ae0254ad23b10fabfb33667.tar
gsoc2013-evolution-85b2913a380c69f14ae0254ad23b10fabfb33667.tar.gz
gsoc2013-evolution-85b2913a380c69f14ae0254ad23b10fabfb33667.tar.bz2
gsoc2013-evolution-85b2913a380c69f14ae0254ad23b10fabfb33667.tar.lz
gsoc2013-evolution-85b2913a380c69f14ae0254ad23b10fabfb33667.tar.xz
gsoc2013-evolution-85b2913a380c69f14ae0254ad23b10fabfb33667.tar.zst
gsoc2013-evolution-85b2913a380c69f14ae0254ad23b10fabfb33667.zip
Merge revisions 36534:36684 from trunk.
svn path=/branches/kill-bonobo/; revision=36685
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/alarm-notify/alarm.c31
-rw-r--r--calendar/gui/cal-search-bar.c5
-rw-r--r--calendar/gui/calendar-commands.c37
-rw-r--r--calendar/gui/calendar-commands.h34
-rw-r--r--calendar/gui/dialogs/calendar-setup.c3
-rw-r--r--calendar/gui/dialogs/comp-editor.c32
-rw-r--r--calendar/gui/e-cal-popup.c32
-rw-r--r--calendar/gui/e-day-view.c50
-rw-r--r--calendar/gui/e-week-view.c9
-rw-r--r--calendar/gui/gnome-cal.c38
-rw-r--r--calendar/gui/gnome-cal.h34
-rw-r--r--calendar/gui/tasks-component.c27
12 files changed, 180 insertions, 152 deletions
diff --git a/calendar/gui/alarm-notify/alarm.c b/calendar/gui/alarm-notify/alarm.c
index 7f6d1f41d5..bf96f1f664 100644
--- a/calendar/gui/alarm-notify/alarm.c
+++ b/calendar/gui/alarm-notify/alarm.c
@@ -1,23 +1,26 @@
-/* Evolution calendar - Low-level alarm timer mechanism
- *
- * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
- * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
- *
- * Authors: Miguel de Icaza <miguel@ximian.com>
- * Federico Mena-Quintero <federico@ximian.com>
+/*
+ * Evolution calendar - Low-level alarm timer mechanism
*
* This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
+ * 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 General Public License for more details.
+ * 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/>
+ *
+ *
+ * Authors:
+ * Miguel de Icaza <miguel@ximian.com>
+ * Federico Mena-Quintero <federico@ximian.com>
+ *
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
*
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <config.h>
diff --git a/calendar/gui/cal-search-bar.c b/calendar/gui/cal-search-bar.c
index d816aa7cd9..b8fe5a45fd 100644
--- a/calendar/gui/cal-search-bar.c
+++ b/calendar/gui/cal-search-bar.c
@@ -552,9 +552,8 @@ generate_viewoption_menu (CALSearchBarItem *subitems)
if (subitems[i].image) {
GtkWidget *image;
- image = gtk_image_new_from_icon_name (
- subitems[i].image,
- GTK_ICON_SIZE_MENU);
+ image = gtk_image_new_from_file (
+ subitems[i].image);
gtk_image_menu_item_set_image (
GTK_IMAGE_MENU_ITEM (menu_item),
image);
diff --git a/calendar/gui/calendar-commands.c b/calendar/gui/calendar-commands.c
index c2a46fb4e5..c398b6e12b 100644
--- a/calendar/gui/calendar-commands.c
+++ b/calendar/gui/calendar-commands.c
@@ -1,27 +1,28 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* Evolution calendar - Commands for the calendar GUI control
- *
- * Copyright (C) 1998 The Free Software Foundation
- * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
- * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
- *
- * Authors: Miguel de Icaza <miguel@ximian.com>
- * Federico Mena-Quintero <federico@ximian.com>
- * Seth Alves <alves@hungry.com>
- * Rodrigo Moya <rodrigo@ximian.com>
+/*
+ * Evolution calendar - Commands for the calendar GUI control
*
* This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
+ * 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 General Public License for more details.
+ * 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/>
+ *
+ *
+ * Authors:
+ * Miguel de Icaza <miguel@ximian.com>
+ * Federico Mena-Quintero <federico@ximian.com>
+ * Seth Alves <alves@hungry.com>
+ * Rodrigo Moya <rodrigo@ximian.com>
+ *
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
*
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
diff --git a/calendar/gui/calendar-commands.h b/calendar/gui/calendar-commands.h
index ac996eeede..cfe2d24232 100644
--- a/calendar/gui/calendar-commands.h
+++ b/calendar/gui/calendar-commands.h
@@ -1,25 +1,27 @@
-/* Evolution calendar - Commands for the calendar GUI control
- *
- * Copyright (C) 1998 The Free Software Foundation
- * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
- * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
- *
- * Authors: Miguel de Icaza <miguel@ximian.com>
- * Federico Mena-Quintero <federico@ximian.com>
- * Seth Alves <alves@hungry.com>
+/*
+ * Evolution calendar - Commands for the calendar GUI control
*
* This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
+ * 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 General Public License for more details.
+ * 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/>
+ *
+ *
+ * Authors:
+ * Miguel de Icaza <miguel@ximian.com>
+ * Federico Mena-Quintero <federico@ximian.com>
+ * Seth Alves <alves@hungry.com>
+ *
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
*
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef CALENDAR_COMMANDS_H
diff --git a/calendar/gui/dialogs/calendar-setup.c b/calendar/gui/dialogs/calendar-setup.c
index f7ab2ee846..724206a072 100644
--- a/calendar/gui/dialogs/calendar-setup.c
+++ b/calendar/gui/dialogs/calendar-setup.c
@@ -259,7 +259,8 @@ eccp_general_offline (EConfig *ec, EConfigItem *item, struct _GtkWidget *parent,
GtkWidget *offline_setting = NULL;
const char *offline_sync;
int row;
- gboolean is_local = g_str_has_prefix (e_source_group_peek_base_uri (sdialog->source_group), "file:");
+ const char *base_uri = e_source_group_peek_base_uri (sdialog->source_group);
+ gboolean is_local = base_uri && (g_str_has_prefix (base_uri, "file://") || g_str_has_prefix (base_uri, "contacts://"));
offline_sync = e_source_get_property (sdialog->source, "offline_sync");
if (old)
return old;
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
index 5e19e690eb..c1f123e836 100644
--- a/calendar/gui/dialogs/comp-editor.c
+++ b/calendar/gui/dialogs/comp-editor.c
@@ -1,21 +1,25 @@
-/* Evolution calendar - Framework for a calendar component editor dialog
- *
- * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
- *
- * Author: Federico Mena-Quintero <federico@ximian.com>
+/*
+ * Evolution calendar - Framework for a calendar component editor dialog
*
* This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
+ * 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 General Public License for more details.
+ * 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/>
+ *
+ *
+ * Authors:
+ * Federico Mena-Quintero <federico@ximian.com>
+ *
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
*
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
@@ -1752,6 +1756,10 @@ comp_editor_init (CompEditor *editor)
priv->attachment_bar = e_attachment_bar_new (NULL);
priv->manager = gtk_ui_manager_new ();
+ gtk_window_add_accel_group (
+ GTK_WINDOW (editor),
+ gtk_ui_manager_get_accel_group (priv->manager));
+
action_group = gtk_action_group_new ("core");
gtk_action_group_set_translation_domain (
action_group, GETTEXT_PACKAGE);
diff --git a/calendar/gui/e-cal-popup.c b/calendar/gui/e-cal-popup.c
index 7f61282a5a..6a5c5b3fa5 100644
--- a/calendar/gui/e-cal-popup.c
+++ b/calendar/gui/e-cal-popup.c
@@ -702,7 +702,7 @@ e_cal_popup_target_new_source(ECalPopup *eabp, ESourceSelector *selector)
{
ECalPopupTargetSource *t = e_popup_target_new(&eabp->popup, E_CAL_POPUP_TARGET_SOURCE, sizeof(*t));
guint32 mask = ~0;
- const char *source_uri;
+ const char *relative_uri;
char *uri;
ESource *source;
const char *offline = NULL;
@@ -719,42 +719,32 @@ e_cal_popup_target_new_source(ECalPopup *eabp, ESourceSelector *selector)
mask &= ~E_CAL_POPUP_SOURCE_PRIMARY;
/* FIXME Gross hack, should have a property or something */
- source_uri = e_source_peek_relative_uri(source);
- if (source_uri && !strcmp("system", source_uri))
+ relative_uri = e_source_peek_relative_uri(source);
+ if (relative_uri && !strcmp("system", relative_uri))
mask &= ~E_CAL_POPUP_SOURCE_SYSTEM;
else
mask &= ~E_CAL_POPUP_SOURCE_USER;
- source = e_source_selector_peek_primary_selection (selector);
uri = e_source_get_uri (source);
if (!uri || (g_ascii_strncasecmp (uri, "file://", 7) && g_ascii_strncasecmp (uri, "contacts://", 11))) {
/* check for e_target_selector's offline_status property here */
- offline = e_source_get_property (source, "offline");
-
- if (offline && strcmp (offline,"1") == 0) {
- /* set the menu item to Mark Offline - */
- mask &= ~E_CAL_POPUP_SOURCE_NO_OFFLINE;
- } else {
+ offline = e_source_get_property (source, "offline_sync");
+ if (offline && strcmp (offline, "1") == 0)
+ mask &= ~E_CAL_POPUP_SOURCE_NO_OFFLINE; /* set the menu item to Mark Offline */
+ else
mask &= ~E_CAL_POPUP_SOURCE_OFFLINE;
- }
} else {
mask |= E_CAL_POPUP_SOURCE_NO_OFFLINE;
mask |= E_CAL_POPUP_SOURCE_OFFLINE;
}
g_free (uri);
- source = e_source_selector_peek_primary_selection (selector);
- /*check for delete_status property here*/
+ /* check for delete_status property here */
delete = e_source_get_property (source, "delete");
-
- if (delete && strcmp (delete,"no") == 0) {
- /*set the menu item to non deletable */
- mask &= ~E_CAL_POPUP_SOURCE_NO_DELETE;
- }
- else {
+ if (delete && strcmp (delete, "no") == 0)
+ mask &= ~E_CAL_POPUP_SOURCE_NO_DELETE; /* set the menu item to non deletable */
+ else
mask &= ~E_CAL_POPUP_SOURCE_DELETE;
- }
-
t->target.mask = mask;
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index 3497dd4326..8b73cd7ccf 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -1,30 +1,26 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
- * Authors :
- * Damon Chaplin <damon@ximian.com>
- * Rodrigo Moya <rodrigo@ximian.com>
- *
- * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ * EDayView - displays the Day & Work-Week views of the calendar.
*
* This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
+ * 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 General Public License for more details.
+ * 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
- * USA
- */
-
-/*
- * EDayView - displays the Day & Work-Week views of the calendar.
+ * 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/>
+ *
+ * Authors:
+ * Damon Chaplin <damon@ximian.com>
+ * Rodrigo Moya <rodrigo@ximian.com>
+ *
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
*/
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -214,11 +210,9 @@ static gboolean e_day_view_on_top_canvas_scroll (GtkWidget *widget,
static gboolean e_day_view_on_main_canvas_scroll (GtkWidget *widget,
GdkEventScroll *scroll,
EDayView *day_view);
-
static gboolean e_day_view_on_time_canvas_scroll (GtkWidget *widget,
GdkEventScroll *scroll,
EDayView *day_view);
-
static gboolean e_day_view_on_main_canvas_motion (GtkWidget *widget,
GdkEventMotion *event,
EDayView *day_view);
@@ -2998,10 +2992,8 @@ e_day_view_on_top_canvas_scroll (GtkWidget *widget,
e_day_view_top_scroll (day_view, -E_DAY_VIEW_WHEEL_MOUSE_STEP_SIZE);
return TRUE;
default:
- break;
+ return FALSE;
}
-
- return FALSE;
}
static gboolean
@@ -3024,13 +3016,11 @@ e_day_view_on_time_canvas_scroll (GtkWidget *widget,
e_day_view_scroll (day_view, -E_DAY_VIEW_WHEEL_MOUSE_STEP_SIZE);
return TRUE;
default:
- break;
- }
-
- return FALSE;
-}
-
-static gboolean
+ return FALSE;
+ }
+}
+
+static gboolean
e_day_view_on_long_event_button_press (EDayView *day_view,
gint event_num,
GdkEventButton *event,
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c
index 2b8f303acd..3a5dd92e2f 100644
--- a/calendar/gui/e-week-view.c
+++ b/calendar/gui/e-week-view.c
@@ -1402,6 +1402,11 @@ e_week_view_set_selected_time_range (ECalendarView *cal_view,
g_return_if_fail (E_IS_WEEK_VIEW (week_view));
+ if (!g_date_valid (&week_view->base_date)) {
+ /* This view has not been initialized/shown yet, thus skip this. */
+ return;
+ }
+
time_to_gdate_with_zone (&date, start_time, e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view)));
/* Set the selection to the given days. */
@@ -3607,12 +3612,12 @@ e_week_view_on_editing_stopped (EWeekView *week_view,
e_cal_component_get_dtend (comp, &dt);
if (dt.value->zone) {
- *dt.value = icaltime_from_timet_with_zone (
+ tt = icaltime_from_timet_with_zone (
event->comp_data->instance_end,
dt.value->is_date,
dt.value->zone);
} else {
- *dt.value = icaltime_from_timet_with_zone (
+ tt = icaltime_from_timet_with_zone (
event->comp_data->instance_end,
dt.value->is_date,
e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view)));
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index f479f5ba4b..31d72ee545 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -1,28 +1,28 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* Evolution calendar - Main calendar view widget
- *
- * Copyright (C) 1998 The Free Software Foundation
- * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
- * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
- * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
- *
- * Authors: Miguel de Icaza <miguel@ximian.com>
- * Federico Mena-Quintero <federico@ximian.com>
- * Seth Alves <alves@hungry.com>
- * Rodrigo Moya <rodrigo@ximian.com>
+/*
+ * Evolution calendar - Main calendar view widget
*
* This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
+ * 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 General Public License for more details.
+ * 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/>
+ *
+ *
+ * Authors:
+ * Miguel de Icaza <miguel@ximian.com>
+ * Federico Mena-Quintero <federico@ximian.com>
+ * Seth Alves <alves@hungry.com>
+ * Rodrigo Moya <rodrigo@ximian.com>
+ *
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
*
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
diff --git a/calendar/gui/gnome-cal.h b/calendar/gui/gnome-cal.h
index 29865d98fa..6c758a60cd 100644
--- a/calendar/gui/gnome-cal.h
+++ b/calendar/gui/gnome-cal.h
@@ -1,25 +1,27 @@
-/* Evolution calendar - Main calendar view widget
- *
- * Copyright (C) 1998 The Free Software Foundation
- * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
- * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
- *
- * Authors: Miguel de Icaza <miguel@ximian.com>
- * Federico Mena-Quintero <federico@ximian.com>
- * Seth Alves <alves@hungry.com>
+/*
+ * Evolution calendar - Main calendar view widget
*
* This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
+ * 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 General Public License for more details.
+ * 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/>
+ *
+ *
+ * Authors:
+ * Miguel de Icaza <miguel@ximian.com>
+ * Federico Mena-Quintero <federico@ximian.com>
+ * Seth Alves <alves@hungry.com>
+ *
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
*
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef GNOME_CALENDAR_APP_H
diff --git a/calendar/gui/tasks-component.c b/calendar/gui/tasks-component.c
index 7c70192c90..c2ad3a45ef 100644
--- a/calendar/gui/tasks-component.c
+++ b/calendar/gui/tasks-component.c
@@ -250,12 +250,39 @@ edit_task_list_cb (EPopup *ep, EPopupItem *pitem, void *data)
calendar_setup_edit_task_list (GTK_WINDOW (gtk_widget_get_toplevel(ep->target->widget)), selected_source);
}
+static void
+set_offline_availability (EPopup *ep, EPopupItem *pitem, void *data, const char *value)
+{
+ TasksComponentView *component_view = data;
+ ESource *selected_source;
+
+ selected_source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (component_view->source_selector));
+ if (!selected_source)
+ return;
+
+ e_source_set_property (selected_source, "offline_sync", value);
+}
+
+static void
+mark_no_offline_cb (EPopup *ep, EPopupItem *pitem, void *data)
+{
+ set_offline_availability (ep, pitem, data, "0");
+}
+
+static void
+mark_offline_cb (EPopup *ep, EPopupItem *pitem, void *data)
+{
+ set_offline_availability (ep, pitem, data, "1");
+}
+
static EPopupItem etc_source_popups[] = {
{ E_POPUP_ITEM, "10.new", N_("_New Task List"), new_task_list_cb, NULL, "stock_todo", 0, 0 },
{ E_POPUP_ITEM, "15.copy", N_("_Copy..."), copy_task_list_cb, NULL, "edit-copy", 0, E_CAL_POPUP_SOURCE_PRIMARY },
{ E_POPUP_BAR, "20.bar" },
{ E_POPUP_ITEM, "20.delete", N_("_Delete"), delete_task_list_cb, NULL, "edit-delete", 0, E_CAL_POPUP_SOURCE_USER|E_CAL_POPUP_SOURCE_PRIMARY },
+ { E_POPUP_ITEM, "30.mark_tasks_offline", N_("_Make available for offline use"), mark_offline_cb, NULL, "stock_disconnect", E_CAL_POPUP_SOURCE_OFFLINE, E_CAL_POPUP_SOURCE_USER|E_CAL_POPUP_SOURCE_PRIMARY|E_CAL_POPUP_SOURCE_OFFLINE },
+ { E_POPUP_ITEM, "40.mark_tasks_no_offline", N_("_Do not make available for offline use"), mark_no_offline_cb, NULL, "stock_connect", E_CAL_POPUP_SOURCE_NO_OFFLINE, E_CAL_POPUP_SOURCE_USER|E_CAL_POPUP_SOURCE_PRIMARY|E_CAL_POPUP_SOURCE_NO_OFFLINE },
{ E_POPUP_BAR, "99.bar" },
{ E_POPUP_ITEM, "99.properties", N_("_Properties"), edit_task_list_cb, NULL, "document-properties", 0, E_CAL_POPUP_SOURCE_PRIMARY },