gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r14832 - in gnunet-gtk: . contrib src


From: gnunet
Subject: [GNUnet-SVN] r14832 - in gnunet-gtk: . contrib src
Date: Sun, 3 Apr 2011 16:12:15 +0200

Author: grothoff
Date: 2011-04-03 16:12:15 +0200 (Sun, 03 Apr 2011)
New Revision: 14832

Modified:
   gnunet-gtk/contrib/Makefile.in
   gnunet-gtk/gnunet_gtk_config.h.in
   gnunet-gtk/src/edit_publish_dialog.c
   gnunet-gtk/src/main_window_adv_pseudonym.c
   gnunet-gtk/src/main_window_file_publish.c
Log:
changing code to work with recent FS API change

Modified: gnunet-gtk/contrib/Makefile.in
===================================================================
--- gnunet-gtk/contrib/Makefile.in      2011-04-03 13:53:51 UTC (rev 14831)
+++ gnunet-gtk/contrib/Makefile.in      2011-04-03 14:12:15 UTC (rev 14832)
@@ -157,7 +157,6 @@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTLLIBS = @INTLLIBS@
-INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
 LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBICONV = @LIBICONV@

Modified: gnunet-gtk/gnunet_gtk_config.h.in
===================================================================
--- gnunet-gtk/gnunet_gtk_config.h.in   2011-04-03 13:53:51 UTC (rev 14831)
+++ gnunet-gtk/gnunet_gtk_config.h.in   2011-04-03 14:12:15 UTC (rev 14832)
@@ -15,14 +15,6 @@
 /* Define to 1 if you have the <argz.h> header file. */
 #undef HAVE_ARGZ_H
 
-/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the
-   CoreFoundation framework. */
-#undef HAVE_CFLOCALECOPYCURRENT
-
-/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in
-   the CoreFoundation framework. */
-#undef HAVE_CFPREFERENCESCOPYAPPVALUE
-
 /* Define if the GNU dcgettext() function is already present or preinstalled.
    */
 #undef HAVE_DCGETTEXT

Modified: gnunet-gtk/src/edit_publish_dialog.c
===================================================================
--- gnunet-gtk/src/edit_publish_dialog.c        2011-04-03 13:53:51 UTC (rev 
14831)
+++ gnunet-gtk/src/edit_publish_dialog.c        2011-04-03 14:12:15 UTC (rev 
14832)
@@ -383,10 +383,8 @@
  * @param length length of the file or directory
  * @param meta metadata for the file or directory (can be modified)
  * @param uri pointer to the keywords that will be used for this entry (can be 
modified)
- * @param anonymity pointer to selected anonymity level (can be modified)
- * @param priority pointer to selected priority (can be modified)
+ * @param bo block options
  * @param do_index should we index (can be modified)
- * @param expirationTime pointer to selected expiration time (can be modified)
  * @param client_info pointer to client context set upon creation (can be 
modified)
  * @return GNUNET_SYSERR (aborts after first call)
  */
@@ -396,10 +394,8 @@
                          uint64_t length,
                          struct GNUNET_CONTAINER_MetaData *meta,
                          struct GNUNET_FS_Uri **uri,
-                         uint32_t *anonymity,
-                         uint32_t *priority,
+                         struct GNUNET_FS_BlockOptions *bo,
                          int *do_index,
-                         struct GNUNET_TIME_Absolute *expirationTime,
                          void **client_info)
 {
   GtkImage *img;
@@ -424,7 +420,7 @@
                                     pixbuf);
        }
     }
-  tp = expirationTime->abs_value / 1000; /* ms to seconds */
+  tp = bo->expiration_time.abs_value / 1000; /* ms to seconds */
   t = gmtime (&tp);
   if (t == NULL)
     year = 0;
