+
+/* Increments the "watch cursor" level, setting the cursor for
+ the assistant window to a watch face to indicate to the user
+ that the ongoing operation may take some time. */
+static void
+push_watch_cursor (struct import_assistant *ia)
+{
+ if (++ia->asst.watch_cursor == 1)
+ {
+ GtkWidget *widget = GTK_WIDGET (ia->asst.assistant);
+ GdkDisplay *display = gtk_widget_get_display (widget);
+ GdkCursor *cursor = gdk_cursor_new_for_display (display, GDK_WATCH);
+ gdk_window_set_cursor (widget->window, cursor);
+ gdk_cursor_unref (cursor);
+ gdk_display_flush (display);
+ }
+}
+
+/* Decrements the "watch cursor" level. If the level reaches
+ zero, the cursor is reset to its default shape. */
+static void
+pop_watch_cursor (struct import_assistant *ia)
+{
+ if (--ia->asst.watch_cursor == 0)
+ {
+ GtkWidget *widget = GTK_WIDGET (ia->asst.assistant);
+ gdk_window_set_cursor (widget->window, NULL);
+ }
+}