aboutsummaryrefslogtreecommitdiff
path: root/src/setup/gnunet-setup-transport-plugins.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-08-15 14:15:47 +0000
committerChristian Grothoff <christian@grothoff.org>2011-08-15 14:15:47 +0000
commit40fb14ed28d5be33a58927c56b70f76215974c16 (patch)
treed58ba8a5d5a3e330a468adf58cbd3e581365fb6c /src/setup/gnunet-setup-transport-plugins.c
parentfa1f4288bf52f66c46c6bf8611111cde0e4b6d44 (diff)
downloadgnunet-gtk-40fb14ed28d5be33a58927c56b70f76215974c16.tar.gz
gnunet-gtk-40fb14ed28d5be33a58927c56b70f76215974c16.zip
importing gnunet-setup
Diffstat (limited to 'src/setup/gnunet-setup-transport-plugins.c')
-rw-r--r--src/setup/gnunet-setup-transport-plugins.c105
1 files changed, 105 insertions, 0 deletions
diff --git a/src/setup/gnunet-setup-transport-plugins.c b/src/setup/gnunet-setup-transport-plugins.c
new file mode 100644
index 00000000..52fa9dea
--- /dev/null
+++ b/src/setup/gnunet-setup-transport-plugins.c
@@ -0,0 +1,105 @@
1/*
2 This file is part of GNUnet.
3 (C) 2010 Christian Grothoff (and other contributing authors)
4
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 2, or (at your
8 option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
19*/
20
21/**
22 * @file src/gnunet-setup-transport-plugins.c
23 * @brief (de)sensitize transport plugin buttons based on plugin availability
24 * @author Christian Grothoff
25 */
26#include "gnunet-setup.h"
27
28
29/**
30 * Test if the given plugin exists and change the sensitivity
31 * of the widget accordingly.
32 *
33 * @param widget widget to update
34 * @param name name of the plugin to check
35 */
36static void
37test_plugin (GtkWidget *widget,
38 const char *name)
39{
40 if (GNUNET_YES ==
41 GNUNET_PLUGIN_test (name))
42 {
43 gtk_widget_set_sensitive (widget,
44 TRUE);
45 }
46 else
47 {
48 gtk_widget_set_sensitive (widget,
49 FALSE);
50 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget),
51 FALSE);
52 }
53}
54
55
56
57void
58GNUNET_setup_transport_tcp_checkbutton_realize_cb (GtkWidget *widget,
59 gpointer user_data)
60{
61 test_plugin (widget, "libgnunet_plugin_transport_tcp");
62}
63
64
65void
66GNUNET_setup_transport_udp_checkbutton_realize_cb (GtkWidget *widget,
67 gpointer user_data)
68{
69 test_plugin (widget, "libgnunet_plugin_transport_udp");
70}
71
72
73void
74GNUNET_setup_transport_http_checkbutton_realize_cb (GtkWidget *widget,
75 gpointer user_data)
76{
77 test_plugin (widget, "libgnunet_plugin_transport_http");
78}
79
80
81void
82GNUNET_setup_transport_https_checkbutton_realize_cb (GtkWidget *widget,
83 gpointer user_data)
84{
85 test_plugin (widget, "libgnunet_plugin_transport_https");
86}
87
88
89void
90GNUNET_setup_transport_dv_checkbutton_realize_cb (GtkWidget *widget,
91 gpointer user_data)
92{
93 test_plugin (widget, "libgnunet_plugin_transport_dv");
94}
95
96
97void
98GNUNET_setup_transport_wlan_checkbutton_realize_cb (GtkWidget *widget,
99 gpointer user_data)
100{
101 test_plugin (widget, "libgnunet_plugin_transport_wlan");
102}
103
104/* end of gnunet-setup-transport-plugins.c */
105