@@ -435,10 +431,10 @@
                             year);
   gtk_spin_button_set_value (GTK_SPIN_BUTTON (gtk_builder_get_object (builder,
                                                                      
"GNUNET_GTK_edit_file_information_anonymity_spin_button")),
-                            *anonymity);
+                            bo->anonymity_level);
   gtk_spin_button_set_value (GTK_SPIN_BUTTON (gtk_builder_get_object (builder,
                                                                      
"GNUNET_GTK_edit_file_information_priority_spin_button")),
-                            *priority);
+                            bo->content_priority);
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object 
(builder,
                                                                           
"GNUNET_GTK_edit_file_information_index_check_button")),
                                *do_index);
@@ -538,10 +534,8 @@
  * @param length length of the file or directory
  * @param meta metadata for the file or directory (can be modified)
  * @param uri pointer to the keywords that will be used for this entry (can be 
modified)
- * @param anonymity pointer to selected anonymity level (can be modified)
- * @param priority pointer to selected priority (can be modified)
+ * @param bo block options (can be modified)
  * @param do_index should we index (can be modified)
- * @param expirationTime pointer to selected expiration time (can be modified)
  * @param client_info pointer to client context set upon creation (can be 
modified)
  * @return GNUNET_SYSERR (aborts after first call)
  */
@@ -551,10 +545,8 @@
                         uint64_t length,
                         struct GNUNET_CONTAINER_MetaData *meta,
                         struct GNUNET_FS_Uri **uri,
-                        uint32_t *anonymity,
-                        uint32_t *priority,
+                        struct GNUNET_FS_BlockOptions *bo,
                         int *do_index,
-                        struct GNUNET_TIME_Absolute *expirationTime,
                         void **client_info)
 {
   char **short_fn = cls;
@@ -574,15 +566,15 @@
   GFile *f;
   GFileInfo *finfo;
   
-  *anonymity = gtk_spin_button_get_value (GTK_SPIN_BUTTON 
(gtk_builder_get_object (builder,
-                                                                               
   "GNUNET_GTK_edit_file_information_anonymity_spin_button")));
-  *priority = gtk_spin_button_get_value (GTK_SPIN_BUTTON 
(gtk_builder_get_object (builder,
-                                                                               
  "GNUNET_GTK_edit_file_information_priority_spin_button")));
+  bo->anonymity_level = gtk_spin_button_get_value (GTK_SPIN_BUTTON 
(gtk_builder_get_object (builder,
+                                                                               
            "GNUNET_GTK_edit_file_information_anonymity_spin_button")));
+  bo->content_priority = gtk_spin_button_get_value (GTK_SPIN_BUTTON 
(gtk_builder_get_object (builder,
+                                                                               
             "GNUNET_GTK_edit_file_information_priority_spin_button")));
   *do_index = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON 
(gtk_builder_get_object (builder,
                                                                                
       "GNUNET_GTK_edit_file_information_index_check_button")));
   sb =GTK_SPIN_BUTTON (gtk_builder_get_object (builder,
                                               
"GNUNET_GTK_edit_file_information_expiration_year_spin_button"));
-  *expirationTime = GNUNET_GTK_get_expiration_time (sb);
+  bo->expiration_time = GNUNET_GTK_get_expiration_time (sb);
   /* update URI */
   if (NULL != (*uri))
     GNUNET_FS_uri_destroy (*uri);

Modified: gnunet-gtk/src/main_window_adv_pseudonym.c
===================================================================
--- gnunet-gtk/src/main_window_adv_pseudonym.c  2011-04-03 13:53:51 UTC (rev 
14831)
+++ gnunet-gtk/src/main_window_adv_pseudonym.c  2011-04-03 14:12:15 UTC (rev 
14832)
@@ -400,13 +400,11 @@
   GtkTreeSelection *sel;
   GtkTreeModel *tm;
   GtkSpinButton *sb;
-  uint32_t anonymity_level;
-  uint32_t priority;
+  struct GNUNET_FS_BlockOptions bo;
   struct GNUNET_FS_Uri *nxt;
   struct GNUNET_FS_Uri *mrg;
   struct GNUNET_FS_Uri *uri;
   struct GNUNET_CONTAINER_MetaData *nm;
