aboutsummaryrefslogtreecommitdiffstats
path: root/modules/calendar
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-05-27 01:09:33 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-05-27 01:09:33 +0800
commitc9ec8c3f4dce2b02c91268529977770364ef87fe (patch)
treed574f2be1b5438407e59e2fead1321766c9bbc83 /modules/calendar
parent6fec6bf39467dd32625847be1b021a7e5bc94d76 (diff)
parent96538878911586a9e9ca26b81e1916c04e538980 (diff)
downloadgsoc2013-evolution-c9ec8c3f4dce2b02c91268529977770364ef87fe.tar.gz
gsoc2013-evolution-c9ec8c3f4dce2b02c91268529977770364ef87fe.tar.zst
gsoc2013-evolution-c9ec8c3f4dce2b02c91268529977770364ef87fe.zip
Merge branch 'express2'
Diffstat (limited to 'modules/calendar')
-rw-r--r--modules/calendar/e-cal-config-view.c2
-rw-r--r--modules/calendar/e-cal-shell-content.c146
-rw-r--r--modules/calendar/e-cal-shell-settings.c8
-rw-r--r--modules/calendar/e-cal-shell-sidebar.c37
-rw-r--r--modules/calendar/e-cal-shell-view-actions.c19
-rw-r--r--modules/calendar/e-cal-shell-view-actions.h2
-rw-r--r--modules/calendar/e-cal-shell-view-private.c96
-rw-r--r--modules/calendar/e-cal-shell-view-private.h4
-rw-r--r--modules/calendar/e-cal-shell-view.c22
9 files changed, 240 insertions, 96 deletions
diff --git a/modules/calendar/e-cal-config-view.c b/modules/calendar/e-cal-config-view.c
index 9783723a4e..e543bf6c56 100644
--- a/modules/calendar/e-cal-config-view.c
+++ b/modules/calendar/e-cal-config-view.c
@@ -43,7 +43,7 @@ cal_config_view_constructed (GObject *object)
if (E_IS_DAY_VIEW (extensible)) {
e_binding_new (
- shell_settings, "cal-day-view-show-week-numbers",
+ shell_settings, "cal-show-week-numbers",
E_DAY_VIEW (extensible)->week_number_label, "visible");
e_binding_new (
diff --git a/modules/calendar/e-cal-shell-content.c b/modules/calendar/e-cal-shell-content.c
index 56f692dd6b..a51a072f66 100644
--- a/modules/calendar/e-cal-shell-content.c
+++ b/modules/calendar/e-cal-shell-content.c
@@ -348,7 +348,7 @@ cal_shell_content_constructed (GObject *object)
/* We borrow the memopad and taskpad models from the memo
* and task views, loading the views if necessary. */
- if (!e_shell_get_express_mode(e_shell_get_default())) {
+ if (!e_shell_get_express_mode (shell)) {
foreign_view = e_shell_window_get_shell_view (shell_window, "memos");
foreign_content = e_shell_view_get_shell_content (foreign_view);
g_object_get (foreign_content, "model", &memo_model, NULL);
@@ -361,7 +361,7 @@ cal_shell_content_constructed (GObject *object)
container = GTK_WIDGET (object);
- if (!e_shell_get_express_mode(e_shell_get_default())) {
+ if (!e_shell_get_express_mode (shell)) {
widget = e_paned_new (GTK_ORIENTATION_HORIZONTAL);
gtk_container_add (GTK_CONTAINER (container), widget);
priv->hpaned = g_object_ref (widget);
@@ -373,14 +373,14 @@ cal_shell_content_constructed (GObject *object)
widget = gtk_notebook_new ();
gtk_notebook_set_show_tabs (GTK_NOTEBOOK (widget), FALSE);
gtk_notebook_set_show_border (GTK_NOTEBOOK (widget), FALSE);
- if (!e_shell_get_express_mode(e_shell_get_default()))
+ if (!e_shell_get_express_mode (shell))
gtk_paned_pack1 (GTK_PANED (container), widget, TRUE, FALSE);
else
gtk_container_add (GTK_CONTAINER (container), widget);
priv->notebook = g_object_ref (widget);
gtk_widget_show (widget);
- if (!e_shell_get_express_mode(e_shell_get_default())) {
+ if (!e_shell_get_express_mode (shell)) {
/* FIXME Need to deal with saving and restoring the position.
* Month view has its own position. */
widget = e_paned_new (GTK_ORIENTATION_VERTICAL);
@@ -412,88 +412,92 @@ cal_shell_content_constructed (GObject *object)
priv->notebook, "page");
container = priv->vpaned;
-if (!e_shell_get_express_mode(e_shell_get_default())) {
- widget = gtk_vbox_new (FALSE, 0);
- gtk_paned_pack1 (GTK_PANED (container), widget, TRUE, TRUE);
- gtk_widget_show (widget);
- container = widget;
+ if (!e_shell_get_express_mode (shell)) {
+ widget = gtk_vbox_new (FALSE, 0);
+ gtk_paned_pack1 (GTK_PANED (container), widget, TRUE, TRUE);
+ gtk_widget_show (widget);
- widget = gtk_hseparator_new ();
- gtk_box_pack_start (GTK_BOX (container), widget, FALSE, TRUE, 0);
- gtk_widget_show (widget);
+ container = widget;
- widget = gtk_label_new (NULL);
- markup = g_strdup_printf ("<b>%s</b>", _("Tasks"));
- gtk_label_set_markup (GTK_LABEL (widget), markup);
- gtk_box_pack_start (GTK_BOX (container), widget, FALSE, TRUE, 0);
- gtk_widget_show (widget);
- g_free (markup);
-
- widget = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy (
- GTK_SCROLLED_WINDOW (widget),
- GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_set_shadow_type (
- GTK_SCROLLED_WINDOW (widget), GTK_SHADOW_IN);
- gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0);
- gtk_widget_show (widget);
+ widget = gtk_hseparator_new ();
+ gtk_box_pack_start (GTK_BOX (container), widget, FALSE, TRUE, 0);
+ gtk_widget_show (widget);
- container = widget;
+ widget = gtk_label_new (NULL);
+ markup = g_strdup_printf ("<b>%s</b>", _("Tasks"));
+ gtk_label_set_markup (GTK_LABEL (widget), markup);
+ gtk_box_pack_start (GTK_BOX (container), widget, FALSE, TRUE, 0);
+ gtk_widget_show (widget);
+ g_free (markup);
+
+ widget = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_policy (
+ GTK_SCROLLED_WINDOW (widget),
+ GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+ gtk_scrolled_window_set_shadow_type (
+ GTK_SCROLLED_WINDOW (widget), GTK_SHADOW_IN);
+ gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0);
+ gtk_widget_show (widget);
- widget = e_task_table_new (shell_view, task_model);
- gtk_container_add (GTK_CONTAINER (container), widget);
- priv->task_table = g_object_ref (widget);
- gtk_widget_show (widget);
+ container = widget;
- cal_shell_content_load_table_state (shell_content, E_TABLE (widget));
+ widget = e_task_table_new (shell_view, task_model);
+ gtk_container_add (GTK_CONTAINER (container), widget);
+ priv->task_table = g_object_ref (widget);
+ gtk_widget_show (widget);
- g_signal_connect_swapped (
- widget, "open-component",
- G_CALLBACK (e_cal_shell_view_taskpad_open_task),
- shell_view);
+ cal_shell_content_load_table_state (
+ shell_content, E_TABLE (widget));
- container = priv->vpaned;
+ g_signal_connect_swapped (
+ widget, "open-component",
+ G_CALLBACK (e_cal_shell_view_taskpad_open_task),
+ shell_view);
- widget = gtk_vbox_new (FALSE, 0);
- gtk_paned_pack2 (GTK_PANED (container), widget, TRUE, TRUE);
- gtk_widget_show (widget);
+ container = priv->vpaned;
- container = widget;
+ widget = gtk_vbox_new (FALSE, 0);
+ gtk_paned_pack2 (GTK_PANED (container), widget, TRUE, TRUE);
+ gtk_widget_show (widget);
- widget = gtk_label_new (NULL);
- markup = g_strdup_printf ("<b>%s</b>", _("Memos"));
- gtk_label_set_markup (GTK_LABEL (widget), markup);
- gtk_box_pack_start (GTK_BOX (container), widget, FALSE, TRUE, 0);
- gtk_widget_show (widget);
- g_free (markup);
-
- widget = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy (
- GTK_SCROLLED_WINDOW (widget),
- GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_set_shadow_type (
- GTK_SCROLLED_WINDOW (widget), GTK_SHADOW_IN);
- gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0);
- gtk_widget_show (widget);
+ container = widget;
- container = widget;
+ widget = gtk_label_new (NULL);
+ markup = g_strdup_printf ("<b>%s</b>", _("Memos"));
+ gtk_label_set_markup (GTK_LABEL (widget), markup);
+ gtk_box_pack_start (GTK_BOX (container), widget, FALSE, TRUE, 0);
+ gtk_widget_show (widget);
+ g_free (markup);
+
+ widget = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_policy (
+ GTK_SCROLLED_WINDOW (widget),
+ GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+ gtk_scrolled_window_set_shadow_type (
+ GTK_SCROLLED_WINDOW (widget), GTK_SHADOW_IN);
+ gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0);
+ gtk_widget_show (widget);
- widget = e_memo_table_new (shell_view, memo_model);
- gtk_container_add (GTK_CONTAINER (container), widget);
- priv->memo_table = g_object_ref (widget);
- gtk_widget_show (widget);
+ container = widget;
+
+ widget = e_memo_table_new (shell_view, memo_model);
+ gtk_container_add (GTK_CONTAINER (container), widget);
+ priv->memo_table = g_object_ref (widget);
+ gtk_widget_show (widget);
- cal_shell_content_load_table_state (shell_content, E_TABLE (widget));
+ cal_shell_content_load_table_state (
+ shell_content, E_TABLE (widget));
- e_cal_model_set_default_time_func (
- memo_model, gc_get_default_time, calendar);
+ e_cal_model_set_default_time_func (
+ memo_model, gc_get_default_time, calendar);
+
+ g_signal_connect_swapped (
+ widget, "open-component",
+ G_CALLBACK (e_cal_shell_view_memopad_open_memo),
+ shell_view);
+ }
- g_signal_connect_swapped (
- widget, "open-component",
- G_CALLBACK (e_cal_shell_view_memopad_open_memo),
- shell_view);
-}
/* Load the view instance. */
view_instance = e_shell_view_new_view_instance (shell_view, NULL);
@@ -505,7 +509,7 @@ if (!e_shell_get_express_mode(e_shell_get_default())) {
* The GtkWidget::map() callback below explains why. */
priv->view_instance = view_instance;
- if (!e_shell_get_express_mode(e_shell_get_default())) {
+ if (!e_shell_get_express_mode (shell)) {
g_signal_connect_swapped (
shell_view, "notify::view-id",
G_CALLBACK (cal_shell_content_notify_view_id_cb),
diff --git a/modules/calendar/e-cal-shell-settings.c b/modules/calendar/e-cal-shell-settings.c
index 3852de0a52..4613f280bb 100644
--- a/modules/calendar/e-cal-shell-settings.c
+++ b/modules/calendar/e-cal-shell-settings.c
@@ -491,8 +491,8 @@ e_cal_shell_backend_init_settings (EShell *shell)
"/apps/evolution/calendar/prompts/confirm_purge");
e_shell_settings_install_property_for_key (
- "cal-day-view-show-week-numbers",
- "/apps/evolution/calendar/display/day_view_show_week_number");
+ "cal-show-week-numbers",
+ "/apps/evolution/calendar/display/show_week_numbers");
e_shell_settings_install_property_for_key (
"cal-free-busy-template",
@@ -539,10 +539,6 @@ e_cal_shell_backend_init_settings (EShell *shell)
"/apps/evolution/calendar/display/show_event_end");
e_shell_settings_install_property_for_key (
- "cal-show-week-numbers",
- "/apps/evolution/calendar/date_navigator/show_week_numbers");
-
- e_shell_settings_install_property_for_key (
"cal-tasks-color-due-today",
"/apps/evolution/calendar/tasks/colors/due_today");
diff --git a/modules/calendar/e-cal-shell-sidebar.c b/modules/calendar/e-cal-shell-sidebar.c
index 20e0a96a67..9491d3fee2 100644
--- a/modules/calendar/e-cal-shell-sidebar.c
+++ b/modules/calendar/e-cal-shell-sidebar.c
@@ -33,6 +33,7 @@
#include "calendar/gui/calendar-config.h"
#include "calendar/gui/e-calendar-selector.h"
#include "calendar/gui/misc.h"
+#include "calendar/gui/dialogs/calendar-setup.h"
#include "e-cal-shell-view.h"
#include "e-cal-shell-backend.h"
@@ -492,7 +493,7 @@ cal_shell_sidebar_restore_state_cb (EShellWindow *shell_window,
bridge = gconf_bridge_get ();
object = G_OBJECT (priv->paned);
- key = "/apps/evolution/calendar/display/date_navigator_vpane_position";
+ key = "/apps/evolution/calendar/display/date_navigator_pane_position";
gconf_bridge_bind_property_delayed (bridge, key, object, "vposition");
}
@@ -575,6 +576,21 @@ cal_shell_sidebar_finalize (GObject *object)
}
static void
+new_calendar_clicked (GtkButton *button,
+ EShellSidebar *shell_sidebar)
+{
+ EShellView *shell_view;
+ EShellWindow *shell_window;
+ EShellBackend *shell_backend;
+
+ shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
+ shell_backend = e_shell_view_get_shell_backend (shell_view);
+ shell_window = e_shell_view_get_shell_window (shell_view);
+
+ calendar_setup_new_calendar (GTK_WINDOW (shell_window));
+}
+
+static void
cal_shell_sidebar_constructed (GObject *object)
{
ECalShellSidebarPrivate *priv;
@@ -621,7 +637,21 @@ cal_shell_sidebar_constructed (GObject *object)
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_shadow_type (
GTK_SCROLLED_WINDOW (widget), GTK_SHADOW_IN);
- gtk_paned_pack1 (GTK_PANED (container), widget, TRUE, TRUE);
+ if (!e_shell_get_express_mode(e_shell_get_default())) {
+ gtk_paned_pack1 (GTK_PANED (container), widget, TRUE, TRUE);
+ } else {
+ GtkWidget *button;
+
+ container = gtk_vbox_new (FALSE, 6);
+ gtk_box_pack_start (GTK_BOX(container), widget, TRUE, TRUE, 0);
+
+ button = gtk_button_new_with_label (_("New Calendar..."));
+ gtk_box_pack_start (GTK_BOX(container), button, FALSE, FALSE, 0);
+ g_signal_connect (button, "clicked", G_CALLBACK(new_calendar_clicked), shell_sidebar);
+
+ gtk_paned_pack1 (GTK_PANED (priv->paned), container, TRUE, TRUE);
+ gtk_widget_show_all (container);
+ }
gtk_widget_show (widget);
container = widget;
@@ -640,7 +670,8 @@ cal_shell_sidebar_constructed (GObject *object)
calitem = E_CALENDAR (widget)->calitem;
e_calendar_item_set_days_start_week_sel (calitem, 9);
e_calendar_item_set_max_days_sel (calitem, 42);
- gtk_paned_pack2 (GTK_PANED (container), widget, FALSE, TRUE);
+ gtk_paned_pack2 (GTK_PANED (container), widget, FALSE, FALSE);
+ gtk_widget_set_size_request (widget, -1, 200);
priv->date_navigator = g_object_ref (widget);
gtk_widget_show (widget);
diff --git a/modules/calendar/e-cal-shell-view-actions.c b/modules/calendar/e-cal-shell-view-actions.c
index d56107ac7a..19812751d8 100644
--- a/modules/calendar/e-cal-shell-view-actions.c
+++ b/modules/calendar/e-cal-shell-view-actions.c
@@ -1228,6 +1228,25 @@ action_event_schedule_cb (GtkAction *action,
edit_event_as (cal_shell_view, TRUE);
}
+ static void
+quit_calendar_cb (GtkAction *action,
+ ECalShellView *cal_shell_view)
+{
+ EShellView *shell_view;
+ EShellWindow *shell_window;
+ GdkEvent *event;
+
+ shell_view = E_SHELL_VIEW (cal_shell_view);
+ shell_window = e_shell_view_get_shell_window (shell_view);
+
+ /* Synthesize a delete_event on this window. */
+ event = gdk_event_new (GDK_DELETE);
+ event->any.window = g_object_ref (((GtkWidget *) shell_window)->window);
+ event->any.send_event = TRUE;
+ gtk_main_do_event (event);
+ gdk_event_free (event);
+}
+
static void
quit_calendar_cb (GtkAction *action,
ECalShellView *cal_shell_view)
diff --git a/modules/calendar/e-cal-shell-view-actions.h b/modules/calendar/e-cal-shell-view-actions.h
index a69b82f645..b79bc6baaf 100644
--- a/modules/calendar/e-cal-shell-view-actions.h
+++ b/modules/calendar/e-cal-shell-view-actions.h
@@ -89,6 +89,8 @@
E_SHELL_WINDOW_ACTION ((window), "event-reply-all")
#define E_SHELL_WINDOW_ACTION_EVENT_OCCURRENCE_MOVABLE(window) \
E_SHELL_WINDOW_ACTION ((window), "event-occurrence-movable")
+#define E_SHELL_WINDOW_ACTION_EVENT_MEETING_NEW(window) \
+ E_SHELL_WINDOW_ACTION ((window), "event-meeting-new")
/* Memo Pad Actions */
#define E_SHELL_WINDOW_ACTION_CALENDAR_MEMOPAD_FORWARD(window) \
diff --git a/modules/calendar/e-cal-shell-view-private.c b/modules/calendar/e-cal-shell-view-private.c
index a112c171b8..11b6ec243d 100644
--- a/modules/calendar/e-cal-shell-view-private.c
+++ b/modules/calendar/e-cal-shell-view-private.c
@@ -26,6 +26,26 @@
#include "calendar/gui/calendar-view-factory.h"
#include "widgets/menus/gal-view-factory-etable.h"
+#define CHECK_NB 5
+
+/* be compatible with older e-d-s for MeeGo */
+#ifndef ETC_TIMEZONE
+# define ETC_TIMEZONE "/etc/timezone"
+# define ETC_TIMEZONE_MAJ "/etc/TIMEZONE"
+# define ETC_RC_CONF "/etc/rc.conf"
+# define ETC_SYSCONFIG_CLOCK "/etc/sysconfig/clock"
+# define ETC_CONF_D_CLOCK "/etc/conf.d/clock"
+# define ETC_LOCALTIME "/etc/localtime"
+#endif
+
+static const gchar * files_to_check [CHECK_NB] = {
+ ETC_TIMEZONE,
+ ETC_TIMEZONE_MAJ,
+ ETC_SYSCONFIG_CLOCK,
+ ETC_CONF_D_CLOCK,
+ ETC_LOCALTIME
+};
+
static void
cal_shell_view_process_completed_tasks (ECalShellView *cal_shell_view,
gboolean config_changed)
@@ -416,6 +436,71 @@ e_cal_shell_view_private_init (ECalShellView *cal_shell_view,
G_CALLBACK (cal_shell_view_notify_view_id_cb), NULL);
}
+static void
+system_timezone_monitor_changed (GFileMonitor *handle,
+ GFile *file,
+ GFile *other_file,
+ GFileMonitorEvent event,
+ gpointer user_data)
+{
+ ECalShellView *view = E_CAL_SHELL_VIEW (user_data);
+ ECalShellViewPrivate *priv = view->priv;
+ ECalShellContent *cal_shell_content;
+ icaltimezone *timezone = NULL, *current_zone = NULL;
+ EShellSettings *settings;
+ EShellBackend *shell_backend;
+ EShell *shell;
+ ECalModel *model;
+ const gchar *location;
+
+ if (event != G_FILE_MONITOR_EVENT_CHANGED &&
+ event != G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT &&
+ event != G_FILE_MONITOR_EVENT_DELETED &&
+ event != G_FILE_MONITOR_EVENT_CREATED)
+ return;
+
+ cal_shell_content = priv->cal_shell_content;
+ model = e_cal_shell_content_get_model (cal_shell_content);
+ current_zone = e_cal_model_get_timezone (model);
+ timezone = e_cal_util_get_system_timezone ();
+
+ if (!g_strcmp0 (icaltimezone_get_tzid (timezone), icaltimezone_get_tzid (current_zone)))
+ return;
+
+ shell_backend = e_shell_view_get_shell_backend ((EShellView *) view);
+ shell = e_shell_backend_get_shell (shell_backend);
+ settings = e_shell_get_shell_settings (shell);
+ location = icaltimezone_get_location (timezone);
+ if (location == NULL)
+ location = "UTC";
+
+ g_object_set (settings, "cal-timezone-string", location, NULL);
+ g_object_set (settings, "cal-timezone", timezone, NULL);
+}
+
+static void
+init_timezone_monitors (ECalShellView *view)
+{
+ ECalShellViewPrivate *priv = view->priv;
+ gint i;
+
+ for (i = 0; i < CHECK_NB; i++) {
+ GFile *file;
+
+ file = g_file_new_for_path (files_to_check[i]);
+ priv->monitors[i] = g_file_monitor_file (file,
+ G_FILE_MONITOR_NONE,
+ NULL, NULL);
+ g_object_unref (file);
+
+ if (priv->monitors[i])
+ g_signal_connect (G_OBJECT (priv->monitors[i]),
+ "changed",
+ G_CALLBACK (system_timezone_monitor_changed),
+ view);
+ }
+}
+
void
e_cal_shell_view_private_constructed (ECalShellView *cal_shell_view)
{
@@ -575,6 +660,7 @@ e_cal_shell_view_private_constructed (ECalShellView *cal_shell_view)
(GHookFunc) e_cal_shell_view_update_search_filter,
cal_shell_view);
+ init_timezone_monitors (cal_shell_view);
e_cal_shell_view_actions_init (cal_shell_view);
e_cal_shell_view_update_sidebar (cal_shell_view);
e_cal_shell_view_update_search_filter (cal_shell_view);
@@ -598,6 +684,11 @@ void
e_cal_shell_view_private_dispose (ECalShellView *cal_shell_view)
{
ECalShellViewPrivate *priv = cal_shell_view->priv;
+ gint i;
+
+ /* Calling calendar's save state from here, because it is too late in its dispose */
+ if (priv->cal_shell_content)
+ e_cal_shell_content_save_state (priv->cal_shell_content);
/* Calling calendar's save state from here, because it is too late in its dispose */
if (priv->cal_shell_content)
@@ -627,6 +718,11 @@ e_cal_shell_view_private_dispose (ECalShellView *cal_shell_view)
g_object_unref (priv->taskpad_activity);
priv->taskpad_activity = NULL;
}
+
+ for (i = 0; i < CHECK_NB; i++) {
+ g_object_unref (priv->monitors[i]);
+ priv->monitors[i] = NULL;
+ }
}
void
diff --git a/modules/calendar/e-cal-shell-view-private.h b/modules/calendar/e-cal-shell-view-private.h
index c69ffc7605..71a191f332 100644
--- a/modules/calendar/e-cal-shell-view-private.h
+++ b/modules/calendar/e-cal-shell-view-private.h
@@ -27,6 +27,7 @@
#include <string.h>
#include <glib/gi18n.h>
#include <libecal/e-cal-time-util.h>
+#include <libecal/e-cal-system-timezone.h>
#include <libedataserver/e-categories.h>
#include <libedataserver/e-data-server-util.h>
#include <libedataserver/e-sexp.h>
@@ -81,6 +82,7 @@
/* ETable Specifications */
#define ETSPEC_FILENAME "e-calendar-table.etspec"
+#define CHECK_NB 5
G_BEGIN_DECLS
@@ -114,6 +116,8 @@ struct _ECalShellViewPrivate {
EActivity *calendar_activity;
EActivity *memopad_activity;
EActivity *taskpad_activity;
+
+ GFileMonitor *monitors[CHECK_NB];
};
void e_cal_shell_view_private_init
diff --git a/modules/calendar/e-cal-shell-view.c b/modules/calendar/e-cal-shell-view.c
index 36ee86354d..218bd7d4da 100644
--- a/modules/calendar/e-cal-shell-view.c
+++ b/modules/calendar/e-cal-shell-view.c
@@ -283,6 +283,7 @@ cal_shell_view_update_actions (EShellView *shell_view)
GtkAction *action;
GList *list, *iter;
gboolean sensitive;
+ gboolean visible;
guint32 state;
gint n_selected;
@@ -305,9 +306,6 @@ cal_shell_view_update_actions (EShellView *shell_view)
if (e_shell_get_express_mode(e_shell_get_default())) {
GtkWidget *widget, *item;
- GdkScreen *scr;
- gint monitor;
- GdkRectangle rect;
/* Hack: Get rid of New and Send/Receive in toolbar
* while in express mode */
@@ -323,18 +321,8 @@ cal_shell_view_update_actions (EShellView *shell_view)
item = e_shell_window_get_managed_widget (
shell_window, "/main-toolbar/send-receive");
- gtk_widget_hide(item);
-
- scr = gdk_screen_get_default ();
- monitor = gdk_screen_get_monitor_at_window (
- scr, gtk_widget_get_window (GTK_WIDGET (shell_window)));
- gdk_screen_get_monitor_geometry (scr, monitor, &rect);
-
- gtk_window_set_default_size (
- GTK_WINDOW (shell_window), rect.width, rect.height);
- gtk_window_set_decorated (
- GTK_WINDOW (shell_window), FALSE);
-
+ if (item)
+ gtk_widget_hide(item);
}
cal_shell_content = priv->cal_shell_content;
calendar = e_cal_shell_content_get_calendar (cal_shell_content);
@@ -477,6 +465,10 @@ cal_shell_view_update_actions (EShellView *shell_view)
action = ACTION (EVENT_REPLY_ALL);
sensitive = (n_selected == 1) && is_meeting;
gtk_action_set_sensitive (action, sensitive);
+
+ action = ACTION (EVENT_MEETING_NEW);
+ visible = itip_addresses_get_default() != NULL;
+ gtk_action_set_visible (action, visible);
}
static void