static void cache_manager_render_cb(GtkWidget *widget, gpointer data) { const gchar *path = layout_get_path(NULL); if (!path || !*path) path = homedir(); cache_manager_render_dialog(widget, path); }
gint slideshow_should_continue(SlideShowData *ss) { const gchar *imd_path; const gchar *path; if (!ss) return FALSE; imd_path = image_get_path(ss->imd); if ( ((imd_path == NULL) != (ss->slide_path == NULL)) || (imd_path && ss->slide_path && strcmp(imd_path, ss->slide_path) != 0) ) return FALSE; if (ss->path_list) return TRUE; if (ss->cd) { if (g_list_length(ss->cd->list) == ss->slide_count) return TRUE; else return FALSE; } if (!ss->layout) return FALSE; path = layout_get_path(ss->layout); if (path && ss->layout_path && strcmp(path, ss->layout_path) == 0) { if (ss->from_selection && ss->slide_count == layout_selection_count(ss->layout, NULL)) return TRUE; if (!ss->from_selection && ss->slide_count == layout_list_count(ss->layout, NULL)) return TRUE; } return FALSE; }
static void startup_path_set_current(GtkWidget *widget, gpointer data) { gtk_entry_set_text(GTK_ENTRY(startup_path_entry), layout_get_path(NULL)); }
static SlideShowData *real_slideshow_start(ImageWindow *imd, LayoutWindow *lw, GList *path_list, gint start_point, CollectionData *cd, CollectInfo *start_info, void (*stop_func)(SlideShowData *, gpointer), gpointer stop_data) { SlideShowData *ss; gint start_index = -1; if (!path_list && !cd && layout_list_count(lw, NULL) < 1) return NULL; ss = g_new0(SlideShowData, 1); ss->imd = imd; ss->path_list = path_list; ss->cd = cd; ss->layout = lw; ss->layout_path = NULL; ss->list = NULL; ss->list_done = NULL; ss->from_selection = FALSE; ss->stop_func = NULL; ss->timeout_id = -1; ss->paused = FALSE; if (ss->path_list) { ss->slide_count = g_list_length(ss->path_list); } else if (ss->cd) { collection_ref(ss->cd); ss->slide_count = g_list_length(ss->cd->list); if (!slideshow_random && start_info) { start_index = g_list_index(ss->cd->list, start_info); } } else { /* layout method */ ss->slide_count = layout_selection_count(ss->layout, NULL); ss->layout_path = g_strdup(layout_get_path(ss->layout)); if (ss->slide_count < 2) { ss->slide_count = layout_list_count(ss->layout, NULL); if (!slideshow_random && start_point >= 0 && start_point < ss->slide_count) { start_index = start_point; } } else { ss->from_selection = TRUE; } } slideshow_list_init(ss, start_index); ss->slide_path = g_strdup(image_get_path(ss->imd)); if (slideshow_step(ss, TRUE)) { slideshow_timer_reset(ss, TRUE); ss->stop_func = stop_func; ss->stop_data = stop_data; } else { slideshow_free(ss); ss = NULL; } return ss; }