-  struct GNUNET_TIME_Absolute expiration;
   const char *root;
   char *value;
   guint ntype;  
@@ -560,24 +558,20 @@
        }
       while (TRUE == gtk_tree_model_iter_next (tm, &iter));
     }
-  anonymity_level = gtk_spin_button_get_value (GTK_SPIN_BUTTON 
(gtk_builder_get_object (builder,
-                                                                               
        "GNUNET_GTK_advertise_pseudonym_anonymity_spin_button")));
-  priority = gtk_spin_button_get_value (GTK_SPIN_BUTTON 
(gtk_builder_get_object (builder,
-                                                                               
 "GNUNET_GTK_advertise_pseudonym_priority_spin_button")));
+  bo.anonymity_level = gtk_spin_button_get_value (GTK_SPIN_BUTTON 
(gtk_builder_get_object (builder,
+                                                                               
           "GNUNET_GTK_advertise_pseudonym_anonymity_spin_button")));
+  bo.content_priority = gtk_spin_button_get_value (GTK_SPIN_BUTTON 
(gtk_builder_get_object (builder,
+                                                                               
            "GNUNET_GTK_advertise_pseudonym_priority_spin_button")));
   sb = GTK_SPIN_BUTTON (gtk_builder_get_object (builder,
                                               
"GNUNET_GTK_advertise_pseudonym_expiration_year_spin_button"));
-  expiration = GNUNET_GTK_get_expiration_time (sb);
-
-  expiration = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_YEARS);
+  bo.expiration_time = GNUNET_GTK_get_expiration_time (sb);
   root = gtk_entry_get_text (GTK_ENTRY (gtk_builder_get_object (builder,
                                                                
"GNUNET_GTK_advertise_pseudonym_root_entry")));
   GNUNET_FS_namespace_advertise (GNUNET_GTK_get_fs_handle (),
                                 uri,
                                 ns,
                                 nm,
-                                anonymity_level,
-                                priority,
-                                expiration,
+                                &bo,
                                 root,
                                 NULL, NULL);
   GNUNET_FS_namespace_delete (ns, GNUNET_NO);

Modified: gnunet-gtk/src/main_window_file_publish.c
===================================================================
--- gnunet-gtk/src/main_window_file_publish.c   2011-04-03 13:53:51 UTC (rev 
14831)
+++ gnunet-gtk/src/main_window_file_publish.c   2011-04-03 14:12:15 UTC (rev 
14832)
@@ -196,16 +196,13 @@
  * Add a file to the tree model.
  *
  * @param filename file to add
- * @param anonymity_level anonymity to use
- * @param expiration expiration time for the entry
+ * @param bo block options to use
  * @param do_index should we index or insert?
  * @param iter parent entry, or NULL for top-level addition
  */
 static void
 add_file_at_iter (const char *filename,
-                 uint32_t anonymity_level,
-                 uint32_t priority,
-                 struct GNUNET_TIME_Absolute expiration,
+                 const struct GNUNET_FS_BlockOptions *bo,
                  int do_index,
                  GtkTreeIter *iter)
 {
@@ -275,9 +272,7 @@
                                                    ksk_uri,
                                                    meta,
                                                    do_index,
-                                                   anonymity_level,
-                                                   priority,
-                                                   expiration);
+                                                   bo);
   GNUNET_CONTAINER_meta_data_destroy (meta);
   GNUNET_FS_uri_destroy (ksk_uri);
   if (S_ISDIR (sbuf.st_mode))
@@ -288,8 +283,8 @@
                      0, file_size_fancy,
                      1, (gboolean) do_index,
                      2, short_fn,
-                     3, (guint)anonymity_level,
-                     4, (guint) priority,
+                     3, (guint) bo->anonymity_level,
+                     4, (guint) bo->content_priority,
                      5, fi,
                      -1);
   GNUNET_free (file_size_fancy);
@@ -302,14 +297,13 @@
  * Add an empty directory to the tree model.
  *
  * @param name name for the directory
