aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2013-06-21 21:56:34 +0800
committerMilan Crha <mcrha@redhat.com>2013-06-21 21:56:34 +0800
commit4a101290fdb546296f7bc0a9a34ba342e741895a (patch)
tree3a5cecac900e672a87f2865a8288f30dbeea4c34 /modules
parent97c70105b71adc9b7cb9f4db15bf44f98133a82c (diff)
downloadgsoc2013-evolution-4a101290fdb546296f7bc0a9a34ba342e741895a.tar
gsoc2013-evolution-4a101290fdb546296f7bc0a9a34ba342e741895a.tar.gz
gsoc2013-evolution-4a101290fdb546296f7bc0a9a34ba342e741895a.tar.bz2
gsoc2013-evolution-4a101290fdb546296f7bc0a9a34ba342e741895a.tar.lz
gsoc2013-evolution-4a101290fdb546296f7bc0a9a34ba342e741895a.tar.xz
gsoc2013-evolution-4a101290fdb546296f7bc0a9a34ba342e741895a.tar.zst
gsoc2013-evolution-4a101290fdb546296f7bc0a9a34ba342e741895a.zip
Calendar views inline text edit with Ctrl+C/V/X does not work
The shortcuts Ctrl+C/V/X are used for whole calendar items copy/paste/cut, not for text when editing event details inline, either in a day/week view or in a list view. By tracking the is-editing property of respective cell editor and using it when enabling/disabling clipboard actions makes the respective text operations work as expected.
Diffstat (limited to 'modules')
-rw-r--r--modules/calendar/e-cal-shell-content.c19
-rw-r--r--modules/calendar/e-cal-shell-view.c31
-rw-r--r--modules/calendar/e-memo-shell-content.c13
-rw-r--r--modules/calendar/e-task-shell-content.c13
4 files changed, 76 insertions, 0 deletions
diff --git a/modules/calendar/e-cal-shell-content.c b/modules/calendar/e-cal-shell-content.c
index 545287dc29..38724aca3e 100644
--- a/modules/calendar/e-cal-shell-content.c
+++ b/modules/calendar/e-cal-shell-content.c
@@ -316,6 +316,16 @@ gc_get_default_time (ECalModel *model,
}
static void
+cal_shell_content_is_editing_changed_cb (gpointer cal_view_tasks_memos_table,
+ GParamSpec *param,
+ EShellView *shell_view)
+{
+ g_return_if_fail (E_IS_SHELL_VIEW (shell_view));
+
+ e_shell_view_update_actions (shell_view);
+}
+
+static void
cal_shell_content_constructed (GObject *object)
{
ECalShellContentPrivate *priv;
@@ -396,6 +406,9 @@ cal_shell_content_constructed (GObject *object)
for (ii = 0; ii < GNOME_CAL_LAST_VIEW; ii++) {
calendar_view = gnome_calendar_get_calendar_view (calendar, ii);
+ g_signal_connect (calendar_view, "notify::is-editing",
+ G_CALLBACK (cal_shell_content_is_editing_changed_cb), shell_view);
+
gtk_notebook_append_page (
GTK_NOTEBOOK (container),
GTK_WIDGET (calendar_view), NULL);
@@ -450,6 +463,9 @@ cal_shell_content_constructed (GObject *object)
G_CALLBACK (e_cal_shell_view_taskpad_open_task),
shell_view);
+ g_signal_connect (widget, "notify::is-editing",
+ G_CALLBACK (cal_shell_content_is_editing_changed_cb), shell_view);
+
container = priv->vpaned;
widget = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
@@ -492,6 +508,9 @@ cal_shell_content_constructed (GObject *object)
G_CALLBACK (e_cal_shell_view_memopad_open_memo),
shell_view);
+ g_signal_connect (widget, "notify::is-editing",
+ G_CALLBACK (cal_shell_content_is_editing_changed_cb), shell_view);
+
/* Load the view instance. */
view_instance = e_shell_view_new_view_instance (shell_view, NULL);
diff --git a/modules/calendar/e-cal-shell-view.c b/modules/calendar/e-cal-shell-view.c
index 39f1472dbb..bacf4f4ec2 100644
--- a/modules/calendar/e-cal-shell-view.c
+++ b/modules/calendar/e-cal-shell-view.c
@@ -340,6 +340,9 @@ cal_shell_view_update_actions (EShellView *shell_view)
ESource *source;
ESourceRegistry *registry;
GnomeCalendar *calendar;
+ ECalendarView *cal_view;
+ EMemoTable *memo_table;
+ ETaskTable *task_table;
ECalModel *model;
GtkAction *action;
const gchar *model_sexp;
@@ -382,6 +385,9 @@ cal_shell_view_update_actions (EShellView *shell_view)
cal_shell_content = priv->cal_shell_content;
calendar = e_cal_shell_content_get_calendar (cal_shell_content);
+ cal_view = gnome_calendar_get_calendar_view (calendar, gnome_calendar_get_view (calendar));
+ memo_table = e_cal_shell_content_get_memo_table (cal_shell_content);
+ task_table = e_cal_shell_content_get_task_table (cal_shell_content);
model = gnome_calendar_get_model (calendar);
model_sexp = e_cal_model_get_search_query (model);
is_searching = model_sexp && *model_sexp &&
@@ -536,6 +542,31 @@ cal_shell_view_update_actions (EShellView *shell_view)
action = ACTION (EVENT_MEETING_NEW);
gtk_action_set_visible (action, has_mail_identity);
+
+ if ((cal_view && e_calendar_view_is_editing (cal_view)) ||
+ e_table_is_editing (E_TABLE (memo_table)) ||
+ e_table_is_editing (E_TABLE (task_table))) {
+ EFocusTracker *focus_tracker;
+
+ /* disable all clipboard actions, if any of the views is in editing mode */
+ focus_tracker = e_shell_window_get_focus_tracker (shell_window);
+
+ action = e_focus_tracker_get_cut_clipboard_action (focus_tracker);
+ if (action)
+ gtk_action_set_sensitive (action, FALSE);
+
+ action = e_focus_tracker_get_copy_clipboard_action (focus_tracker);
+ if (action)
+ gtk_action_set_sensitive (action, FALSE);
+
+ action = e_focus_tracker_get_paste_clipboard_action (focus_tracker);
+ if (action)
+ gtk_action_set_sensitive (action, FALSE);
+
+ action = e_focus_tracker_get_delete_selection_action (focus_tracker);
+ if (action)
+ gtk_action_set_sensitive (action, FALSE);
+ }
}
static void
diff --git a/modules/calendar/e-memo-shell-content.c b/modules/calendar/e-memo-shell-content.c
index abb1adadf4..ded7e8af67 100644
--- a/modules/calendar/e-memo-shell-content.c
+++ b/modules/calendar/e-memo-shell-content.c
@@ -300,6 +300,16 @@ memo_shell_content_restore_state_cb (EShellWindow *shell_window,
G_SETTINGS_BIND_DEFAULT);
}
+static void
+memo_shell_content_is_editing_changed_cb (EMemoTable *memo_table,
+ GParamSpec *param,
+ EShellView *shell_view)
+{
+ g_return_if_fail (E_IS_SHELL_VIEW (shell_view));
+
+ e_shell_view_update_actions (shell_view);
+}
+
static GtkOrientation
memo_shell_content_get_orientation (EMemoShellContent *memo_shell_content)
{
@@ -542,6 +552,9 @@ memo_shell_content_constructed (GObject *object)
G_CALLBACK (memo_shell_content_selection_change_cb),
object);
+ g_signal_connect (priv->memo_table, "notify::is-editing",
+ G_CALLBACK (memo_shell_content_is_editing_changed_cb), shell_view);
+
g_signal_connect_swapped (
priv->memo_model, "model-row-changed",
G_CALLBACK (memo_shell_content_model_row_changed_cb),
diff --git a/modules/calendar/e-task-shell-content.c b/modules/calendar/e-task-shell-content.c
index 07d11a4b5b..7bfb5b741f 100644
--- a/modules/calendar/e-task-shell-content.c
+++ b/modules/calendar/e-task-shell-content.c
@@ -300,6 +300,16 @@ task_shell_content_restore_state_cb (EShellWindow *shell_window,
g_object_unref (settings);
}
+static void
+task_shell_content_is_editing_changed_cb (ETaskTable *task_table,
+ GParamSpec *param,
+ EShellView *shell_view)
+{
+ g_return_if_fail (E_IS_SHELL_VIEW (shell_view));
+
+ e_shell_view_update_actions (shell_view);
+}
+
static GtkOrientation
task_shell_content_get_orientation (ETaskShellContent *task_shell_content)
{
@@ -542,6 +552,9 @@ task_shell_content_constructed (GObject *object)
G_CALLBACK (task_shell_content_selection_change_cb),
object);
+ g_signal_connect (priv->task_table, "notify::is-editing",
+ G_CALLBACK (task_shell_content_is_editing_changed_cb), shell_view);
+
g_signal_connect_swapped (
priv->task_model, "model-row-changed",
G_CALLBACK (task_shell_content_model_row_changed_cb),