[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r25178 - in gnunet-gtk: contrib src/setup
From: |
gnunet |
Subject: |
[GNUnet-SVN] r25178 - in gnunet-gtk: contrib src/setup |
Date: |
Mon, 3 Dec 2012 09:22:56 +0100 |
Author: grothoff
Date: 2012-12-03 09:22:56 +0100 (Mon, 03 Dec 2012)
New Revision: 25178
Modified:
gnunet-gtk/contrib/gnunet_setup_gns_edit_a.glade
gnunet-gtk/contrib/gnunet_setup_gtk_main_window.glade
gnunet-gtk/src/setup/gnunet-setup-gns.c
Log:
-fixing #2492, taking first steps towards custom edit dialog for records
Modified: gnunet-gtk/contrib/gnunet_setup_gns_edit_a.glade
===================================================================
--- gnunet-gtk/contrib/gnunet_setup_gns_edit_a.glade 2012-12-02 14:57:05 UTC
(rev 25177)
+++ gnunet-gtk/contrib/gnunet_setup_gns_edit_a.glade 2012-12-03 08:22:56 UTC
(rev 25178)
@@ -47,6 +47,21 @@
</packing>
</child>
<child>
+ <object class="GtkButton" id="edit_dialog_delete_button">
+ <property name="label">gtk-delete</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkButton" id="edit_dialog_save_button">
<property name="label">gtk-save</property>
<property name="use_action_appearance">False</property>
@@ -59,7 +74,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">1</property>
+ <property name="position">2</property>
</packing>
</child>
</object>
@@ -513,6 +528,7 @@
</child>
<action-widgets>
<action-widget response="-6">edit_dialog_cancel_button</action-widget>
+ <action-widget response="-2">edit_dialog_delete_button</action-widget>
<action-widget response="-5">edit_dialog_save_button</action-widget>
</action-widgets>
</object>
Modified: gnunet-gtk/contrib/gnunet_setup_gtk_main_window.glade
===================================================================
--- gnunet-gtk/contrib/gnunet_setup_gtk_main_window.glade 2012-12-02
14:57:05 UTC (rev 25177)
+++ gnunet-gtk/contrib/gnunet_setup_gtk_main_window.glade 2012-12-03
08:22:56 UTC (rev 25178)
@@ -36,9 +36,9 @@
<child>
<object class="GtkButton" id="GNUNET_setup_cancel_button">
<property name="label">gtk-cancel</property>
+ <property name="use_action_appearance">False</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
@@ -50,9 +50,9 @@
<child>
<object class="GtkButton" id="GNUNET_setup_save_as_button">
<property name="label">gtk-save-as</property>
+ <property name="use_action_appearance">False</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
@@ -64,9 +64,9 @@
<child>
<object class="GtkButton" id="GNUNET_setup_save_button">
<property name="label">gtk-save</property>
+ <property name="use_action_appearance">False</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
@@ -122,12 +122,12 @@
<child>
<object class="GtkCheckButton"
id="GNUNET_setup_general_services_topology_checkbutton">
<property name="label"
translatable="yes">Topology</property>
+ <property
name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property
name="receives_default">False</property>
<property name="tooltip_text"
translatable="yes">The topology subsystem is required as it ensures that your
peer connects to other peers.</property>
- <property
name="use_action_appearance">False</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
@@ -142,11 +142,11 @@
<child>
<object class="GtkCheckButton"
id="GNUNET_setup_general_services_hostlist_checkbutton">
<property name="label"
translatable="yes">Hostlist</property>
+ <property
name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property
name="receives_default">False</property>
<property name="tooltip_text"
translatable="yes">Hostlist servers are used to find other peers. Here you can
choose to offer a hostlist or simply configure which hostlists by other peers
you want to use.</property>
- <property
name="use_action_appearance">False</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
@@ -161,11 +161,11 @@
<child>
<object class="GtkCheckButton"
id="GNUNET_setup_general_services_fs_checkbutton">
<property name="label" translatable="yes">File
_Sharing</property>
+ <property
name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property
name="receives_default">False</property>
<property name="tooltip_text"
translatable="yes">Enable GNUnet's file-sharing subsystem.</property>
- <property
name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="active">True</property>
@@ -181,11 +181,11 @@
<child>
<object class="GtkCheckButton"
id="GNUNET_setup_general_services_pt_checkbutton">
<property name="label"
translatable="yes">PT/VPN</property>
+ <property
name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property
name="receives_default">False</property>
<property name="tooltip_text"
translatable="yes">Using the PT/VPN subsystems you can tunnel your Internet
traffic over GNUnet. This is useful if you want to access the IPv4-Internet if
you only have IPv6-connectivity or vice versa. Furthermore, if you are only
connected to other peers using WLAN, you could also get Internet access in the
first place by routing IP traffic over GNUnet.</property>
- <property
name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
@@ -200,11 +200,11 @@
<child>
<object class="GtkCheckButton"
id="GNUNET_setup_general_services_exit_checkbutton">
<property name="label"
translatable="yes">EXIT</property>
+ <property
name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property
name="receives_default">False</property>
<property name="tooltip_text"
translatable="yes">By offering an EXIT service, you can allow other peers to
use your Internet connection to reach the IPv4 and/or IPv6 Internet.
Naturally, as your machine will be seen as the origin of the traffic, this
might be risky in some jurisdictions. Enabling the exit for IPv4 and IPv6 and
PT/VPN interception for IPv4 and IPv6 on the same machine will still give you
4to6 and 6to4 protocol translation, allowing you to access IPv4-only servers
from IPv6-only clients and IPv6-only servers from IPv4-only clients.</property>
- <property
name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
@@ -219,11 +219,11 @@
<child>
<object class="GtkCheckButton"
id="GNUNET_setup_general_services_gns_checkbutton">
<property name="label"
translatable="yes">GNS</property>
+ <property
name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property
name="receives_default">False</property>
<property name="tooltip_text"
translatable="yes">The GNS is GNUnet's replacement for DNS. Enabling this
subsystem will make the ".gnunet" TLD available on your system. You will be in
charge of your ".gnunet" TLD.</property>
- <property
name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
@@ -273,10 +273,10 @@
<child>
<object class="GtkCheckButton"
id="GNUNET_setup_friends_only_checkbutton">
<property name="label" translatable="yes">F_2F
only</property>
+ <property
name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property
name="receives_default">False</property>
- <property
name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
@@ -407,10 +407,10 @@
<child>
<object class="GtkCheckButton"
id="GNUNET_setup_hostlist_client_enable_checkbutton">
<property name="label"
translatable="yes">Use Hostlists to bootstrap</property>
+ <property
name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property
name="receives_default">False</property>
- <property
name="use_action_appearance">False</property>
<property name="xalign">0</property>
<property
name="draw_indicator">True</property>
</object>
@@ -424,10 +424,10 @@
<child>
<object class="GtkCheckButton"
id="GNUNET_setup_hostlist_client_learn_checkbutton">
<property name="label"
translatable="yes">Learn Servers from P2P Network</property>
+ <property
name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property
name="receives_default">False</property>
- <property
name="use_action_appearance">False</property>
<property name="xalign">0</property>
<property
name="draw_indicator">True</property>
</object>
@@ -456,10 +456,10 @@
<child>
<object class="GtkCheckButton"
id="GNUNET_setup_hostlist_offer_hostlist_checkbutton">
<property name="label"
translatable="yes">Run Hostlist Server</property>
+ <property
name="use_action_appearance">False</property>
<property
name="visible">True</property>
<property
name="can_focus">True</property>
<property
name="receives_default">False</property>
- <property
name="use_action_appearance">False</property>
<property name="xalign">0</property>
<property
name="draw_indicator">True</property>
<signal name="realize"
handler="GNUNET_setup_hostlist_offer_hostlist_checkbutton_realize_cb"
swapped="no"/>
@@ -473,10 +473,10 @@
<child>
<object class="GtkCheckButton"
id="GNUNET_setup_hostlist_advertise_checkbutton">
<property name="label"
translatable="yes">Advertise Hostlist Server</property>
+ <property
name="use_action_appearance">False</property>
<property
name="visible">True</property>
<property
name="can_focus">True</property>
<property
name="receives_default">False</property>
- <property
name="use_action_appearance">False</property>
<property name="xalign">0</property>
<property
name="draw_indicator">True</property>
<signal name="realize"
handler="GNUNET_setup_hostlist_advertise_checkbutton_realize_cb" swapped="no"/>
@@ -783,11 +783,11 @@
<child>
<object class="GtkCheckButton"
id="GNUNET_setup_transport_nat_checkbutton">
<property name="label"
translatable="yes">Peer is behind _NAT</property>
+ <property
name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property
name="receives_default">False</property>
<property name="tooltip_text"
translatable="yes">Check this box if your machine is behind a NAT box (router
that performs network address translation). Leave off if your machine has a
globally unique IPv4 address. NAT options only impact IPv4 addresses at this
time.</property>
- <property
name="use_action_appearance">False</property>
<property
name="use_underline">True</property>
<property name="xalign">0</property>
<property
name="draw_indicator">True</property>
@@ -802,10 +802,10 @@
<child>
<object class="GtkButton"
id="GNUNET_setup_transport_autoconfig_button">
<property name="label"
translatable="yes">Attempt automatic configuration</property>
+ <property
name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property
name="receives_default">True</property>
- <property
name="use_action_appearance">False</property>
<signal name="clicked"
handler="GNUNET_setup_transport_autoconfig_button_clicked_cb" swapped="no"/>
</object>
<packing>
@@ -818,11 +818,11 @@
<child>
<object class="GtkCheckButton"
id="GNUNET_setup_transport_disable_ipv6_checkbutton">
<property name="label"
translatable="yes">Disable IPv_6 support</property>
+ <property
name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property
name="receives_default">False</property>
<property name="tooltip_text"
translatable="yes">Disable advertising IPv6 addresses. Check this box if you
know that your system has no IPv6 Internet connectivity.</property>
- <property
name="use_action_appearance">False</property>
<property
name="use_underline">True</property>
<property name="xalign">0</property>
<property
name="draw_indicator">True</property>
@@ -866,11 +866,11 @@
<child>
<object class="GtkCheckButton"
id="GNUNET_setup_transport_hole_punched_checkbutton">
<property name="label"
translatable="yes">NAT ports have been opened manually</property>
+ <property
name="use_action_appearance">False</property>
<property
name="visible">True</property>
<property
name="can_focus">True</property>
<property
name="receives_default">False</property>
<property name="tooltip_text"
translatable="yes">Set this option if you have configured your NAT to forward
the ports for the various enabled GNUnet transports. If the external ports are
different, the respective values of the external port should be specified under
"advertised port" for the respective transport. You also need to specify the
"External (public) IPv4 address" of your NAT box below.</property>
- <property
name="use_action_appearance">False</property>
<property name="xalign">0</property>
<property
name="draw_indicator">True</property>
</object>
@@ -883,11 +883,11 @@
<child>
<object class="GtkCheckButton"
id="GNUNET_setup_transport_upnp_enable_checkbutton">
<property name="label"
translatable="yes">Enable NAT traversal via UPnP or PMP</property>
+ <property
name="use_action_appearance">False</property>
<property
name="visible">True</property>
<property
name="can_focus">True</property>
<property
name="receives_default">False</property>
<property name="tooltip_text"
translatable="yes">This option enables the use of upnpc from miniupnpd for NAT
traversal</property>
- <property
name="use_action_appearance">False</property>
<property name="xalign">0</property>
<property
name="draw_indicator">True</property>
</object>
@@ -900,11 +900,11 @@
<child>
<object class="GtkCheckButton"
id="GNUNET_setup_transport_icmp_server_enable_checkbutton">
<property name="label"
translatable="yes">Enable NAT traversal using ICMP method</property>
+ <property
name="use_action_appearance">False</property>
<property
name="visible">True</property>
<property
name="can_focus">True</property>
<property
name="receives_default">False</property>
<property name="tooltip_text"
translatable="yes">This option enables the use of the "Autonomous NAT
Traversal" method (presented at P2P 2010). It requires
gnunet-helper-nat-server to be installed SUID on the local system.</property>
- <property
name="use_action_appearance">False</property>
<property name="xalign">0</property>
<property
name="draw_indicator">True</property>
</object>
@@ -961,11 +961,11 @@
<child>
<object class="GtkCheckButton"
id="GNUNET_setup_transport_icmp_client_enable_checkbutton">
<property name="label"
translatable="yes">Enable connecting to NATed peers using ICMP method</property>
+ <property
name="use_action_appearance">False</property>
<property
name="visible">True</property>
<property
name="can_focus">True</property>
<property
name="receives_default">False</property>
<property name="tooltip_text"
translatable="yes">This method allows this peer to initiate connections to
NATed peers using the 'Autonomous NAT traversal' method (presented at P2P
2010). It requires having gnunet-helper-nat-client installed SUID on the local
system.</property>
- <property
name="use_action_appearance">False</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property
name="draw_indicator">True</property>
@@ -1107,10 +1107,10 @@
<child>
<object class="GtkCheckButton"
id="GNUNET_setup_transport_tcp_checkbutton">
<property name="label"
translatable="yes">_TCP</property>
+ <property
name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property
name="receives_default">False</property>
- <property
name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="active">True</property>
@@ -1127,10 +1127,10 @@
<child>
<object class="GtkCheckButton"
id="GNUNET_setup_transport_udp_checkbutton">
<property name="label"
translatable="yes">_UDP</property>
+ <property
name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property
name="receives_default">False</property>
- <property
name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
@@ -1146,10 +1146,10 @@
<child>
<object class="GtkCheckButton"
id="GNUNET_setup_transport_http_client_checkbutton">
<property name="label"
translatable="yes">_HTTP Client</property>
+ <property
name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property
name="receives_default">False</property>
- <property
name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="active">True</property>
@@ -1166,10 +1166,10 @@
<child>
<object class="GtkCheckButton"
id="GNUNET_setup_transport_http_server_checkbutton">
<property name="label"
translatable="yes">HTT_P Server</property>
+ <property
name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property
name="receives_default">False</property>
- <property
name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="active">True</property>
@@ -1186,10 +1186,10 @@
<child>
<object class="GtkCheckButton"
id="GNUNET_setup_transport_https_client_checkbutton">
<property name="label"
translatable="yes">HTTPS _Client</property>
+ <property
name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property
name="receives_default">False</property>
- <property
name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="active">True</property>
@@ -1206,10 +1206,10 @@
<child>
<object class="GtkCheckButton"
id="GNUNET_setup_transport_https_server_checkbutton">
<property name="label"
translatable="yes">HTTPS _Server</property>
+ <property
name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property
name="receives_default">False</property>
- <property
name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="active">True</property>
@@ -1226,9 +1226,9 @@
<child>
<object class="GtkCheckButton"
id="GNUNET_setup_transport_dv_checkbutton">
<property name="label"
translatable="yes">D_V</property>
+ <property
name="use_action_appearance">False</property>
<property name="can_focus">True</property>
<property
name="receives_default">False</property>
- <property
name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
@@ -1244,10 +1244,10 @@
<child>
<object class="GtkCheckButton"
id="GNUNET_setup_transport_wlan_checkbutton">
<property name="label"
translatable="yes">_WLAN</property>
+ <property
name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property
name="receives_default">False</property>
- <property
name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
@@ -1411,11 +1411,11 @@
<child>
<object class="GtkButton"
id="GNUNET_setup_transport_tcp_test_button">
<property name="label"
translatable="yes">Test configuration</property>
+ <property
name="use_action_appearance">False</property>
<property
name="visible">True</property>
<property
name="can_focus">True</property>
<property
name="receives_default">True</property>
<property name="tooltip_text"
translatable="yes">Test your network configuration by contacting a public
gnunet-nat-server and asking it to establish a connection to your system for
testing. This test can only work if you are not running your peer at the time
you run the test.</property>
- <property
name="use_action_appearance">False</property>
<signal name="clicked"
handler="GNUNET_setup_transport_tcp_test_button_clicked_cb" swapped="no"/>
</object>
<packing>
@@ -1610,11 +1610,11 @@
<child>
<object class="GtkButton"
id="GNUNET_setup_transport_udp_test_button">
<property name="label"
translatable="yes">Test configuration</property>
+ <property
name="use_action_appearance">False</property>
<property
name="visible">True</property>
<property
name="can_focus">True</property>
<property
name="receives_default">True</property>
<property name="tooltip_text"
translatable="yes">Test your network configuration by contacting a public
gnunet-nat-server and asking it to establish a connection to your system for
testing. This test can only work if you are not running your peer at the time
you run the test.</property>
- <property
name="use_action_appearance">False</property>
<signal name="clicked"
handler="GNUNET_setup_transport_udp_test_button_clicked_cb" swapped="no"/>
</object>
<packing>
@@ -1817,11 +1817,11 @@
<child>
<object class="GtkButton"
id="GNUNET_setup_transport_http_test_button">
<property name="label"
translatable="yes">Test configuration</property>
+ <property
name="use_action_appearance">False</property>
<property
name="visible">True</property>
<property
name="can_focus">True</property>
<property
name="receives_default">True</property>
<property name="tooltip_text"
translatable="yes">Test your network configuration by contacting a public
gnunet-nat-server and asking it to establish a connection to your system for
testing. This test can only work if you are not running your peer at the time
you run the test.</property>
- <property
name="use_action_appearance">False</property>
<signal name="clicked"
handler="GNUNET_setup_transport_http_test_button_clicked_cb" swapped="no"/>
</object>
<packing>
@@ -2024,11 +2024,11 @@
<child>
<object class="GtkButton"
id="GNUNET_setup_transport_https_test_button">
<property name="label"
translatable="yes">Test configuration</property>
+ <property
name="use_action_appearance">False</property>
<property
name="visible">True</property>
<property
name="can_focus">True</property>
<property
name="receives_default">True</property>
<property name="tooltip_text"
translatable="yes">Test your network configuration by contacting a public
gnunet-nat-server and asking it to establish a connection to your system for
testing. This test can only work if you are not running your peer at the time
you run the test.</property>
- <property
name="use_action_appearance">False</property>
<signal name="clicked"
handler="GNUNET_setup_transport_https_test_button_clicked_cb" swapped="no"/>
</object>
<packing>
@@ -2245,10 +2245,10 @@
<child>
<object class="GtkCheckButton"
id="GNUNET_setup_fs_migration_from_checkbutton">
<property name="label"
translatable="yes">Enable unsolicited content transmission from this
peer</property>
+ <property
name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property
name="receives_default">False</property>
- <property
name="use_action_appearance">False</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
@@ -2263,10 +2263,10 @@
<child>
<object class="GtkCheckButton"
id="GNUNET_setup_fs_migration_to_checkbutton">
<property name="label"
translatable="yes">Enable caching content at this peer</property>
+ <property
name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property
name="receives_default">False</property>
- <property
name="use_action_appearance">False</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
@@ -2336,10 +2336,10 @@
<child>
<object class="GtkRadioButton"
id="GNUNET_setup_fs_datastore_sqlite_radiobutton">
<property name="label"
translatable="yes">sqLite</property>
+ <property
name="use_action_appearance">False</property>
<property
name="visible">True</property>
<property
name="can_focus">True</property>
<property
name="receives_default">False</property>
- <property
name="use_action_appearance">False</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property
name="draw_indicator">True</property>
@@ -2354,10 +2354,10 @@
<child>
<object class="GtkRadioButton"
id="GNUNET_setup_fs_datastore_mysql_radiobutton">
<property name="label"
translatable="yes">MySQL</property>
+ <property
name="use_action_appearance">False</property>
<property
name="visible">True</property>
<property
name="can_focus">True</property>
<property
name="receives_default">False</property>
- <property
name="use_action_appearance">False</property>
<property name="xalign">0</property>
<property
name="yalign">0.50999999046325684</property>
<property
name="draw_indicator">True</property>
@@ -2373,10 +2373,10 @@
<child>
<object class="GtkRadioButton"
id="GNUNET_setup_fs_datastore_postgres_radiobutton">
<property name="label"
translatable="yes">Postgres</property>
+ <property
name="use_action_appearance">False</property>
<property
name="visible">True</property>
<property
name="can_focus">True</property>
<property
name="receives_default">False</property>
- <property
name="use_action_appearance">False</property>
<property name="xalign">0</property>
<property
name="draw_indicator">True</property>
<property
name="group">GNUNET_setup_fs_datastore_sqlite_radiobutton</property>
@@ -2723,10 +2723,10 @@
<child>
<object class="GtkButton"
id="GNUNET_setup_datastore_mysql_tab_test_button">
<property name="label"
translatable="yes">Test configuration</property>
+ <property
name="use_action_appearance">False</property>
<property
name="visible">True</property>
<property
name="can_focus">True</property>
<property
name="receives_default">True</property>
- <property
name="use_action_appearance">False</property>
<signal name="clicked"
handler="GNUNET_setup_datastore_mysql_tab_test_button_clicked_cb" swapped="no"/>
</object>
<packing>
@@ -2826,10 +2826,10 @@
<child>
<object class="GtkButton"
id="GNUNET_setup_datastore_postgres_tab_test_button">
<property name="label"
translatable="yes">Test configuration</property>
+ <property
name="use_action_appearance">False</property>
<property
name="visible">True</property>
<property
name="can_focus">True</property>
<property
name="receives_default">True</property>
- <property
name="use_action_appearance">False</property>
<signal name="clicked"
handler="GNUNET_setup_datastore_postgres_tab_test_button_clicked_cb"
swapped="no"/>
</object>
<packing>
@@ -2935,10 +2935,10 @@
<child>
<object class="GtkRadioButton"
id="GNUNET_setup_fs_datacache_sqlite_radiobutton">
<property name="label"
translatable="yes">sqLite</property>
+ <property
name="use_action_appearance">False</property>
<property
name="visible">True</property>
<property
name="can_focus">True</property>
<property
name="receives_default">False</property>
- <property
name="use_action_appearance">False</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property
name="draw_indicator">True</property>
@@ -2953,10 +2953,10 @@
<child>
<object class="GtkRadioButton"
id="GNUNET_setup_fs_datacache_heap_radiobutton">
<property name="label"
translatable="yes">Memory</property>
+ <property
name="use_action_appearance">False</property>
<property
name="visible">True</property>
<property
name="can_focus">True</property>
<property
name="receives_default">False</property>
- <property
name="use_action_appearance">False</property>
<property name="xalign">0</property>
<property
name="yalign">0.50999999046325684</property>
<property
name="draw_indicator">True</property>
@@ -2972,10 +2972,10 @@
<child>
<object class="GtkRadioButton"
id="GNUNET_setup_fs_datacache_postgres_radiobutton">
<property name="label"
translatable="yes">Postgres</property>
+ <property
name="use_action_appearance">False</property>
<property
name="visible">True</property>
<property
name="can_focus">True</property>
<property
name="receives_default">False</property>
- <property
name="use_action_appearance">False</property>
<property name="xalign">0</property>
<property
name="draw_indicator">True</property>
<property
name="group">GNUNET_setup_fs_datacache_sqlite_radiobutton</property>
@@ -3070,8 +3070,10 @@
<object class="GtkVBox"
id="GNUNET_setup_datacache_heap_vbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label"
translatable="yes">No setup required.</property>
</object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
</child>
<child type="tab">
<object class="GtkLabel"
id="GNUNET_setup_fs_datacache_heap_tab_label">
@@ -3080,6 +3082,7 @@
<property name="label"
translatable="yes">sqLite</property>
</object>
<packing>
+ <property name="position">1</property>
<property name="tab_fill">False</property>
</packing>
</child>
@@ -3144,10 +3147,10 @@
<child>
<object class="GtkButton"
id="GNUNET_setup_datacache_postgres_tab_test_button">
<property name="label"
translatable="yes">Test configuration</property>
+ <property
name="use_action_appearance">False</property>
<property
name="visible">True</property>
<property
name="can_focus">True</property>
<property
name="receives_default">True</property>
- <property
name="use_action_appearance">False</property>
<signal name="clicked"
handler="GNUNET_setup_datacache_postgres_tab_test_button_clicked_cb"
swapped="no"/>
</object>
<packing>
@@ -3256,11 +3259,11 @@
<child>
<object class="GtkCheckButton"
id="GNUNET_setup_pt_ipv4_checkbutton">
<property name="label"
translatable="yes">Tunnel IPv4 Traffic</property>
+ <property
name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property
name="receives_default">False</property>
<property name="tooltip_text"
translatable="yes">By enabling this option, all of your IPv4-Internet traffic
will be routed over GNUnet to a GNUnet exit node. Note that this will enable
other GNUnet peers to observe your unencrypted Internet traffic. This enables
4over6 tunneling and 4to6 protocol translation.</property>
- <property
name="use_action_appearance">False</property>
<property
name="draw_indicator">True</property>
</object>
<packing>
@@ -3273,11 +3276,11 @@
<child>
<object class="GtkCheckButton"
id="GNUNET_setup_pt_ipv6_checkbutton">
<property name="label"
translatable="yes">Tunnel IPv6 Traffic</property>
+ <property
name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property
name="receives_default">False</property>
<property name="tooltip_text"
translatable="yes">By enabling this option, all of your IPv6-Internet traffic
will be routed over GNUnet to a GNUnet exit node. Note that this will enable
other GNUnet peers to observe your unencrypted Internet traffic. This enables
6over4 tunneling and 6to4 protocol translation.</property>
- <property
name="use_action_appearance">False</property>
<property
name="draw_indicator">True</property>
</object>
<packing>
@@ -3290,11 +3293,11 @@
<child>
<object class="GtkCheckButton"
id="GNUNET_setup_pt_dns_checkbutton">
<property name="label"
translatable="yes">Tunnel DNS Traffic</property>
+ <property
name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property
name="receives_default">False</property>
<property name="tooltip_text"
translatable="yes">Enabling this option will cause your DNS traffic to be
routed via the GNUnet network to some other peer offering DNS exit
functionality. This is needed if you have no Internet access (and are thus
tunnelling both IPv4 and IPv6 traffic over GNUnet). If you have regular
Internet access, this option only makes sense if you want to get some 'weak'
anonymity by tunnelling all of your traffic over GNUnet (using the network as a
1-hop proxy in the worst-case, so this does not provide you with strong
anonymity).</property>
- <property
name="use_action_appearance">False</property>
<property
name="draw_indicator">True</property>
</object>
<packing>
@@ -3589,10 +3592,10 @@
<child>
<object class="GtkCheckButton"
id="GNUNET_setup_dns_enable_exit_checkbutton">
<property name="label"
translatable="yes">Enable DNS Exit</property>
+ <property
name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property
name="receives_default">False</property>
- <property
name="use_action_appearance">False</property>
<property name="xalign">0</property>
<property
name="draw_indicator">True</property>
</object>
@@ -3606,11 +3609,11 @@
<child>
<object class="GtkCheckButton"
id="GNUNET_setup_exit_enable_ipv4_exit_checkbutton">
<property name="label"
translatable="yes">Enable IPv4 Exit</property>
+ <property
name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property
name="receives_default">False</property>
<property name="tooltip_text"
translatable="yes">This option will allow other peers to send IPv4 traffic to
the Internet using your network connection.</property>
- <property
name="use_action_appearance">False</property>
<property name="xalign">0</property>
<property
name="draw_indicator">True</property>
</object>
@@ -3624,11 +3627,11 @@
<child>
<object class="GtkCheckButton"
id="GNUNET_setup_exit_enable_ipv6_exit_checkbutton">
<property name="label"
translatable="yes">Enable IPv6 Exit</property>
+ <property
name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property
name="receives_default">False</property>
<property name="tooltip_text"
translatable="yes">This option will allow other peers to send IPv6 traffic to
the Internet using your network connection. You should make sure that you have
IPv6-support before enabling this option.</property>
- <property
name="use_action_appearance">False</property>
<property name="xalign">0</property>
<property
name="draw_indicator">True</property>
</object>
@@ -3951,10 +3954,10 @@
<child>
<object class="GtkRadioButton"
id="GNUNET_setup_namestore_sqlite_radiobutton">
<property name="label"
translatable="yes">sqLite</property>
+ <property
name="use_action_appearance">False</property>
<property
name="visible">True</property>
<property
name="can_focus">True</property>
<property
name="receives_default">False</property>
- <property
name="use_action_appearance">False</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property
name="draw_indicator">True</property>
@@ -3970,10 +3973,10 @@
<child>
<object class="GtkRadioButton"
id="GNUNET_setup_namestore_postgres_radiobutton">
<property name="label"
translatable="yes">Postgres</property>
+ <property
name="use_action_appearance">False</property>
<property
name="visible">True</property>
<property
name="can_focus">True</property>
<property
name="receives_default">False</property>
- <property
name="use_action_appearance">False</property>
<property name="xalign">0</property>
<property
name="draw_indicator">True</property>
<property
name="group">GNUNET_setup_namestore_sqlite_radiobutton</property>
@@ -4079,10 +4082,10 @@
<child>
<object class="GtkButton"
id="GNUNET_setup_namestore_postgres_tab_test_button">
<property name="label"
translatable="yes">Test configuration</property>
+ <property
name="use_action_appearance">False</property>
<property
name="visible">True</property>
<property
name="can_focus">True</property>
<property
name="receives_default">True</property>
- <property
name="use_action_appearance">False</property>
<signal name="clicked"
handler="GNUNET_setup_namestore_postgres_tab_test_button_clicked_cb"
swapped="no"/>
</object>
<packing>
@@ -4196,10 +4199,10 @@
<child>
<object class="GtkButton"
id="GNUNET_setup_gns_public_key_copy_button">
<property name="label">gtk-copy</property>
+ <property
name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property
name="receives_default">True</property>
- <property
name="use_action_appearance">False</property>
<property name="use_stock">True</property>
<signal name="clicked"
handler="GNUNET_setup_gns_public_key_copy_button_clicked_cb" swapped="no"/>
</object>
@@ -4270,10 +4273,10 @@
<child>
<object class="GtkRadioButton"
id="GNUNET_setup_gns_master_zone_selection_radiobutton">
<property name="label"
translatable="yes">_Master Zone</property>
+ <property
name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property
name="receives_default">False</property>
- <property
name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
@@ -4289,10 +4292,10 @@
<child>
<object class="GtkRadioButton"
id="GNUNET_setup_gns_private_zone_selection_radiobutton">
<property name="label"
translatable="yes">_Private Zone</property>
+ <property
name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property
name="receives_default">False</property>
- <property
name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
<property
name="group">GNUNET_setup_gns_master_zone_selection_radiobutton</property>
@@ -4308,10 +4311,10 @@
<child>
<object class="GtkRadioButton"
id="GNUNET_setup_gns_shorten_zone_selection_radiobutton">
<property name="label"
translatable="yes">_Shorten Zone</property>
+ <property
name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property
name="receives_default">False</property>
- <property
name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
<property
name="group">GNUNET_setup_gns_master_zone_selection_radiobutton</property>
@@ -4368,10 +4371,10 @@
<child>
<object class="GtkButton"
id="GNUNET_setup_gns_qr_saveas_button">
<property name="label">gtk-save-as</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
<signal name="clicked"
handler="GNUNET_setup_gns_qr_saveas_button_clicked_cb" swapped="no"/>
</object>
@@ -4447,13 +4450,13 @@
<property name="sort_column_id">3</property>
<child>
<object class="GtkCellRendererCombo"
id="GNUNET_setup_gns_type_cellrenderercombo">
- <property name="editable">True</property>
<property
name="model">GNUNET_setup_gns_type_liststore</property>
<property name="text_column">1</property>
<signal name="edited"
handler="GNUNET_setup_gns_type_cellrenderercombo_edited_cb" swapped="no"/>
</object>
<attributes>
<attribute name="visible">10</attribute>
+ <attribute name="editable">10</attribute>
<attribute name="text">3</attribute>
</attributes>
</child>
@@ -4467,14 +4470,11 @@
<property name="clickable">True</property>
<property name="sort_column_id">7</property>
<child>
- <object class="GtkCellRendererText"
id="GNUNET_setup_gns_value_cellrenderertext">
- <signal name="edited"
handler="GNUNET_setup_gns_value_cellrenderertext_edited_cb" swapped="no"/>
- </object>
+ <object class="GtkCellRendererText"
id="GNUNET_setup_gns_value_cellrenderertext"/>
<attributes>
<attribute name="sensitive">11</attribute>
<attribute name="visible">10</attribute>
<attribute name="background">8</attribute>
- <attribute name="editable">11</attribute>
<attribute name="text">7</attribute>
</attributes>
</child>
@@ -4556,11 +4556,11 @@
<child>
<object class="GtkLinkButton" id="GNUNET_setup_help_text">
<property name="label" translatable="yes">Welcome to
gnunet-setup.</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="has_tooltip">True</property>
- <property name="use_action_appearance">False</property>
<property name="relief">none</property>
<property name="uri">https://gnunet.org/gnunet-setup</property>
</object>
@@ -4613,80 +4613,19 @@
<property name="step_increment">1000000</property>
<property name="page_increment">1000000000</property>
</object>
- <object class="GtkMenu" id="GNUNET_setup_gns_delete_popup_menu">
+ <object class="GtkMenu" id="GNUNET_setup_gns_edit_popup_menu">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
- <object class="GtkMenuItem" id="GNUNET_setup_gns_popup_delete_button">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="tooltip_text" translatable="yes">Delete GNS
entry</property>
+ <object class="GtkMenuItem" id="GNUNET_setup_gns_popup_edit_button">
<property name="use_action_appearance">False</property>
- <property name="label" translatable="yes">Delete</property>
- <signal name="activate"
handler="GNUNET_setup_gns_popup_delete_button_activate_cb" swapped="no"/>
- </object>
- </child>
- <child>
- <object class="GtkSeparatorMenuItem" id="GNUNET_GTK_delete_sep">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="use_action_appearance">False</property>
+ <property name="tooltip_text" translatable="yes">Edit GNS
entry</property>
+ <property name="label" translatable="yes">Edit</property>
+ <signal name="activate"
handler="GNUNET_setup_gns_popup_edit_button_activate_cb" swapped="no"/>
</object>
</child>
- <child>
- <object class="GtkMenuItem" id="GNUNET_setup_gns_popup_1d_exp_button">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="use_action_appearance">False</property>
- <property name="label" translatable="yes">1 day</property>
- <signal name="activate"
handler="GNUNET_setup_gns_popup_1d_exp_button_activate_cb" swapped="no"/>
- </object>
- </child>
- <child>
- <object class="GtkMenuItem" id="GNUNET_setup_gns_popup_1w_exp_button">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="use_action_appearance">False</property>
- <property name="label" translatable="yes">1 week</property>
- <signal name="activate"
handler="GNUNET_setup_gns_popup_1w_exp_button_activate_cb" swapped="no"/>
- </object>
- </child>
- <child>
- <object class="GtkMenuItem" id="GNUNET_setup_gns_popup_1y_exp_button">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="use_action_appearance">False</property>
- <property name="label" translatable="yes">1 year</property>
- <signal name="activate"
handler="GNUNET_setup_gns_popup_1y_exp_button_activate_cb" swapped="no"/>
- </object>
- </child>
- <child>
- <object class="GtkMenuItem"
id="GNUNET_setup_gns_popup_forever_exp_button">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="use_action_appearance">False</property>
- <property name="label" translatable="yes">never</property>
- <signal name="activate"
handler="GNUNET_setup_gns_popup_forever_exp_button_activate_cb" swapped="no"/>
- </object>
- </child>
- <child>
- <object class="GtkSeparatorMenuItem" id="<separator2>">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="use_action_appearance">False</property>
- </object>
- </child>
- <child>
- <object class="GtkMenuItem" id="GNUNET_setup_gns_popup_cal_button">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="tooltip_text" translatable="yes">Pick expiration date
from calendar</property>
- <property name="use_action_appearance">False</property>
- <property name="label" translatable="yes">Calendar</property>
- <property name="use_underline">True</property>
- <signal name="activate"
handler="GNUNET_setup_gns_popup_cal_button_activate_cb" swapped="no"/>
- </object>
- </child>
</object>
<object class="GtkListStore" id="GNUNET_setup_gns_exit_dialog_liststore">
<columns>
Modified: gnunet-gtk/src/setup/gnunet-setup-gns.c
===================================================================
--- gnunet-gtk/src/setup/gnunet-setup-gns.c 2012-12-02 14:57:05 UTC (rev
25177)
+++ gnunet-gtk/src/setup/gnunet-setup-gns.c 2012-12-03 08:22:56 UTC (rev
25178)
@@ -201,7 +201,107 @@
};
+
+
/**
+ * Context we use for making changes to the namestore.
+ * (closure for 'add_new_records_after_removing_old_records').
+ */
+struct UpdateContext
+{
+
+ /**
+ * Kept in a DLL.
+ */
+ struct UpdateContext *next;
+
+ /**
+ * Kept in a DLL.
+ */
+ struct UpdateContext *prev;
+
+ /**
+ * Array of records to add.
+ */
+ struct GNUNET_NAMESTORE_RecordData *rd;
+
+ /**
+ * Name under which we should add the records.
+ */
+ char *name;
+
+ /**
+ * Associated namestore operation.
+ */
+ struct GNUNET_NAMESTORE_QueueEntry *qe;
+
+ /**
+ * Size of the 'rd' array.
+ */
+ unsigned int rd_count;
+
+ /**
+ * Current position for record creation.
+ */
+ unsigned int rd_pos;
+};
+
+
+/**
+ * Closure for 'check_name_validity_and_remove_proc'.
+ */
+struct RemoveContext
+{
+
+ /**
+ * Kept in a DLL.
+ */
+ struct RemoveContext *next;
+
+ /**
+ * Kept in a DLL.
+ */
+ struct RemoveContext *prev;
+
+ /**
+ * Associated namestore operation.
+ */
+ struct GNUNET_NAMESTORE_QueueEntry *qe;
+
+ /**
+ * Path for 'gtk_tree_model_get_iter_from_string' for removing
+ * the record from the tree view IF the operation was successful.
+ * FIXME: replace with a 'GtkTreeIter'?
+ */
+ char *path;
+};
+
+
+/**
+ * Handle created for pseudonym-operations.
+ */
+struct PseuContext
+{
+
+ /**
+ * Kept in a DLL.
+ */
+ struct PseuContext *next;
+
+ /**
+ * Kept in a DLL.
+ */
+ struct PseuContext *prev;
+
+ /**
+ * Associated namestore operation.
+ */
+ struct GNUNET_NAMESTORE_QueueEntry *qe;
+
+};
+
+
+/**
* Head of linked list of active zone operations.
*/
static struct ZoneIteration_Context *zc_head;
@@ -212,6 +312,36 @@
static struct ZoneIteration_Context *zc_tail;
/**
+ * Head of linked list of active update operations.
+ */
+static struct UpdateContext *uc_head;
+
+/**
+ * Tail of linked list of active update operations.
+ */
+static struct UpdateContext *uc_tail;
+
+/**
+ * Head of linked list of active remove operations.
+ */
+static struct RemoveContext *rc_head;
+
+/**
+ * Tail of linked list of active remove operations.
+ */
+static struct RemoveContext *rc_tail;
+
+/**
+ * Head of linked list of active pseudonym operations.
+ */
+static struct PseuContext *pc_head;
+
+/**
+ * Tail of linked list of active pseudonym operations.
+ */
+static struct PseuContext *pc_tail;
+
+/**
* Name of our zone as a string.
*/
static char *zone_as_string;
@@ -256,7 +386,20 @@
*/
static char *current_pseudonym;
+/**
+ * Pointer to 'short', 'private' or empty string, depending on
+ * which zone we are editing right now.
+ */
+static const char *current_zone_name;
+/**
+ * Pointer to name of the configuration option that gives the
+ * zone key for the zone we are editing right now.
+ */
+static const char *current_zone_option;
+
+
+
#if HAVE_QRENCODE_H
#include <qrencode.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
@@ -379,30 +522,115 @@
/**
- * Context we use for making changes to the namestore.
- * (closure for 'add_new_records_after_removing_old_records').
+ * Function called upon completion of the qr-code 'save as' dialog.
+ *
+ * @param dialog the dialog
+ * @param response_id reason for the dialog closing
+ * @param user_data the 'GtkBuilder' we used to create the dialog
*/
-struct UpdateContext
+void
+GNUNET_setup_qr_save_as_dialog_response_cb (GtkDialog *dialog,
+ gint response_id,
+ gpointer user_data)
{
+#if HAVE_QRENCODE_H
+ GtkBuilder *builder = user_data;
+ GdkPixbuf *pb;
+ char *filename;
- /**
- * Array of records to add.
- */
- struct GNUNET_NAMESTORE_RecordData *rd;
+ if (GTK_RESPONSE_OK != response_id)
+ {
+ gtk_widget_destroy (GTK_WIDGET (dialog));
+ g_object_unref (G_OBJECT (builder));
+ return;
+ }
+ filename =
+ GNUNET_GTK_filechooser_get_filename_utf8 (GTK_FILE_CHOOSER (dialog));
+ pb = create_qrcode (8);
+ if (NULL == pb)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING, _("Failed to initialize QR-code
pixbuf"));
+ return;
+ }
+ gdk_pixbuf_save (pb,
+ filename,
+ "png",
+ NULL, NULL);
+ g_free (filename);
+ g_object_unref (pb);
+ gtk_widget_destroy (GTK_WIDGET (dialog));
+ g_object_unref (G_OBJECT (builder));
+#else
+ GNUNET_break (0);
+#endif
+}
- /**
- * Name under which we should add the records.
- */
- char * name;
- /**
- * Size of the 'rd' array.
- */
- unsigned int rd_count;
-};
+/**
+ * User clicked on 'save as' to extract the QR code. Open 'save as'
+ * dialog to get the desired filename and file type.
+ */
+void
+GNUNET_setup_gns_qr_saveas_button_clicked_cb (GtkButton *button,
+ gpointer user_data)
+{
+ GtkBuilder *builder;
+ GtkWindow *dialog;
+ const gchar *pseu;
+ GtkEntry *entry;
+ char *suggestion;
+ entry = GTK_ENTRY (GNUNET_SETUP_get_object ("GNUNET_setup_gns_pseu_entry"));
+ pseu = gtk_entry_get_text (GTK_ENTRY(entry));
+ builder =
+ GNUNET_GTK_get_new_builder ("gnunet_setup_qr_save_as_dialog.glade",
+ NULL);
+ if (NULL == builder)
+ {
+ GNUNET_break (0);
+ return;
+ }
+ GNUNET_asprintf (&suggestion,
+ "%s.png",
+ pseu);
+ dialog = GTK_WINDOW (gtk_builder_get_object
+ (builder, "GNUNET_setup_qr_save_as_dialog"));
+ gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog),
+ suggestion);
+ GNUNET_free (suggestion);
+ gtk_window_present (dialog);
+}
+
/**
+ * Load a particular zone into the main tree view.
+ *
+ * @param zonename name of the option in the configuration file
+ * with the name of the file with the private key of the
+ * zone to load
+ * @param default_pseu default pseudonym to use
+ */
+static void
+load_zone (const char *zonename,
+ const char *default_pseu);
+
+
+/**
+ * Our model is somehow are inconsistent with the namestore database.
+ * Clear our model and resync by loading all of it from the namestore.
+ * (Naturally, this should never happen in normal operation; however,
+ * if multiple users edit the same namestore, it might happen without
+ * there being a bug ...).
+ */
+static void
+resync_db ()
+{
+ load_zone (current_zone_option,
+ current_zone_name);
+}
+
+
+/**
* Display an error message for the user.
*
* @param title title of the error message
@@ -430,6 +658,99 @@
/**
+ * Release resources of this update context.
+ *
+ * @param uc context to free
+ */
+static void
+free_update_context (struct UpdateContext *uc)
+{
+ unsigned int c;
+
+ if (NULL != uc->qe)
+ {
+ GNUNET_NAMESTORE_cancel (uc->qe);
+ uc->qe = NULL;
+ }
+ GNUNET_CONTAINER_DLL_remove (uc_head, uc_tail, uc);
+ for (c = 0; c < uc->rd_count; c++)
+ GNUNET_free ((void *) uc->rd[c].data);
+ GNUNET_free (uc->rd);
+ GNUNET_free (uc->name);
+ GNUNET_free (uc);
+}
+
+
+/**
+ * Function called to transmit the next record from this update context
+ * to the database.
+ *
+ * @param uc update context
+ */
+static void
+create_next_record (struct UpdateContext *uc);
+
+
+/**
+ * Function called after we created a new record. If the creation was
+ * successful, add more records from the update context.
+ *
+ * @param cls the 'struct UpdateContext'
+ * @param success GNUNET_SYSERR on failure (including timeout/queue
drop/failure to validate)
+ * GNUNET_NO if content was already there or not found
+ * GNUNET_YES (or other positive value) on success
+ * @param emsg NULL on success, otherwise an error message
+ */
+static void
+create_more_records (void *cls,
+ int32_t success,
+ const char *emsg)
+{
+ struct UpdateContext *uc = cls;
+
+ uc->qe = NULL;
+ switch (success)
+ {
+ case GNUNET_OK:
+ uc->rd_pos++;
+ create_next_record (uc);
+ return;
+ case GNUNET_NO:
+ case GNUNET_SYSERR:
+ show_error_message (_("Failed to create record"),
+ emsg);
+ resync_db ();
+ break;
+ default:
+ GNUNET_break (0);
+ break;
+ }
+ free_update_context (uc);
+}
+
+
+
+/**
+ * Function called to transmit the next record from this update context
+ * to the database.
+ *
+ * @param uc update context
+ */
+static void
+create_next_record (struct UpdateContext *uc)
+{
+ if (uc->rd_pos == uc->rd_count)
+ {
+ free_update_context (uc);
+ return;
+ }
+ uc->qe = GNUNET_NAMESTORE_record_create (namestore, pkey,
+ uc->name, &uc->rd[uc->rd_pos],
+ &create_more_records, uc);
+}
+
+
+/**
* Function called after we removed the old record. If the
* removal was successful, add the new records from the
* update context.
@@ -445,50 +766,42 @@
int32_t success,
const char *emsg)
{
- struct UpdateContext * uc = cls;
- unsigned int c;
+ struct UpdateContext *uc = cls;
+ uc->qe = NULL;
switch (success)
{
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],
- NULL, NULL);
- break;
+ create_next_record (uc);
+ return;
case GNUNET_SYSERR:
show_error_message (_("Failed to remove record"),
emsg);
+ resync_db ();
break;
default:
GNUNET_break (0);
+ resync_db ();
break;
}
- for (c = 0; c < uc->rd_count; c++)
- GNUNET_free ((void *) uc->rd[c].data);
- GNUNET_free (uc->rd);
- GNUNET_free (uc->name);
- GNUNET_free (uc);
+ free_update_context (uc);
}
/**
* Check that the data at the given 'path' (see
gtk_tree_model_get_iter_from_string)
- * is valid and if so commit it after removing the old data.
+ * is valid, and if so commit it after removing the old data.
*
- * @param path path identifying the new record (FIXME: use GtkTreeIter
instead!?)
+ * @param it iter identifying the new record
* @param oldname name of the old record, NULL if this is a fresh name
*/
static void
-check_name_validity_and_commit (const gchar *path, const char * oldname)
+check_name_validity_and_commit (GtkTreeIter *it,
+ const char *oldname)
{
- GtkTreeIter it;
GtkTreeIter parent; /* parent record with the 'name' */
- char * name; /* name of the records */
+ char *name; /* name of the records */
struct GNUNET_NAMESTORE_RecordData *rd;
unsigned int records; /* number of records in 'rd' */
int children; /* number of records below 'parent' */
@@ -496,14 +809,13 @@
struct UpdateContext * uc;
int c;
- gtk_tree_model_get_iter_from_string(tm, &it, path);
- if (! gtk_tree_model_iter_parent (tm, &parent, &it))
+ if (! gtk_tree_model_iter_parent (tm, &parent, it))
{
if (NULL != oldname)
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Name of existing record `%s' was changed, moving associated
records\n",
oldname);
- parent = it;
+ parent = *it;
}
gtk_tree_model_get (tm, &parent,
GNS_TREESTORE_COL_NAME, &name,
@@ -531,7 +843,7 @@
}
rd = GNUNET_malloc (records * sizeof (struct GNUNET_NAMESTORE_RecordData));
- GNUNET_assert (gtk_tree_model_iter_children (tm, &it, &parent));
+ GNUNET_assert (gtk_tree_model_iter_children (tm, it, &parent));
for (c = 0; c < children; c++)
{
@@ -544,7 +856,7 @@
void * data;
size_t data_size;
- gtk_tree_model_get (tm, &it,
+ gtk_tree_model_get (tm, it,
GNS_TREESTORE_COL_NAME, &n_name,
GNS_TREESTORE_COL_RECORD_TYPE, &n_type,
GNS_TREESTORE_COL_IS_PUBLIC, &n_public,
@@ -581,13 +893,13 @@
}
g_free (n_name);
g_free (n_value);
- GNUNET_assert (gtk_tree_model_iter_next (tm, &it) ^ (c + 1 == children));
+ GNUNET_assert (gtk_tree_model_iter_next (tm, it) ^ (c + 1 == children));
}
if (GNUNET_YES == append_pseu)
{
- GtkEntry * entry;
- const gchar * pseu;
+ GtkEntry *entry;
+ const gchar *pseu;
/* Append PSEU record */
GNUNET_assert (children == (records -1));
@@ -632,30 +944,44 @@
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,
- NULL,
- &add_new_records_after_removing_old_records,
uc);
+ GNUNET_CONTAINER_DLL_insert (uc_head, uc_tail, uc);
+ uc->qe = GNUNET_NAMESTORE_record_remove (namestore,
+ pkey,
+ (NULL != oldname) ? oldname : name,
+ NULL,
+
&add_new_records_after_removing_old_records, uc);
+ if (NULL == uc->qe)
+ {
+ show_error_message (_("Failed to commit record to database"),
+ _("Internal error"));
+ resync_db ();
+ free_update_context (uc);
+ return;
+ }
}
/**
- * Closure for 'check_name_validity_and_remove_proc'.
+ * Release resources of the given remove context.
+ *
+ * @param rc remove context to release
*/
-struct RemoveContext
+static void
+free_remove_context (struct RemoveContext *rc)
{
+ if (NULL != rc->qe)
+ {
+ GNUNET_NAMESTORE_cancel (rc->qe);
+ rc->qe = NULL;
+ }
+ GNUNET_CONTAINER_DLL_remove (rc_head,
+ rc_tail,
+ rc);
+ GNUNET_free (rc->path);
+ GNUNET_free (rc);
+}
- /**
- * Path for 'gtk_tree_model_get_iter_from_string' for removing
- * the record from the tree view IF the operation was successful.
- * FIXME: replace with a 'GtkTreeIter'?
- */
- char *path;
-};
-
/**
* We tried to remove a record from the namestore, if we were
* successful, also remove it from the model.
@@ -671,75 +997,77 @@
int32_t success,
const char *emsg)
{
- struct RemoveContext *rcc = cls;
+ struct RemoveContext *rc = cls;
GtkTreeIter it;
+ rc->qe = NULL;
switch (success)
{
case GNUNET_YES:
case GNUNET_NO:
- gtk_tree_model_get_iter_from_string(tm, &it, rcc->path);
+ gtk_tree_model_get_iter_from_string(tm, &it, rc->path);
gtk_tree_store_remove (ts, &it);
break;
case GNUNET_SYSERR:
show_error_message (_("Failed to remove record"),
emsg);
+ resync_db ();
break;
default:
GNUNET_break (0);
break;
}
- GNUNET_free (rcc->path);
- GNUNET_free (rcc);
+ free_remove_context (rc);
}
/**
- * FIXME...
+ * Remove a record from the model (and if it is valid, also from
+ * the namestore). If the given path identifies an entire 'name',
+ * remove all records under that name.
*
- * @param path
+ * @param path identifying record(s) to remove
*/
static void
-check_name_validity_and_remove (const gchar *path)
+remove_records_by_path (const gchar *path)
{
GtkTreeIter it;
GtkTreeIter parent;
char *name;
int valid = GNUNET_YES;
struct GNUNET_NAMESTORE_RecordData rd;
- struct RemoveContext *rcc;
- char *n_name;
- int n_type;
- gboolean n_public;
- char *n_exp_color;
- guint64 n_exp_time;
- char *n_exp_str;
- gboolean n_is_relative;
- char *n_value;
- char *n_value_color;
+ struct RemoveContext *rc;
+ char *n_name;
+ int n_type;
+ gboolean n_public;
+ char *n_exp_color;
+ guint64 n_exp_time;
+ char *n_exp_str;
+ gboolean n_is_relative;
+ char *n_value;
+ char *n_value_color;
- gtk_tree_model_get_iter_from_string(tm, &it, path);
- gtk_tree_model_get(tm, &it,
- GNS_TREESTORE_COL_NAME, &name,
- -1);
+ gtk_tree_model_get_iter_from_string (tm, &it, path);
+ gtk_tree_model_get (tm, &it,
+ GNS_TREESTORE_COL_NAME, &name,
+ -1);
if (gtk_tree_model_iter_parent (tm, &parent, &it))
{
/* Removing a single record */
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Removing single record for name `%s'\n", name);
-
- gtk_tree_model_get(tm, &it,
- GNS_TREESTORE_COL_NAME, &n_name,
- GNS_TREESTORE_COL_RECORD_TYPE, &n_type,
- GNS_TREESTORE_COL_IS_PUBLIC, &n_public,
- GNS_TREESTORE_COL_EXP_TIME_COLOR, &n_exp_color,
- GNS_TREESTORE_COL_EXP_TIME, &n_exp_time,
- GNS_TREESTORE_COL_EXP_TIME_IS_REL, &n_is_relative,
- GNS_TREESTORE_COL_EXP_TIME_AS_STR, &n_exp_str,
- GNS_TREESTORE_COL_VAL_AS_STR, &n_value,
- GNS_TREESTORE_COL_VAL_COLOR, &n_value_color,
- -1);
-
+ gtk_tree_model_get (tm, &it,
+ GNS_TREESTORE_COL_NAME, &n_name,
+ GNS_TREESTORE_COL_RECORD_TYPE, &n_type,
+ GNS_TREESTORE_COL_IS_PUBLIC, &n_public,
+ GNS_TREESTORE_COL_EXP_TIME_COLOR, &n_exp_color,
+ GNS_TREESTORE_COL_EXP_TIME, &n_exp_time,
+ GNS_TREESTORE_COL_EXP_TIME_IS_REL, &n_is_relative,
+ GNS_TREESTORE_COL_EXP_TIME_AS_STR, &n_exp_str,
+ GNS_TREESTORE_COL_VAL_AS_STR, &n_value,
+ GNS_TREESTORE_COL_VAL_COLOR, &n_value_color,
+ -1);
+
/* valid name */
if (NULL == n_name)
valid = GNUNET_NO;
@@ -749,12 +1077,15 @@
valid = GNUNET_NO;
/* valid expiration */
- if ((n_exp_color != NULL) || (NULL == n_exp_str) || (0 == n_exp_time))
- valid = GNUNET_NO;
+ if ( (NULL != n_exp_color) ||
+ (NULL == n_exp_str) ||
+ (0 == n_exp_time) )
+ valid = GNUNET_NO;
/* valid value */
- if ((n_value_color != NULL) || (NULL == n_value))
- valid = GNUNET_NO;
+ if ( (NULL != n_value_color) ||
+ (NULL == n_value) )
+ valid = GNUNET_NO;
if (GNUNET_YES == valid)
{
@@ -769,11 +1100,10 @@
GNUNET_NAMESTORE_string_to_value (n_type, n_value,
(void**)&rd.data, &rd.data_size);
- 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);
+ rc = GNUNET_malloc (sizeof (struct RemoveContext));
+ rc->path = strdup (path);
+ rc->qe = GNUNET_NAMESTORE_record_remove (namestore, pkey, name, &rd,
+ &update_treemodel_after_remove,
rc);
GNUNET_free ((void *) rd.data);
}
else
@@ -790,11 +1120,10 @@
else if (0 != strcmp (name, ROOT_STR))
{
/* 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);
+ rc = GNUNET_malloc(sizeof (struct RemoveContext));
+ rc->path = strdup (path);
+ rc->qe = GNUNET_NAMESTORE_record_remove (namestore, pkey, name, NULL,
+ &update_treemodel_after_remove,
rc);
}
g_free (name);
}
@@ -838,12 +1167,12 @@
return;
}
/* check if this is a new record */
- gtk_tree_model_get_iter_from_string(tm, &it, path);
- gtk_tree_model_get(tm, &it,
- GNS_TREESTORE_COL_NOT_DUMMY_ROW, ¬_dummy_row,
- GNS_TREESTORE_COL_NAME, &name_str,
- GNS_TREESTORE_COL_VAL_AS_STR, &value_str,
- -1);
+ gtk_tree_model_get_iter_from_string (tm, &it, path);
+ gtk_tree_model_get (tm, &it,
+ GNS_TREESTORE_COL_NOT_DUMMY_ROW, ¬_dummy_row,
+ GNS_TREESTORE_COL_NAME, &name_str,
+ GNS_TREESTORE_COL_VAL_AS_STR, &value_str,
+ -1);
is_valid = GNUNET_NO;
if ( (NULL != value_str) &&
(GNUNET_OK == GNUNET_NAMESTORE_string_to_value (type,
@@ -857,11 +1186,11 @@
if (not_dummy_row)
{
/* Updating an existing record */
- gtk_tree_store_set(ts, &it,
- GNS_TREESTORE_COL_RECORD_TYPE, type,
- GNS_TREESTORE_COL_RECORD_TYPE_AS_STR, new_text,
- GNS_TREESTORE_COL_VAL_COLOR, (GNUNET_NO == is_valid) ?
"red" : NULL,
- -1);
+ gtk_tree_store_set (ts, &it,
+ GNS_TREESTORE_COL_RECORD_TYPE, type,
+ GNS_TREESTORE_COL_RECORD_TYPE_AS_STR, new_text,
+ GNS_TREESTORE_COL_VAL_COLOR, (GNUNET_NO == is_valid) ?
"red" : NULL,
+ -1);
}
else if ((NULL != name_str) && (0 != strcmp (NEW_NAME_STR, name_str)))
{
@@ -897,7 +1226,7 @@
}
GNUNET_free_non_null (value_str);
GNUNET_free_non_null (name_str);
- check_name_validity_and_commit (path, NULL);
+ check_name_validity_and_commit (&it, NULL);
}
@@ -920,7 +1249,7 @@
gtk_tree_model_get_iter_from_string (tm, &it, path);
gtk_tree_model_get (tm, &it, GNS_TREESTORE_COL_IS_PUBLIC, &value, -1);
gtk_tree_store_set (ts, &it, GNS_TREESTORE_COL_IS_PUBLIC, !value, -1);
- check_name_validity_and_commit (path, NULL);
+ check_name_validity_and_commit (&it, NULL);
}
@@ -958,7 +1287,7 @@
GNS_TREESTORE_COL_EXP_TIME_IS_REL, FALSE,
GNS_TREESTORE_COL_EXP_TIME_COLOR, NULL,
-1);
- check_name_validity_and_commit (path, NULL);
+ check_name_validity_and_commit (&it, NULL);
return;
}
if (GNUNET_OK ==
@@ -971,76 +1300,15 @@
GNS_TREESTORE_COL_EXP_TIME_IS_REL, TRUE,
GNS_TREESTORE_COL_EXP_TIME_COLOR, NULL,
-1);
- check_name_validity_and_commit (path, NULL);
+ check_name_validity_and_commit (&it, NULL);
return;
}
- gtk_tree_store_set (ts, &it,
- GNS_TREESTORE_COL_EXP_TIME_AS_STR, new_text,
- GNS_TREESTORE_COL_EXP_TIME_COLOR, "red",
- GNS_TREESTORE_COL_EXP_TIME, 0,
- -1);
+ show_error_message (_("Invalid time value"),
+ new_text);
}
/**
- * The user has edited a 'value' cell. Update the model,
- * including the status on the consistency of the value with
- * the type.
- *
- * @param renderer updated renderer
- * @param path the path identifying the edited cell
- * @param new_text the new value
- * @param user_data unused
- */
-void
-GNUNET_setup_gns_value_cellrenderertext_edited_cb (GtkCellRendererText
*renderer,
- gchar *path,
- gchar *new_text,
- gpointer user_data)
-{
- GtkTreeModel *tm = GTK_TREE_MODEL(ts);
- GtkTreeIter it;
- size_t data_size;
- void * data;
- int type;
- gchar * old_value;
-
- if (0 != strcmp(new_text,""))
- {
- gtk_tree_model_get_iter_from_string(tm, &it, path);
- gtk_tree_model_get(tm, &it,
- GNS_TREESTORE_COL_RECORD_TYPE, &type,
- GNS_TREESTORE_COL_VAL_AS_STR, &old_value,
- -1);
-
- if (old_value != NULL)
- {
- if (0 == strcmp(new_text, old_value))
- {
- GNUNET_free (old_value);
- return;
- }
- GNUNET_free (old_value);
- }
- if (GNUNET_OK == GNUNET_NAMESTORE_string_to_value (type,
- new_text,
- &data,
- &data_size))
- {
- gtk_tree_store_set (ts, &it, GNS_TREESTORE_COL_VAL_COLOR, NULL, -1);
- gtk_tree_store_set (ts, &it, GNS_TREESTORE_COL_VAL_AS_STR, new_text, -1);
- check_name_validity_and_commit (path, NULL);
- }
- else
- {
- gtk_tree_store_set (ts, &it, GNS_TREESTORE_COL_VAL_COLOR, "red", -1);
- gtk_tree_store_set (ts, &it, GNS_TREESTORE_COL_VAL_AS_STR, new_text, -1);
- }
- }
-}
-
-
-/**
* The user has edited a 'name' cell. Update the model (and if needed
* create another fresh line for additional records).
*
@@ -1060,7 +1328,9 @@
gboolean not_dummy;
char *name;
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "New text for `%s' is `%s'\n", path,
new_text);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "New text for `%s' is `%s'\n",
+ path, new_text);
if ((0 == strcmp (new_text, NEW_NAME_STR)) || (0 == strcmp (new_text, "")))
return;
if (GNUNET_OK !=
@@ -1072,14 +1342,12 @@
gdk_beep ();
return;
}
-
+ gtk_tree_model_get_iter_from_string (tm, &it, path);
+ gtk_tree_model_get (tm, &it,
+ GNS_TREESTORE_COL_NOT_DUMMY_ROW, ¬_dummy,
+ GNS_TREESTORE_COL_NAME, &name,
+ -1);
- gtk_tree_model_get_iter_from_string(tm, &it, path);
- gtk_tree_model_get(tm, &it,
- GNS_TREESTORE_COL_NOT_DUMMY_ROW, ¬_dummy,
- GNS_TREESTORE_COL_NAME, &name,
- -1);
-
if (! not_dummy)
{
/* change dummy line to new name, then add new dummy */
@@ -1091,7 +1359,8 @@
GNS_TREESTORE_COL_NOT_DUMMY_ROW, FALSE,
GNS_TREESTORE_COL_IS_RECORD_ROW, TRUE,
-1);
- check_name_validity_and_commit (gtk_tree_model_get_string_from_iter(tm,
&it), name);
+ check_name_validity_and_commit (&it,
+ name);
if (0 == strcmp (name, _(NEW_NAME_STR)))
{
/* add a new dummy line */
@@ -1123,7 +1392,7 @@
while (gtk_tree_model_iter_next (tm, &child));
}
- check_name_validity_and_commit (gtk_tree_model_get_string_from_iter(tm,
&it), name);
+ check_name_validity_and_commit (&it, name);
}
if (GNUNET_SYSERR == GNUNET_DNSPARSER_check_label (new_text))
@@ -1154,27 +1423,19 @@
GtkTreeIter it;
GtkMenu *popup;
GtkTreeSelection * ts;
- gboolean not_dummy;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Considering creating popup menu...\n");
- ts = gtk_tree_view_get_selection(tv);
+ ts = gtk_tree_view_get_selection (tv);
if (! gtk_tree_selection_get_selected (ts, &tm, &it))
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"No row selected\n");
return FALSE;
}
- gtk_tree_model_get(tm, &it, GNS_TREESTORE_COL_NOT_DUMMY_ROW, ¬_dummy, -1);
- if (! not_dummy)
- {
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Dummy row selected\n");
- return FALSE;
- }
popup = GTK_MENU (GNUNET_SETUP_get_object
("GNUNET_setup_gns_delete_popup_menu"));
gtk_widget_show_all (GTK_WIDGET(popup));
- gtk_menu_popup(popup, NULL, NULL, NULL, NULL, 0, 0);
+ gtk_menu_popup (popup, NULL, NULL, NULL, NULL, 0, 0);
return TRUE;
}
@@ -1216,108 +1477,27 @@
if (GNUNET_NO == not_dummy)
return; /* do not delete the dummy line */
path = gtk_tree_model_get_string_from_iter (tm, &it);
- check_name_validity_and_remove (path);
+ remove_records_by_path (path);
g_free (path);
}
/**
- * User selected 'delete' in the popup menu. Delete the
+ * User selected 'edit' in the popup menu. Edit the
* selected row.
- */
-void
-GNUNET_setup_gns_popup_delete_button_activate_cb (GtkWidget *widget,
- gpointer user_data)
-{
- delete_selected_row ();
-}
-
-
-/**
- * Set the expiration time of the selected row to the given value.
*
- * @param reltime relative expiration time to use
- */
-static void
-set_relative_expiration_time (struct GNUNET_TIME_Relative reltime)
-{
- GtkTreeIter it;
- GtkTreeIter parent;
- GtkCellRendererText *renderer;
- GtkTreeSelection * ts;
- gboolean has_parent;
- char *path;
- const char *tstr;
- int not_dummy;
-
- ts = gtk_tree_view_get_selection(tv);
- if (! gtk_tree_selection_get_selected (ts, &tm, &it))
- return;
- gtk_tree_model_get (tm, &it, GNS_TREESTORE_COL_NOT_DUMMY_ROW, ¬_dummy,
-1);
- if (GNUNET_NO == not_dummy)
- return;
-
- /* Has parent? */
- has_parent = gtk_tree_model_iter_parent (tm, &parent, &it);
- if (FALSE == has_parent)
- return;
- /* this is a single record */
- renderer = GTK_CELL_RENDERER_TEXT((GNUNET_SETUP_get_object
("GNUNET_setup_gns_name_cellrenderertext")));
- path = gtk_tree_model_get_string_from_iter (tm, &it);
- tstr = GNUNET_STRINGS_relative_time_to_string (reltime, GNUNET_NO);
- GNUNET_setup_gns_expiration_cellrenderertext_edited_cb (renderer,
- path,
- (gchar *) tstr,
- NULL);
-}
-
-
-/**
- *
+ * @param widget the GtkTreeView
+ * @param user_data main window builder
*/
void
-GNUNET_setup_gns_popup_1d_exp_button_activate_cb (GtkWidget *widget,
- gpointer user_data)
+GNUNET_setup_gns_popup_edit_button_activate_cb (GtkWidget *widget,
+ gpointer user_data)
{
- set_relative_expiration_time (GNUNET_TIME_UNIT_DAYS);
+ // FIXME: create dialog to edit_selected_row ();
}
/**
- *
- */
-void
-GNUNET_setup_gns_popup_1w_exp_button_activate_cb (GtkWidget *widget,
- gpointer user_data)
-{
- set_relative_expiration_time (GNUNET_TIME_UNIT_WEEKS);
-}
-
-
-/**
- *
- */
-void
-GNUNET_setup_gns_popup_1y_exp_button_activate_cb (GtkWidget *widget,
- gpointer user_data)
-{
- set_relative_expiration_time (GNUNET_TIME_UNIT_YEARS);
-}
-
-
-/**
- *
- */
-void
-GNUNET_setup_gns_popup_forever_exp_button_activate_cb (GtkWidget *widget,
- gpointer user_data)
-{
- set_relative_expiration_time (GNUNET_TIME_UNIT_FOREVER_REL);
-}
-
-
-
-/**
* Function called upon completion of the calendar dialog.
*
* @param dialog the dialog
@@ -1472,7 +1652,8 @@
/* Check for right click*/
if (NULL == widget)
return FALSE;
- if ( (GDK_BUTTON_PRESS == event->type) && (3 == event->button) )
+ if ( (GDK_BUTTON_PRESS == event->type) &&
+ (3 == event->button) )
return create_popup_menu ();
return FALSE;
}
@@ -1488,7 +1669,8 @@
gpointer user_data)
{
/* Check for delete key */
- if ((event->type == GDK_KEY_PRESS) && (GDK_KEY_Delete == event->keyval))
+ if ( (GDK_KEY_PRESS == event->type) &&
+ (GDK_KEY_Delete == event->keyval) )
{
delete_selected_row ();
return TRUE;
@@ -1498,100 +1680,27 @@
/**
- * Function called upon completion of the qr-code 'save as' dialog.
+ * Function called upon completion of a 'pseu' operation.
*
- * @param dialog the dialog
- * @param response_id reason for the dialog closing
- * @param user_data the 'GtkBuilder' we used to create the dialog
+ * @param cls the 'struct PseuContext' of the operation that completed
+ * @param success GNUNET_OK if the operation succeeded
+ * @param emsg error message if the operation failed
*/
-void
-GNUNET_setup_qr_save_as_dialog_response_cb (GtkDialog *dialog,
- gint response_id,
- gpointer user_data)
-{
-#if HAVE_QRENCODE_H
- GtkBuilder *builder = user_data;
- GdkPixbuf *pb;
- char *filename;
-
- if (GTK_RESPONSE_OK != response_id)
- {
- gtk_widget_destroy (GTK_WIDGET (dialog));
- g_object_unref (G_OBJECT (builder));
- return;
- }
- filename =
- GNUNET_GTK_filechooser_get_filename_utf8 (GTK_FILE_CHOOSER (dialog));
- pb = create_qrcode (8);
- if (NULL == pb)
- {
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING, _("Failed to initialize QR-code
pixbuf"));
- return;
- }
- gdk_pixbuf_save (pb,
- filename,
- "png",
- NULL, NULL);
- g_free (filename);
- g_object_unref (pb);
- gtk_widget_destroy (GTK_WIDGET (dialog));
- g_object_unref (G_OBJECT (builder));
-#else
- GNUNET_break (0);
-#endif
-}
-
-
-/**
- * User clicked on 'save as' to extract the QR code. Open 'save as'
- * dialog to get the desired filename and file type.
- */
-void
-GNUNET_setup_gns_qr_saveas_button_clicked_cb (GtkButton *button,
- gpointer user_data)
-{
- GtkBuilder *builder;
- GtkWindow *dialog;
- const gchar *pseu;
- GtkEntry *entry;
- char *suggestion;
-
- entry = GTK_ENTRY (GNUNET_SETUP_get_object ("GNUNET_setup_gns_pseu_entry"));
- pseu = gtk_entry_get_text (GTK_ENTRY(entry));
- builder =
- GNUNET_GTK_get_new_builder ("gnunet_setup_qr_save_as_dialog.glade",
- NULL);
- if (NULL == builder)
- {
- GNUNET_break (0);
- return;
- }
- GNUNET_asprintf (&suggestion,
- "%s.png",
- pseu);
- dialog = GTK_WINDOW (gtk_builder_get_object
- (builder, "GNUNET_setup_qr_save_as_dialog"));
- gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog),
- suggestion);
- GNUNET_free (suggestion);
- gtk_window_present (dialog);
-}
-
-
-/**
- *
- */
static void
pseu_change_cont (void *cls,
int32_t success,
const char *emsg)
{
+ struct PseuContext *pc = cls;
GtkWidget *dialog;
-
+ GtkWindow *main_window;
+
+ pc->qe = NULL;
+ GNUNET_CONTAINER_DLL_remove (pc_head,
+ pc_tail,
+ pc);
if (GNUNET_SYSERR == success)
{
- GtkWindow *main_window;
-
main_window = GTK_WINDOW (GNUNET_SETUP_get_object ("GNUNET_setup_dialog"));
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("New Pseudonym could not be set:
`%s'\n"), emsg);
dialog = gtk_message_dialog_new (main_window,
@@ -1604,6 +1713,7 @@
G_CALLBACK (gtk_widget_destroy),
dialog);
gtk_widget_show_all (dialog);
+ resync_db ();
}
}
@@ -1621,6 +1731,7 @@
{
struct GNUNET_NAMESTORE_RecordData rd;
const gchar *pseu;
+ struct PseuContext *pc;
pseu = gtk_entry_get_text (GTK_ENTRY (editable));
if (GNUNET_OK !=
@@ -1642,10 +1753,11 @@
rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY;
rd.data_size = strlen (pseu) + 1;
rd.data = 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);
+ pc = GNUNET_malloc (sizeof (struct PseuContext));
+ GNUNET_CONTAINER_DLL_insert (pc_head, pc_tail, pc);
+ pc->qe = GNUNET_NAMESTORE_record_create (namestore, pkey, "+",
+ &rd,
+ &pseu_change_cont, pc);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"New Pseudonym is `%s' %u\n",
(char *) rd.data, rd.data_size);
@@ -1659,10 +1771,11 @@
rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY;
rd.data_size = strlen (current_pseudonym) + 1;
rd.data = current_pseudonym;
- // FIXME: need to keep 'struct GNUNET_NAMESTORE_QueueEntry' around (to
cancel on disconnect...)
- GNUNET_NAMESTORE_record_remove (namestore, pkey, "+",
- &rd,
- &pseu_change_cont, NULL);
+ pc = GNUNET_malloc (sizeof (struct PseuContext));
+ GNUNET_CONTAINER_DLL_insert (pc_head, pc_tail, pc);
+ pc->qe = GNUNET_NAMESTORE_record_remove (namestore, pkey, "+",
+ &rd,
+ &pseu_change_cont, pc);
gtk_entry_set_text (GTK_ENTRY(editable), "");
GNUNET_free_non_null (current_pseudonym);
current_pseudonym = NULL;
@@ -1923,6 +2036,26 @@
/**
+ * Stop a zone iteration.
+ *
+ * @param zc_ctx zone iteration to stop.
+ */
+static void
+abort_zone_iteration (struct ZoneIteration_Context *zc_ctx)
+{
+ if (NULL != zc_ctx->rkgc)
+ GNUNET_CRYPTO_rsa_key_create_stop (zc_ctx->rkgc);
+ if (NULL != zc_ctx->it)
+ GNUNET_NAMESTORE_zone_iteration_stop (zc_ctx->it);
+ GNUNET_free_non_null (zc_ctx->label);
+ GNUNET_CONTAINER_DLL_remove (zc_head,
+ zc_tail,
+ zc_ctx);
+ GNUNET_free (zc_ctx);
+}
+
+
+/**
* Load a particular zone into the main tree view.
*
* @param zonename name of the option in the configuration file
@@ -1939,6 +2072,8 @@
char *emsg;
/* clear previous zone */
+ current_zone_option = zonename;
+ current_zone_name = default_pseu;
gtk_widget_hide (GTK_WIDGET (GNUNET_SETUP_get_object
("GNUNET_setup_gns_zone_selection_hbuttonbox")));
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")));
@@ -1963,6 +2098,8 @@
gtk_widget_show (GTK_WIDGET (GNUNET_SETUP_get_object
("GNUNET_setup_gns_zone_selection_hbuttonbox")));
return;
}
+ while (NULL != (zc_ctx = zc_head))
+ abort_zone_iteration (zc_head);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using `%s'\n", keyfile);
zc_ctx = GNUNET_malloc (sizeof (struct ZoneIteration_Context));
GNUNET_CONTAINER_DLL_insert (zc_head,
@@ -2057,24 +2194,15 @@
void
GNUNET_SETUP_gns_done ()
{
- struct ZoneIteration_Context *zc_ctx;
-
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);
- while (NULL != (zc_ctx = zc_head))
- {
- if (NULL != zc_ctx->rkgc)
- GNUNET_CRYPTO_rsa_key_create_stop (zc_ctx->rkgc);
- if (NULL != zc_ctx->it)
- GNUNET_NAMESTORE_zone_iteration_stop (zc_ctx->it);
- GNUNET_free_non_null (zc_ctx->label);
- GNUNET_CONTAINER_DLL_remove (zc_head,
- zc_tail,
- zc_ctx);
- GNUNET_free (zc_ctx);
- }
- // FIXME: need to cancel pending record operations!
+ while (NULL != zc_head)
+ abort_zone_iteration (zc_head);
+ while (NULL != uc_head)
+ free_update_context (uc_head);
+ while (NULL != rc_head)
+ free_remove_context (rc_head);
if (NULL != namestore)
{
GNUNET_NAMESTORE_disconnect (namestore);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r25178 - in gnunet-gtk: contrib src/setup,
gnunet <=