+ * @param bo block options
  * @param iter parent entry, or NULL for top-level addition
  * @param pos iterator to set to the location of the new element
  */
 static void
 create_dir_at_iter (const char *name,
-                   uint32_t anonymity,
-                   uint32_t priority,
-                   struct GNUNET_TIME_Absolute expiration,
+                   const struct GNUNET_FS_BlockOptions *bo,
                    GtkTreeIter *iter,
                    GtkTreeIter *pos)
 {
@@ -343,16 +337,14 @@
                                                          row_reference,
                                                          NULL,
                                                          meta,
-                                                         anonymity,
-                                                         priority,
-                                                         expiration);
+                                                         bo);
   GNUNET_CONTAINER_meta_data_destroy (meta);
   gtk_tree_store_set (ts, pos,
                      0, MARKER_DIR_FILE_SIZE,
                      1, (gboolean) GNUNET_NO,
                      2, name,
-                     3, (guint) anonymity,
-                     4, (guint) priority,
+                     3, (guint) bo->anonymity_level,
+                     4, (guint) bo->content_priority,
                      5, fi,
                      -1);
   update_selectivity ();
@@ -451,21 +443,11 @@
   struct GNUNET_CONTAINER_MetaData *no_ksk;
 
   /**
-   * Content expiration to use.
+   * Block options to use.
    */
-  struct GNUNET_TIME_Absolute expiration;
+  struct GNUNET_FS_BlockOptions bo;
 
   /**
-   * Anonymity level to use.
-   */
-  uint32_t anonymity_level;
-
-  /**
-   * Content priority to use.
-   */
-  uint32_t priority;
-
-  /**
    * Index or insert?
    */
   int do_index;
@@ -633,8 +615,7 @@
  * @param ts tree store to modify
  * @param iter position in the tree store for this file
  * @param filename file to add
- * @param anonymity_level anonymity to use
- * @param expiration expiration time for the entry
+ * @param bo block options
  * @param do_index should we index or insert?
  * @param md_no_ksk metadata with keywords NOT to add
  * @param meta metadata for the file
@@ -643,9 +624,7 @@
 add_entry_to_ts (GtkTreeStore *ts,
                 GtkTreeIter *iter,
                 const char *filename,
-                uint32_t anonymity_level,
-                uint32_t priority,
-                struct GNUNET_TIME_Absolute expiration,
+                const struct GNUNET_FS_BlockOptions *bo,
                 int do_index,
                 struct GNUNET_CONTAINER_MetaData *md_no_ksk,
                 struct GNUNET_CONTAINER_MetaData *meta)
@@ -705,9 +684,7 @@
                                                              row_reference,
                                                              ksk_uri,
                                                              meta,
-                                                             anonymity_level,
-                                                             priority,
-                                                             expiration);
+                                                             bo);
     }
   else
     {
@@ -717,9 +694,7 @@
                                                        ksk_uri,
                                                        meta,
                                                        do_index,
-                                                       anonymity_level,
-                                                       priority,
-                                                       expiration);
+                                                       bo);
     }
   GNUNET_CONTAINER_meta_data_destroy (meta);
   GNUNET_FS_uri_destroy (ksk_uri);
@@ -734,8 +709,8 @@
                      0, file_size_fancy,
                      1, (gboolean) do_index,
                      2, short_fn,
-                     3, (guint)anonymity_level,
-                     4, (guint) priority,
+                     3, (guint) bo->anonymity_level,
+                     4, (guint) bo->content_priority,
                      5, fi,
                      -1);
   GNUNET_free (file_size_fancy);
@@ -766,9 +741,7 @@
   add_entry_to_ts (adc->ts,
                   &pd->iter,
                   filename,
-                  adc->anonymity_level,
-                  adc->priority,
-                  adc->expiration,
+                  &adc->bo,
                   adc->do_index,
                   adc->no_ksk,
                   pd->meta);
@@ -921,9 +894,7 @@
          add_entry_to_ts (adc->ts,
                           &pd->iter,
                           filename,
-                          adc->anonymity_level,
-                          adc->priority,
-                          adc->expiration,
+                          &adc->bo,
                           adc->do_index,
                           NULL,
                           pd->meta);
