gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r22412 - gnunet-gtk/src/setup


From: gnunet
Subject: [GNUnet-SVN] r22412 - gnunet-gtk/src/setup
Date: Sun, 1 Jul 2012 17:34:25 +0200

Author: grothoff
Date: 2012-07-01 17:34:25 +0200 (Sun, 01 Jul 2012)
New Revision: 22412

Modified:
   gnunet-gtk/src/setup/gnunet-setup-gns.c
Log:
-fix scaling

Modified: gnunet-gtk/src/setup/gnunet-setup-gns.c
===================================================================
--- gnunet-gtk/src/setup/gnunet-setup-gns.c     2012-06-30 17:11:28 UTC (rev 
22411)
+++ gnunet-gtk/src/setup/gnunet-setup-gns.c     2012-07-01 15:34:25 UTC (rev 
22412)
@@ -226,11 +226,11 @@
 /**
  * Create the QR code image for our zone.
  *
- * @param size height and width of the image to create
+ * @param scale factor for scaling up the size of the image to create
  * @return NULL on error
  */
 static GdkPixbuf *
-create_qrcode (unsigned int size)
+create_qrcode (unsigned int scale)
 {
   QRinput * qri;
   QRcode *qrc;
@@ -246,6 +246,7 @@
   int c;
   const char *dir;
   char *fn;
+  unsigned int size;
 
   qri = QRinput_new2 (0, QR_ECLEVEL_Q);
   if (NULL == qri)
@@ -284,6 +285,8 @@
                   "%s%s",
                   dir,
                   "qr_dummy.png");
+  size = qrc->width * scale;
+  size += 8 - (size % 8);
   pb = gdk_pixbuf_new_from_file_at_size (fn,
                                         size, size,
                                         NULL);
@@ -318,7 +321,7 @@
   GdkPixbuf *pb;
   GtkImage *image;
 
-  pb = create_qrcode (QRCODE_IMAGE_SIZE);
+  pb = create_qrcode (2);
   if (NULL == pb)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_WARNING, _("Failed to initialize QR-code 
pixbuf"));
@@ -411,6 +414,9 @@
   {
   case GNUNET_OK:
   case GNUNET_NO:  
+    /* FIXME: should check continuation's return values;
+       also, need to keep 'struct GNUNET_NAMESTORE_QueueEntry'
+       around to cancel before disconnect upon termination... */
     for (c = 0; c < uc->rd_count; c++)          
       GNUNET_NAMESTORE_record_create (namestore, pkey,
                                      uc->name, &uc->rd[c], 
@@ -589,6 +595,7 @@
   uc->rd = rd;
   uc->rd_count = records;
   uc->name = name;
+  // FIXME: need to keep 'struct GNUNET_NAMESTORE_QueueEntry' around...
   GNUNET_NAMESTORE_record_remove (namestore, 
                                  pkey,
                                  (NULL != oldname) ? oldname : name, 
@@ -728,6 +735,7 @@
 
       rcc = GNUNET_malloc(sizeof (struct RemoveContext));
       rcc->path = strdup (path);
+      // FIXME: need to keep 'struct GNUNET_NAMESTORE_QueueEntry' around...
       GNUNET_NAMESTORE_record_remove (namestore, pkey, name, &rd, 
&update_treemodel_after_remove, rcc);
       GNUNET_free ((void *) rd.data);
     }
@@ -747,6 +755,7 @@
     /* Removing the whole name record */
     rcc = GNUNET_malloc(sizeof (struct RemoveContext));
     rcc->path = strdup (path);
+    // FIXME: need to keep 'struct GNUNET_NAMESTORE_QueueEntry' around...
     GNUNET_NAMESTORE_record_remove (namestore, pkey, name, NULL, 
&update_treemodel_after_remove, rcc);
   }
   g_free (name);
@@ -1458,7 +1467,7 @@
   }
   filename =
     GNUNET_GTK_filechooser_get_filename_utf8 (GTK_FILE_CHOOSER (dialog));
-  pb = create_qrcode (512);
+  pb = create_qrcode (8);
   if (NULL == pb)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_WARNING, _("Failed to initialize QR-code 
pixbuf"));
@@ -1643,7 +1652,7 @@
     GNUNET_free (val);
   }
 
-  GNUNET_NAMESTORE_zone_iterator_next(zc_ctx->it);
+  GNUNET_NAMESTORE_zone_iterator_next (zc_ctx->it);
 }
 
 
@@ -1699,6 +1708,7 @@
     rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY;
     rd.data_size = strlen (pseu) + 1;
     rd.data = strdup (pseu);
+    // FIXME: need to keep 'struct GNUNET_NAMESTORE_QueueEntry' around (to 
cancel on disconnect...)
     GNUNET_NAMESTORE_record_create (namestore, pkey, "+", &rd, 
&pseu_change_cont, NULL);
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "New Pseudonym is `%s' %u\n", (char 
*) rd.data, rd.data_size);
   }
@@ -1825,7 +1835,8 @@
                                      GNS_TREESTORE_COL_IS_RECORD_ROW, FALSE,
                                      GNS_TREESTORE_COL_NOT_DUMMY_ROW, FALSE,
                                      -1);
-
+  
+  // FIXME: need to keep this handle for 'GNUNET_SETUP_gns_done' around!
   zc_ctx = GNUNET_malloc (sizeof (struct ZoneIteration_Context));
   zc_ctx->zone = zone;
   zc_ctx->it = GNUNET_NAMESTORE_zone_iteration_start (namestore, &zone,
@@ -1846,6 +1857,8 @@
   gtk_widget_show (GTK_WIDGET (GNUNET_SETUP_get_object 
("GNUNET_setup_gns_status_label")));
   gtk_widget_hide (GTK_WIDGET (GNUNET_SETUP_get_object 
("GNUNET_setup_gns_main_scrolledwindow")));
   gtk_tree_store_clear (ts);
+  // FIXME: need to abort any pending zone iteration!
+  // FIXME: need to cancel pending record operations!
   if (NULL != namestore)
   {
     GNUNET_NAMESTORE_disconnect (namestore);




reply via email to

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