[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r33571 - in gnunet-gtk: contrib src/namestore
From: |
gnunet |
Subject: |
[GNUnet-SVN] r33571 - in gnunet-gtk: contrib src/namestore |
Date: |
Fri, 6 Jun 2014 15:32:30 +0200 |
Author: grothoff
Date: 2014-06-06 15:32:30 +0200 (Fri, 06 Jun 2014)
New Revision: 33571
Modified:
gnunet-gtk/contrib/gnunet_namestore_edit_box.glade
gnunet-gtk/contrib/gnunet_namestore_edit_srv.glade
gnunet-gtk/contrib/gnunet_namestore_edit_tlsa.glade
gnunet-gtk/src/namestore/plugin_gtk_namestore_box.c
gnunet-gtk/src/namestore/plugin_gtk_namestore_srv.c
Log:
-handle combo box changes as well
Modified: gnunet-gtk/contrib/gnunet_namestore_edit_box.glade
===================================================================
--- gnunet-gtk/contrib/gnunet_namestore_edit_box.glade 2014-06-06 13:22:11 UTC
(rev 33570)
+++ gnunet-gtk/contrib/gnunet_namestore_edit_box.glade 2014-06-06 13:32:30 UTC
(rev 33571)
@@ -103,7 +103,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
- <object class="GtkLabel"
id="edit_dialog_srv_port_label">
+ <object class="GtkLabel"
id="edit_dialog_port_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label"
translatable="yes">_Port:</property>
@@ -117,7 +117,7 @@
</packing>
</child>
<child>
- <object class="GtkSpinButton"
id="edit_dialog_srv_port_spinbutton">
+ <object class="GtkSpinButton"
id="edit_dialog_port_spinbutton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="max_length">5</property>
@@ -137,7 +137,7 @@
</packing>
</child>
<child>
- <object class="GtkLabel"
id="edit_dialog_srv_protocol_label">
+ <object class="GtkLabel"
id="edit_dialog_protocol_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label"
translatable="yes">Protocol:</property>
@@ -150,7 +150,7 @@
</packing>
</child>
<child>
- <object class="GtkComboBox"
id="edit_dialog_srv_protocol_combobox">
+ <object class="GtkComboBox"
id="edit_dialog_protocol_combobox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property
name="model">edit_dialog_protocol_liststore</property>
@@ -170,7 +170,7 @@
</packing>
</child>
<child>
- <object class="GtkLabel"
id="edit_dialog_srv_label_label">
+ <object class="GtkLabel"
id="edit_dialog_label_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label"
translatable="yes">Label:</property>
Modified: gnunet-gtk/contrib/gnunet_namestore_edit_srv.glade
===================================================================
--- gnunet-gtk/contrib/gnunet_namestore_edit_srv.glade 2014-06-06 13:22:11 UTC
(rev 33570)
+++ gnunet-gtk/contrib/gnunet_namestore_edit_srv.glade 2014-06-06 13:32:30 UTC
(rev 33571)
@@ -110,7 +110,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
- <object class="GtkLabel"
id="edit_dialog_srv_port_label">
+ <object class="GtkLabel"
id="edit_dialog_port_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label"
translatable="yes">_Port:</property>
@@ -124,7 +124,7 @@
</packing>
</child>
<child>
- <object class="GtkSpinButton"
id="edit_dialog_srv_port_spinbutton">
+ <object class="GtkSpinButton"
id="edit_dialog_port_spinbutton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="max_length">5</property>
@@ -144,7 +144,7 @@
</packing>
</child>
<child>
- <object class="GtkLabel"
id="edit_dialog_srv_protocol_label">
+ <object class="GtkLabel"
id="edit_dialog_protocol_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label"
translatable="yes">Protocol:</property>
@@ -157,11 +157,12 @@
</packing>
</child>
<child>
- <object class="GtkComboBox"
id="edit_dialog_srv_protocol_combobox">
+ <object class="GtkComboBox"
id="edit_dialog_protocol_combobox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property
name="model">edit_dialog_protocol_liststore</property>
<property name="active">0</property>
+ <signal name="changed"
handler="edit_dialog_srv_protocol_combobox_changed_cb" swapped="no"/>
<child>
<object class="GtkCellRendererText"
id="edit_dialog_srv_protocol_name_cellrenderertext"/>
<attributes>
@@ -177,7 +178,7 @@
</packing>
</child>
<child>
- <object class="GtkLabel"
id="edit_dialog_srv_label_label">
+ <object class="GtkLabel"
id="edit_dialog_label_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label"
translatable="yes">Label:</property>
Modified: gnunet-gtk/contrib/gnunet_namestore_edit_tlsa.glade
===================================================================
--- gnunet-gtk/contrib/gnunet_namestore_edit_tlsa.glade 2014-06-06 13:22:11 UTC
(rev 33570)
+++ gnunet-gtk/contrib/gnunet_namestore_edit_tlsa.glade 2014-06-06 13:32:30 UTC
(rev 33571)
@@ -17,6 +17,56 @@
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
+ <object class="GtkListStore" id="edit_dialog_expiration_relative_liststore">
+ <columns>
+ <!-- column-name relativetime -->
+ <column type="gchararray"/>
+ </columns>
+ <data>
+ <row>
+ <col id="0">7 days</col>
+ </row>
+ <row>
+ <col id="0">1 day</col>
+ </row>
+ <row>
+ <col id="0">1 h</col>
+ </row>
+ </data>
+ </object>
+ <object class="GtkListStore" id="edit_dialog_protocol_liststore">
+ <columns>
+ <!-- column-name protocol_name -->
+ <column type="gchararray"/>
+ <!-- column-name protocol_number -->
+ <column type="guint"/>
+ </columns>
+ <data>
+ <row>
+ <col id="0" translatable="yes">tcp</col>
+ <col id="1">6</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">udp</col>
+ <col id="1">17</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">sctp</col>
+ <col id="1">132</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">dccp</col>
+ <col id="1">33</col>
+ </row>
+ </data>
+ </object>
+ <object class="GtkAdjustment" id="edit_dialog_tlsa_port_adjustment">
+ <property name="lower">1</property>
+ <property name="upper">65535</property>
+ <property name="value">443</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
<object class="GtkDialog" id="edit_a_dialog">
<property name="can_focus">False</property>
<property name="border_width">5</property>
@@ -60,7 +110,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
- <object class="GtkLabel"
id="edit_dialog_tlsa_port_label">
+ <object class="GtkLabel"
id="edit_dialog_port_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label"
translatable="yes">_Port:</property>
@@ -74,7 +124,7 @@
</packing>
</child>
<child>
- <object class="GtkSpinButton"
id="edit_dialog_tlsa_port_spinbutton">
+ <object class="GtkSpinButton"
id="edit_dialog_port_spinbutton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="max_length">5</property>
@@ -94,7 +144,7 @@
</packing>
</child>
<child>
- <object class="GtkLabel"
id="edit_dialog_tlsa_protocol_label">
+ <object class="GtkLabel"
id="edit_dialog_protocol_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label"
translatable="yes">Protocol:</property>
@@ -107,11 +157,12 @@
</packing>
</child>
<child>
- <object class="GtkComboBox"
id="edit_dialog_tlsa_protocol_combobox">
+ <object class="GtkComboBox"
id="edit_dialog_protocol_combobox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property
name="model">edit_dialog_protocol_liststore</property>
<property name="active">0</property>
+ <signal name="changed"
handler="edit_dialog_protocol_combobox_changed_cb" swapped="no"/>
<child>
<object class="GtkCellRendererText"
id="edit_dialog_tlsa_protocol_name_cellrenderertext"/>
<attributes>
@@ -958,6 +1009,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
+ <property name="pack_type">end</property>
<property name="position">1</property>
</packing>
</child>
@@ -969,54 +1021,4 @@
<action-widget response="-5">edit_dialog_save_button</action-widget>
</action-widgets>
</object>
- <object class="GtkListStore" id="edit_dialog_expiration_relative_liststore">
- <columns>
- <!-- column-name relativetime -->
- <column type="gchararray"/>
- </columns>
- <data>
- <row>
- <col id="0">7 days</col>
- </row>
- <row>
- <col id="0">1 day</col>
- </row>
- <row>
- <col id="0">1 h</col>
- </row>
- </data>
- </object>
- <object class="GtkListStore" id="edit_dialog_protocol_liststore">
- <columns>
- <!-- column-name protocol_name -->
- <column type="gchararray"/>
- <!-- column-name protocol_number -->
- <column type="guint"/>
- </columns>
- <data>
- <row>
- <col id="0" translatable="yes">tcp</col>
- <col id="1">6</col>
- </row>
- <row>
- <col id="0" translatable="yes">udp</col>
- <col id="1">17</col>
- </row>
- <row>
- <col id="0" translatable="yes">sctp</col>
- <col id="1">132</col>
- </row>
- <row>
- <col id="0" translatable="yes">dccp</col>
- <col id="1">33</col>
- </row>
- </data>
- </object>
- <object class="GtkAdjustment" id="edit_dialog_tlsa_port_adjustment">
- <property name="lower">1</property>
- <property name="upper">65535</property>
- <property name="value">443</property>
- <property name="step_increment">1</property>
- <property name="page_increment">10</property>
- </object>
</interface>
Modified: gnunet-gtk/src/namestore/plugin_gtk_namestore_box.c
===================================================================
--- gnunet-gtk/src/namestore/plugin_gtk_namestore_box.c 2014-06-06 13:22:11 UTC
(rev 33570)
+++ gnunet-gtk/src/namestore/plugin_gtk_namestore_box.c 2014-06-06 13:32:30 UTC
(rev 33571)
@@ -27,9 +27,29 @@
#include "gnunet_gtk_namestore_plugin.h"
+#ifndef EDP_CBC_DEF
+#define EDP_CBC_DEF
+/**
+ * The user has changed the protocol selection. Enable/disable 'save'
+ * button depending on the validity of the value.
+ *
+ * @param entry editing widget
+ * @param user_data the plugin environment
+ */
+static void
+edit_dialog_protocol_combobox_changed_cb (GtkEditable *entry,
+ gpointer user_data)
+{
+ struct GNUNET_GTK_NAMESTORE_PluginEnvironment *edc = user_data;
+
+ edc->check_validity (edc);
+}
+#endif
+
/* We simply include the code for boxed plugins directly here */
#include "plugin_gtk_namestore_srv.c"
+
/**
* Context for the box.
*/
@@ -193,7 +213,11 @@
struct GNUNET_GTK_NAMESTORE_PluginEnvironment *env = cls;
struct GNUNET_GTK_NAMESTORE_PluginFunctions *plugin;
static struct GNUNET_GTK_NAMESTORE_Symbol symbols[] = {
- /* FIXME: add symbols! */
+ { "GNS_edit_dialog_srv_target_entry_changed_cb",
+ G_CALLBACK (GNS_edit_dialog_srv_target_entry_changed_cb) },
+ { "edit_dialog_protocol_combobox_changed_cb",
+ G_CALLBACK (edit_dialog_protocol_combobox_changed_cb) },
+ /* FIXME: add TLSA symbols! */
/* need to include symbols from all boxed types here */
{ NULL, NULL }
};
Modified: gnunet-gtk/src/namestore/plugin_gtk_namestore_srv.c
===================================================================
--- gnunet-gtk/src/namestore/plugin_gtk_namestore_srv.c 2014-06-06 13:22:11 UTC
(rev 33570)
+++ gnunet-gtk/src/namestore/plugin_gtk_namestore_srv.c 2014-06-06 13:32:30 UTC
(rev 33571)
@@ -28,6 +28,43 @@
/**
+ * The user has edited the target value. Enable/disable 'save'
+ * button depending on the validity of the value.
+ *
+ * @param entry editing widget
+ * @param user_data the plugin environment
+ */
+static void
+GNS_edit_dialog_srv_target_entry_changed_cb (GtkEditable *entry,
+ gpointer user_data)
+{
+ struct GNUNET_GTK_NAMESTORE_PluginEnvironment *edc = user_data;
+
+ edc->check_validity (edc);
+}
+
+
+#ifndef EDP_CBC_DEF
+#define EDP_CBC_DEF
+/**
+ * The user has changed the protocol selection. Enable/disable 'save'
+ * button depending on the validity of the value.
+ *
+ * @param entry editing widget
+ * @param user_data the plugin environment
+ */
+static void
+edit_dialog_protocol_combobox_changed_cb (GtkEditable *entry,
+ gpointer user_data)
+{
+ struct GNUNET_GTK_NAMESTORE_PluginEnvironment *edc = user_data;
+
+ edc->check_validity (edc);
+}
+#endif
+
+
+/**
* Function that will be called to initialize the builder's
* widgets from the existing record (if there is one).
* The `n_value` is the existing value of the record as a string.
@@ -71,12 +108,12 @@
gtk_spin_button_set_value
(GTK_SPIN_BUTTON (gtk_builder_get_object (builder,
-
"edit_dialog_srv_port_spinbutton")),
+ "edit_dialog_port_spinbutton")),
protocol);
cb = GTK_COMBO_BOX (gtk_builder_get_object (builder,
-
"edit_dialog_srv_protocol_combobox"));
+
"edit_dialog_protocol_combobox"));
tm = GTK_TREE_MODEL (gtk_builder_get_object (builder,
-
"edit_dialog_srv_protocol_liststore"));
+
"edit_dialog_protocol_liststore"));
if (gtk_tree_model_get_iter_first (tm,
&iter))
{
@@ -140,9 +177,9 @@
protocol = gtk_spin_button_get_value
(GTK_SPIN_BUTTON (gtk_builder_get_object (builder,
-
"edit_dialog_srv_port_spinbutton")));
+ "edit_dialog_port_spinbutton")));
cb = GTK_COMBO_BOX (gtk_builder_get_object (builder,
-
"edit_dialog_srv_protocol_combobox"));
+
"edit_dialog_protocol_combobox"));
if (! gtk_combo_box_get_active_iter (cb,
&iter))
{
@@ -150,7 +187,7 @@
return NULL;
}
tm = GTK_TREE_MODEL (gtk_builder_get_object (builder,
-
"edit_dialog_srv_protocol_liststore"));
+
"edit_dialog_protocol_liststore"));
gtk_tree_model_get (tm,
&iter,
1, &service,
@@ -208,7 +245,7 @@
(GNUNET_OK != GNUNET_DNSPARSER_check_name (preedit)) )
return GNUNET_SYSERR;
cb = GTK_COMBO_BOX (gtk_builder_get_object (builder,
-
"edit_dialog_srv_protocol_combobox"));
+
"edit_dialog_protocol_combobox"));
if (! gtk_combo_box_get_active_iter (cb,
&iter))
return GNUNET_SYSERR;
@@ -228,7 +265,10 @@
struct GNUNET_GTK_NAMESTORE_PluginEnvironment *env = cls;
struct GNUNET_GTK_NAMESTORE_PluginFunctions *plugin;
static struct GNUNET_GTK_NAMESTORE_Symbol symbols[] = {
- /* FIXME: add symbols! */
+ { "GNS_edit_dialog_srv_target_entry_changed_cb",
+ G_CALLBACK (GNS_edit_dialog_srv_target_entry_changed_cb) },
+ { "edit_dialog_protocol_combobox_changed_cb",
+ G_CALLBACK (edit_dialog_protocol_combobox_changed_cb) },
{ NULL, NULL }
};
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r33571 - in gnunet-gtk: contrib src/namestore,
gnunet <=