gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r13503 - in gnunet-setup: . contrib src


From: gnunet
Subject: [GNUnet-SVN] r13503 - in gnunet-setup: . contrib src
Date: Tue, 2 Nov 2010 22:21:52 +0100

Author: grothoff
Date: 2010-11-02 22:21:52 +0100 (Tue, 02 Nov 2010)
New Revision: 13503

Modified:
   gnunet-setup/TODO
   gnunet-setup/contrib/gnunet-setup.glade
   gnunet-setup/src/gnunet-setup-options.c
   gnunet-setup/src/gnunet-setup-options.h
   gnunet-setup/src/gnunet-setup.c
Log:
more work on gnunet-setup

Modified: gnunet-setup/TODO
===================================================================
--- gnunet-setup/TODO   2010-11-02 21:12:13 UTC (rev 13502)
+++ gnunet-setup/TODO   2010-11-02 21:21:52 UTC (rev 13503)
@@ -1,14 +1,3 @@
-* draft UI <-> config linkage specification struct:
-  - help text, help URI
-  - config options
-  - UI element name
-  - UI element type
-  - show/hide associations
-* implement:
-  - help / URI update
-  - config load
-  - config change
-  - show / hide 
 * More glade work:
   - VPN configuration
   - clone datastore setup tab for datacache setup 
@@ -21,3 +10,5 @@
   - sanity checks: 
     + datastore, datacache config valid? 
     + port conflicts
+  - autoconfiguration
+    + NAT

Modified: gnunet-setup/contrib/gnunet-setup.glade
===================================================================
--- gnunet-setup/contrib/gnunet-setup.glade     2010-11-02 21:12:13 UTC (rev 
13502)
+++ gnunet-setup/contrib/gnunet-setup.glade     2010-11-02 21:21:52 UTC (rev 
13503)
@@ -2,68 +2,76 @@
 <interface>
   <requires lib="gtk+" version="2.20"/>
   <!-- interface-naming-policy project-wide -->
-  <object class="GtkAdjustment" 
id="GNUNET_setup_fs_datastore_quota_adjustment">
-    <property name="lower">1000000</property>
-    <property name="upper">999999999999</property>
-    <property name="value">100000000</property>
-    <property name="step_increment">1000000</property>
-    <property name="page_increment">1000000000</property>
+  <object class="GtkAdjustment" 
id="GNUNET_setup_fs_datastore_mysql_port_adjustment">
+    <property name="lower">1</property>
+    <property name="upper">65535</property>
+    <property name="value">3306</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
   </object>
-  <object class="GtkAdjustment" id="adjustment8">
-    <property name="upper">100</property>
+  <object class="GtkAdjustment" 
id="GNUNET_setup_fs_datacache_quota_adjustment">
+    <property name="lower">65536</property>
+    <property name="upper">9999999999</property>
+    <property name="value">1024000</property>
+    <property name="step_increment">65536</property>
+    <property name="page_increment">1024000</property>
+  </object>
+  <object class="GtkAdjustment" id="GNUNET_setup_bandwidth_out_adjustment">
+    <property name="lower">1024</property>
+    <property name="upper">999999999</property>
+    <property name="value">65536</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
-    <property name="page_size">10</property>
   </object>
-  <object class="GtkAdjustment" id="adjustment7">
+  <object class="GtkAdjustment" id="GNUNET_setup_bandwidth_in_adjustment">
+    <property name="lower">5000</property>
+    <property name="upper">999999999</property>
+    <property name="value">65536</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
+  <object class="GtkAdjustment" id="adjustment6">
     <property name="upper">100</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
     <property name="page_size">10</property>
   </object>
-  <object class="GtkListStore" id="GNUNET_setup_hostlist_url_liststore">
-    <columns>
-      <!-- column-name url -->
-      <column type="gchararray"/>
-    </columns>
-  </object>
-  <object class="GtkAdjustment" 
id="GNUNET_setup_hostlist_server_port_adjustment">
-    <property name="lower">1</property>
-    <property name="upper">65535</property>
-    <property name="value">8080</property>
+  <object class="GtkAdjustment" id="adjustment5">
+    <property name="upper">100</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
+    <property name="page_size">10</property>
   </object>
