diff options
author | Milan Crha <mcrha@redhat.com> | 2013-05-30 23:48:11 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2013-05-30 23:48:11 +0800 |
commit | ef5795c3fd5186f42f54a2695db8d6c1bd46f489 (patch) | |
tree | 3834749068b9e89d634344724ccf4afab34d87c7 /modules | |
parent | 4d398331f327468488b958d6af33a47e5354a2c6 (diff) | |
download | gsoc2013-evolution-ef5795c3fd5186f42f54a2695db8d6c1bd46f489.tar gsoc2013-evolution-ef5795c3fd5186f42f54a2695db8d6c1bd46f489.tar.gz gsoc2013-evolution-ef5795c3fd5186f42f54a2695db8d6c1bd46f489.tar.bz2 gsoc2013-evolution-ef5795c3fd5186f42f54a2695db8d6c1bd46f489.tar.lz gsoc2013-evolution-ef5795c3fd5186f42f54a2695db8d6c1bd46f489.tar.xz gsoc2013-evolution-ef5795c3fd5186f42f54a2695db8d6c1bd46f489.tar.zst gsoc2013-evolution-ef5795c3fd5186f42f54a2695db8d6c1bd46f489.zip |
Bug #700812 - Search in Calendar view is broken
Diffstat (limited to 'modules')
-rw-r--r-- | modules/calendar/e-cal-shell-view-private.c | 10 | ||||
-rw-r--r-- | modules/calendar/e-cal-shell-view.c | 29 |
2 files changed, 34 insertions, 5 deletions
diff --git a/modules/calendar/e-cal-shell-view-private.c b/modules/calendar/e-cal-shell-view-private.c index 8cafe21c49..f8d455edb5 100644 --- a/modules/calendar/e-cal-shell-view-private.c +++ b/modules/calendar/e-cal-shell-view-private.c @@ -1458,6 +1458,8 @@ cal_iterate_searching (ECalShellView *cal_shell_view) priv->searching_activity = NULL; } + e_shell_view_update_actions (E_SHELL_VIEW (cal_shell_view)); + return; } @@ -1564,7 +1566,7 @@ cal_iterate_searching (ECalShellView *cal_shell_view) priv->search_time = new_time; for (link = list; link != NULL; link = g_list_next (link)) { - ECalClient *client = E_CAL_CLIENT (link); + ECalClient *client = E_CAL_CLIENT (link->data); e_cal_client_get_object_list ( client, sexp, cancellable, @@ -1573,6 +1575,8 @@ cal_iterate_searching (ECalShellView *cal_shell_view) g_list_free_full (list, (GDestroyNotify) g_object_unref); g_free (sexp); + + e_shell_view_update_actions (E_SHELL_VIEW (cal_shell_view)); } void @@ -1621,8 +1625,10 @@ e_cal_shell_view_search_events (ECalShellView *cal_shell_view, priv->search_direction = search_forward ? +30 : -30; - if (cal_searching_check_candidates (cal_shell_view)) + if (cal_searching_check_candidates (cal_shell_view)) { + e_shell_view_update_actions (E_SHELL_VIEW (cal_shell_view)); return; + } range_years = cal_searching_get_search_range_years (cal_shell_view); diff --git a/modules/calendar/e-cal-shell-view.c b/modules/calendar/e-cal-shell-view.c index 312f28f8ab..dbcebf922f 100644 --- a/modules/calendar/e-cal-shell-view.c +++ b/modules/calendar/e-cal-shell-view.c @@ -47,6 +47,18 @@ cal_shell_view_finalize (GObject *object) } static void +cal_shell_view_prepare_for_quit_cb (EShell *shell, + EActivity *activity, + ECalShellView *cal_shell_view) +{ + g_return_if_fail (E_IS_CAL_SHELL_VIEW (cal_shell_view)); + + /* stop running searches, if any; the activity tight + on the search prevents application to quit */ + e_cal_shell_view_search_stop (cal_shell_view); +} + +static void cal_shell_view_add_action_button (GtkBox *box, GtkAction *action) { @@ -83,6 +95,8 @@ cal_shell_view_add_action_button (GtkBox *box, static void cal_shell_view_constructed (GObject *object) { + EShell *shell; + EShellView *shell_view; EShellContent *shell_content; EShellWindow *shell_window; EShellSearchbar *searchbar; @@ -91,10 +105,12 @@ cal_shell_view_constructed (GObject *object) /* Chain up to parent's constructed() method. */ G_OBJECT_CLASS (parent_class)->constructed (object); - e_cal_shell_view_private_constructed (E_CAL_SHELL_VIEW (object)); + shell_view = E_SHELL_VIEW (object); - shell_window = e_shell_view_get_shell_window (E_SHELL_VIEW (object)); - shell_content = e_shell_view_get_shell_content (E_SHELL_VIEW (object)); + e_cal_shell_view_private_constructed (E_CAL_SHELL_VIEW (shell_view)); + + shell_window = e_shell_view_get_shell_window (shell_view); + shell_content = e_shell_view_get_shell_content (shell_view); searchbar = e_cal_shell_content_get_searchbar (E_CAL_SHELL_CONTENT (shell_content)); box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); @@ -106,6 +122,13 @@ cal_shell_view_constructed (GObject *object) gtk_widget_show_all (box); gtk_container_add (GTK_CONTAINER (e_shell_searchbar_get_search_box (searchbar)), box); + + shell = e_shell_backend_get_shell (e_shell_view_get_shell_backend (shell_view)); + + g_signal_connect ( + shell, "prepare-for-quit", + G_CALLBACK (cal_shell_view_prepare_for_quit_cb), + object); } static void |