diff options
Diffstat (limited to 'src/namestore/gnunet-namestore-gtk.c')
-rw-r--r-- | src/namestore/gnunet-namestore-gtk.c | 138 |
1 files changed, 66 insertions, 72 deletions
diff --git a/src/namestore/gnunet-namestore-gtk.c b/src/namestore/gnunet-namestore-gtk.c index 8c3acf8a..eb13501f 100644 --- a/src/namestore/gnunet-namestore-gtk.c +++ b/src/namestore/gnunet-namestore-gtk.c | |||
@@ -374,14 +374,9 @@ static struct GNUNET_IDENTITY_Operation *id_op; | |||
374 | static struct GNUNET_GTK_MainLoop *ml; | 374 | static struct GNUNET_GTK_MainLoop *ml; |
375 | 375 | ||
376 | /** | 376 | /** |
377 | * Name of the configuration file. | ||
378 | */ | ||
379 | static const char *cfgName; | ||
380 | |||
381 | /** | ||
382 | * Our configuration. | 377 | * Our configuration. |
383 | */ | 378 | */ |
384 | struct GNUNET_CONFIGURATION_Handle *cfg; | 379 | static const struct GNUNET_CONFIGURATION_Handle *cfg; |
385 | 380 | ||
386 | /** | 381 | /** |
387 | * Global return value (for success/failure of gnunet-setup). | 382 | * Global return value (for success/failure of gnunet-setup). |
@@ -389,7 +384,6 @@ struct GNUNET_CONFIGURATION_Handle *cfg; | |||
389 | static int gret; | 384 | static int gret; |
390 | 385 | ||
391 | 386 | ||
392 | |||
393 | /** | 387 | /** |
394 | * Get an object from the main window. | 388 | * Get an object from the main window. |
395 | * | 389 | * |
@@ -405,7 +399,6 @@ get_object (const char *name) | |||
405 | } | 399 | } |
406 | 400 | ||
407 | 401 | ||
408 | |||
409 | #if HAVE_QRENCODE_H | 402 | #if HAVE_QRENCODE_H |
410 | #include <qrencode.h> | 403 | #include <qrencode.h> |
411 | #include <gdk-pixbuf/gdk-pixbuf.h> | 404 | #include <gdk-pixbuf/gdk-pixbuf.h> |
@@ -441,7 +434,7 @@ create_qrcode (unsigned int scale) | |||
441 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "QRinput_new2"); | 434 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "QRinput_new2"); |
442 | return NULL; | 435 | return NULL; |
443 | } | 436 | } |
444 | entry = GTK_ENTRY (get_object ("gnunet_namestore_gtk_gns_pseu_entry")); | 437 | entry = GTK_ENTRY (get_object ("gnunet_namestore_gtk_pseu_entry")); |
445 | pseu = gtk_entry_get_text (GTK_ENTRY(entry)); | 438 | pseu = gtk_entry_get_text (GTK_ENTRY(entry)); |
446 | GNUNET_asprintf (&str, | 439 | GNUNET_asprintf (&str, |
447 | "gnunet://gns/%s/%s\n", | 440 | "gnunet://gns/%s/%s\n", |
@@ -514,7 +507,7 @@ setup_qrcode () | |||
514 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, _("Failed to initialize QR-code pixbuf")); | 507 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, _("Failed to initialize QR-code pixbuf")); |
515 | return; | 508 | return; |
516 | } | 509 | } |
517 | image = GTK_IMAGE (get_object ("gnunet_namestore_gtk_gns_qr_image")); | 510 | image = GTK_IMAGE (get_object ("gnunet_namestore_gtk_qr_image")); |
518 | if (NULL == image) | 511 | if (NULL == image) |
519 | { | 512 | { |
520 | GNUNET_break (0); | 513 | GNUNET_break (0); |
@@ -532,7 +525,7 @@ setup_qrcode () | |||
532 | * | 525 | * |
533 | * @param dialog the dialog | 526 | * @param dialog the dialog |
534 | * @param response_id reason for the dialog closing | 527 | * @param response_id reason for the dialog closing |
535 | * @param user_data the 'GtkBuilder' we used to create the dialog | 528 | * @param user_data the `GtkBuilder` we used to create the dialog |
536 | */ | 529 | */ |
537 | void | 530 | void |
538 | gnunet_namestore_gtk_qr_save_as_dialog_response_cb (GtkDialog *dialog, | 531 | gnunet_namestore_gtk_qr_save_as_dialog_response_cb (GtkDialog *dialog, |
@@ -577,7 +570,7 @@ gnunet_namestore_gtk_qr_save_as_dialog_response_cb (GtkDialog *dialog, | |||
577 | * dialog to get the desired filename and file type. | 570 | * dialog to get the desired filename and file type. |
578 | */ | 571 | */ |
579 | void | 572 | void |
580 | gnunet_namestore_gtk_gns_qr_saveas_button_clicked_cb (GtkButton *button, | 573 | gnunet_namestore_gtk_qr_saveas_button_clicked_cb (GtkButton *button, |
581 | gpointer user_data) | 574 | gpointer user_data) |
582 | { | 575 | { |
583 | GtkBuilder *builder; | 576 | GtkBuilder *builder; |
@@ -586,7 +579,7 @@ gnunet_namestore_gtk_gns_qr_saveas_button_clicked_cb (GtkButton *button, | |||
586 | GtkEntry *entry; | 579 | GtkEntry *entry; |
587 | char *suggestion; | 580 | char *suggestion; |
588 | 581 | ||
589 | entry = GTK_ENTRY (get_object ("gnunet_namestore_gtk_gns_pseu_entry")); | 582 | entry = GTK_ENTRY (get_object ("gnunet_namestore_gtk_pseu_entry")); |
590 | pseu = gtk_entry_get_text (GTK_ENTRY(entry)); | 583 | pseu = gtk_entry_get_text (GTK_ENTRY(entry)); |
591 | builder = | 584 | builder = |
592 | GNUNET_GTK_get_new_builder ("gnunet_namestore_gtk_qr_save_as_dialog.glade", | 585 | GNUNET_GTK_get_new_builder ("gnunet_namestore_gtk_qr_save_as_dialog.glade", |
@@ -612,10 +605,10 @@ gnunet_namestore_gtk_gns_qr_saveas_button_clicked_cb (GtkButton *button, | |||
612 | * Check if adding a record of the given type is Ok given the other | 605 | * Check if adding a record of the given type is Ok given the other |
613 | * records already present for the given name. | 606 | * records already present for the given name. |
614 | * | 607 | * |
615 | * @param rd_count size of the 'rd' array | 608 | * @param rd_count size of the @a rd array |
616 | * @param rd existing records | 609 | * @param rd existing records |
617 | * @param n_type new record to be added | 610 | * @param n_type new record to be added |
618 | * @return GNUNET_OK if adding this record is OK, GNUNET_NO if not | 611 | * @return #GNUNET_OK if adding this record is OK, #GNUNET_NO if not |
619 | */ | 612 | */ |
620 | static int | 613 | static int |
621 | check_record_permitted (unsigned int rd_count, | 614 | check_record_permitted (unsigned int rd_count, |
@@ -665,8 +658,8 @@ check_record_permitted (unsigned int rd_count, | |||
665 | /** | 658 | /** |
666 | * Function called upon completion of an operation. | 659 | * Function called upon completion of an operation. |
667 | * | 660 | * |
668 | * @param cls the 'struct OperationContext' of the operation that completed | 661 | * @param cls the `struct OperationContext` of the operation that completed |
669 | * @param success GNUNET_OK if the operation succeeded | 662 | * @param success #GNUNET_OK if the operation succeeded |
670 | * @param emsg error message if the operation failed | 663 | * @param emsg error message if the operation failed |
671 | */ | 664 | */ |
672 | static void | 665 | static void |
@@ -735,13 +728,13 @@ clear_zone_view () | |||
735 | GNUNET_CONTAINER_multihashmap_iterate (n2r, | 728 | GNUNET_CONTAINER_multihashmap_iterate (n2r, |
736 | &release_ri, | 729 | &release_ri, |
737 | NULL); | 730 | NULL); |
738 | gtk_widget_hide (GTK_WIDGET (get_object ("gnunet_namestore_gtk_gns_zone_selection_hbuttonbox"))); | 731 | gtk_widget_hide (GTK_WIDGET (get_object ("gnunet_namestore_gtk_zone_selection_hbuttonbox"))); |
739 | gtk_widget_show (GTK_WIDGET (get_object ("gnunet_namestore_gtk_gns_status_label"))); | 732 | gtk_widget_show (GTK_WIDGET (get_object ("gnunet_namestore_gtk_status_label"))); |
740 | gtk_widget_hide (GTK_WIDGET (get_object ("gnunet_namestore_gtk_gns_main_scrolledwindow"))); | 733 | gtk_widget_hide (GTK_WIDGET (get_object ("gnunet_namestore_gtk_scrolledwindow"))); |
741 | gtk_widget_hide (GTK_WIDGET (get_object ("gnunet_namestore_gtk_gns_qr_image"))); | 734 | gtk_widget_hide (GTK_WIDGET (get_object ("gnunet_namestore_gtk_qr_image"))); |
742 | gtk_widget_hide (GTK_WIDGET (get_object ("gnunet_namestore_gtk_gns_qr_saveas_button"))); | 735 | gtk_widget_hide (GTK_WIDGET (get_object ("gnunet_namestore_gtk_qr_saveas_button"))); |
743 | gtk_widget_hide (GTK_WIDGET (get_object ("gnunet_namestore_gtk_gns_qr_vseparator"))); | 736 | gtk_widget_hide (GTK_WIDGET (get_object ("gnunet_namestore_gtk_qr_vseparator"))); |
744 | gtk_widget_hide (GTK_WIDGET (get_object ("gnunet_namestore_gtk_gns_pseu_hbox"))); | 737 | gtk_widget_hide (GTK_WIDGET (get_object ("gnunet_namestore_gtk_pseu_hbox"))); |
745 | gtk_tree_store_clear (ts); | 738 | gtk_tree_store_clear (ts); |
746 | } | 739 | } |
747 | 740 | ||
@@ -804,7 +797,7 @@ free_edit_dialog_context (struct EditDialogContext *edc) | |||
804 | * Process a record that was stored in the namestore. | 797 | * Process a record that was stored in the namestore. |
805 | * | 798 | * |
806 | * @param cls closure | 799 | * @param cls closure |
807 | * @param rd_count number of entries in 'rd' array | 800 | * @param rd_count number of entries in @a rd array |
808 | * @param rd array of records with data to store | 801 | * @param rd array of records with data to store |
809 | */ | 802 | */ |
810 | static void | 803 | static void |
@@ -853,7 +846,7 @@ merge_with_existing_records (void *cls, | |||
853 | * Process an encrypted that was stored in the namestore for | 846 | * Process an encrypted that was stored in the namestore for |
854 | * merging. | 847 | * merging. |
855 | * | 848 | * |
856 | * @param cls closure | 849 | * @param cls closure with the `struct MoveOperationContext` |
857 | * @param block block to decrypt | 850 | * @param block block to decrypt |
858 | */ | 851 | */ |
859 | static void | 852 | static void |
@@ -885,7 +878,7 @@ decrypt_block_for_merge (void *cls, | |||
885 | 878 | ||
886 | /** | 879 | /** |
887 | * The edit dialog completed; update the namestore and the | 880 | * The edit dialog completed; update the namestore and the |
888 | * view based on the new values in 'edc'. | 881 | * view based on the new values in @a edc. |
889 | * | 882 | * |
890 | * @param edc editing context information | 883 | * @param edc editing context information |
891 | * @param ret return code of the dialog | 884 | * @param ret return code of the dialog |
@@ -1080,7 +1073,7 @@ edit_dialog_continuation (struct EditDialogContext *edc, | |||
1080 | * @param ri record information for this name (can be NULL | 1073 | * @param ri record information for this name (can be NULL |
1081 | * if this is the first record for the name) | 1074 | * if this is the first record for the name) |
1082 | * @param off offset of the record being edited in the | 1075 | * @param off offset of the record being edited in the |
1083 | * ri's list; UINT_MAX if this is a new record | 1076 | * @a ri's list; UINT_MAX if this is a new record |
1084 | */ | 1077 | */ |
1085 | static void | 1078 | static void |
1086 | launch_edit_dialog (gint n_type, | 1079 | launch_edit_dialog (gint n_type, |
@@ -1174,7 +1167,7 @@ launch_edit_dialog (gint n_type, | |||
1174 | * | 1167 | * |
1175 | * @param ri existing records | 1168 | * @param ri existing records |
1176 | * @param n_type type of the new record | 1169 | * @param n_type type of the new record |
1177 | * @return GNUNET_OK if this is allowed | 1170 | * @return #GNUNET_OK if this is allowed |
1178 | */ | 1171 | */ |
1179 | static int | 1172 | static int |
1180 | check_permissions (struct RecordInfo *ri, | 1173 | check_permissions (struct RecordInfo *ri, |
@@ -1210,8 +1203,8 @@ check_permissions (struct RecordInfo *ri, | |||
1210 | * @param user_data main window builder | 1203 | * @param user_data main window builder |
1211 | */ | 1204 | */ |
1212 | void | 1205 | void |
1213 | gnunet_namestore_gtk_gns_popup_edit_button_activate_cb (GtkWidget *widget, | 1206 | gnunet_namestore_gtk_popup_edit_button_activate_cb (GtkWidget *widget, |
1214 | gpointer user_data) | 1207 | gpointer user_data) |
1215 | { | 1208 | { |
1216 | GtkTreeSelection *sel; | 1209 | GtkTreeSelection *sel; |
1217 | gint n_type; | 1210 | gint n_type; |
@@ -1263,10 +1256,10 @@ gnunet_namestore_gtk_gns_popup_edit_button_activate_cb (GtkWidget *widget, | |||
1263 | * @param user_data unused | 1256 | * @param user_data unused |
1264 | */ | 1257 | */ |
1265 | void | 1258 | void |
1266 | gnunet_namestore_gtk_gns_type_cellrenderercombo_edited_cb (GtkCellRendererText *text, | 1259 | gnunet_namestore_gtk_type_cellrenderercombo_edited_cb (GtkCellRendererText *text, |
1267 | gchar *path_string, | 1260 | gchar *path_string, |
1268 | gchar *new_text, | 1261 | gchar *new_text, |
1269 | gpointer user_data) | 1262 | gpointer user_data) |
1270 | { | 1263 | { |
1271 | GtkTreeIter it; | 1264 | GtkTreeIter it; |
1272 | guint type; | 1265 | guint type; |
@@ -1322,10 +1315,10 @@ gnunet_namestore_gtk_gns_type_cellrenderercombo_edited_cb (GtkCellRendererText * | |||
1322 | * @param user_data unused | 1315 | * @param user_data unused |
1323 | */ | 1316 | */ |
1324 | void | 1317 | void |
1325 | gnunet_namestore_gtk_gns_name_cellrenderertext_edited_cb (GtkCellRendererText *renderer, | 1318 | gnunet_namestore_gtk_name_cellrenderertext_edited_cb (GtkCellRendererText *renderer, |
1326 | gchar *path, | 1319 | gchar *path, |
1327 | gchar *new_text, | 1320 | gchar *new_text, |
1328 | gpointer user_data) | 1321 | gpointer user_data) |
1329 | { | 1322 | { |
1330 | GtkTreeIter it; | 1323 | GtkTreeIter it; |
1331 | gboolean not_dummy; | 1324 | gboolean not_dummy; |
@@ -1447,8 +1440,8 @@ create_popup_menu () | |||
1447 | * @return TRUE if a menu was activated | 1440 | * @return TRUE if a menu was activated |
1448 | */ | 1441 | */ |
1449 | gboolean | 1442 | gboolean |
1450 | gnunet_namestore_gtk_gns_main_treeview_popup_menu_cb (GtkWidget *widget, | 1443 | gnunet_namestore_gtk_treeview_popup_menu_cb (GtkWidget *widget, |
1451 | gpointer user_data) | 1444 | gpointer user_data) |
1452 | { | 1445 | { |
1453 | return create_popup_menu (); | 1446 | return create_popup_menu (); |
1454 | } | 1447 | } |
@@ -1464,7 +1457,7 @@ gnunet_namestore_gtk_gns_main_treeview_popup_menu_cb (GtkWidget *widget, | |||
1464 | * @return TRUE if a menu was activated (event was handled) | 1457 | * @return TRUE if a menu was activated (event was handled) |
1465 | */ | 1458 | */ |
1466 | gboolean | 1459 | gboolean |
1467 | gnunet_namestore_gtk_gns_main_treeview_button_press_event_cb (GtkWidget *widget, | 1460 | gnunet_namestore_gtk_treeview_button_press_event_cb (GtkWidget *widget, |
1468 | GdkEventButton *event, | 1461 | GdkEventButton *event, |
1469 | gpointer user_data) | 1462 | gpointer user_data) |
1470 | { | 1463 | { |
@@ -1488,7 +1481,7 @@ gnunet_namestore_gtk_gns_main_treeview_button_press_event_cb (GtkWidget *widget, | |||
1488 | * @return TRUE if the key was processed ('del') | 1481 | * @return TRUE if the key was processed ('del') |
1489 | */ | 1482 | */ |
1490 | gboolean | 1483 | gboolean |
1491 | gnunet_namestore_gtk_gns_main_treeview_key_press_event_cb (GtkWidget *widget, | 1484 | gnunet_namestore_gtk_treeview_key_press_event_cb (GtkWidget *widget, |
1492 | GdkEventKey *event, | 1485 | GdkEventKey *event, |
1493 | gpointer user_data) | 1486 | gpointer user_data) |
1494 | { | 1487 | { |
@@ -1614,7 +1607,7 @@ gnunet_namestore_gtk_gns_main_treeview_key_press_event_cb (GtkWidget *widget, | |||
1614 | * @param user_data unused | 1607 | * @param user_data unused |
1615 | */ | 1608 | */ |
1616 | void | 1609 | void |
1617 | gnunet_namestore_gtk_gns_pseu_entry_changed_cb (GtkEditable *editable, | 1610 | gnunet_namestore_gtk_pseu_entry_changed_cb (GtkEditable *editable, |
1618 | gpointer user_data) | 1611 | gpointer user_data) |
1619 | { | 1612 | { |
1620 | const gchar *pseu; | 1613 | const gchar *pseu; |
@@ -1713,7 +1706,7 @@ gnunet_namestore_gtk_gns_pseu_entry_changed_cb (GtkEditable *editable, | |||
1713 | * @param user_data unused | 1706 | * @param user_data unused |
1714 | */ | 1707 | */ |
1715 | void | 1708 | void |
1716 | gnunet_namestore_gtk_gns_public_key_copy_button_clicked_cb (GtkButton *button, | 1709 | gnunet_namestore_gtk_public_key_copy_button_clicked_cb (GtkButton *button, |
1717 | gpointer user_data) | 1710 | gpointer user_data) |
1718 | { | 1711 | { |
1719 | GtkClipboard *cb; | 1712 | GtkClipboard *cb; |
@@ -1737,20 +1730,20 @@ static void | |||
1737 | zone_sync_proc (void *cls) | 1730 | zone_sync_proc (void *cls) |
1738 | { | 1731 | { |
1739 | if (0 == strcmp (current_zone_option, "ZONEKEY")) | 1732 | if (0 == strcmp (current_zone_option, "ZONEKEY")) |
1740 | gtk_widget_show (GTK_WIDGET (get_object ("gnunet_namestore_gtk_gns_pseu_hbox"))); | 1733 | gtk_widget_show (GTK_WIDGET (get_object ("gnunet_namestore_gtk_pseu_hbox"))); |
1741 | #if HAVE_QRENCODE_H | 1734 | #if HAVE_QRENCODE_H |
1742 | setup_qrcode (); | 1735 | setup_qrcode (); |
1743 | gtk_widget_show (GTK_WIDGET (get_object ("gnunet_namestore_gtk_gns_qr_image"))); | 1736 | gtk_widget_show (GTK_WIDGET (get_object ("gnunet_namestore_gtk_qr_image"))); |
1744 | gtk_widget_show (GTK_WIDGET (get_object ("gnunet_namestore_gtk_gns_qr_saveas_button"))); | 1737 | gtk_widget_show (GTK_WIDGET (get_object ("gnunet_namestore_gtk_qr_saveas_button"))); |
1745 | gtk_widget_show (GTK_WIDGET (get_object ("gnunet_namestore_gtk_gns_qr_vseparator"))); | 1738 | gtk_widget_show (GTK_WIDGET (get_object ("gnunet_namestore_gtk_qr_vseparator"))); |
1746 | #else | 1739 | #else |
1747 | gtk_widget_hide (GTK_WIDGET (get_object ("gnunet_namestore_gtk_gns_qr_image"))); | 1740 | gtk_widget_hide (GTK_WIDGET (get_object ("gnunet_namestore_gtk_qr_image"))); |
1748 | gtk_widget_hide (GTK_WIDGET (get_object ("gnunet_namestore_gtk_gns_qr_saveas_button"))); | 1741 | gtk_widget_hide (GTK_WIDGET (get_object ("gnunet_namestore_gtk_qr_saveas_button"))); |
1749 | gtk_widget_hide (GTK_WIDGET (get_object ("gnunet_namestore_gtk_gns_qr_vseparator"))); | 1742 | gtk_widget_hide (GTK_WIDGET (get_object ("gnunet_namestore_gtk_qr_vseparator"))); |
1750 | #endif | 1743 | #endif |
1751 | gtk_widget_hide (GTK_WIDGET (get_object ("gnunet_namestore_gtk_gns_status_label"))); | 1744 | gtk_widget_hide (GTK_WIDGET (get_object ("gnunet_namestore_gtk_status_label"))); |
1752 | gtk_widget_show (GTK_WIDGET (get_object ("gnunet_namestore_gtk_gns_main_scrolledwindow"))); | 1745 | gtk_widget_show (GTK_WIDGET (get_object ("gnunet_namestore_gtk_scrolledwindow"))); |
1753 | gtk_widget_show (GTK_WIDGET (get_object ("gnunet_namestore_gtk_gns_zone_selection_hbuttonbox"))); | 1746 | gtk_widget_show (GTK_WIDGET (get_object ("gnunet_namestore_gtk_zone_selection_hbuttonbox"))); |
1754 | } | 1747 | } |
1755 | 1748 | ||
1756 | 1749 | ||
@@ -1924,7 +1917,7 @@ zone_iteration_proc (void *cls, | |||
1924 | (GNUNET_NAMESTORE_TYPE_PSEU == rd[c].record_type) && | 1917 | (GNUNET_NAMESTORE_TYPE_PSEU == rd[c].record_type) && |
1925 | (NULL == current_pseudonym) ) | 1918 | (NULL == current_pseudonym) ) |
1926 | { | 1919 | { |
1927 | pseu_entry = GTK_ENTRY((get_object ("gnunet_namestore_gtk_gns_pseu_entry"))); | 1920 | pseu_entry = GTK_ENTRY((get_object ("gnunet_namestore_gtk_pseu_entry"))); |
1928 | gtk_entry_set_text (pseu_entry, val); | 1921 | gtk_entry_set_text (pseu_entry, val); |
1929 | #if HAVE_QRENCODE_H | 1922 | #if HAVE_QRENCODE_H |
1930 | setup_qrcode (); | 1923 | setup_qrcode (); |
@@ -1998,7 +1991,7 @@ identity_cb (void *cls, | |||
1998 | show_error_message (_("Failed to load zone"), | 1991 | show_error_message (_("Failed to load zone"), |
1999 | emsg); | 1992 | emsg); |
2000 | GNUNET_free (emsg); | 1993 | GNUNET_free (emsg); |
2001 | gtk_widget_show (GTK_WIDGET (get_object ("gnunet_namestore_gtk_gns_zone_selection_hbuttonbox"))); | 1994 | gtk_widget_show (GTK_WIDGET (get_object ("gnunet_namestore_gtk_zone_selection_hbuttonbox"))); |
2002 | return; | 1995 | return; |
2003 | } | 1996 | } |
2004 | pkey = GNUNET_new (struct GNUNET_CRYPTO_EccPrivateKey); | 1997 | pkey = GNUNET_new (struct GNUNET_CRYPTO_EccPrivateKey); |
@@ -2006,7 +1999,7 @@ identity_cb (void *cls, | |||
2006 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (pkey, &pubkey); | 1999 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (pkey, &pubkey); |
2007 | label = g_markup_printf_escaped (_("<b>Editing zone %s</b>"), | 2000 | label = g_markup_printf_escaped (_("<b>Editing zone %s</b>"), |
2008 | GNUNET_NAMESTORE_z2s (&pubkey)); | 2001 | GNUNET_NAMESTORE_z2s (&pubkey)); |
2009 | gtk_label_set_markup (GTK_LABEL (get_object ("gnunet_namestore_gtk_gns_zone_label")), | 2002 | gtk_label_set_markup (GTK_LABEL (get_object ("gnunet_namestore_gtk_zone_label")), |
2010 | label); | 2003 | label); |
2011 | g_free (label); | 2004 | g_free (label); |
2012 | /* Append a top level row and leave it empty */ | 2005 | /* Append a top level row and leave it empty */ |
@@ -2071,8 +2064,8 @@ load_zone (const char *zonename) | |||
2071 | * @param user_data builder, unused | 2064 | * @param user_data builder, unused |
2072 | */ | 2065 | */ |
2073 | void | 2066 | void |
2074 | gnunet_namestore_gtk_gns_shorten_zone_selection_radiobutton_toggled_cb (GtkToggleButton *togglebutton, | 2067 | gnunet_namestore_gtk_shorten_zone_selection_radiobutton_toggled_cb (GtkToggleButton *togglebutton, |
2075 | gpointer user_data) | 2068 | gpointer user_data) |
2076 | { | 2069 | { |
2077 | if (gtk_toggle_button_get_active (togglebutton)) | 2070 | if (gtk_toggle_button_get_active (togglebutton)) |
2078 | load_zone ("gns-short"); | 2071 | load_zone ("gns-short"); |
@@ -2087,8 +2080,8 @@ gnunet_namestore_gtk_gns_shorten_zone_selection_radiobutton_toggled_cb (GtkToggl | |||
2087 | * @param user_data builder, unused | 2080 | * @param user_data builder, unused |
2088 | */ | 2081 | */ |
2089 | void | 2082 | void |
2090 | gnunet_namestore_gtk_gns_private_zone_selection_radiobutton_toggled_cb (GtkToggleButton *togglebutton, | 2083 | gnunet_namestore_gtk_private_zone_selection_radiobutton_toggled_cb (GtkToggleButton *togglebutton, |
2091 | gpointer user_data) | 2084 | gpointer user_data) |
2092 | { | 2085 | { |
2093 | if (gtk_toggle_button_get_active (togglebutton)) | 2086 | if (gtk_toggle_button_get_active (togglebutton)) |
2094 | load_zone ("gns-private"); | 2087 | load_zone ("gns-private"); |
@@ -2103,8 +2096,8 @@ gnunet_namestore_gtk_gns_private_zone_selection_radiobutton_toggled_cb (GtkToggl | |||
2103 | * @param user_data builder, unused | 2096 | * @param user_data builder, unused |
2104 | */ | 2097 | */ |
2105 | void | 2098 | void |
2106 | gnunet_namestore_gtk_gns_master_zone_selection_radiobutton_toggled_cb (GtkToggleButton *togglebutton, | 2099 | gnunet_namestore_gtk_master_zone_selection_radiobutton_toggled_cb (GtkToggleButton *togglebutton, |
2107 | gpointer user_data) | 2100 | gpointer user_data) |
2108 | { | 2101 | { |
2109 | if (gtk_toggle_button_get_active (togglebutton)) | 2102 | if (gtk_toggle_button_get_active (togglebutton)) |
2110 | load_zone ("gns-master"); | 2103 | load_zone ("gns-master"); |
@@ -2118,7 +2111,8 @@ gnunet_namestore_gtk_gns_master_zone_selection_radiobutton_toggled_cb (GtkToggle | |||
2118 | * @param tc scheduler context | 2111 | * @param tc scheduler context |
2119 | */ | 2112 | */ |
2120 | static void | 2113 | static void |
2121 | cleanup_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 2114 | cleanup_task (void *cls, |
2115 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
2122 | { | 2116 | { |
2123 | struct OperationContext *oc; | 2117 | struct OperationContext *oc; |
2124 | struct MoveOperationContext *moc; | 2118 | struct MoveOperationContext *moc; |
@@ -2131,8 +2125,8 @@ cleanup_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
2131 | GNUNET_GTK_main_loop_quit (ml); | 2125 | GNUNET_GTK_main_loop_quit (ml); |
2132 | 2126 | ||
2133 | 2127 | ||
2134 | gtk_widget_show (GTK_WIDGET (get_object ("gnunet_namestore_gtk_gns_status_label"))); | 2128 | gtk_widget_show (GTK_WIDGET (get_object ("gnunet_namestore_gtk_status_label"))); |
2135 | gtk_widget_hide (GTK_WIDGET (get_object ("gnunet_namestore_gtk_gns_main_scrolledwindow"))); | 2129 | gtk_widget_hide (GTK_WIDGET (get_object ("gnunet_namestore_gtk_scrolledwindow"))); |
2136 | if (NULL != zmon) | 2130 | if (NULL != zmon) |
2137 | { | 2131 | { |
2138 | GNUNET_NAMESTORE_zone_monitor_stop (zmon); | 2132 | GNUNET_NAMESTORE_zone_monitor_stop (zmon); |
@@ -2220,26 +2214,26 @@ run (void *cls, | |||
2220 | GtkLabel *status_label; | 2214 | GtkLabel *status_label; |
2221 | 2215 | ||
2222 | ml = cls; | 2216 | ml = cls; |
2217 | cfg = GNUNET_GTK_main_loop_get_configuration (ml); | ||
2223 | if (GNUNET_OK != GNUNET_GTK_main_loop_build_window (ml, NULL)) | 2218 | if (GNUNET_OK != GNUNET_GTK_main_loop_build_window (ml, NULL)) |
2224 | return; | 2219 | return; |
2225 | 2220 | ||
2226 | cfgName = GNUNET_GTK_main_loop_get_configuration_file (ml); | 2221 | main_window = GTK_WIDGET (get_object ("gnunet_namestore_gtk_dialog")); |
2227 | main_window = GTK_WIDGET (get_object ("gnunet_namestore_dialog")); | ||
2228 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, | 2222 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, |
2229 | &cleanup_task, NULL); | 2223 | &cleanup_task, NULL); |
2230 | 2224 | ||
2231 | namestore = GNUNET_NAMESTORE_connect (cfg); | 2225 | namestore = GNUNET_NAMESTORE_connect (cfg); |
2232 | if (NULL == namestore) | 2226 | if (NULL == namestore) |
2233 | { | 2227 | { |
2234 | status_label = GTK_LABEL (get_object ("gnunet_namestore_gtk_gns_status_label")); | 2228 | status_label = GTK_LABEL (get_object ("gnunet_namestore_gtk_status_label")); |
2235 | label = g_markup_printf_escaped (_("<b><big>Failed to connect to namestore</b></big>")); | 2229 | label = g_markup_printf_escaped (_("<b><big>Failed to connect to namestore</b></big>")); |
2236 | gtk_label_set_markup (status_label, label); | 2230 | gtk_label_set_markup (status_label, label); |
2237 | g_free (label); | 2231 | g_free (label); |
2238 | return; | 2232 | return; |
2239 | } | 2233 | } |
2240 | identity = GNUNET_IDENTITY_connect (cfg, NULL, NULL); | 2234 | identity = GNUNET_IDENTITY_connect (cfg, NULL, NULL); |
2241 | ts = GTK_TREE_STORE (get_object ("gnunet_namestore_gtk_gns_treestore")); | 2235 | ts = GTK_TREE_STORE (get_object ("gnunet_namestore_gtk_treestore")); |
2242 | tv = GTK_TREE_VIEW (get_object ("gnunet_namestore_gtk_gns_main_treeview")); | 2236 | tv = GTK_TREE_VIEW (get_object ("gnunet_namestore_gtk_treeview")); |
2243 | tm = GTK_TREE_MODEL (ts); | 2237 | tm = GTK_TREE_MODEL (ts); |
2244 | n2r = GNUNET_CONTAINER_multihashmap_create (128, GNUNET_NO); | 2238 | n2r = GNUNET_CONTAINER_multihashmap_create (128, GNUNET_NO); |
2245 | load_zone ("gns-master"); | 2239 | load_zone ("gns-master"); |