-  <object class="GtkAdjustment" 
id="GNUNET_setup_transport_http_port_adjustment">
-    <property name="lower">1</property>
-    <property name="upper">65535</property>
-    <property name="value">1080</property>
+  <object class="GtkAdjustment" id="adjustment4">
+    <property name="upper">100</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
+    <property name="page_size">10</property>
   </object>
-  <object class="GtkAdjustment" 
id="GNUNET_setup_transport_udp_port_adjustment">
-    <property name="lower">1</property>
-    <property name="upper">65535</property>
-    <property name="value">2086</property>
+  <object class="GtkAdjustment" id="adjustment3">
+    <property name="upper">100</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
+    <property name="page_size">10</property>
   </object>
-  <object class="GtkAdjustment" 
id="GNUNET_setup_transport_tcp_port_adjustment">
-    <property name="lower">1</property>
-    <property name="upper">65535</property>
-    <property name="value">2086</property>
+  <object class="GtkAdjustment" id="adjustment2">
+    <property name="upper">100</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
+    <property name="page_size">10</property>
   </object>
-  <object class="GtkAdjustment" id="GNUNET_setup_min_friends_adjustment">
-    <property name="upper">9999</property>
+  <object class="GtkAdjustment" id="adjustment1">
+    <property name="upper">100</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
+    <property name="page_size">10</property>
   </object>
   <object class="GtkDialog" id="GNUNET_setup_dialog">
     <property name="border_width">5</property>
     <property name="title" translatable="yes">gnunet-setup</property>
     <property name="window_position">center</property>
+    <property name="default_width">800</property>
+    <property name="default_height">550</property>
     <property name="icon_name">preferences-system</property>
     <property name="type_hint">dialog</property>
     <property name="has_separator">False</property>
@@ -1566,68 +1574,62 @@
       <action-widget response="-3">GNUNET_setup_save_button</action-widget>
     </action-widgets>
   </object>
-  <object class="GtkAdjustment" id="adjustment1">
-    <property name="upper">100</property>
+  <object class="GtkAdjustment" id="GNUNET_setup_min_friends_adjustment">
+    <property name="upper">9999</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
-    <property name="page_size">10</property>
   </object>
-  <object class="GtkAdjustment" id="adjustment2">
-    <property name="upper">100</property>
+  <object class="GtkAdjustment" 
id="GNUNET_setup_transport_tcp_port_adjustment">
+    <property name="lower">1</property>
+    <property name="upper">65535</property>
+    <property name="value">2086</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
-    <property name="page_size">10</property>
   </object>
-  <object class="GtkAdjustment" id="adjustment3">
-    <property name="upper">100</property>
+  <object class="GtkAdjustment" 
id="GNUNET_setup_transport_udp_port_adjustment">
+    <property name="lower">1</property>
+    <property name="upper">65535</property>
+    <property name="value">2086</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
-    <property name="page_size">10</property>
   </object>
-  <object class="GtkAdjustment" id="adjustment4">
-    <property name="upper">100</property>
+  <object class="GtkAdjustment" 
id="GNUNET_setup_transport_http_port_adjustment">
+    <property name="lower">1</property>
+    <property name="upper">65535</property>
+    <property name="value">1080</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
-    <property name="page_size">10</property>
   </object>
-  <object class="GtkAdjustment" id="adjustment5">
-    <property name="upper">100</property>
+  <object class="GtkAdjustment" 
id="GNUNET_setup_hostlist_server_port_adjustment">
+    <property name="lower">1</property>
+    <property name="upper">65535</property>
+    <property name="value">8080</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
-    <property name="page_size">10</property>
   </object>
-  <object class="GtkAdjustment" id="adjustment6">
+  <object class="GtkListStore" id="GNUNET_setup_hostlist_url_liststore">
+    <columns>
+      <!-- column-name url -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
+  <object class="GtkAdjustment" id="adjustment7">
     <property name="upper">100</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
     <property name="page_size">10</property>
   </object>
-  <object class="GtkAdjustment" id="GNUNET_setup_bandwidth_in_adjustment">
-    <property name="lower">5000</property>
-    <property name="upper">999999999</property>
-    <property name="value">65536</property>
+  <object class="GtkAdjustment" id="adjustment8">
+    <property name="upper">100</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
+    <property name="page_size">10</property>
   </object>