@@ -942,13 +913,12 @@
  * Add a directory to the tree model.
  *
  * @param filename directory name to add
- * @param iter parent entry, or NULL for top-level addition
+ * @param bo block options
+ * @param do_index should we index?
  */
 static void
 add_dir (const char *filename,
-        uint32_t anonymity_level,
-        uint32_t priority,
-        struct GNUNET_TIME_Absolute expiration,
+        const struct GNUNET_FS_BlockOptions *bo,
         int do_index)
 {
   struct stat sbuf;
@@ -962,9 +932,7 @@
       return;
     }
   memset (&scan_ctx, 0, sizeof (scan_ctx));
-  scan_ctx.anonymity_level = anonymity_level;
-  scan_ctx.priority = priority;
-  scan_ctx.expiration = expiration;
+  scan_ctx.bo = *bo;
   scan_ctx.do_index = do_index;
   scan_ctx.ts = GTK_TREE_STORE (gtk_builder_get_object (master_builder,
                                                        
"GNUNET_GTK_file_sharing_publishing_tree_store"));
@@ -1344,6 +1312,7 @@
   GtkTreeSelection *sel;
   GtkTreeIter iter;
   GtkTreeIter pos;
+  struct GNUNET_FS_BlockOptions bo;
 
   tv = GTK_TREE_VIEW (gtk_builder_get_object (master_builder,
                                              
"GNUNET_GTK_master_publish_dialog_file_information_tree_view"));
@@ -1353,21 +1322,21 @@
    * to calling this function (currently we
    * use default values for those).
    */
+  bo.anonymity_level = 1;
+  bo.content_priority = 1000;
+  bo.expiration_time = GNUNET_TIME_relative_to_absolute 
(GNUNET_TIME_UNIT_YEARS);
+  bo.replication_level = 1;
   if (TRUE != gtk_tree_selection_get_selected (sel,
                                               NULL,
                                               &iter))
     {
       create_dir_at_iter ("unnamed/", 
-                         1 /* anonymity */,
-                         1000 /* priority */,
-                         GNUNET_TIME_relative_to_absolute 
(GNUNET_TIME_UNIT_YEARS) /* expiration */,
+                         &bo,                    
                          NULL, &pos);
       return;
     }
   create_dir_at_iter ("unnamed/",
-                     1 /* anonymity */,
-                     1000 /* priority */,
-                     GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_YEARS) 
/* expiration */,
+                     &bo,
                      &iter, &pos);
 }
 
@@ -1379,9 +1348,7 @@
   GtkWidget *ad;
   GtkBuilder *builder;
   char *filename;
-  uint32_t anonymity;
-  uint32_t priority;
-  struct GNUNET_TIME_Absolute exp;
+  struct GNUNET_FS_BlockOptions bo;
   int do_index;
   GtkSpinButton *sb;
 
@@ -1401,18 +1368,18 @@
       return;
     }
   filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(ad));
-  anonymity = gtk_spin_button_get_value (GTK_SPIN_BUTTON 
(gtk_builder_get_object (builder,
-                                                                               
   "GNUNET_GTK_publish_file_dialog_anonymity_spin_button")));
-  priority = gtk_spin_button_get_value (GTK_SPIN_BUTTON 
(gtk_builder_get_object (builder,
-                                                                               
  "GNUNET_GTK_publish_file_dialog_priority_spin_button")));
