aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2008-10-31 20:54:01 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2008-10-31 20:54:01 +0800
commit78fd379aa7c17c60c4b5fc07e5243b32ec4a2639 (patch)
tree55a5c29dfb02f27e094b1fcf3e324904008aa5ad /calendar
parent9c9e85d286fe61ed11e457c737bd26e2732119ab (diff)
downloadgsoc2013-evolution-78fd379aa7c17c60c4b5fc07e5243b32ec4a2639.tar.gz
gsoc2013-evolution-78fd379aa7c17c60c4b5fc07e5243b32ec4a2639.tar.zst
gsoc2013-evolution-78fd379aa7c17c60c4b5fc07e5243b32ec4a2639.zip
Support inline renaming of sources in the source selector, with help
from evolution-data-server (see bug #558322). Kill another frivolous plugin: select-one-source svn path=/branches/kill-bonobo/; revision=36705
Diffstat (limited to 'calendar')
-rw-r--r--calendar/modules/e-cal-shell-view-actions.c57
-rw-r--r--calendar/modules/e-cal-shell-view-actions.h4
-rw-r--r--calendar/modules/e-cal-shell-view-private.c20
-rw-r--r--calendar/modules/e-cal-shell-view.c4
-rw-r--r--calendar/modules/e-memo-shell-sidebar.c4
-rw-r--r--calendar/modules/e-memo-shell-view-actions.c20
-rw-r--r--calendar/modules/e-memo-shell-view-actions.h2
-rw-r--r--calendar/modules/e-memo-shell-view.c4
-rw-r--r--calendar/modules/e-task-shell-view-actions.c20
-rw-r--r--calendar/modules/e-task-shell-view-actions.h4
-rw-r--r--calendar/modules/e-task-shell-view.c4
11 files changed, 141 insertions, 2 deletions
diff --git a/calendar/modules/e-cal-shell-view-actions.c b/calendar/modules/e-cal-shell-view-actions.c
index f2c7d47b62..22b2250acb 100644
--- a/calendar/modules/e-cal-shell-view-actions.c
+++ b/calendar/modules/e-cal-shell-view-actions.c
@@ -284,6 +284,49 @@ action_calendar_purge_cb (GtkAction *action,
}
static void
+action_calendar_rename_cb (GtkAction *action,
+ ECalShellView *cal_shell_view)
+{
+ ECalShellSidebar *cal_shell_sidebar;
+ ESourceSelector *selector;
+
+ cal_shell_sidebar = cal_shell_view->priv->cal_shell_sidebar;
+ selector = e_cal_shell_sidebar_get_selector (cal_shell_sidebar);
+
+ e_source_selector_edit_primary_selection (selector);
+}
+
+static void
+action_calendar_select_one_cb (GtkAction *action,
+ ECalShellView *cal_shell_view)
+{
+ ECalShellSidebar *cal_shell_sidebar;
+ ESourceSelector *selector;
+ ESource *primary;
+ GSList *list, *iter;
+
+ /* XXX ESourceSelector should provide a function for this. */
+
+ cal_shell_sidebar = cal_shell_view->priv->cal_shell_sidebar;
+ selector = e_cal_shell_sidebar_get_selector (cal_shell_sidebar);
+ primary = e_source_selector_peek_primary_selection (selector);
+ g_return_if_fail (primary != NULL);
+
+ list = e_source_selector_get_selection (selector);
+ for (iter = list; iter != NULL; iter = iter->next) {
+ ESource *source = iter->data;
+
+ if (source == primary)
+ continue;
+
+ e_source_selector_unselect_source (selector, source);
+ }
+ e_source_selector_free_selection (list);
+
+ e_source_selector_select_source (selector, primary);
+}
+
+static void
action_calendar_view_cb (GtkRadioAction *action,
GtkRadioAction *current,
ECalShellView *cal_shell_view)
@@ -615,6 +658,20 @@ static GtkActionEntry calendar_entries[] = {
N_("Purge old appointments and meetings"),
G_CALLBACK (action_calendar_purge_cb) },
+ { "calendar-rename",
+ NULL,
+ N_("_Rename..."),
+ "F2",
+ N_("Rename the selected calendar"),
+ G_CALLBACK (action_calendar_rename_cb) },
+
+ { "calendar-select-one",
+ "stock_check-filled",
+ N_("Show _Only This Calendar"),
+ NULL,
+ NULL, /* XXX Add a tooltip! */
+ G_CALLBACK (action_calendar_select_one_cb) },
+
{ "event-clipboard-copy",
GTK_STOCK_COPY,
NULL,
diff --git a/calendar/modules/e-cal-shell-view-actions.h b/calendar/modules/e-cal-shell-view-actions.h
index c682b22190..9d75b002a8 100644
--- a/calendar/modules/e-cal-shell-view-actions.h
+++ b/calendar/modules/e-cal-shell-view-actions.h
@@ -47,6 +47,10 @@
E_SHELL_WINDOW_ACTION ((window), "calendar-properties")
#define E_SHELL_WINDOW_ACTION_CALENDAR_PURGE(window) \
E_SHELL_WINDOW_ACTION ((window), "calendar-purge")
+#define E_SHELL_WINDOW_ACTION_CALENDAR_RENAME(window) \
+ E_SHELL_WINDOW_ACTION ((window), "calendar-rename")
+#define E_SHELL_WINDOW_ACTION_CALENDAR_SELECT_ONE(window) \
+ E_SHELL_WINDOW_ACTION ((window), "calendar-select-one")
#define E_SHELL_WINDOW_ACTION_CALENDAR_VIEW_DAY(window) \
E_SHELL_WINDOW_ACTION ((window), "calendar-view-day")
#define E_SHELL_WINDOW_ACTION_CALENDAR_VIEW_LIST(window) \
diff --git a/calendar/modules/e-cal-shell-view-private.c b/calendar/modules/e-cal-shell-view-private.c
index 8b1f0d9c82..561ff4a2b0 100644
--- a/calendar/modules/e-cal-shell-view-private.c
+++ b/calendar/modules/e-cal-shell-view-private.c
@@ -116,6 +116,19 @@ cal_shell_view_mini_calendar_scroll_event_cb (ECalShellView *cal_shell_view,
cal_shell_view, calitem);
}
+static gboolean
+cal_shell_view_selector_popup_event_cb (EShellView *shell_view,
+ ESource *primary_source,
+ GdkEventButton *event)
+{
+ const gchar *widget_path;
+
+ widget_path = "/calendar-popup";
+ e_shell_view_show_popup_menu (shell_view, widget_path, event);
+
+ return TRUE;
+}
+
static void
cal_shell_view_memopad_popup_event_cb (EShellView *shell_view,
GdkEventButton *event)
@@ -240,6 +253,7 @@ e_cal_shell_view_private_constructed (ECalShellView *cal_shell_view)
ECalendar *mini_calendar;
EMemoTable *memo_table;
ECalendarTable *task_table;
+ ESourceSelector *selector;
guint id;
shell_view = E_SHELL_VIEW (cal_shell_view);
@@ -256,6 +270,7 @@ e_cal_shell_view_private_constructed (ECalShellView *cal_shell_view)
task_table = e_cal_shell_content_get_task_table (cal_shell_content);
cal_shell_sidebar = E_CAL_SHELL_SIDEBAR (shell_sidebar);
+ selector = e_cal_shell_sidebar_get_selector (cal_shell_sidebar);
mini_calendar = e_cal_shell_sidebar_get_mini_calendar (cal_shell_sidebar);
e_calendar_item_set_get_time_callback (
@@ -285,6 +300,11 @@ e_cal_shell_view_private_constructed (ECalShellView *cal_shell_view)
cal_shell_view);
g_signal_connect_swapped (
+ selector, "popup-event",
+ G_CALLBACK (cal_shell_view_selector_popup_event_cb),
+ cal_shell_view);
+
+ g_signal_connect_swapped (
memo_table, "popup-event",
G_CALLBACK (cal_shell_view_memopad_popup_event_cb),
cal_shell_view);
diff --git a/calendar/modules/e-cal-shell-view.c b/calendar/modules/e-cal-shell-view.c
index fa2142e42a..ca6264efef 100644
--- a/calendar/modules/e-cal-shell-view.c
+++ b/calendar/modules/e-cal-shell-view.c
@@ -140,6 +140,10 @@ cal_shell_view_update_actions (EShellView *shell_view)
sensitive = (source != NULL);
gtk_action_set_sensitive (action, sensitive);
+ action = ACTION (CALENDAR_RENAME);
+ sensitive = has_primary_source;
+ gtk_action_set_sensitive (action, sensitive);
+
action = ACTION (EVENT_CLIPBOARD_COPY);
sensitive = (n_selected > 0);
gtk_action_set_sensitive (action, sensitive);
diff --git a/calendar/modules/e-memo-shell-sidebar.c b/calendar/modules/e-memo-shell-sidebar.c
index 9068397005..d66f4881b1 100644
--- a/calendar/modules/e-memo-shell-sidebar.c
+++ b/calendar/modules/e-memo-shell-sidebar.c
@@ -463,9 +463,9 @@ memo_shell_sidebar_check_state (EShellSidebar *shell_sidebar)
}
if (source != NULL)
- state = E_MEMO_SHELL_SIDEBAR_HAS_PRIMARY_SOURCE;
+ state |= E_MEMO_SHELL_SIDEBAR_HAS_PRIMARY_SOURCE;
if (is_system)
- state = E_MEMO_SHELL_SIDEBAR_PRIMARY_SOURCE_IS_SYSTEM;
+ state |= E_MEMO_SHELL_SIDEBAR_PRIMARY_SOURCE_IS_SYSTEM;
return state;
}
diff --git a/calendar/modules/e-memo-shell-view-actions.c b/calendar/modules/e-memo-shell-view-actions.c
index 915f52640e..627f698449 100644
--- a/calendar/modules/e-memo-shell-view-actions.c
+++ b/calendar/modules/e-memo-shell-view-actions.c
@@ -289,6 +289,19 @@ action_memo_list_properties_cb (GtkAction *action,
}
static void
+action_memo_list_rename_cb (GtkAction *action,
+ EMemoShellView *memo_shell_view)
+{
+ EMemoShellSidebar *memo_shell_sidebar;
+ ESourceSelector *selector;
+
+ memo_shell_sidebar = memo_shell_view->priv->memo_shell_sidebar;
+ selector = e_memo_shell_sidebar_get_selector (memo_shell_sidebar);
+
+ e_source_selector_edit_primary_selection (selector);
+}
+
+static void
action_memo_list_select_one_cb (GtkAction *action,
EMemoShellView *memo_shell_view)
{
@@ -587,6 +600,13 @@ static GtkActionEntry memo_entries[] = {
NULL, /* XXX Add a tooltip! */
G_CALLBACK (action_memo_list_properties_cb) },
+ { "memo-list-rename",
+ NULL,
+ N_("_Rename..."),
+ "F2",
+ N_("Rename the selected memo list"),
+ G_CALLBACK (action_memo_list_rename_cb) },
+
{ "memo-list-select-one",
"stock_check-filled",
N_("Show _Only This Memo List"),
diff --git a/calendar/modules/e-memo-shell-view-actions.h b/calendar/modules/e-memo-shell-view-actions.h
index 474751c7c3..28b8b3cfe7 100644
--- a/calendar/modules/e-memo-shell-view-actions.h
+++ b/calendar/modules/e-memo-shell-view-actions.h
@@ -61,6 +61,8 @@
E_SHELL_WINDOW_ACTION ((window), "memo-list-print-preview")
#define E_SHELL_WINDOW_ACTION_MEMO_LIST_PROPERTIES(window) \
E_SHELL_WINDOW_ACTION ((window), "memo-list-properties")
+#define E_SHELL_WINDOW_ACTION_MEMO_LIST_RENAME(window) \
+ E_SHELL_WINDOW_ACTION ((window), "memo-list-rename")
#define E_SHELL_WINDOW_ACTION_MEMO_LIST_SELECT_ONE(window) \
E_SHELL_WINDOW_ACTION ((window), "memo-list-select-one")
diff --git a/calendar/modules/e-memo-shell-view.c b/calendar/modules/e-memo-shell-view.c
index 161caf92d0..0237e84e27 100644
--- a/calendar/modules/e-memo-shell-view.c
+++ b/calendar/modules/e-memo-shell-view.c
@@ -158,6 +158,10 @@ memo_shell_view_update_actions (EShellView *shell_view)
sensitive = has_primary_source;
gtk_action_set_sensitive (action, sensitive);
+ action = ACTION (MEMO_LIST_RENAME);
+ sensitive = has_primary_source;
+ gtk_action_set_sensitive (action, sensitive);
+
action = ACTION (MEMO_OPEN);
sensitive = single_memo_selected;
gtk_action_set_sensitive (action, sensitive);
diff --git a/calendar/modules/e-task-shell-view-actions.c b/calendar/modules/e-task-shell-view-actions.c
index 45c1400c40..80ee864db0 100644
--- a/calendar/modules/e-task-shell-view-actions.c
+++ b/calendar/modules/e-task-shell-view-actions.c
@@ -336,6 +336,19 @@ action_task_list_properties_cb (GtkAction *action,
}
static void
+action_task_list_rename_cb (GtkAction *action,
+ ETaskShellView *task_shell_view)
+{
+ ETaskShellSidebar *task_shell_sidebar;
+ ESourceSelector *selector;
+
+ task_shell_sidebar = task_shell_view->priv->task_shell_sidebar;
+ selector = e_task_shell_sidebar_get_selector (task_shell_sidebar);
+
+ e_source_selector_edit_primary_selection (selector);
+}
+
+static void
action_task_list_select_one_cb (GtkAction *action,
ETaskShellView *task_shell_view)
{
@@ -712,6 +725,13 @@ static GtkActionEntry task_entries[] = {
NULL, /* XXX Add a tooltip! */
G_CALLBACK (action_task_list_properties_cb) },
+ { "task-list-rename",
+ NULL,
+ N_("_Rename..."),
+ "F2",
+ N_("Rename the selected task list"),
+ G_CALLBACK (action_task_list_rename_cb) },
+
{ "task-list-select-one",
"stock_check-filled",
N_("Show _Only This Task List"),
diff --git a/calendar/modules/e-task-shell-view-actions.h b/calendar/modules/e-task-shell-view-actions.h
index 48aa01811c..0d6465435c 100644
--- a/calendar/modules/e-task-shell-view-actions.h
+++ b/calendar/modules/e-task-shell-view-actions.h
@@ -69,6 +69,10 @@
E_SHELL_WINDOW_ACTION ((window), "task-list-print-preview")
#define E_SHELL_WINDOW_ACTION_TASK_LIST_PROPERTIES(window) \
E_SHELL_WINDOW_ACTION ((window), "task-list-properties")
+#define E_SHELL_WINDOW_ACTION_TASK_LIST_RENAME(window) \
+ E_SHELL_WINDOW_ACTION ((window), "task-list-rename")
+#define E_SHELL_WINDOW_ACTION_TASK_LIST_SELECT_ONE(window) \
+ E_SHELL_WINDOW_ACTION ((window), "task-list-select-one")
/* Task Query Actions */
#define E_SHELL_WINDOW_ACTION_TASK_FILTER_ACTIVE_TASKS(window) \
diff --git a/calendar/modules/e-task-shell-view.c b/calendar/modules/e-task-shell-view.c
index 99e6164eb4..9c893d259a 100644
--- a/calendar/modules/e-task-shell-view.c
+++ b/calendar/modules/e-task-shell-view.c
@@ -173,6 +173,10 @@ task_shell_view_update_actions (EShellView *shell_view)
sensitive = has_primary_source;
gtk_action_set_sensitive (action, sensitive);
+ action = ACTION (TASK_LIST_RENAME);
+ sensitive = has_primary_source;
+ gtk_action_set_sensitive (action, sensitive);
+
action = ACTION (TASK_MARK_COMPLETE);
sensitive =
any_tasks_selected &&