-  <object class="GtkAdjustment" id="GNUNET_setup_bandwidth_out_adjustment">
-    <property name="lower">1024</property>
-    <property name="upper">999999999</property>
-    <property name="value">65536</property>
-    <property name="step_increment">1</property>
-    <property name="page_increment">10</property>
+  <object class="GtkAdjustment" 
id="GNUNET_setup_fs_datastore_quota_adjustment">
+    <property name="lower">1000000</property>
+    <property name="upper">999999999999</property>
+    <property name="value">100000000</property>
+    <property name="step_increment">1000000</property>
+    <property name="page_increment">1000000000</property>
   </object>
-  <object class="GtkAdjustment" 
id="GNUNET_setup_fs_datacache_quota_adjustment">
-    <property name="lower">65536</property>
-    <property name="upper">9999999999</property>
-    <property name="value">1024000</property>
-    <property name="step_increment">65536</property>
-    <property name="page_increment">1024000</property>
-  </object>
-  <object class="GtkAdjustment" 
id="GNUNET_setup_fs_datastore_mysql_port_adjustment">
-    <property name="lower">1</property>
-    <property name="upper">65535</property>
-    <property name="value">3306</property>
-    <property name="step_increment">1</property>
-    <property name="page_increment">10</property>
-  </object>
 </interface>

Modified: gnunet-setup/src/gnunet-setup-options.c
===================================================================
--- gnunet-setup/src/gnunet-setup-options.c     2010-11-02 21:12:13 UTC (rev 
13502)
+++ gnunet-setup/src/gnunet-setup-options.c     2010-11-02 21:21:52 UTC (rev 
13503)
@@ -26,8 +26,31 @@
 #include "gnunet-setup-options.h"
 #include <gnunet/gnunet_util_lib.h>
 
+/**
+ * Regular expression for YES
+ */
+#define REX_YES "^YES$"
+
+/**
+ * Regular expression for NO
+ */
+#define REX_NO "^NO$"
+
+
+/**
+ * Initialize a toggle button based on an options 'yes/no' value.
+ *
+ * @param cls closure
+ * @param section section with the value
+ * @param option option name
+ * @param value value as a string
+ * @param widget widget to initialize
+ * @param cfg configuration handle
+ * @return GNUNET_OK on success, GNUNET_SYSERR if there was a problem
+ */
 static int
