diff options
Diffstat (limited to 'src/plugins/fs/directory.c')
-rw-r--r-- | src/plugins/fs/directory.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/plugins/fs/directory.c b/src/plugins/fs/directory.c index 3d72db4a..c1c7b8cd 100644 --- a/src/plugins/fs/directory.c +++ b/src/plugins/fs/directory.c | |||
@@ -44,9 +44,9 @@ selectFile () | |||
44 | char *ret; | 44 | char *ret; |
45 | 45 | ||
46 | uploadXML | 46 | uploadXML |
47 | = glade_xml_new (getGladeFileName (), | 47 | = glade_xml_new (GNUNET_GTK_get_glade_filename (), |
48 | "openDirectoryFileDialog", PACKAGE_NAME); | 48 | "openDirectoryFileDialog", PACKAGNUNET_GENAME); |
49 | connectGladeWithPlugins (uploadXML); | 49 | GNUNET_GTK_connect_glade_with_plugins (uploadXML); |
50 | dialog = GTK_FILE_CHOOSER (glade_xml_get_widget (uploadXML, | 50 | dialog = GTK_FILE_CHOOSER (glade_xml_get_widget (uploadXML, |
51 | "openDirectoryFileDialog")); | 51 | "openDirectoryFileDialog")); |
52 | if (gtk_dialog_run (GTK_DIALOG (dialog)) != GTK_RESPONSE_CANCEL) | 52 | if (gtk_dialog_run (GTK_DIALOG (dialog)) != GTK_RESPONSE_CANCEL) |
@@ -67,7 +67,7 @@ selectFile () | |||
67 | #endif /* MINGW */ | 67 | #endif /* MINGW */ |
68 | 68 | ||
69 | static int | 69 | static int |
70 | spcb (const ECRS_FileInfo * fi, | 70 | spcb (const GNUNET_ECRS_FileInfo * fi, |
71 | const GNUNET_HashCode * key, int isRoot, void *closure) | 71 | const GNUNET_HashCode * key, int isRoot, void *closure) |
72 | { | 72 | { |
73 | SearchList *list = closure; | 73 | SearchList *list = closure; |
@@ -83,10 +83,10 @@ on_open_menu_activate_fs (GtkWidget * dummy1, GtkWidget * dummy2) | |||
83 | char *directory_data; | 83 | char *directory_data; |
84 | unsigned long long directory_data_len; | 84 | unsigned long long directory_data_len; |
85 | size_t dlen; | 85 | size_t dlen; |
86 | struct ECRS_MetaData *md; | 86 | struct GNUNET_ECRS_MetaData *md; |
87 | int fd; | 87 | int fd; |
88 | SearchList *list; | 88 | SearchList *list; |
89 | struct ECRS_URI *uri; | 89 | struct GNUNET_ECRS_URI *uri; |
90 | const char *kws[2]; | 90 | const char *kws[2]; |
91 | GtkNotebook *notebook; | 91 | GtkNotebook *notebook; |
92 | 92 | ||
@@ -97,14 +97,14 @@ on_open_menu_activate_fs (GtkWidget * dummy1, GtkWidget * dummy2) | |||
97 | dn)) || | 97 | dn)) || |
98 | (GNUNET_OK != GNUNET_disk_file_size (NULL, dn, &directory_data_len, GNUNET_YES))) | 98 | (GNUNET_OK != GNUNET_disk_file_size (NULL, dn, &directory_data_len, GNUNET_YES))) |
99 | { | 99 | { |
100 | addLogEntry (_("Error accessing file `%s'."), dn); | 100 | GNUNET_GTK_add_log_entry (_("Error accessing file `%s'."), dn); |
101 | GNUNET_free (dn); | 101 | GNUNET_free (dn); |
102 | return; | 102 | return; |
103 | } | 103 | } |
104 | fd = GNUNET_disk_file_open (NULL, dn, O_LARGEFILE | O_RDONLY); | 104 | fd = GNUNET_disk_file_open (NULL, dn, O_LARGEFILE | O_RDONLY); |
105 | if (fd == -1) | 105 | if (fd == -1) |
106 | { | 106 | { |
107 | addLogEntry (_("Error opening file `%s'."), dn); | 107 | GNUNET_GTK_add_log_entry (_("Error opening file `%s'."), dn); |
108 | GNUNET_free (dn); | 108 | GNUNET_free (dn); |
109 | return; | 109 | return; |
110 | } | 110 | } |
@@ -112,38 +112,38 @@ on_open_menu_activate_fs (GtkWidget * dummy1, GtkWidget * dummy2) | |||
112 | directory_data = MMAP (NULL, dlen, PROT_READ, MAP_SHARED, fd, 0); | 112 | directory_data = MMAP (NULL, dlen, PROT_READ, MAP_SHARED, fd, 0); |
113 | if (directory_data == MAP_FAILED) | 113 | if (directory_data == MAP_FAILED) |
114 | { | 114 | { |
115 | addLogEntry (_("Error mapping file `%s' into memory."), dn); | 115 | GNUNET_GTK_add_log_entry (_("Error mapping file `%s' into memory."), dn); |
116 | CLOSE (fd); | 116 | CLOSE (fd); |
117 | GNUNET_free (dn); | 117 | GNUNET_free (dn); |
118 | return; | 118 | return; |
119 | } | 119 | } |
120 | kws[0] = dn; | 120 | kws[0] = dn; |
121 | kws[1] = NULL; | 121 | kws[1] = NULL; |
122 | uri = ECRS_keywordsToUri (kws); | 122 | uri = GNUNET_ECRS_keyword_string_to_uri (kws); |
123 | md = NULL; | 123 | md = NULL; |
124 | list = fs_search_started (NULL, uri, 0, 0, NULL, FSUI_COMPLETED); | 124 | list = fs_search_started (NULL, uri, 0, 0, NULL, GNUNET_FSUI_COMPLETED); |
125 | ECRS_freeUri (uri); | 125 | GNUNET_ECRS_uri_destroy (uri); |
126 | ECRS_listDirectory (NULL, | 126 | GNUNET_ECRS_directory_list_contents (NULL, |
127 | directory_data, directory_data_len, &md, &spcb, list); | 127 | directory_data, directory_data_len, &md, &spcb, list); |
128 | if (md != NULL) | 128 | if (md != NULL) |
129 | ECRS_freeMetaData (md); | 129 | GNUNET_ECRS_meta_data_destroy (md); |
130 | MUNMAP (directory_data, dlen); | 130 | MUNMAP (directory_data, dlen); |
131 | CLOSE (fd); | 131 | CLOSE (fd); |
132 | GNUNET_free (dn); | 132 | GNUNET_free (dn); |
133 | 133 | ||
134 | /* switch view -- select directory */ | 134 | /* switch view -- select directory */ |
135 | notebook | 135 | notebook |
136 | = GTK_NOTEBOOK (glade_xml_get_widget (getMainXML (), "downloadNotebook")); | 136 | = GTK_NOTEBOOK (glade_xml_get_widget (GNUNET_GTK_get_main_glade_XML (), "downloadNotebook")); |
137 | gtk_notebook_set_current_page (notebook, | 137 | gtk_notebook_set_current_page (notebook, |
138 | gtk_notebook_page_num (notebook, | 138 | gtk_notebook_page_num (notebook, |
139 | list->searchpage)); | 139 | list->searchpage)); |
140 | 140 | ||
141 | notebook | 141 | notebook |
142 | = GTK_NOTEBOOK (glade_xml_get_widget (getMainXML (), "fsnotebook")); | 142 | = GTK_NOTEBOOK (glade_xml_get_widget (GNUNET_GTK_get_main_glade_XML (), "fsnotebook")); |
143 | gtk_notebook_set_current_page (notebook, | 143 | gtk_notebook_set_current_page (notebook, |
144 | gtk_notebook_page_num (notebook, | 144 | gtk_notebook_page_num (notebook, |
145 | glade_xml_get_widget | 145 | glade_xml_get_widget |
146 | (getMainXML (), | 146 | (GNUNET_GTK_get_main_glade_XML (), |
147 | "fsdownloadvbox"))); | 147 | "fsdownloadvbox"))); |
148 | } | 148 | } |
149 | 149 | ||