gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r13496 - gnunet-setup/src


From: gnunet
Subject: [GNUnet-SVN] r13496 - gnunet-setup/src
Date: Tue, 2 Nov 2010 17:03:41 +0100

Author: grothoff
Date: 2010-11-02 17:03:41 +0100 (Tue, 02 Nov 2010)
New Revision: 13496

Added:
   gnunet-setup/src/gnunet-setup-options.c
   gnunet-setup/src/gnunet-setup-options.h
Log:
more work on setup

Added: gnunet-setup/src/gnunet-setup-options.c
===================================================================
--- gnunet-setup/src/gnunet-setup-options.c                             (rev 0)
+++ gnunet-setup/src/gnunet-setup-options.c     2010-11-02 16:03:41 UTC (rev 
13496)
@@ -0,0 +1,35 @@
+/*
+     This file is part of GNUnet.
+     (C) 2010 Christian Grothoff (and other contributing authors)
+
+     GNUnet is free software; you can redistribute it and/or modify
+     it under the terms of the GNU General Public License as published
+     by the Free Software Foundation; either version 2, or (at your
+     option) any later version.
+
+     GNUnet is distributed in the hope that it will be useful, but
+     WITHOUT ANY WARRANTY; without even the implied warranty of
+     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+     General Public License for more details.
+
+     You should have received a copy of the GNU General Public License
+     along with GNUnet; see the file COPYING.  If not, write to the
+     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+     Boston, MA 02111-1307, USA.
+*/
+
+/**
+ * @file src/gnunet-setup-options.c
+ * @brief configuration details
+ * @author Christian Grothoff
+ */
+#include "gnunet-setup-options.h"
+
+/**
+ * Option specification data.
+ */
+const struct GNUNET_SETUP_OptionSpecification option_specifications[] =
+  {
+
+  };
+

Added: gnunet-setup/src/gnunet-setup-options.h
===================================================================
--- gnunet-setup/src/gnunet-setup-options.h                             (rev 0)
+++ gnunet-setup/src/gnunet-setup-options.h     2010-11-02 16:03:41 UTC (rev 
13496)
@@ -0,0 +1,159 @@
+/*
+     This file is part of GNUnet.
+     (C) 2010 Christian Grothoff (and other contributing authors)
+
+     GNUnet is free software; you can redistribute it and/or modify
+     it under the terms of the GNU General Public License as published
+     by the Free Software Foundation; either version 2, or (at your
+     option) any later version.
+
+     GNUnet is distributed in the hope that it will be useful, but
+     WITHOUT ANY WARRANTY; without even the implied warranty of
+     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+     General Public License for more details.
+
+     You should have received a copy of the GNU General Public License
+     along with GNUnet; see the file COPYING.  If not, write to the
+     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+     Boston, MA 02111-1307, USA.
+*/
+
+/**
+ * @file src/gnunet-setup-options.h
+ * @brief configuration details
+ * @author Christian Grothoff
+ */
+#ifndef GNUNET_SETUP_OPTIONS_H
+#define GNUNET_SETUP_OPTIONS_H
+
+#ifndef HAVE_USED_CONFIG_H
+#define HAVE_USED_CONFIG_H
+#include "gnunet_setup_config.h"
+#endif
+
+#include <gnunet/platform.h>
+#include <gnunet/gnunet_directories.h>
+#include <gnunet/gnunet_util_lib.h>
+#include <gladeui/glade.h>
+#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.
+ */
+typedef int (*GNUNET_SETUP_Validation)(void *cls,
+                                      const char *section,
+                                      const char *option,
+                                      GtkWidget *widget,
+                                      const struct GNUNET_CONFIGURATION_Handle 
*cfg);
+
+/**
+ * 
+ */
+typedef int (*GNUNET_SETUP_LoadFunction)(const char *section,
+                                        const char *option,
+                                        const char *value,
+                                        GtkWidget *widget,
+                                        const struct 
GNUNET_CONFIGURATION_Handle *cfg);
+
+
+/**
+ * 
+ */
+typedef int (*GNUNET_SETUP_SaveFunction)(const char *section,
+                                        const char *option,
+                                        GtkWidget *widget,
+                                        struct GNUNET_CONFIGURATION_Handle 
*cfg);
+
+
+/**
+ * Structs of this type specify under which conditions the values of
+ * a particular option impact the visibility (or sensitivity) of some
+ * other widget.
+ */
+struct GNUNET_SETUP_VisibilitySpecification
+{
+
+  const char *widget_name;
+
+  const char *show_value;
+
+  const char *hide_value;
+
+};
+
+/**
+ * Structs of this type define how widgets relate to GNUnet options
+ * and control visibility and special actions.
+ */
+struct GNUNET_SETUP_OptionSpecification
+{
+  /**
+   * Name of the GTK widget in Glade.
+   */
+  const char *widget_name;
+
+  /**
+   * Section in the configuration
+   */
+  const char *section;
+
+  /**
+   * Name of the configuration option.
+   */
+  const char *option;
+
+  /**
+   * Help text to display for this option.
+   */
+  const char *help_text;
+
+  /**
+   * Help URL to link to for this option.
+   */
+  const char *help_url;
+
+  /**
+   * Function to call to validate the entry (can be NULL).
+   */
+  GNUNET_SETUP_Validation validation_function;
+
+  /**
+   * Closure for 'validation_function'.
+   */
+  void *validation_function_cls;
+
+  /**
+   * Function to call to initialize the widget from the configuration.
+   */
+  GNUNET_SETUP_LoadFunction load_function;
+
+  /**
+   * Function to call set the configuration from the widget.
+   */
+  GNUNET_SETUP_SaveFunction save_function;
+
+  /**
+   * Visibility changes to apply if this option changes (NULL, or
+   * NULL-terminated).
+   */
+  const struct GNUNET_SETUP_VisibilitySpecification visibility[];
+
+};
+
+
+/**
+ * Option specification data.
+ */
+extern const struct GNUNET_SETUP_OptionSpecification option_specifications[];
+
+#endif




reply via email to

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