-  do_index = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON 
(gtk_builder_get_object (builder,
-                                                                               
      "GNUNET_GTK_publish_file_dialog_do_index_checkbutton")));
   sb = GTK_SPIN_BUTTON (gtk_builder_get_object (builder,
                                                
"GNUNET_GTK_publish_file_dialog_expiration_year_spin_button"));
-  exp = GNUNET_GTK_get_expiration_time (sb);
-  add_file_at_iter (filename, anonymity,
-                   priority, 
-                   exp, do_index, 
+  bo.anonymity_level = gtk_spin_button_get_value (GTK_SPIN_BUTTON 
(gtk_builder_get_object (builder,
+                                                                               
           "GNUNET_GTK_publish_file_dialog_anonymity_spin_button")));
+  bo.content_priority = gtk_spin_button_get_value (GTK_SPIN_BUTTON 
(gtk_builder_get_object (builder,
+                                                                               
            "GNUNET_GTK_publish_file_dialog_priority_spin_button")));
+  bo.expiration_time = GNUNET_GTK_get_expiration_time (sb);
+  bo.replication_level = 1; /* FIXME... */
+  do_index = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON 
(gtk_builder_get_object (builder,
+                                                                               
      "GNUNET_GTK_publish_file_dialog_do_index_checkbutton")));
+  add_file_at_iter (filename,
+                   &bo, do_index, 
                    NULL);
   gtk_widget_destroy (ad);
   g_object_unref (G_OBJECT (builder));
@@ -1479,10 +1446,8 @@
                       uint64_t length,
                       struct GNUNET_CONTAINER_MetaData *meta,
                       struct GNUNET_FS_Uri **uri,
-                      uint32_t *anonymity,
-                      uint32_t *priority,
+                      struct GNUNET_FS_BlockOptions *bo,
                       int *do_index,
-                      struct GNUNET_TIME_Absolute *expirationTime,
                       void **client_info)
 {
   GtkTreeRowReference *row = *client_info;
@@ -1538,11 +1503,9 @@
   GtkWidget *ad;
   GtkBuilder *builder;
   char *filename;
-  uint32_t anonymity;
-  uint32_t priority;
-  struct GNUNET_TIME_Absolute exp;
   int do_index;
   GtkSpinButton *sb;
+  struct GNUNET_FS_BlockOptions bo;
 
   builder = GNUNET_GTK_get_new_builder ("publish-directory-dialog.glade");
   if (builder == NULL)
@@ -1560,22 +1523,20 @@
       return;
     }
   filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(ad));
-  anonymity = gtk_spin_button_get_value (GTK_SPIN_BUTTON 
(gtk_builder_get_object (builder,
-                                                                               
   "GNUNET_GTK_publish_directory_dialog_anonymity_spin_button")));
-  priority = gtk_spin_button_get_value (GTK_SPIN_BUTTON 
(gtk_builder_get_object (builder,
-                                                                               
  "GNUNET_GTK_publish_directory_dialog_priority_spin_button")));
+  sb = GTK_SPIN_BUTTON (gtk_builder_get_object (builder,
+                                               
"GNUNET_GTK_publish_directory_dialog_expiration_year_spin_button"));
+  bo.anonymity_level = gtk_spin_button_get_value (GTK_SPIN_BUTTON 
(gtk_builder_get_object (builder,
+                                                                               
           "GNUNET_GTK_publish_directory_dialog_anonymity_spin_button")));
+  bo.content_priority = gtk_spin_button_get_value (GTK_SPIN_BUTTON 
(gtk_builder_get_object (builder,
+                                                                               
            "GNUNET_GTK_publish_directory_dialog_priority_spin_button")));
+  bo.expiration_time = GNUNET_GTK_get_expiration_time (sb);
   do_index = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON 
(gtk_builder_get_object (builder,
                                                                                
      "GNUNET_GTK_publish_directory_dialog_do_index_checkbutton")));
-  sb = GTK_SPIN_BUTTON (gtk_builder_get_object (builder,
-                                          
"GNUNET_GTK_publish_directory_dialog_expiration_year_spin_button"));
-
-  exp = GNUNET_GTK_get_expiration_time (sb);
+  
   gtk_widget_destroy (ad);
   g_object_unref (G_OBJECT (builder));
   /* FIXME: open progress dialog here... */
-  add_dir (filename, anonymity, priority, 
-          exp,
-          do_index);
+  add_dir (filename, &bo, do_index);
   g_free (filename);
   update_selectivity ();
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]