-load_yes_no (const char *section,
+load_yes_no (const void *cls,
+            const char *section,
             const char *option,
             const char *value,
             GtkWidget *widget,
@@ -38,14 +61,25 @@
   button = GTK_TOGGLE_BUTTON (widget);
   if (button == NULL)
     return GNUNET_SYSERR;
-  gtk_toggle_button_set_mode (button,
-                             strcasecmp (value, "YES") ? TRUE : FALSE);
+  gtk_toggle_button_set_active (button,
+                               (0 == strcasecmp (value, "YES")) ? TRUE : 
FALSE);
   return GNUNET_OK;
 }
 
 
+/**
+ * Set a yes/no option based on a toggle button.
+ *
+ * @param cls closure
+ * @param section section with the value
+ * @param option option name
+ * @param widget widget to initialize
+ * @param cfg configuration handle to update
+ * @return GNUNET_OK on success, GNUNET_SYSERR if there was a problem
+ */
 static int
-save_yes_no (const char *section,
+save_yes_no (const void *cls,
+            const char *section,
             const char *option,
             GtkWidget *widget,
             struct GNUNET_CONFIGURATION_Handle *cfg)
@@ -56,26 +90,124 @@
   button = GTK_TOGGLE_BUTTON (widget);
   if (button == NULL)
     return GNUNET_SYSERR;
-  mode = gtk_toggle_button_get_mode (button);
+  mode = gtk_toggle_button_get_active (button);
   GNUNET_CONFIGURATION_set_value_string (cfg, 
                                         section, option,
-                                        mode ? "YES" : "NO");
+                                        mode == TRUE ? "YES" : "NO");
   return GNUNET_OK;
 }
 
 
 /**
+ * Initialize a toggle button based on the existence of a word
+ * in an option value.
+ *
+ * @param cls word to test for (conat char *)
+ * @param section section with the value
+ * @param option option name
+ * @param value value as a string
+ * @param widget widget to initialize
+ * @param cfg configuration handle
+ * @return GNUNET_OK on success, GNUNET_SYSERR if there was a problem
+ */
+static int
+load_option_list (const void *cls,
+                 const char *section,
+                 const char *option,
+                 const char *value,
+                 GtkWidget *widget,
+                 const struct GNUNET_CONFIGURATION_Handle *cfg)
+{
+  const char *word = cls;
+  char *t;
+  char *w;
+  GtkToggleButton *button;
+  int found;
+
+  button = GTK_TOGGLE_BUTTON (widget);
+  if (button == NULL)
+    return GNUNET_SYSERR;
+  found = GNUNET_NO;
+  t = GNUNET_strdup (value);
+  w = strtok (t, " ");
+  while (w != NULL)
+    {
+      if (0 == strcmp (w, word))
+       {
+         found = GNUNET_YES;
+         break;
+       }
+      w = strtok (NULL, " ");
+    }
+  GNUNET_free (t);
+  gtk_toggle_button_set_active (button,
+                               found);
+  return GNUNET_OK;
+}
+
+
+/**
+ * Add or remove a word from a sentence based on a toggle button's yes/no 
value.
+ *
+ * @param cls  word to add or remove for (conat char *)
+ * @param section section with the value
+ * @param option option name
+ * @param widget widget to initialize
+ * @param cfg configuration handle to update
+ * @return GNUNET_OK on success, GNUNET_SYSERR if there was a problem
+ */
+static int
+save_option_list (const void *cls,
+                 const char *section,
+                 const char *option,
+                 GtkWidget *widget,
+                 struct GNUNET_CONFIGURATION_Handle *cfg)
+{
+  const char *word = cls;
+  GtkToggleButton *button;
+  gboolean mode;
+
+  button = GTK_TOGGLE_BUTTON (widget);
+  if (button == NULL)
+    return GNUNET_SYSERR;
+  mode = gtk_toggle_button_get_active (button);
+  if (mode == TRUE)
+    GNUNET_CONFIGURATION_append_value_filename (cfg,
+                                               section,
+                                               option,
+                                               word);
+  else
+    GNUNET_CONFIGURATION_remove_value_filename (cfg,
+                                               section,
+                                               option,
+                                               word);
+  return GNUNET_OK;
+}
+
+
+/**
  * Hide "min connected friends" option if in F2F-only mode.
  */
 static struct GNUNET_SETUP_VisibilitySpecification 
hide_min_connected_friends[] =
 {
-  { "GNUNET_setup_minimum_friends_label", "YES", NULL },
-  { "GNUNET_setup_minimum_friends_spinbutton", "YES", NULL },
+  { "GNUNET_setup_minimum_friends_label", NULL, REX_YES },
+  { "GNUNET_setup_minimum_friends_spinbutton", NULL, REX_YES },
   { NULL, NULL, NULL }
 };
 
 
+
 /**
+ * Hide "fs tab" if FS not active.
+ */
+static struct GNUNET_SETUP_VisibilitySpecification hide_fs_tab[] =
+{
+  { "GNUNET_setup_fs_scrolledwindow", "(^| )fs($| )", NULL },
+  { NULL, NULL, NULL }
+};
+
+
+/**
  * Option specification data.
  */
 const struct GNUNET_SETUP_OptionSpecification option_specifications[] =
