aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2013-05-30 23:48:41 +0800
committerMilan Crha <mcrha@redhat.com>2013-05-30 23:48:41 +0800
commit070eddbc2b9e44d288c796d18b16fdd4da1179e7 (patch)
tree581a0d634f82846861b3219c538813da832a8157
parentb9525b5f6b09cc7c51ec532366f844ab22cf31fd (diff)
downloadgsoc2013-evolution-070eddbc2b9e44d288c796d18b16fdd4da1179e7.tar
gsoc2013-evolution-070eddbc2b9e44d288c796d18b16fdd4da1179e7.tar.gz
gsoc2013-evolution-070eddbc2b9e44d288c796d18b16fdd4da1179e7.tar.bz2
gsoc2013-evolution-070eddbc2b9e44d288c796d18b16fdd4da1179e7.tar.lz
gsoc2013-evolution-070eddbc2b9e44d288c796d18b16fdd4da1179e7.tar.xz
gsoc2013-evolution-070eddbc2b9e44d288c796d18b16fdd4da1179e7.tar.zst
gsoc2013-evolution-070eddbc2b9e44d288c796d18b16fdd4da1179e7.zip
Bug #700812 - Search in Calendar view is broken
-rw-r--r--modules/calendar/e-cal-shell-view-private.c10
-rw-r--r--modules/calendar/e-cal-shell-view.c29
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 366af1b57d..02e5e97bb9 100644
--- a/modules/calendar/e-cal-shell-view-private.c
+++ b/modules/calendar/e-cal-shell-view-private.c
@@ -1488,6 +1488,8 @@ cal_iterate_searching (ECalShellView *cal_shell_view)
priv->searching_activity = NULL;
}
+ e_shell_view_update_actions (E_SHELL_VIEW (cal_shell_view));
+
return;
}
@@ -1594,7 +1596,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,
@@ -1603,6 +1605,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
@@ -1651,8 +1655,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 f17a1386b4..445d69e86d 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,14 +105,16 @@ 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);
+
+ e_cal_shell_view_private_constructed (E_CAL_SHELL_VIEW (shell_view));
/* no search bar in express mode */
if (e_shell_get_express_mode (e_shell_get_default ()))
return;
- shell_window = e_shell_view_get_shell_window (E_SHELL_VIEW (object));
- shell_content = e_shell_view_get_shell_content (E_SHELL_VIEW (object));
+ 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);
@@ -110,6 +126,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