diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-03-14 21:25:59 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-03-14 21:25:59 +0000 |
commit | 678ecc83cfb72db18235aba5105ffd89648d1c31 (patch) | |
tree | 5c35e5dbf8aa0d90cac16577d93b7ba051f2c47d | |
parent | ba185437385d92950655ae10ae4d698b524132b5 (diff) | |
download | gnunet-gtk-678ecc83cfb72db18235aba5105ffd89648d1c31.tar.gz gnunet-gtk-678ecc83cfb72db18235aba5105ffd89648d1c31.zip |
- crashes...
-rw-r--r-- | contrib/gnunet_gns_gtk_main_window.glade | 218 | ||||
-rw-r--r-- | src/gns/gnunet-gns-gtk.c | 22 | ||||
-rw-r--r-- | src/gns/gnunet-gns-gtk_zone.c | 36 |
3 files changed, 177 insertions, 99 deletions
diff --git a/contrib/gnunet_gns_gtk_main_window.glade b/contrib/gnunet_gns_gtk_main_window.glade index cafb17c2..4fe6e015 100644 --- a/contrib/gnunet_gns_gtk_main_window.glade +++ b/contrib/gnunet_gns_gtk_main_window.glade | |||
@@ -1,126 +1,66 @@ | |||
1 | <?xml version="1.0"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | <interface> | 2 | <interface> |
3 | <requires lib="gtk+" version="2.16"/> | 3 | <requires lib="gtk+" version="2.16"/> |
4 | <!-- interface-naming-policy project-wide --> | 4 | <!-- interface-naming-policy project-wide --> |
5 | <object class="GtkTreeStore" id="GNUNET_GNS_GTK_treestore"> | ||
6 | <columns> | ||
7 | <!-- column-name name --> | ||
8 | <column type="gchararray"/> | ||
9 | <!-- column-name is_public --> | ||
10 | <column type="gboolean"/> | ||
11 | <!-- column-name record_type --> | ||
12 | <column type="guint"/> | ||
13 | <!-- column-name record_type_as_string --> | ||
14 | <column type="gchararray"/> | ||
15 | <!-- column-name expiration_time --> | ||
16 | <column type="guint64"/> | ||
17 | <!-- column-name expiration_time_is_relative --> | ||
18 | <column type="gboolean"/> | ||
19 | <!-- column-name expiration_time_as_string --> | ||
20 | <column type="gchararray"/> | ||
21 | <!-- column-name value_as_string --> | ||
22 | <column type="gchararray"/> | ||
23 | <!-- column-name value_color --> | ||
24 | <column type="gchararray"/> | ||
25 | </columns> | ||
26 | </object> | ||
27 | <object class="GtkListStore" id="GNUNET_GNS_GTK_type_liststore"> | ||
28 | <columns> | ||
29 | <!-- column-name type --> | ||
30 | <column type="guint"/> | ||
31 | <!-- column-name typename --> | ||
32 | <column type="gchararray"/> | ||
33 | </columns> | ||
34 | <data> | ||
35 | <row> | ||
36 | <col id="0">1</col> | ||
37 | <col id="1" translatable="yes">A</col> | ||
38 | </row> | ||
39 | <row> | ||
40 | <col id="0">2</col> | ||
41 | <col id="1" translatable="yes">NS</col> | ||
42 | </row> | ||
43 | <row> | ||
44 | <col id="0">5</col> | ||
45 | <col id="1" translatable="yes">CNAME</col> | ||
46 | </row> | ||
47 | <row> | ||
48 | <col id="0">6</col> | ||
49 | <col id="1" translatable="yes">SOA</col> | ||
50 | </row> | ||
51 | <row> | ||
52 | <col id="0">12</col> | ||
53 | <col id="1" translatable="yes">PTR</col> | ||
54 | </row> | ||
55 | <row> | ||
56 | <col id="0">15</col> | ||
57 | <col id="1" translatable="yes">MX</col> | ||
58 | </row> | ||
59 | <row> | ||
60 | <col id="0">16</col> | ||
61 | <col id="1" translatable="yes">TXT</col> | ||
62 | </row> | ||
63 | <row> | ||
64 | <col id="0">28</col> | ||
65 | <col id="1" translatable="yes">AAAA</col> | ||
66 | </row> | ||
67 | <row> | ||
68 | <col id="0">65536</col> | ||
69 | <col id="1" translatable="yes">PKEY</col> | ||
70 | </row> | ||
71 | <row> | ||
72 | <col id="0">65537</col> | ||
73 | <col id="1" translatable="yes">PSEU</col> | ||
74 | </row> | ||
75 | </data> | ||
76 | </object> | ||
77 | <object class="GtkWindow" id="GNUNET_GNS_GTK_main_window"> | 5 | <object class="GtkWindow" id="GNUNET_GNS_GTK_main_window"> |
78 | <signal name="delete_event" handler="GNUNET_GNS_GTK_main_window_delete_event_cb"/> | 6 | <property name="can_focus">False</property> |
7 | <signal name="delete-event" handler="GNUNET_GNS_GTK_main_window_delete_event_cb" swapped="no"/> | ||
79 | <child> | 8 | <child> |
80 | <object class="GtkVBox" id="GNUNET_GNS_GTK_main_vbox"> | 9 | <object class="GtkVBox" id="GNUNET_GNS_GTK_main_vbox"> |
81 | <property name="visible">True</property> | 10 | <property name="visible">True</property> |
82 | <property name="orientation">vertical</property> | 11 | <property name="can_focus">False</property> |
83 | <child> | 12 | <child> |
84 | <object class="GtkMenuBar" id="GNUNET_GNS_GTK_menubar"> | 13 | <object class="GtkMenuBar" id="GNUNET_GNS_GTK_menubar"> |
85 | <property name="visible">True</property> | 14 | <property name="visible">True</property> |
15 | <property name="can_focus">False</property> | ||
86 | <child> | 16 | <child> |
87 | <object class="GtkMenuItem" id="GNUNET_GNS_GTK_file_menuitem"> | 17 | <object class="GtkMenuItem" id="GNUNET_GNS_GTK_file_menuitem"> |
88 | <property name="visible">True</property> | 18 | <property name="visible">True</property> |
19 | <property name="can_focus">False</property> | ||
20 | <property name="use_action_appearance">False</property> | ||
89 | <property name="label" translatable="yes">_File</property> | 21 | <property name="label" translatable="yes">_File</property> |
90 | <property name="use_underline">True</property> | 22 | <property name="use_underline">True</property> |
91 | <child type="submenu"> | 23 | <child type="submenu"> |
92 | <object class="GtkMenu" id="menu1"> | 24 | <object class="GtkMenu" id="menu1"> |
93 | <property name="visible">True</property> | 25 | <property name="visible">True</property> |
26 | <property name="can_focus">False</property> | ||
94 | <child> | 27 | <child> |
95 | <object class="GtkImageMenuItem" id="GNUNET_GNS_GTK_new_imagemenuitem"> | 28 | <object class="GtkImageMenuItem" id="GNUNET_GNS_GTK_new_imagemenuitem"> |
96 | <property name="label">gtk-new</property> | 29 | <property name="label">gtk-new</property> |
97 | <property name="visible">True</property> | 30 | <property name="visible">True</property> |
31 | <property name="can_focus">False</property> | ||
32 | <property name="use_action_appearance">False</property> | ||
98 | <property name="use_underline">True</property> | 33 | <property name="use_underline">True</property> |
99 | <property name="use_stock">True</property> | 34 | <property name="use_stock">True</property> |
100 | <signal name="activate" handler="GNUNET_GNS_GTK_new_imagemenuitem_activate_cb"/> | 35 | <signal name="activate" handler="GNUNET_GNS_GTK_new_imagemenuitem_activate_cb" swapped="no"/> |
101 | </object> | 36 | </object> |
102 | </child> | 37 | </child> |
103 | <child> | 38 | <child> |
104 | <object class="GtkImageMenuItem" id="GNUNET_GNS_GTK_open_imagemenuitem"> | 39 | <object class="GtkImageMenuItem" id="GNUNET_GNS_GTK_open_imagemenuitem"> |
105 | <property name="label">gtk-open</property> | 40 | <property name="label">gtk-open</property> |
106 | <property name="visible">True</property> | 41 | <property name="visible">True</property> |
42 | <property name="can_focus">False</property> | ||
43 | <property name="use_action_appearance">False</property> | ||
107 | <property name="use_underline">True</property> | 44 | <property name="use_underline">True</property> |
108 | <property name="use_stock">True</property> | 45 | <property name="use_stock">True</property> |
109 | <signal name="activate" handler="GNUNET_GNS_GTK_open_imagemenuitem_activate_cb"/> | 46 | <signal name="activate" handler="GNUNET_GNS_GTK_open_imagemenuitem_activate_cb" swapped="no"/> |
110 | </object> | 47 | </object> |
111 | </child> | 48 | </child> |
112 | <child> | 49 | <child> |
113 | <object class="GtkSeparatorMenuItem" id="separatormenuitem1"> | 50 | <object class="GtkSeparatorMenuItem" id="separatormenuitem1"> |
114 | <property name="visible">True</property> | 51 | <property name="visible">True</property> |
52 | <property name="can_focus">False</property> | ||
115 | </object> | 53 | </object> |
116 | </child> | 54 | </child> |
117 | <child> | 55 | <child> |
118 | <object class="GtkImageMenuItem" id="GNUNET_GNS_GTK_quit_imagemenuitem"> | 56 | <object class="GtkImageMenuItem" id="GNUNET_GNS_GTK_quit_imagemenuitem"> |
119 | <property name="label">gtk-quit</property> | 57 | <property name="label">gtk-quit</property> |
120 | <property name="visible">True</property> | 58 | <property name="visible">True</property> |
59 | <property name="can_focus">False</property> | ||
60 | <property name="use_action_appearance">False</property> | ||
121 | <property name="use_underline">True</property> | 61 | <property name="use_underline">True</property> |
122 | <property name="use_stock">True</property> | 62 | <property name="use_stock">True</property> |
123 | <signal name="activate" handler="GNUNET_GNS_GTK_quit_imagemenuitem_activate_cb"/> | 63 | <signal name="activate" handler="GNUNET_GNS_GTK_quit_imagemenuitem_activate_cb" swapped="no"/> |
124 | </object> | 64 | </object> |
125 | </child> | 65 | </child> |
126 | </object> | 66 | </object> |
@@ -130,17 +70,22 @@ | |||
130 | <child> | 70 | <child> |
131 | <object class="GtkMenuItem" id="GNUNET_GNS_GTK_options_menuitem"> | 71 | <object class="GtkMenuItem" id="GNUNET_GNS_GTK_options_menuitem"> |
132 | <property name="visible">True</property> | 72 | <property name="visible">True</property> |
73 | <property name="can_focus">False</property> | ||
74 | <property name="use_action_appearance">False</property> | ||
133 | <property name="label" translatable="yes">_Options</property> | 75 | <property name="label" translatable="yes">_Options</property> |
134 | <property name="use_underline">True</property> | 76 | <property name="use_underline">True</property> |
135 | <child type="submenu"> | 77 | <child type="submenu"> |
136 | <object class="GtkMenu" id="menu2"> | 78 | <object class="GtkMenu" id="menu2"> |
137 | <property name="visible">True</property> | 79 | <property name="visible">True</property> |
80 | <property name="can_focus">False</property> | ||
138 | <child> | 81 | <child> |
139 | <object class="GtkCheckMenuItem" id="GNUNET_GNS_GTK_autoshort_imagemenuitem"> | 82 | <object class="GtkCheckMenuItem" id="GNUNET_GNS_GTK_autoshort_imagemenuitem"> |
140 | <property name="visible">True</property> | 83 | <property name="visible">True</property> |
84 | <property name="can_focus">False</property> | ||
85 | <property name="use_action_appearance">False</property> | ||
141 | <property name="label" translatable="yes">Automatically shorten names</property> | 86 | <property name="label" translatable="yes">Automatically shorten names</property> |
142 | <property name="use_underline">True</property> | 87 | <property name="use_underline">True</property> |
143 | <signal name="toggled" handler="GNUNET_GNS_GTK_autoshort_imagemenuitem_toggled_cb"/> | 88 | <signal name="toggled" handler="GNUNET_GNS_GTK_autoshort_imagemenuitem_toggled_cb" swapped="no"/> |
144 | </object> | 89 | </object> |
145 | </child> | 90 | </child> |
146 | </object> | 91 | </object> |
@@ -150,18 +95,23 @@ | |||
150 | <child> | 95 | <child> |
151 | <object class="GtkMenuItem" id="GNUNET_GNS_GTK_help_menuitem"> | 96 | <object class="GtkMenuItem" id="GNUNET_GNS_GTK_help_menuitem"> |
152 | <property name="visible">True</property> | 97 | <property name="visible">True</property> |
98 | <property name="can_focus">False</property> | ||
99 | <property name="use_action_appearance">False</property> | ||
153 | <property name="label" translatable="yes">_Help</property> | 100 | <property name="label" translatable="yes">_Help</property> |
154 | <property name="use_underline">True</property> | 101 | <property name="use_underline">True</property> |
155 | <child type="submenu"> | 102 | <child type="submenu"> |
156 | <object class="GtkMenu" id="menu3"> | 103 | <object class="GtkMenu" id="menu3"> |
157 | <property name="visible">True</property> | 104 | <property name="visible">True</property> |
105 | <property name="can_focus">False</property> | ||
158 | <child> | 106 | <child> |
159 | <object class="GtkImageMenuItem" id="GNUNET_GNS_GTK_about_imagemenuitem"> | 107 | <object class="GtkImageMenuItem" id="GNUNET_GNS_GTK_about_imagemenuitem"> |
160 | <property name="label">gtk-about</property> | 108 | <property name="label">gtk-about</property> |
161 | <property name="visible">True</property> | 109 | <property name="visible">True</property> |
110 | <property name="can_focus">False</property> | ||
111 | <property name="use_action_appearance">False</property> | ||
162 | <property name="use_underline">True</property> | 112 | <property name="use_underline">True</property> |
163 | <property name="use_stock">True</property> | 113 | <property name="use_stock">True</property> |
164 | <signal name="activate" handler="GNUNET_GNS_GTK_about_imagemenuitem_activate_cb"/> | 114 | <signal name="activate" handler="GNUNET_GNS_GTK_about_imagemenuitem_activate_cb" swapped="no"/> |
165 | </object> | 115 | </object> |
166 | </child> | 116 | </child> |
167 | </object> | 117 | </object> |
@@ -171,24 +121,29 @@ | |||
171 | </object> | 121 | </object> |
172 | <packing> | 122 | <packing> |
173 | <property name="expand">False</property> | 123 | <property name="expand">False</property> |
124 | <property name="fill">True</property> | ||
174 | <property name="position">0</property> | 125 | <property name="position">0</property> |
175 | </packing> | 126 | </packing> |
176 | </child> | 127 | </child> |
177 | <child> | 128 | <child> |
178 | <object class="GtkFrame" id="GNUNET_GNS_GTK_main_frame"> | 129 | <object class="GtkFrame" id="GNUNET_GNS_GTK_main_frame"> |
179 | <property name="visible">True</property> | 130 | <property name="visible">True</property> |
131 | <property name="can_focus">False</property> | ||
180 | <property name="label_xalign">0</property> | 132 | <property name="label_xalign">0</property> |
181 | <property name="shadow_type">none</property> | 133 | <property name="shadow_type">none</property> |
182 | <child> | 134 | <child> |
183 | <object class="GtkAlignment" id="GNUNET_GNS_GTK_main_alignment"> | 135 | <object class="GtkAlignment" id="GNUNET_GNS_GTK_main_alignment"> |
184 | <property name="visible">True</property> | 136 | <property name="visible">True</property> |
137 | <property name="can_focus">False</property> | ||
185 | <property name="left_padding">12</property> | 138 | <property name="left_padding">12</property> |
186 | <child> | 139 | <child> |
187 | <object class="GtkHBox" id="GNUNET_GNS_GTK_pseu_hbox"> | 140 | <object class="GtkHBox" id="GNUNET_GNS_GTK_pseu_hbox"> |
188 | <property name="visible">True</property> | 141 | <property name="visible">True</property> |
142 | <property name="can_focus">False</property> | ||
189 | <child> | 143 | <child> |
190 | <object class="GtkLabel" id="GNUNET_GNS_GTK_pseu_label"> | 144 | <object class="GtkLabel" id="GNUNET_GNS_GTK_pseu_label"> |
191 | <property name="visible">True</property> | 145 | <property name="visible">True</property> |
146 | <property name="can_focus">False</property> | ||
192 | <property name="label" translatable="yes">Preferred zone name (PSEU):</property> | 147 | <property name="label" translatable="yes">Preferred zone name (PSEU):</property> |
193 | </object> | 148 | </object> |
194 | <packing> | 149 | <packing> |
@@ -204,10 +159,16 @@ | |||
204 | <property name="can_focus">True</property> | 159 | <property name="can_focus">True</property> |
205 | <property name="tooltip_text" translatable="yes">Enter the preferred name for this zone here. The value will be stored in the PSEU record for your public key. This is the GNS equivalent of your domain name. You should try to pick a name that is globally unique.</property> | 160 | <property name="tooltip_text" translatable="yes">Enter the preferred name for this zone here. The value will be stored in the PSEU record for your public key. This is the GNS equivalent of your domain name. You should try to pick a name that is globally unique.</property> |
206 | <property name="max_length">63</property> | 161 | <property name="max_length">63</property> |
207 | <property name="invisible_char">●</property> | 162 | <property name="invisible_char">●</property> |
208 | <signal name="changed" handler="GNUNET_GNS_GTK_pseu_entry_changed_cb"/> | 163 | <property name="primary_icon_activatable">False</property> |
164 | <property name="secondary_icon_activatable">False</property> | ||
165 | <property name="primary_icon_sensitive">True</property> | ||
166 | <property name="secondary_icon_sensitive">True</property> | ||
167 | <signal name="changed" handler="GNUNET_GNS_GTK_pseu_entry_changed_cb" swapped="no"/> | ||
209 | </object> | 168 | </object> |
210 | <packing> | 169 | <packing> |
170 | <property name="expand">True</property> | ||
171 | <property name="fill">True</property> | ||
211 | <property name="padding">5</property> | 172 | <property name="padding">5</property> |
212 | <property name="position">1</property> | 173 | <property name="position">1</property> |
213 | </packing> | 174 | </packing> |
@@ -219,8 +180,9 @@ | |||
219 | <property name="can_focus">True</property> | 180 | <property name="can_focus">True</property> |
220 | <property name="receives_default">True</property> | 181 | <property name="receives_default">True</property> |
221 | <property name="tooltip_text" translatable="yes">Copy the public key of this zone to the clipboard.</property> | 182 | <property name="tooltip_text" translatable="yes">Copy the public key of this zone to the clipboard.</property> |
183 | <property name="use_action_appearance">False</property> | ||
222 | <property name="use_stock">True</property> | 184 | <property name="use_stock">True</property> |
223 | <signal name="clicked" handler="GNUNET_GNS_GTK_public_key_copy_button_clicked_cb"/> | 185 | <signal name="clicked" handler="GNUNET_GNS_GTK_public_key_copy_button_clicked_cb" swapped="no"/> |
224 | </object> | 186 | </object> |
225 | <packing> | 187 | <packing> |
226 | <property name="expand">False</property> | 188 | <property name="expand">False</property> |
@@ -236,6 +198,7 @@ | |||
236 | <child type="label"> | 198 | <child type="label"> |
237 | <object class="GtkLabel" id="GNUNET_GNS_GTK_zone_label"> | 199 | <object class="GtkLabel" id="GNUNET_GNS_GTK_zone_label"> |
238 | <property name="visible">True</property> | 200 | <property name="visible">True</property> |
201 | <property name="can_focus">False</property> | ||
239 | <property name="label" translatable="yes"><b>SET TO PUBLIC KEY OF THE ZONE</b></property> | 202 | <property name="label" translatable="yes"><b>SET TO PUBLIC KEY OF THE ZONE</b></property> |
240 | <property name="use_markup">True</property> | 203 | <property name="use_markup">True</property> |
241 | </object> | 204 | </object> |
@@ -259,8 +222,8 @@ | |||
259 | <property name="visible">True</property> | 222 | <property name="visible">True</property> |
260 | <property name="can_focus">True</property> | 223 | <property name="can_focus">True</property> |
261 | <property name="model">GNUNET_GNS_GTK_treestore</property> | 224 | <property name="model">GNUNET_GNS_GTK_treestore</property> |
262 | <signal name="realize" handler="GNUNET_GNS_GTK_main_treeview_realize_cb"/> | 225 | <signal name="realize" handler="GNUNET_GNS_GTK_main_treeview_realize_cb" swapped="no"/> |
263 | <signal name="popup_menu" handler="GNUNET_GNS_GTK_main_treeview_popup_menu_cb"/> | 226 | <signal name="popup-menu" handler="GNUNET_GNS_GTK_main_treeview_popup_menu_cb" swapped="no"/> |
264 | <child> | 227 | <child> |
265 | <object class="GtkTreeViewColumn" id="GNUNET_GNS_GTK_name_treeviewcolumn"> | 228 | <object class="GtkTreeViewColumn" id="GNUNET_GNS_GTK_name_treeviewcolumn"> |
266 | <property name="title">Name</property> | 229 | <property name="title">Name</property> |
@@ -268,10 +231,11 @@ | |||
268 | <property name="reorderable">True</property> | 231 | <property name="reorderable">True</property> |
269 | <property name="sort_indicator">True</property> | 232 | <property name="sort_indicator">True</property> |
270 | <property name="sort_column_id">0</property> | 233 | <property name="sort_column_id">0</property> |
234 | <signal name="clicked" handler="GNUNET_GNS_GTK_main_treeview_click_cb" swapped="no"/> | ||
271 | <child> | 235 | <child> |
272 | <object class="GtkCellRendererText" id="GNUNET_GNS_GTK_name_cellrenderertext"> | 236 | <object class="GtkCellRendererText" id="GNUNET_GNS_GTK_name_cellrenderertext"> |
273 | <property name="editable">True</property> | 237 | <property name="editable">True</property> |
274 | <signal name="edited" handler="GNUNET_GNS_GTK_name_cellrenderertext_edited_cb"/> | 238 | <signal name="edited" handler="GNUNET_GNS_GTK_name_cellrenderertext_edited_cb" swapped="no"/> |
275 | </object> | 239 | </object> |
276 | <attributes> | 240 | <attributes> |
277 | <attribute name="text">0</attribute> | 241 | <attribute name="text">0</attribute> |
@@ -287,7 +251,7 @@ | |||
287 | <property name="clickable">True</property> | 251 | <property name="clickable">True</property> |
288 | <child> | 252 | <child> |
289 | <object class="GtkCellRendererToggle" id="GNUNET_GNS_GTK_ispublic_cellrenderertoggle"> | 253 | <object class="GtkCellRendererToggle" id="GNUNET_GNS_GTK_ispublic_cellrenderertoggle"> |
290 | <signal name="toggled" handler="GNUNET_GNS_GTK_ispublic_cellrenderertoggle_toggled_cb"/> | 254 | <signal name="toggled" handler="GNUNET_GNS_GTK_ispublic_cellrenderertoggle_toggled_cb" swapped="no"/> |
291 | </object> | 255 | </object> |
292 | <attributes> | 256 | <attributes> |
293 | <attribute name="active">1</attribute> | 257 | <attribute name="active">1</attribute> |
@@ -307,7 +271,7 @@ | |||
307 | <child> | 271 | <child> |
308 | <object class="GtkCellRendererCombo" id="GNUNET_GNS_GTK_type_cellrenderercombo"> | 272 | <object class="GtkCellRendererCombo" id="GNUNET_GNS_GTK_type_cellrenderercombo"> |
309 | <property name="editable">True</property> | 273 | <property name="editable">True</property> |
310 | <signal name="changed" handler="GNUNET_GNS_GTK_type_cellrenderercombo_changed_cb"/> | 274 | <signal name="changed" handler="GNUNET_GNS_GTK_type_cellrenderercombo_changed_cb" swapped="no"/> |
311 | </object> | 275 | </object> |
312 | <attributes> | 276 | <attributes> |
313 | <attribute name="text-column">3</attribute> | 277 | <attribute name="text-column">3</attribute> |
@@ -324,7 +288,7 @@ | |||
324 | <child> | 288 | <child> |
325 | <object class="GtkCellRendererText" id="GNUNET_GNS_GTK_expiration_cellrenderertext"> | 289 | <object class="GtkCellRendererText" id="GNUNET_GNS_GTK_expiration_cellrenderertext"> |
326 | <property name="editable">True</property> | 290 | <property name="editable">True</property> |
327 | <signal name="edited" handler="GNUNET_GNS_GTK_expiration_cellrenderertext_edited_cb"/> | 291 | <signal name="edited" handler="GNUNET_GNS_GTK_expiration_cellrenderertext_edited_cb" swapped="no"/> |
328 | </object> | 292 | </object> |
329 | <attributes> | 293 | <attributes> |
330 | <attribute name="text">6</attribute> | 294 | <attribute name="text">6</attribute> |
@@ -340,7 +304,7 @@ | |||
340 | <property name="sort_column_id">7</property> | 304 | <property name="sort_column_id">7</property> |
341 | <child> | 305 | <child> |
342 | <object class="GtkCellRendererText" id="GNUNET_GNS_GTK_value_cellrenderertext"> | 306 | <object class="GtkCellRendererText" id="GNUNET_GNS_GTK_value_cellrenderertext"> |
343 | <signal name="edited" handler="GNUNET_GNS_GTK_value_cellrenderertext_edited_cb"/> | 307 | <signal name="edited" handler="GNUNET_GNS_GTK_value_cellrenderertext_edited_cb" swapped="no"/> |
344 | </object> | 308 | </object> |
345 | <attributes> | 309 | <attributes> |
346 | <attribute name="background">8</attribute> | 310 | <attribute name="background">8</attribute> |
@@ -353,10 +317,84 @@ | |||
353 | </child> | 317 | </child> |
354 | </object> | 318 | </object> |
355 | <packing> | 319 | <packing> |
320 | <property name="expand">True</property> | ||
321 | <property name="fill">True</property> | ||
356 | <property name="position">2</property> | 322 | <property name="position">2</property> |
357 | </packing> | 323 | </packing> |
358 | </child> | 324 | </child> |
359 | </object> | 325 | </object> |
360 | </child> | 326 | </child> |
361 | </object> | 327 | </object> |
328 | <object class="GtkTreeStore" id="GNUNET_GNS_GTK_treestore"> | ||
329 | <columns> | ||
330 | <!-- column-name name --> | ||
331 | <column type="gchararray"/> | ||
332 | <!-- column-name is_public --> | ||
333 | <column type="gboolean"/> | ||
334 | <!-- column-name record_type --> | ||
335 | <column type="guint"/> | ||
336 | <!-- column-name record_type_as_string --> | ||
337 | <column type="gchararray"/> | ||
338 | <!-- column-name expiration_time --> | ||
339 | <column type="guint64"/> | ||
340 | <!-- column-name expiration_time_is_relative --> | ||
341 | <column type="gboolean"/> | ||
342 | <!-- column-name expiration_time_as_string --> | ||
343 | <column type="gchararray"/> | ||
344 | <!-- column-name value_as_string --> | ||
345 | <column type="gchararray"/> | ||
346 | <!-- column-name value_color --> | ||
347 | <column type="gchararray"/> | ||
348 | </columns> | ||
349 | </object> | ||
350 | <object class="GtkListStore" id="GNUNET_GNS_GTK_type_liststore"> | ||
351 | <columns> | ||
352 | <!-- column-name type --> | ||
353 | <column type="guint"/> | ||
354 | <!-- column-name typename --> | ||
355 | <column type="gchararray"/> | ||
356 | </columns> | ||
357 | <data> | ||
358 | <row> | ||
359 | <col id="0">1</col> | ||
360 | <col id="1" translatable="yes">A</col> | ||
361 | </row> | ||
362 | <row> | ||
363 | <col id="0">2</col> | ||
364 | <col id="1" translatable="yes">NS</col> | ||
365 | </row> | ||
366 | <row> | ||
367 | <col id="0">5</col> | ||
368 | <col id="1" translatable="yes">CNAME</col> | ||
369 | </row> | ||
370 | <row> | ||
371 | <col id="0">6</col> | ||
372 | <col id="1" translatable="yes">SOA</col> | ||
373 | </row> | ||
374 | <row> | ||
375 | <col id="0">12</col> | ||
376 | <col id="1" translatable="yes">PTR</col> | ||
377 | </row> | ||
378 | <row> | ||
379 | <col id="0">15</col> | ||
380 | <col id="1" translatable="yes">MX</col> | ||
381 | </row> | ||
382 | <row> | ||
383 | <col id="0">16</col> | ||
384 | <col id="1" translatable="yes">TXT</col> | ||
385 | </row> | ||
386 | <row> | ||
387 | <col id="0">28</col> | ||
388 | <col id="1" translatable="yes">AAAA</col> | ||
389 | </row> | ||
390 | <row> | ||
391 | <col id="0">65536</col> | ||
392 | <col id="1" translatable="yes">PKEY</col> | ||
393 | </row> | ||
394 | <row> | ||
395 | <col id="0">65537</col> | ||
396 | <col id="1" translatable="yes">PSEU</col> | ||
397 | </row> | ||
398 | </data> | ||
399 | </object> | ||
362 | </interface> | 400 | </interface> |
diff --git a/src/gns/gnunet-gns-gtk.c b/src/gns/gnunet-gns-gtk.c index 59edb42b..ed3ff064 100644 --- a/src/gns/gnunet-gns-gtk.c +++ b/src/gns/gnunet-gns-gtk.c | |||
@@ -67,7 +67,7 @@ struct GNUNET_GNS_Context | |||
67 | */ | 67 | */ |
68 | struct GNUNET_NAMESTORE_Handle *ns; | 68 | struct GNUNET_NAMESTORE_Handle *ns; |
69 | 69 | ||
70 | GtkBuilder builder; | 70 | GtkBuilder *builder; |
71 | 71 | ||
72 | 72 | ||
73 | }; | 73 | }; |
@@ -245,6 +245,7 @@ GNUNET_GNS_GTK_public_key_copy_button_clicked_cb (GtkButton *button, | |||
245 | static void | 245 | static void |
246 | shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 246 | shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
247 | { | 247 | { |
248 | |||
248 | struct GNUNET_GNS_Context *gns = cls; | 249 | struct GNUNET_GNS_Context *gns = cls; |
249 | GNUNET_assert (gns != NULL); | 250 | GNUNET_assert (gns != NULL); |
250 | if (NULL != gns->ns) | 251 | if (NULL != gns->ns) |
@@ -383,20 +384,14 @@ run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
383 | return; | 384 | return; |
384 | } | 385 | } |
385 | 386 | ||
386 | struct ZoneIteration_Context * zc_ctx = GNUNET_malloc (sizeof (struct ZoneIteration_Context)); | ||
387 | zc_ctx->zone = zone; | ||
388 | GNUNET_NAMESTORE_zone_iteration_start(gns->ns, &zone, | ||
389 | GNUNET_NAMESTORE_RF_NONE, | ||
390 | GNUNET_NAMESTORE_RF_NONE, | ||
391 | &zone_iteration_proc, | ||
392 | zc_ctx); | ||
393 | |||
394 | if (GNUNET_OK != GNUNET_GTK_main_loop_build_window (ml, gns)) | 387 | if (GNUNET_OK != GNUNET_GTK_main_loop_build_window (ml, gns)) |
395 | { | 388 | { |
396 | GNUNET_break (0); | 389 | GNUNET_break (0); |
397 | GNUNET_SCHEDULER_add_now (&shutdown_task, gns); | 390 | GNUNET_SCHEDULER_add_now (&shutdown_task, gns); |
398 | return; | 391 | return; |
399 | } | 392 | } |
393 | gns->builder = GNUNET_GTK_main_loop_get_builder(ml); | ||
394 | |||
400 | zone_as_string = GNUNET_strdup (GNUNET_h2s_full (&zone)); | 395 | zone_as_string = GNUNET_strdup (GNUNET_h2s_full (&zone)); |
401 | label = g_markup_printf_escaped (_("<b>Editing zone %s</b>"), | 396 | label = g_markup_printf_escaped (_("<b>Editing zone %s</b>"), |
402 | zone_as_string); | 397 | zone_as_string); |
@@ -413,12 +408,21 @@ run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
413 | "gnunet-gtk" /* FIXME: different icon? */ , | 408 | "gnunet-gtk" /* FIXME: different icon? */ , |
414 | "gnunet-gns-gtk"); | 409 | "gnunet-gns-gtk"); |
415 | 410 | ||
411 | struct ZoneIteration_Context * zc_ctx = GNUNET_malloc (sizeof (struct ZoneIteration_Context)); | ||
412 | zc_ctx->zone = zone; | ||
413 | GNUNET_NAMESTORE_zone_iteration_start(gns->ns, &zone, | ||
414 | GNUNET_NAMESTORE_RF_NONE, | ||
415 | GNUNET_NAMESTORE_RF_NONE, | ||
416 | &zone_iteration_proc, | ||
417 | zc_ctx); | ||
418 | |||
416 | /* make GUI visible */ | 419 | /* make GUI visible */ |
417 | if (!tray_only) | 420 | if (!tray_only) |
418 | { | 421 | { |
419 | gtk_widget_show (main_window); | 422 | gtk_widget_show (main_window); |
420 | gtk_window_present (GTK_WINDOW (main_window)); | 423 | gtk_window_present (GTK_WINDOW (main_window)); |
421 | } | 424 | } |
425 | |||
422 | } | 426 | } |
423 | 427 | ||
424 | 428 | ||
diff --git a/src/gns/gnunet-gns-gtk_zone.c b/src/gns/gnunet-gns-gtk_zone.c index a6218623..b7f7c22c 100644 --- a/src/gns/gnunet-gns-gtk_zone.c +++ b/src/gns/gnunet-gns-gtk_zone.c | |||
@@ -140,6 +140,42 @@ GNUNET_GNS_GTK_main_treeview_popup_menu_cb (GtkWidget *widget, | |||
140 | return FALSE; | 140 | return FALSE; |
141 | } | 141 | } |
142 | 142 | ||
143 | enum | ||
144 | { | ||
145 | COL_FIRST_NAME = 0, | ||
146 | COL_LAST_NAME, | ||
147 | COL_YEAR_BORN, | ||
148 | NUM_COLS | ||
149 | } ; | ||
150 | |||
151 | static void | ||
152 | test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
153 | { | ||
154 | struct GNUNET_GNS_Context *gns=cls; | ||
155 | GtkBuilder *builder = gns->builder; | ||
156 | GtkTreeStore *ts; | ||
157 | GtkTreeIter toplevel, child; | ||
158 | |||
159 | ts = GTK_TREE_STORE (gtk_builder_get_object (builder, "GNUNET_GNS_GTK_treestore")); | ||
160 | GNUNET_assert (ts != NULL); | ||
161 | |||
162 | GNUNET_break (0); | ||
163 | /* Append a top level row and leave it empty */ | ||
164 | gtk_tree_store_append(ts, &toplevel, NULL); | ||
165 | /* | ||
166 | gtk_tree_store_set(ts, &toplevel, | ||
167 | COL_FIRST_NAME, "Maria", | ||
168 | COL_LAST_NAME, "Incognito", | ||
169 | -1);*/ | ||
170 | } | ||
171 | |||
172 | void | ||
173 | GNUNET_GNS_GTK_main_treeview_click_cb (GtkTreeViewColumn *treeviewcolumn, | ||
174 | gpointer user_data) | ||
175 | { | ||
176 | |||
177 | GNUNET_SCHEDULER_add_now (&test, user_data); | ||
178 | } | ||
143 | 179 | ||
144 | /** | 180 | /** |
145 | * The zone treeview was realized. Setup the model. | 181 | * The zone treeview was realized. Setup the model. |