Пример #1
0
gint collection_load_begin(CollectionData *cd, const gchar *path, gint append)
{
	if (!collection_load(cd, path, append)) return FALSE;

	collection_load_thumb_idle(cd);

	return TRUE;
}
Пример #2
0
gboolean collection_load_begin(CollectionData *cd, const gchar *path, CollectionLoadFlags flags)
{
	if (!collection_load(cd, path, flags)) return FALSE;

	collection_load_thumb_idle(cd);

	return TRUE;
}
Пример #3
0
static void real_collection_button_pressed(FileDialog *fd, gpointer data, gint append)
{
	CollectionData *cd = data;
	gboolean err = FALSE;
	gchar *text = NULL;

	if (!isname(fd->dest_path))
		{
		err = TRUE;
		text = g_strdup_printf(_("No such file '%s'."), fd->dest_path);
		}
	if (!err && isdir(fd->dest_path))
		{
		err = TRUE;
		text = g_strdup_printf(_("'%s' is a directory, not a collection file."), fd->dest_path);
		}
	if (!err && !access_file(fd->dest_path, R_OK))
		{
		err = TRUE;
		text = g_strdup_printf(_("You do not have read permissions on the file '%s'."), fd->dest_path);
		}

	if (err) {
		if  (text)
			{
			file_util_warning_dialog(_("Can not open collection file"), text, GTK_STOCK_DIALOG_ERROR, NULL);
			g_free(text);
		}
		return;
	}

	if (append)
		{
		collection_load(cd, fd->dest_path, TRUE);
		collection_unref(cd);
		}
	else
		{
		collection_window_new(fd->dest_path);
		}

	file_dialog_sync_history(fd, TRUE);
	file_dialog_close(fd);
}
Пример #4
0
static void real_collection_button_pressed(FileDialog *fd, gpointer data, gint append)
{
	CollectionData *cd = data;

	if (!fd->dest_path || isdir(fd->dest_path)) return;

	if (append)
		{
		collection_load(cd, fd->dest_path, TRUE);
		collection_unref(cd);
		}
	else
		{
		collection_window_new(fd->dest_path);
		}

	file_dialog_sync_history(fd, TRUE);
	file_dialog_close(fd);
}
Пример #5
0
void view_window_new(FileData *fd)
{
	GList *list;

	if (file_extension_match(fd->path, GQ_COLLECTION_EXT))
		{
		ViewWindow *vw;
		CollectionData *cd;
		CollectInfo *info;

		cd = collection_new(fd->path);
		if (collection_load(cd, fd->path, COLLECTION_LOAD_NONE))
			{
			info = collection_get_first(cd);
			}
		else
			{
			collection_unref(cd);
			cd = NULL;
			info = NULL;
			}
		vw = real_view_window_new(NULL, NULL, cd, info);
		if (vw && cd)
			{
			g_signal_connect(G_OBJECT(vw->window), "destroy",
					 G_CALLBACK(view_window_collection_unref_cb), cd);
			}
		}
	else if (isdir(fd->path) && filelist_read(fd, &list, NULL))
		{
		list = filelist_sort_path(list);
		list = filelist_filter(list, FALSE);
		real_view_window_new(NULL, list, NULL, NULL);
		filelist_free(list);
		}
	else
		{
		real_view_window_new(fd, NULL, NULL, NULL);
		}
}
Пример #6
0
gboolean collection_load_only_geometry(CollectionData *cd, const gchar *path)
{
	return collection_load(cd, path, COLLECTION_LOAD_GEOMETRY);
}