@@ -87,13 +219,48 @@
       "FRIENDS-ONLY",
       gettext_noop ("Should GNUnet exclusively connect to peers in the 
`friends file'"),
       "https://gnunet.org/configuration-f2f";,
-      NULL, NULL,
       &load_yes_no,
-      &save_yes_no,
+      &save_yes_no, NULL,
       hide_min_connected_friends
     },    
+
+    {
+      "GNUNET_setup_general_services_fs_checkbutton",
+      "toggled",
+      "arm",
+      "DEFAULTSERVICES",
+      gettext_noop ("Should file-sharing be started automatically when GNUnet 
starts?"),
+      "https://gnunet.org/configuration-fs";,
+      &load_option_list,
+      &save_option_list, "fs",
+      hide_fs_tab
+    },
+
+    {
+      "GNUNET_setup_general_services_vpn_checkbutton",
+      "toggled",
+      "arm",
+      "DEFAULTSERVICES",
+      gettext_noop ("Should the VPN be started automatically when GNUnet 
starts?"),
+      "https://gnunet.org/configuration-vpn";,
+      &load_option_list,
+      &save_option_list, "vpn",
+      NULL /* hide_vpn_tab */
+    },
+
+    {
+      "GNUNET_setup_hostlist_client_enable_checkbutton",
+      "toggled",
+      "hostlist",
+      "OPTIONS",
+      gettext_noop ("Should GNUnet learn about other peers using hostlists"),
+      "https://gnunet.org/configuration-hostlist";,
+      &load_option_list,
+      &save_option_list, "-b",
+      NULL
+    },
     { NULL, NULL, NULL, NULL, NULL,
-      NULL, NULL, NULL, NULL, NULL, NULL }
+      NULL, NULL, NULL, NULL }
   };
 
 /* end of gnunet-setup-options.c */

Modified: gnunet-setup/src/gnunet-setup-options.h
===================================================================
--- gnunet-setup/src/gnunet-setup-options.h     2010-11-02 21:12:13 UTC (rev 
13502)
+++ gnunet-setup/src/gnunet-setup-options.h     2010-11-02 21:21:52 UTC (rev 
13503)
@@ -38,28 +38,19 @@
 #include <gtk/gtk.h>
 
 
-/* FIXME: how to do store of options like
-   "tcp udp http" from multiple checkboxes? 
-   
-   FIXME: is this fine for initializing the GtkTreeStore with the URLs?
-
-   FIXME: how should we handle things like context menus to manipulate
-   URL lists? 
-*/
-
 /**
- * Function to be called to validate option values.
+ * Function to setup the value on load.
+ *
+ * @param cls closure
+ * @param section section with the value
+ * @param option option name
+ * @param value value as a string
+ * @param widget widget to initialize
+ * @param cfg configuration handle
+ * @return GNUNET_OK on success, GNUNET_SYSERR if there was a problem
  */
-typedef int (*GNUNET_SETUP_Validation)(const void *cls,
-                                      const char *section,
-                                      const char *option,
-                                      GtkWidget *widget,
-                                      const struct GNUNET_CONFIGURATION_Handle 
*cfg);
-
-/**
- * 
- */
-typedef int (*GNUNET_SETUP_LoadFunction)(const char *section,
+typedef int (*GNUNET_SETUP_LoadFunction)(const void *cls,
+                                        const char *section,
                                         const char *option,
                                         const char *value,
                                         GtkWidget *widget,
@@ -67,9 +58,18 @@
 
 
 /**
+ * Modify the configuration to contain the right value for
+ * the option based on the state of the widget.
  * 
+ * @param cls closure
+ * @param section section with the value
+ * @param option option name
+ * @param widget widget to initialize
+ * @param cfg configuration handle to update
+ * @return GNUNET_OK on success, GNUNET_SYSERR if there was a problem
  */
-typedef int (*GNUNET_SETUP_SaveFunction)(const char *section,
+typedef int (*GNUNET_SETUP_SaveFunction)(const void *cls,
+                                        const char *section,
                                         const char *option,
                                         GtkWidget *widget,
                                         struct GNUNET_CONFIGURATION_Handle 
*cfg);
@@ -88,13 +88,13 @@
   const char *widget_name;
 
   /**
-   * If the option is set to this value, the widget should be
+   * If the option value matchis this regex, the widget should be
    * shown.  If NULL, the "hide_value" controls visibility.
    */
   const char *show_value;
 
   /**
-   * If the option is set to this value, the widget should be
+   * If the option value matchis this regex, the widget should be
    * hidden.  If NULL, the "show_value" controls visibility.
    */  
   const char *hide_value;
@@ -139,16 +139,6 @@
   const char *help_url;
 
   /**
-   * Function to call to validate the entry (can be NULL).
-   */
-  GNUNET_SETUP_Validation validation_function;
-
-  /**
-   * Closure for 'validation_function'.
-   */
-  const void *validation_function_cls;
-
-  /**
    * Function to call to initialize the widget from the configuration.
    */
   GNUNET_SETUP_LoadFunction load_function;
@@ -159,6 +149,11 @@
   GNUNET_SETUP_SaveFunction save_function;
 
   /**
+   * Closure for 'validation_function'.
+   */
+  const void *load_save_cls;
+
+  /**
    * Visibility changes to apply if this option changes (NULL, or
    * NULL-terminated).
    */

Modified: gnunet-setup/src/gnunet-setup.c
===================================================================
--- gnunet-setup/src/gnunet-setup.c     2010-11-02 21:12:13 UTC (rev 13502)
+++ gnunet-setup/src/gnunet-setup.c     2010-11-02 21:21:52 UTC (rev 13503)
@@ -27,6 +27,7 @@
 #include <locale.h>
 #endif
 #include "gnunet-setup-options.h"
+#include <regex.h>
 
 /**
  * Builder for the main window.
@@ -145,12 +146,9 @@
 }
 
 
-static void
-widget_selected_callback (GtkWidget *widget,
-                         GtkSelectionData *data,
-                         guint info,
-                         guint time,
-                         gpointer user_data)
+static gboolean
+widget_focused_callback (GtkWidget *widget,
+                        gpointer user_data)
 {
   const struct GNUNET_SETUP_OptionSpecification *os = user_data;
   GtkLinkButton *help;
@@ -161,6 +159,7 @@
                           os->help_url);
   gtk_button_set_label (GTK_BUTTON (help),
                        os->help_text);  
+  return FALSE;
 }
 
 
@@ -178,6 +177,7 @@
   unsigned int i;
   const struct GNUNET_SETUP_VisibilitySpecification *vs;
   GtkWidget *widget;
+  regex_t r;
 
   if (os->visibility == NULL)
     return;
@@ -192,22 +192,40 @@
          GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
                      _("Widget `%s' not found\n"),
                      vs->widget_name);
