aboutsummaryrefslogtreecommitdiffstats
path: root/modules/calendar
diff options
context:
space:
mode:
Diffstat (limited to 'modules/calendar')
-rw-r--r--modules/calendar/e-cal-shell-content.c26
-rw-r--r--modules/calendar/e-cal-shell-sidebar.c36
-rw-r--r--modules/calendar/e-cal-shell-view-actions.c6
-rw-r--r--modules/calendar/e-cal-shell-view-private.c4
-rw-r--r--modules/calendar/e-cal-shell-view.c28
-rw-r--r--modules/calendar/e-memo-shell-sidebar.c36
-rw-r--r--modules/calendar/e-task-shell-sidebar.c36
7 files changed, 137 insertions, 35 deletions
diff --git a/modules/calendar/e-cal-shell-content.c b/modules/calendar/e-cal-shell-content.c
index dc409aa0ce..56f692dd6b 100644
--- a/modules/calendar/e-cal-shell-content.c
+++ b/modules/calendar/e-cal-shell-content.c
@@ -151,7 +151,7 @@ cal_chell_content_get_pad_state_filename (EShellContent *shell_content, ETable *
g_return_val_if_fail (E_IS_SHELL_CONTENT (shell_content), NULL);
g_return_val_if_fail (table != NULL, NULL);
g_return_val_if_fail (E_IS_TABLE (table), NULL);
-
+
if (E_IS_TASK_TABLE (table))
nick = "TaskPad";
else if (E_IS_MEMO_TABLE (table))
@@ -200,11 +200,15 @@ e_cal_shell_content_save_state (ECalShellContent *cal_shell_content)
priv = E_CAL_SHELL_CONTENT_GET_PRIVATE (cal_shell_content);
- if (priv->task_table)
- cal_shell_content_save_table_state (E_SHELL_CONTENT (cal_shell_content), E_TABLE (priv->task_table));
+ if (priv->task_table != NULL)
+ cal_shell_content_save_table_state (
+ E_SHELL_CONTENT (cal_shell_content),
+ E_TABLE (priv->task_table));
if (priv->memo_table != NULL)
- cal_shell_content_save_table_state (E_SHELL_CONTENT (cal_shell_content), E_TABLE (priv->memo_table));
+ cal_shell_content_save_table_state (
+ E_SHELL_CONTENT (cal_shell_content),
+ E_TABLE (priv->memo_table));
}
static void
@@ -344,11 +348,11 @@ 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(e_shell_get_default())) {
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);
-
+
foreign_view = e_shell_window_get_shell_view (shell_window, "tasks");
foreign_content = e_shell_view_get_shell_content (foreign_view);
g_object_get (foreign_content, "model", &task_model, NULL);
@@ -356,7 +360,7 @@ cal_shell_content_constructed (GObject *object)
/* Build content widgets. */
container = GTK_WIDGET (object);
-
+
if (!e_shell_get_express_mode(e_shell_get_default())) {
widget = e_paned_new (GTK_ORIENTATION_HORIZONTAL);
gtk_container_add (GTK_CONTAINER (container), widget);
@@ -369,7 +373,7 @@ 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(e_shell_get_default()))
gtk_paned_pack1 (GTK_PANED (container), widget, TRUE, FALSE);
else
gtk_container_add (GTK_CONTAINER (container), widget);
@@ -408,7 +412,7 @@ cal_shell_content_constructed (GObject *object)
priv->notebook, "page");
container = priv->vpaned;
-if(!e_shell_get_express_mode(e_shell_get_default())) {
+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);
@@ -501,7 +505,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(e_shell_get_default())) {
g_signal_connect_swapped (
shell_view, "notify::view-id",
G_CALLBACK (cal_shell_content_notify_view_id_cb),
@@ -552,7 +556,7 @@ cal_shell_content_class_init (ECalShellContentClass *class)
object_class->get_property = cal_shell_content_get_property;
object_class->dispose = cal_shell_content_dispose;
object_class->constructed = cal_shell_content_constructed;
-
+
widget_class = GTK_WIDGET_CLASS (class);
widget_class->map = cal_shell_content_map;
diff --git a/modules/calendar/e-cal-shell-sidebar.c b/modules/calendar/e-cal-shell-sidebar.c
index db0d0a072f..20e0a96a67 100644
--- a/modules/calendar/e-cal-shell-sidebar.c
+++ b/modules/calendar/e-cal-shell-sidebar.c
@@ -277,9 +277,15 @@ static void
cal_shell_sidebar_set_default (ECalShellSidebar *cal_shell_sidebar,
ESource *source)
{
+ EShellView *shell_view;
+ EShellContent *shell_content;
+ EShellSidebar *shell_sidebar;
+ ECalShellContent *cal_shell_content;
ECalSourceType source_type;
GHashTable *client_table;
+ ECalModel *model;
ECal *client;
+ icaltimezone *timezone;
const gchar *uid;
source_type = E_CAL_SOURCE_TYPE_EVENT;
@@ -304,7 +310,17 @@ cal_shell_sidebar_set_default (ECalShellSidebar *cal_shell_sidebar,
G_CALLBACK (cal_shell_sidebar_default_opened_cb),
cal_shell_sidebar);
- e_cal_set_default_timezone (client, e_cal_model_get_timezone (e_cal_shell_content_get_model (E_CAL_SHELL_CONTENT (e_shell_view_get_shell_content (e_shell_sidebar_get_shell_view (E_SHELL_SIDEBAR (cal_shell_sidebar)))))), NULL);
+ /* FIXME Sidebar should not be accessing the EShellContent.
+ * This probably needs to be moved to ECalShellView. */
+ shell_sidebar = E_SHELL_SIDEBAR (cal_shell_sidebar);
+ shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
+ shell_content = e_shell_view_get_shell_content (shell_view);
+
+ cal_shell_content = E_CAL_SHELL_CONTENT (shell_content);
+ model = e_cal_shell_content_get_model (cal_shell_content);
+ timezone = e_cal_model_get_timezone (model);
+
+ e_cal_set_default_timezone (client, timezone, NULL);
e_cal_open_async (client, FALSE);
}
@@ -895,11 +911,17 @@ void
e_cal_shell_sidebar_add_source (ECalShellSidebar *cal_shell_sidebar,
ESource *source)
{
+ EShellView *shell_view;
+ EShellContent *shell_content;
+ EShellSidebar *shell_sidebar;
+ ECalShellContent *cal_shell_content;
ECalSourceType source_type;
ESourceSelector *selector;
GHashTable *client_table;
+ ECalModel *model;
ECal *default_client;
ECal *client;
+ icaltimezone *timezone;
const gchar *uid;
const gchar *uri;
gchar *message;
@@ -958,7 +980,17 @@ e_cal_shell_sidebar_add_source (ECalShellSidebar *cal_shell_sidebar,
G_CALLBACK (cal_shell_sidebar_client_opened_cb),
cal_shell_sidebar);
- e_cal_set_default_timezone (client, e_cal_model_get_timezone (e_cal_shell_content_get_model (E_CAL_SHELL_CONTENT (e_shell_view_get_shell_content (e_shell_sidebar_get_shell_view (E_SHELL_SIDEBAR (cal_shell_sidebar)))))), NULL);
+ /* FIXME Sidebar should not be accessing the EShellContent.
+ * This probably needs to be moved to ECalShellView. */
+ shell_sidebar = E_SHELL_SIDEBAR (cal_shell_sidebar);
+ shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
+ shell_content = e_shell_view_get_shell_content (shell_view);
+
+ cal_shell_content = E_CAL_SHELL_CONTENT (shell_content);
+ model = e_cal_shell_content_get_model (cal_shell_content);
+ timezone = e_cal_model_get_timezone (model);
+
+ e_cal_set_default_timezone (client, timezone, NULL);
e_cal_open_async (client, FALSE);
}
diff --git a/modules/calendar/e-cal-shell-view-actions.c b/modules/calendar/e-cal-shell-view-actions.c
index 17afe3bf7a..3251183000 100644
--- a/modules/calendar/e-cal-shell-view-actions.c
+++ b/modules/calendar/e-cal-shell-view-actions.c
@@ -1213,7 +1213,7 @@ quit_calendar_cb (GtkAction *action,
event->any.send_event = TRUE;
gtk_main_do_event (event);
gdk_event_free (event);
-
+
}
static void
@@ -1454,7 +1454,7 @@ static GtkActionEntry calendar_entries[] = {
NULL,
NULL, /* XXX Add a tooltip! */
G_CALLBACK (quit_calendar_cb) },
-
+
/*** Menus ***/
{ "calendar-actions-menu",
@@ -1716,7 +1716,7 @@ e_cal_shell_view_actions_init (ECalShellView *cal_shell_view)
cal_shell_content = cal_shell_view->priv->cal_shell_content;
searchbar = e_cal_shell_content_get_searchbar (cal_shell_content);
-
+
/* Calendar Actions */
action_group = ACTION_GROUP (CALENDAR);
gtk_action_group_add_actions (
diff --git a/modules/calendar/e-cal-shell-view-private.c b/modules/calendar/e-cal-shell-view-private.c
index 1c9c26840c..71db1236c1 100644
--- a/modules/calendar/e-cal-shell-view-private.c
+++ b/modules/calendar/e-cal-shell-view-private.c
@@ -535,7 +535,7 @@ e_cal_shell_view_private_constructed (ECalShellView *cal_shell_view)
G_CALLBACK (cal_shell_view_selector_client_removed_cb),
cal_shell_view);
- if (memo_table)
+ if (memo_table)
g_signal_connect_swapped (
memo_table, "popup-event",
G_CALLBACK (cal_shell_view_memopad_popup_event_cb),
@@ -564,7 +564,7 @@ e_cal_shell_view_private_constructed (ECalShellView *cal_shell_view)
task_table, "status-message",
G_CALLBACK (e_cal_shell_view_taskpad_set_status_message),
cal_shell_view);
-
+
if (task_table)
g_signal_connect_swapped (
task_table, "selection-change",
diff --git a/modules/calendar/e-cal-shell-view.c b/modules/calendar/e-cal-shell-view.c
index 29d8fd08b1..a489fe59a7 100644
--- a/modules/calendar/e-cal-shell-view.c
+++ b/modules/calendar/e-cal-shell-view.c
@@ -303,35 +303,37 @@ cal_shell_view_update_actions (EShellView *shell_view)
shell_window = e_shell_view_get_shell_window (shell_view);
- if(e_shell_get_express_mode(e_shell_get_default())) {
+ 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
+ /* Hack: Get rid of New and Send/Receive in toolbar
* while in express mode */
widget = e_shell_window_get_managed_widget (
shell_window, "/main-toolbar");
item = (GtkWidget *)gtk_toolbar_get_nth_item ((GtkToolbar *)widget, 0);
gtk_widget_hide(item);
-
+
widget = e_shell_window_get_managed_widget (
shell_window, "/main-menu");
gtk_widget_hide(widget);
-
+
item = e_shell_window_get_managed_widget (
shell_window, "/main-toolbar/send-receive");
- gtk_widget_hide(item);
+ 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)));
+ 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 ((GtkWindow *)shell_window, rect.width, rect.height);
- gtk_window_set_decorated ((GtkWindow *)shell_window, FALSE);
+
+ gtk_window_set_default_size (
+ GTK_WINDOW (shell_window), rect.width, rect.height);
+ gtk_window_set_decorated (
+ GTK_WINDOW (shell_window), FALSE);
}
cal_shell_content = priv->cal_shell_content;
@@ -503,11 +505,11 @@ cal_shell_view_class_init (ECalShellViewClass *class,
shell_view_class->new_shell_sidebar = e_cal_shell_sidebar_new;
shell_view_class->execute_search = cal_shell_view_execute_search;
shell_view_class->update_actions = cal_shell_view_update_actions;
-
- if(e_shell_get_express_mode(e_shell_get_default()))
+
+ if (e_shell_get_express_mode(e_shell_get_default()))
shell_view_class->construct_searchbar = NULL;
-}
+}
static void
cal_shell_view_init (ECalShellView *cal_shell_view,
diff --git a/modules/calendar/e-memo-shell-sidebar.c b/modules/calendar/e-memo-shell-sidebar.c
index 984294472e..416759213e 100644
--- a/modules/calendar/e-memo-shell-sidebar.c
+++ b/modules/calendar/e-memo-shell-sidebar.c
@@ -272,9 +272,15 @@ static void
memo_shell_sidebar_set_default (EMemoShellSidebar *memo_shell_sidebar,
ESource *source)
{
+ EShellView *shell_view;
+ EShellContent *shell_content;
+ EShellSidebar *shell_sidebar;
+ EMemoShellContent *memo_shell_content;
ECalSourceType source_type;
GHashTable *client_table;
+ ECalModel *model;
ECal *client;
+ icaltimezone *timezone;
const gchar *uid;
source_type = E_CAL_SOURCE_TYPE_JOURNAL;
@@ -299,7 +305,17 @@ memo_shell_sidebar_set_default (EMemoShellSidebar *memo_shell_sidebar,
G_CALLBACK (memo_shell_sidebar_default_opened_cb),
memo_shell_sidebar);
- e_cal_set_default_timezone (client, e_cal_model_get_timezone (e_memo_shell_content_get_memo_model (E_MEMO_SHELL_CONTENT (e_shell_view_get_shell_content (e_shell_sidebar_get_shell_view (E_SHELL_SIDEBAR (memo_shell_sidebar)))))), NULL);
+ /* FIXME Sidebar should not be accessing the EShellContent.
+ * This probably needs to be moved to EMemoShellView. */
+ shell_sidebar = E_SHELL_SIDEBAR (memo_shell_sidebar);
+ shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
+ shell_content = e_shell_view_get_shell_content (shell_view);
+
+ memo_shell_content = E_MEMO_SHELL_CONTENT (shell_content);
+ model = e_memo_shell_content_get_memo_model (memo_shell_content);
+ timezone = e_cal_model_get_timezone (model);
+
+ e_cal_set_default_timezone (client, timezone, NULL);
e_cal_open_async (client, FALSE);
}
@@ -813,11 +829,17 @@ void
e_memo_shell_sidebar_add_source (EMemoShellSidebar *memo_shell_sidebar,
ESource *source)
{
+ EShellView *shell_view;
+ EShellContent *shell_content;
+ EShellSidebar *shell_sidebar;
+ EMemoShellContent *memo_shell_content;
ECalSourceType source_type;
ESourceSelector *selector;
GHashTable *client_table;
+ ECalModel *model;
ECal *default_client;
ECal *client;
+ icaltimezone *timezone;
const gchar *uid;
const gchar *uri;
gchar *message;
@@ -876,7 +898,17 @@ e_memo_shell_sidebar_add_source (EMemoShellSidebar *memo_shell_sidebar,
G_CALLBACK (memo_shell_sidebar_client_opened_cb),
memo_shell_sidebar);
- e_cal_set_default_timezone (client, e_cal_model_get_timezone (e_memo_shell_content_get_memo_model (E_MEMO_SHELL_CONTENT (e_shell_view_get_shell_content (e_shell_sidebar_get_shell_view (E_SHELL_SIDEBAR (memo_shell_sidebar)))))), NULL);
+ /* FIXME Sidebar should not be accessing the EShellContent.
+ * This probably needs to be moved to EMemoShellView. */
+ shell_sidebar = E_SHELL_SIDEBAR (memo_shell_sidebar);
+ shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
+ shell_content = e_shell_view_get_shell_content (shell_view);
+
+ memo_shell_content = E_MEMO_SHELL_CONTENT (shell_content);
+ model = e_memo_shell_content_get_memo_model (memo_shell_content);
+ timezone = e_cal_model_get_timezone (model);
+
+ e_cal_set_default_timezone (client, timezone, NULL);
e_cal_open_async (client, FALSE);
}
diff --git a/modules/calendar/e-task-shell-sidebar.c b/modules/calendar/e-task-shell-sidebar.c
index db80a50500..07eb43bdbf 100644
--- a/modules/calendar/e-task-shell-sidebar.c
+++ b/modules/calendar/e-task-shell-sidebar.c
@@ -272,9 +272,15 @@ static void
task_shell_sidebar_set_default (ETaskShellSidebar *task_shell_sidebar,
ESource *source)
{
+ EShellView *shell_view;
+ EShellContent *shell_content;
+ EShellSidebar *shell_sidebar;
+ ETaskShellContent *task_shell_content;
ECalSourceType source_type;
GHashTable *client_table;
+ ECalModel *model;
ECal *client;
+ icaltimezone *timezone;
const gchar *uid;
source_type = E_CAL_SOURCE_TYPE_TODO;
@@ -299,7 +305,17 @@ task_shell_sidebar_set_default (ETaskShellSidebar *task_shell_sidebar,
G_CALLBACK (task_shell_sidebar_default_opened_cb),
task_shell_sidebar);
- e_cal_set_default_timezone (client, e_cal_model_get_timezone (e_task_shell_content_get_task_model (E_TASK_SHELL_CONTENT (e_shell_view_get_shell_content (e_shell_sidebar_get_shell_view (E_SHELL_SIDEBAR (task_shell_sidebar)))))), NULL);
+ /* FIXME Sidebar should not be accessing the EShellContent.
+ * This probably needs to be moved to ETaskShellView. */
+ shell_sidebar = E_SHELL_SIDEBAR (task_shell_sidebar);
+ shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
+ shell_content = e_shell_view_get_shell_content (shell_view);
+
+ task_shell_content = E_TASK_SHELL_CONTENT (shell_content);
+ model = e_task_shell_content_get_task_model (task_shell_content);
+ timezone = e_cal_model_get_timezone (model);
+
+ e_cal_set_default_timezone (client, timezone, NULL);
e_cal_open_async (client, FALSE);
}
@@ -813,11 +829,17 @@ void
e_task_shell_sidebar_add_source (ETaskShellSidebar *task_shell_sidebar,
ESource *source)
{
+ EShellView *shell_view;
+ EShellContent *shell_content;
+ EShellSidebar *shell_sidebar;
+ ETaskShellContent *task_shell_content;
ECalSourceType source_type;
ESourceSelector *selector;
GHashTable *client_table;
+ ECalModel *model;
ECal *default_client;
ECal *client;
+ icaltimezone *timezone;
const gchar *uid;
const gchar *uri;
gchar *message;
@@ -876,7 +898,17 @@ e_task_shell_sidebar_add_source (ETaskShellSidebar *task_shell_sidebar,
G_CALLBACK (task_shell_sidebar_client_opened_cb),
task_shell_sidebar);
- e_cal_set_default_timezone (client, e_cal_model_get_timezone (e_task_shell_content_get_task_model (E_TASK_SHELL_CONTENT (e_shell_view_get_shell_content (e_shell_sidebar_get_shell_view (E_SHELL_SIDEBAR (task_shell_sidebar)))))), NULL);
+ /* FIXME Sidebar should not be accessing the EShellContent.
+ * This probably needs to be moved to ETaskShellView. */
+ shell_sidebar = E_SHELL_SIDEBAR (task_shell_sidebar);
+ shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
+ shell_content = e_shell_view_get_shell_content (shell_view);
+
+ task_shell_content = E_TASK_SHELL_CONTENT (shell_content);
+ model = e_task_shell_content_get_task_model (task_shell_content);
+ timezone = e_cal_model_get_timezone (model);
+
+ e_cal_set_default_timezone (client, timezone, NULL);
e_cal_open_async (client, FALSE);
}