diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-01-18 08:24:26 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-01-18 08:24:26 +0000 |
commit | 979b48bd4b7356fb4ce4d9f2d6fd54d4aaa1b934 (patch) | |
tree | ac171a093b54b019ffff5d6a088962862f5f5d69 /src/fs/gnunet-fs-gtk-download.h | |
parent | faaac0e31528524f9fd39f5d71031cd483c3029b (diff) | |
download | gnunet-gtk-979b48bd4b7356fb4ce4d9f2d6fd54d4aaa1b934.tar.gz gnunet-gtk-979b48bd4b7356fb4ce4d9f2d6fd54d4aaa1b934.zip |
LRN:
Whenever a file is downloaded, store its downloaded name in a treestore
(FIXME: when a previously downloaded .gnd file is opened, set
downloaded name appropriately? Or not, since it won't have
anonymity?), as well as the anonymity level that was used.
When one of its children is downloaded, this information is checked
and, if present, is used to construct the child filename (and
anonymity is used to download the child; FIXME: anonymity == -1 might
be used, if parent supplied a filename, but not anonymity? This might
need a fix), so it is downloaded without showing the "Save as" dialog.
(TODO: the logic behind constructing the child filename from the name
of already downloaded directory file relies on directory file having a
'.gnd' extension; if it isn't there, the whole thing fails (tries to
mkdir() with the name of the .gnd-less directory file, which isn't
possible); Enforce .gnd extension? Change the name to avoid conflict?)
In future it might be necessary to add a context menu item that
overrides this behaviour and shows the dialog anyway.
Also changes the way gtkfilechooser is set up, so that it fills the
entry with short filename only, without the directory part, and the
directory part is used to select a directory. Without this the entry
gets absolute filename or directoryname, and if you later change the
directory in the dialog, contents of the entry remain the same. It's
intended to be relative most of the time!
Slight API changes for "Save as" dialog, now it invokes a callback
(FIXME: this breaks "Download URI", as it is not adapted to the
callback yet, that must be fixed as soon as possible!).
To that end one of its static functions was made public.
Diffstat (limited to 'src/fs/gnunet-fs-gtk-download.h')
-rw-r--r-- | src/fs/gnunet-fs-gtk-download.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/fs/gnunet-fs-gtk-download.h b/src/fs/gnunet-fs-gtk-download.h index c150ea2b..9d4af3e4 100644 --- a/src/fs/gnunet-fs-gtk-download.h +++ b/src/fs/gnunet-fs-gtk-download.h | |||
@@ -28,6 +28,10 @@ | |||
28 | #define GNUNET_FS_GTK_DOWNLOAD_H | 28 | #define GNUNET_FS_GTK_DOWNLOAD_H |
29 | #include "gnunet-fs-gtk-common.h" | 29 | #include "gnunet-fs-gtk-common.h" |
30 | 30 | ||
31 | struct DownloadContext; | ||
32 | |||
33 | typedef void (*GNUNET_FS_DownloadAsCallback ) (struct DownloadContext *dc); | ||
34 | |||
31 | /** | 35 | /** |
32 | * Information we keep for a download. | 36 | * Information we keep for a download. |
33 | */ | 37 | */ |
@@ -79,9 +83,17 @@ struct DownloadContext | |||
79 | * (this is the same as sr->tab, but sr is opaque here). | 83 | * (this is the same as sr->tab, but sr is opaque here). |
80 | */ | 84 | */ |
81 | struct SearchTab *tab; | 85 | struct SearchTab *tab; |
86 | |||
87 | /** | ||
88 | * A function to call once a filename is picked. | ||
89 | */ | ||
90 | GNUNET_FS_DownloadAsCallback cb; | ||
82 | }; | 91 | }; |
83 | 92 | ||
84 | 93 | ||
94 | void | ||
95 | GNUNET_GTK_save_as_dialog_free_download_context (struct DownloadContext *dc); | ||
96 | |||
85 | 97 | ||
86 | void | 98 | void |
87 | GNUNET_FS_GTK_open_download_as_dialog (struct DownloadContext *dc); | 99 | GNUNET_FS_GTK_open_download_as_dialog (struct DownloadContext *dc); |