-       }
+       }      
       if (NULL != vs->show_value)
        {
-         if (0 == strcasecmp (value,
-                              vs->show_value))
+         if (0 != regcomp (&r, vs->show_value, REG_EXTENDED | REG_ICASE | 
REG_NOSUB))
+           {
+             GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+                         _("Invalid regular expression `%s'\n"),
+                         vs->show_value);
+             i++;
+             continue;
+           }
+         if (0 == regexec (&r, value, 0, NULL, 0))
            gtk_widget_show (widget);
          else
-           gtk_widget_hide (widget);
+           {
+             gtk_widget_hide (widget);
+           }
+         regfree (&r);
        }
       if (NULL != vs->hide_value)
        {
-         if (0 == strcasecmp (value,
-                              vs->hide_value))
+         if (0 != regcomp (&r, vs->hide_value, REG_ICASE | REG_NOSUB))
+           {
+             GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+                         _("Invalid regular expression `%s'\n"),
+                         vs->show_value);
+             i++;
+             continue;
+           }
+         if (0 == regexec (&r, value, 0, NULL, 0))
+           gtk_widget_show (widget);
+         else
            gtk_widget_hide (widget);
-         else
-           gtk_widget_show (widget);
+         regfree (&r);
        }
       i++;
     }
@@ -226,7 +244,8 @@
   widget = GTK_WIDGET (gtk_builder_get_object (builder,
                                               os->widget_name));
   if (GNUNET_OK !=
-      os->save_function (os->section,
+      os->save_function (os->load_save_cls,
+                        os->section,
                         os->option,
                         widget,
                         cfg))
@@ -329,7 +348,8 @@
          continue;
        }
       if (GNUNET_OK != 
-         os->load_function (os->section, os->option,
+         os->load_function (os->load_save_cls,
+                            os->section, os->option,
                             value,
                             widget,
                             cfg))
@@ -345,8 +365,8 @@
       if (os->help_text != NULL)
        {
          g_signal_connect (widget,
-                           "selection-get",
-                           G_CALLBACK (&widget_selected_callback),
+                           "enter",
+                           G_CALLBACK (&widget_focused_callback),
                            (void*) os);
        }
       g_signal_connect_swapped (widget,




reply via email to

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