[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r19155 - gnunet-gtk/src/fs
From: |
gnunet |
Subject: |
[GNUnet-SVN] r19155 - gnunet-gtk/src/fs |
Date: |
Sun, 15 Jan 2012 13:14:11 +0100 |
Author: grothoff
Date: 2012-01-15 13:14:11 +0100 (Sun, 15 Jan 2012)
New Revision: 19155
Modified:
gnunet-gtk/src/fs/gnunet-fs-gtk-main_window_file_publish.c
Log:
-LRN: use filemetascanner
Modified: gnunet-gtk/src/fs/gnunet-fs-gtk-main_window_file_publish.c
===================================================================
--- gnunet-gtk/src/fs/gnunet-fs-gtk-main_window_file_publish.c 2012-01-15
12:13:44 UTC (rev 19154)
+++ gnunet-gtk/src/fs/gnunet-fs-gtk-main_window_file_publish.c 2012-01-15
12:14:11 UTC (rev 19155)
@@ -1203,6 +1203,55 @@
}
void
+scan_file_or_directory (struct MainPublishingDialogContext *ctx, gchar
*filename,
+ struct GNUNET_FS_BlockOptions *bo, int do_index)
+{
+ struct AddDirClientContext *adcc;
+ GtkTextIter iter;
+
+ adcc = GNUNET_malloc (sizeof (struct AddDirClientContext));
+ adcc->ctx = ctx;
+ GNUNET_CONTAINER_DLL_insert_tail (ctx->adddir_head, ctx->adddir_tail, adcc);
+ adcc->ds = GNUNET_FS_directory_scan_start (filename,
+ GNUNET_NO, NULL, directory_scan_cb, adcc);
+ adcc->directory_scan_bo = *bo;
+ adcc->directory_scan_do_index = do_index;
+
+ adcc->progress_dialog_builder = GNUNET_GTK_get_new_builder (
+ "gnunet_fs_gtk_progress_dialog.glade", adcc);
+ adcc->progress_dialog = GTK_WIDGET (gtk_builder_get_object (
+ adcc->progress_dialog_builder,
+ "GNUNET_FS_GTK_progress_dialog"));
+ adcc->progress_dialog_bar = GTK_PROGRESS_BAR (gtk_builder_get_object (
+ adcc->progress_dialog_builder,
+ "GNUNET_FS_GTK_progress_dialog_progressbar"));
+ adcc->progress_dialog_ok = GTK_BUTTON (gtk_builder_get_object (
+ adcc->progress_dialog_builder,
+ "GNUNET_FS_GTK_progress_dialog_ok_button"));
+ adcc->progress_dialog_cancel = GTK_BUTTON (gtk_builder_get_object (
+ adcc->progress_dialog_builder,
+ "GNUNET_FS_GTK_progress_dialog_cancel_button"));
+ adcc->progress_dialog_textview = GTK_TEXT_VIEW (
+ gtk_builder_get_object (adcc->progress_dialog_builder,
+ "GNUNET_FS_GTK_progress_dialog_textview"));
+ adcc->progress_dialog_textbuffer = GTK_TEXT_BUFFER (
+ gtk_builder_get_object (adcc->progress_dialog_builder,
+ "GNUNET_FS_GTK_progress_dialog_textbuffer"));
+ gtk_widget_set_sensitive (GTK_WIDGET (adcc->progress_dialog_ok), FALSE);
+
+ gtk_text_buffer_get_end_iter (adcc->progress_dialog_textbuffer,
+ &iter);
+ adcc->progress_dialog_textmark = gtk_text_buffer_create_mark (
+ adcc->progress_dialog_textbuffer, "scroll",
+ &iter, FALSE);
+
+ gtk_window_set_transient_for (GTK_WINDOW (adcc->progress_dialog),
adcc->ctx->master_pubdialog);
+ gtk_window_present (GTK_WINDOW (adcc->progress_dialog));
+
+ update_selectivity (ctx);
+}
+
+void
GNUNET_GTK_publish_directory_dialog_response_cb (GtkDialog * dialog,
gint response_id,
struct
MainPublishingDialogContext *ctx)
@@ -1212,8 +1261,6 @@
GtkSpinButton *sb;
struct GNUNET_FS_BlockOptions bo;
GtkWidget *ad;
- GtkTextIter iter;
- struct AddDirClientContext *adcc;
if (g_signal_handler_is_connected (G_OBJECT (dialog),
ctx->open_directory_handler_id))
g_signal_handler_disconnect (G_OBJECT (dialog),
ctx->open_directory_handler_id);
@@ -1248,47 +1295,8 @@
(ctx->open_directory_builder,
"GNUNET_GTK_publish_directory_dialog_do_index_checkbutton")));
- adcc = GNUNET_malloc (sizeof (struct AddDirClientContext));
- adcc->ctx = ctx;
- GNUNET_CONTAINER_DLL_insert_tail (ctx->adddir_head, ctx->adddir_tail,
adcc);
- adcc->ds = GNUNET_FS_directory_scan_start (filename,
- GNUNET_NO, NULL, directory_scan_cb, adcc);
- adcc->directory_scan_bo = bo;
- adcc->directory_scan_do_index = do_index;
-
- adcc->progress_dialog_builder = GNUNET_GTK_get_new_builder (
- "gnunet_fs_gtk_progress_dialog.glade", adcc);
- adcc->progress_dialog = GTK_WIDGET (gtk_builder_get_object (
- adcc->progress_dialog_builder,
- "GNUNET_FS_GTK_progress_dialog"));
- adcc->progress_dialog_bar = GTK_PROGRESS_BAR (gtk_builder_get_object (
- adcc->progress_dialog_builder,
- "GNUNET_FS_GTK_progress_dialog_progressbar"));
- adcc->progress_dialog_ok = GTK_BUTTON (gtk_builder_get_object (
- adcc->progress_dialog_builder,
- "GNUNET_FS_GTK_progress_dialog_ok_button"));
- adcc->progress_dialog_cancel = GTK_BUTTON (gtk_builder_get_object (
- adcc->progress_dialog_builder,
- "GNUNET_FS_GTK_progress_dialog_cancel_button"));
- adcc->progress_dialog_textview = GTK_TEXT_VIEW (
- gtk_builder_get_object (adcc->progress_dialog_builder,
- "GNUNET_FS_GTK_progress_dialog_textview"));
- adcc->progress_dialog_textbuffer = GTK_TEXT_BUFFER (
- gtk_builder_get_object (adcc->progress_dialog_builder,
- "GNUNET_FS_GTK_progress_dialog_textbuffer"));
- gtk_widget_set_sensitive (GTK_WIDGET (adcc->progress_dialog_ok), FALSE);
-
- gtk_text_buffer_get_end_iter (adcc->progress_dialog_textbuffer,
- &iter);
- adcc->progress_dialog_textmark = gtk_text_buffer_create_mark (
- adcc->progress_dialog_textbuffer, "scroll",
- &iter, FALSE);
-
- gtk_window_set_transient_for (GTK_WINDOW (adcc->progress_dialog),
adcc->ctx->master_pubdialog);
- gtk_window_present (GTK_WINDOW (adcc->progress_dialog));
-
+ scan_file_or_directory (ctx, filename, &bo, do_index);
g_free (filename);
- update_selectivity (ctx);
}
gtk_widget_destroy (ad);
g_object_unref (G_OBJECT (ctx->open_directory_builder));
@@ -1711,9 +1719,10 @@
"GNUNET_GTK_publish_file_dialog_do_index_checkbutton")));
filename = GNUNET_GTK_filechooser_get_filename_utf8 (GTK_FILE_CHOOSER
(ad));
- add_file_at_iter (ctx, filename, &bo, do_index, NULL);
+
+ scan_file_or_directory (ctx, filename, &bo, do_index);
+
g_free (filename);
- update_selectivity (ctx);
}
else
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r19155 - gnunet-gtk/src/fs,
gnunet <=