diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-02-02 20:11:33 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-02-02 20:11:33 +0000 |
commit | 3bac269295fb91e0908f445beeef72a6b9e15c3a (patch) | |
tree | 54a0791341845e137c7adce588101b08d00b536f | |
parent | cf8082825451ef71b60b687a4d740f7381956380 (diff) | |
download | gnunet-gtk-3bac269295fb91e0908f445beeef72a6b9e15c3a.tar.gz gnunet-gtk-3bac269295fb91e0908f445beeef72a6b9e15c3a.zip |
-resolving misc fixmes, classifying others
-rw-r--r-- | src/fs/gnunet-fs-gtk.c | 5 | ||||
-rw-r--r-- | src/fs/gnunet-fs-gtk_create-pseudonym.c | 2 | ||||
-rw-r--r-- | src/fs/gnunet-fs-gtk_main-window-namespace-dropdown.c | 12 | ||||
-rw-r--r-- | src/fs/gnunet-fs-gtk_open-directory.c | 2 | ||||
-rw-r--r-- | src/fs/gnunet-fs-gtk_publish-dialog.c | 53 |
5 files changed, 23 insertions, 51 deletions
diff --git a/src/fs/gnunet-fs-gtk.c b/src/fs/gnunet-fs-gtk.c index 8d092ba2..bbc8f58d 100644 --- a/src/fs/gnunet-fs-gtk.c +++ b/src/fs/gnunet-fs-gtk.c | |||
@@ -158,11 +158,12 @@ run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
158 | GTK_SELECTION_MULTIPLE); | 158 | GTK_SELECTION_MULTIPLE); |
159 | 159 | ||
160 | GNUNET_GTK_tray_icon_create (GTK_WINDOW (main_window), | 160 | GNUNET_GTK_tray_icon_create (GTK_WINDOW (main_window), |
161 | "gnunet-gtk" /* FIXME: rename icon? */ , | 161 | "gnunet-fs-gtk", |
162 | "gnunet-fs-gtk"); | 162 | "gnunet-fs-gtk"); |
163 | /* initialize file-sharing */ | 163 | /* initialize file-sharing */ |
164 | fs = GNUNET_FS_start (GNUNET_GTK_main_loop_get_configuration (ml), | 164 | fs = GNUNET_FS_start (GNUNET_GTK_main_loop_get_configuration (ml), |
165 | "gnunet-gtk", &GNUNET_GTK_fs_event_handler, NULL, | 165 | "gnunet-fs-gtk", |
166 | &GNUNET_GTK_fs_event_handler, NULL, | ||
166 | GNUNET_FS_FLAGS_NONE /* | GNUNET_FS_FLAGS_PERSISTENCE | | 167 | GNUNET_FS_FLAGS_NONE /* | GNUNET_FS_FLAGS_PERSISTENCE | |
167 | * GNUNET_FS_FLAGS_DO_PROBES */ , | 168 | * GNUNET_FS_FLAGS_DO_PROBES */ , |
168 | GNUNET_FS_OPTIONS_END); | 169 | GNUNET_FS_OPTIONS_END); |
diff --git a/src/fs/gnunet-fs-gtk_create-pseudonym.c b/src/fs/gnunet-fs-gtk_create-pseudonym.c index 708ace52..558fcb91 100644 --- a/src/fs/gnunet-fs-gtk_create-pseudonym.c +++ b/src/fs/gnunet-fs-gtk_create-pseudonym.c | |||
@@ -51,7 +51,7 @@ GNUNET_GTK_create_namespace_dialog_response_cb (GtkDialog * dialog, | |||
51 | } | 51 | } |
52 | name = gtk_entry_get_text (GTK_ENTRY (gtk_builder_get_object (builder, | 52 | name = gtk_entry_get_text (GTK_ENTRY (gtk_builder_get_object (builder, |
53 | "GNUNET_GTK_create_namespace_name_entry"))); | 53 | "GNUNET_GTK_create_namespace_name_entry"))); |
54 | /* FIXME: show busy dialog while doing key creation */ | 54 | /* FIXME-FEATURE: show busy dialog while doing key creation */ |
55 | if (NULL != name) | 55 | if (NULL != name) |
56 | { | 56 | { |
57 | ns = GNUNET_FS_namespace_create (GNUNET_FS_GTK_get_fs_handle (), name); | 57 | ns = GNUNET_FS_namespace_create (GNUNET_FS_GTK_get_fs_handle (), name); |
diff --git a/src/fs/gnunet-fs-gtk_main-window-namespace-dropdown.c b/src/fs/gnunet-fs-gtk_main-window-namespace-dropdown.c index 8093ba2d..af8a2399 100644 --- a/src/fs/gnunet-fs-gtk_main-window-namespace-dropdown.c +++ b/src/fs/gnunet-fs-gtk_main-window-namespace-dropdown.c | |||
@@ -36,7 +36,7 @@ | |||
36 | * ID of a timeout task which we schedule to close the drop-down automatically | 36 | * ID of a timeout task which we schedule to close the drop-down automatically |
37 | * if the mouse leaves the area for a while. 0 for no such task. | 37 | * if the mouse leaves the area for a while. 0 for no such task. |
38 | * | 38 | * |
39 | * FIXME: this task is not cancelled if the main window is closed while | 39 | * FIXME-BUG-MINOR: this task is not cancelled if the main window is closed while |
40 | * the drop-down is down. | 40 | * the drop-down is down. |
41 | */ | 41 | */ |
42 | static guint namespace_selector_window_leave_timeout_source; | 42 | static guint namespace_selector_window_leave_timeout_source; |
@@ -403,7 +403,7 @@ GNUNET_GTK_main_window_realize_cb (GtkWidget * widget, gpointer user_data) | |||
403 | GtkTreeIter iter; | 403 | GtkTreeIter iter; |
404 | GtkTreeStore *namespace_treestore; | 404 | GtkTreeStore *namespace_treestore; |
405 | 405 | ||
406 | /* FIXME: can't we do the button initialization when we create the main window? */ | 406 | /* FIXME-STYLE: can't we do the button initialization when we create the main window? */ |
407 | /* Make sure button class is realized */ | 407 | /* Make sure button class is realized */ |
408 | g_type_class_unref (g_type_class_ref (GTK_TYPE_BUTTON)); | 408 | g_type_class_unref (g_type_class_ref (GTK_TYPE_BUTTON)); |
409 | /* GNUnet main window assumes that images on buttons are visible, | 409 | /* GNUnet main window assumes that images on buttons are visible, |
@@ -417,7 +417,7 @@ GNUNET_GTK_main_window_realize_cb (GtkWidget * widget, gpointer user_data) | |||
417 | GTK_TREE_STORE (GNUNET_FS_GTK_get_main_window_object | 417 | GTK_TREE_STORE (GNUNET_FS_GTK_get_main_window_object |
418 | ("main_window_search_namespace_treestore")); | 418 | ("main_window_search_namespace_treestore")); |
419 | 419 | ||
420 | /* FIXME: find a way to manage pseudonyms. | 420 | /* FIXME-FEATURE: find a way to manage pseudonyms. |
421 | * Right now the list will be filled with ALL and ANY pseudonyms that we | 421 | * Right now the list will be filled with ALL and ANY pseudonyms that we |
422 | * find, these are held as files in a special directory. | 422 | * find, these are held as files in a special directory. |
423 | * I don't see an easy way to ignore certain pseudonyms in that directory, | 423 | * I don't see an easy way to ignore certain pseudonyms in that directory, |
@@ -430,7 +430,7 @@ GNUNET_GTK_main_window_realize_cb (GtkWidget * widget, gpointer user_data) | |||
430 | 0, "Any", 1, NULL, 2, "", 3, | 430 | 0, "Any", 1, NULL, 2, "", 3, |
431 | "Do not search in any particular namespace", | 431 | "Do not search in any particular namespace", |
432 | -1); | 432 | -1); |
433 | /* FIXME-BUG: when do we unregister? */ | 433 | /* FIXME-BUG-MINOR: when do we unregister? */ |
434 | GNUNET_PSEUDONYM_discovery_callback_register (GNUNET_FS_GTK_get_configuration (), | 434 | GNUNET_PSEUDONYM_discovery_callback_register (GNUNET_FS_GTK_get_configuration (), |
435 | &add_namespace_to_ts, | 435 | &add_namespace_to_ts, |
436 | namespace_treestore); | 436 | namespace_treestore); |
@@ -461,7 +461,9 @@ GNUNET_GTK_main_window_realize_cb (GtkWidget * widget, gpointer user_data) | |||
461 | } | 461 | } |
462 | 462 | ||
463 | /* show the window (to trigger certain events) and immediately hide it */ | 463 | /* show the window (to trigger certain events) and immediately hide it */ |
464 | /* FIXME: yuck, can't we trigger these events by other means? */ | 464 | /* FIXME-STYLE: yuck, can't we trigger these events by other means? |
465 | CG->LRN: Which events are you even talking about here? I can't find anything | ||
466 | that would seem to be needed here. */ | ||
465 | { | 467 | { |
466 | GtkWidget *namespace_selector_window; | 468 | GtkWidget *namespace_selector_window; |
467 | 469 | ||
diff --git a/src/fs/gnunet-fs-gtk_open-directory.c b/src/fs/gnunet-fs-gtk_open-directory.c index 33ca2003..fb6bfec2 100644 --- a/src/fs/gnunet-fs-gtk_open-directory.c +++ b/src/fs/gnunet-fs-gtk_open-directory.c | |||
@@ -168,7 +168,7 @@ GNUNET_GTK_main_menu_file_open_gnunet_directory_activate_cb (GtkWidget * dummy, | |||
168 | (builder, "GNUNET_GTK_open_directory_dialog")); | 168 | (builder, "GNUNET_GTK_open_directory_dialog")); |
169 | ff = GTK_FILE_FILTER (gtk_builder_get_object | 169 | ff = GTK_FILE_FILTER (gtk_builder_get_object |
170 | (builder, "gnunet_directory_filter")); | 170 | (builder, "gnunet_directory_filter")); |
171 | /* FIXME: some day, write a custom file filter for gnunet-directories... */ | 171 | /* FIXME-FEATURE: some day, write a custom file filter for gnunet-directories... */ |
172 | gtk_file_filter_add_pattern (ff, "*" GNUNET_FS_DIRECTORY_EXT); | 172 | gtk_file_filter_add_pattern (ff, "*" GNUNET_FS_DIRECTORY_EXT); |
173 | 173 | ||
174 | toplevel = gtk_widget_get_toplevel (dummy); | 174 | toplevel = gtk_widget_get_toplevel (dummy); |
diff --git a/src/fs/gnunet-fs-gtk_publish-dialog.c b/src/fs/gnunet-fs-gtk_publish-dialog.c index 914c62f5..ab52502d 100644 --- a/src/fs/gnunet-fs-gtk_publish-dialog.c +++ b/src/fs/gnunet-fs-gtk_publish-dialog.c | |||
@@ -129,22 +129,12 @@ struct MainPublishingDialogContext | |||
129 | GtkWidget *cancel_button; | 129 | GtkWidget *cancel_button; |
130 | 130 | ||
131 | /** | 131 | /** |
132 | * FIXME: ugly, keep? | 132 | * Builder for the open directory dialog (non-NULL while the dialog is open) |
133 | */ | ||
134 | gulong open_directory_handler_id; | ||
135 | |||
136 | /** | ||
137 | * FIXME: ugly, keep? | ||
138 | */ | 133 | */ |
139 | GtkBuilder *open_directory_builder; | 134 | GtkBuilder *open_directory_builder; |
140 | 135 | ||
141 | /** | 136 | /** |
142 | * FIXME: ugly, keep? | 137 | * Builder for the open file dialog (non-NULL while the dialog is open) |
143 | */ | ||
144 | gulong open_file_handler_id; | ||
145 | |||
146 | /** | ||
147 | * FIXME: ugly, keep? | ||
148 | */ | 138 | */ |
149 | GtkBuilder *open_file_builder; | 139 | GtkBuilder *open_file_builder; |
150 | 140 | ||
@@ -1260,12 +1250,6 @@ publish_directory_dialog_response_cb (GtkDialog * dialog, | |||
1260 | { | 1250 | { |
1261 | struct MainPublishingDialogContext *ctx = user_data; | 1251 | struct MainPublishingDialogContext *ctx = user_data; |
1262 | 1252 | ||
1263 | /* FIXME-UGLY: how about using a separate closure and not needing this mess? | ||
1264 | In fact, even without it I don't see why we need to disconnect the handler... */ | ||
1265 | if (g_signal_handler_is_connected (G_OBJECT (dialog), ctx->open_directory_handler_id)) | ||
1266 | g_signal_handler_disconnect (G_OBJECT (dialog), ctx->open_directory_handler_id); | ||
1267 | ctx->open_directory_handler_id = 0; | ||
1268 | |||
1269 | if (response_id == -5 /* OK */) | 1253 | if (response_id == -5 /* OK */) |
1270 | { | 1254 | { |
1271 | char *filename; | 1255 | char *filename; |
@@ -1327,12 +1311,6 @@ publish_file_dialog_response_cb (GtkDialog * dialog, | |||
1327 | { | 1311 | { |
1328 | struct MainPublishingDialogContext *ctx = user_data; | 1312 | struct MainPublishingDialogContext *ctx = user_data; |
1329 | 1313 | ||
1330 | /* FIXME-UGLY: how about using a separate closure and not needing this mess? | ||
1331 | In fact, even without it I don't see why we need to disconnect the handler... */ | ||
1332 | if (g_signal_handler_is_connected (G_OBJECT (dialog), ctx->open_file_handler_id)) | ||
1333 | g_signal_handler_disconnect (G_OBJECT (dialog), ctx->open_file_handler_id); | ||
1334 | ctx->open_file_handler_id = 0; | ||
1335 | |||
1336 | if (response_id == -5 /* OK */) | 1314 | if (response_id == -5 /* OK */) |
1337 | { | 1315 | { |
1338 | char *filename; | 1316 | char *filename; |
@@ -1397,9 +1375,6 @@ GNUNET_GTK_master_publish_dialog_add_button_clicked_cb (GtkWidget * dummy, | |||
1397 | GtkWidget *ad; | 1375 | GtkWidget *ad; |
1398 | GtkComboBox *combo; | 1376 | GtkComboBox *combo; |
1399 | 1377 | ||
1400 | /* FIXME-UGLY: should we use a fresh, specific context for this dialog? | ||
1401 | FIXME-BUG: how does this right now prevent two dialogs from being opened? | ||
1402 | (or the master dialog from being closed in the meantime?) */ | ||
1403 | ctx->open_file_builder = GNUNET_GTK_get_new_builder ("gnunet_fs_gtk_publish_file_dialog.glade", ctx); | 1378 | ctx->open_file_builder = GNUNET_GTK_get_new_builder ("gnunet_fs_gtk_publish_file_dialog.glade", ctx); |
1404 | GNUNET_FS_GTK_setup_expiration_year_adjustment (ctx->open_file_builder); | 1379 | GNUNET_FS_GTK_setup_expiration_year_adjustment (ctx->open_file_builder); |
1405 | ad = GTK_WIDGET (gtk_builder_get_object | 1380 | ad = GTK_WIDGET (gtk_builder_get_object |
@@ -1412,9 +1387,10 @@ GNUNET_GTK_master_publish_dialog_add_button_clicked_cb (GtkWidget * dummy, | |||
1412 | "GNUNET_GTK_publish_file_dialog_replication_spin_button")), 0); | 1387 | "GNUNET_GTK_publish_file_dialog_replication_spin_button")), 0); |
1413 | gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (ctx->open_file_builder, | 1388 | gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (ctx->open_file_builder, |
1414 | "GNUNET_GTK_publish_file_dialog_do_index_checkbutton")), TRUE); | 1389 | "GNUNET_GTK_publish_file_dialog_do_index_checkbutton")), TRUE); |
1415 | 1390 | ||
1416 | ctx->open_file_handler_id = g_signal_connect (G_OBJECT (ad), "response", | 1391 | /* FIXME-UGLY: automatically connect using glade instead */ |
1417 | G_CALLBACK (publish_file_dialog_response_cb), ctx); | 1392 | g_signal_connect (G_OBJECT (ad), "response", |
1393 | G_CALLBACK (publish_file_dialog_response_cb), ctx); | ||
1418 | combo = GTK_COMBO_BOX (gtk_builder_get_object (ctx->open_file_builder, | 1394 | combo = GTK_COMBO_BOX (gtk_builder_get_object (ctx->open_file_builder, |
1419 | "GNUNET_GTK_publish_file_dialog_anonymity_combobox")); | 1395 | "GNUNET_GTK_publish_file_dialog_anonymity_combobox")); |
1420 | gtk_combo_box_set_model (combo, | 1396 | gtk_combo_box_set_model (combo, |
@@ -1442,12 +1418,8 @@ GNUNET_GTK_master_publish_dialog_open_button_clicked_cb (GtkWidget * dummy, | |||
1442 | struct MainPublishingDialogContext *ctx = user_data; | 1418 | struct MainPublishingDialogContext *ctx = user_data; |
1443 | GtkWidget *ad; | 1419 | GtkWidget *ad; |
1444 | GtkComboBox *combo; | 1420 | GtkComboBox *combo; |
1445 | GtkTreeModel *anon_treemodel; | ||
1446 | |||
1447 | /* FIXME-UGLY: should we use a fresh, specific context for this dialog? | ||
1448 | FIXME-BUG: how does this right now prevent two dialogs from being opened? | ||
1449 | (or the master dialog from being closed in the meantime?) */ | ||
1450 | 1421 | ||
1422 | /* FIXME-UGLY: should we use a fresh, specific context for this dialog? */ | ||
1451 | ctx->open_directory_builder = GNUNET_GTK_get_new_builder ("gnunet_fs_gtk_publish_directory_dialog.glade", ctx); | 1423 | ctx->open_directory_builder = GNUNET_GTK_get_new_builder ("gnunet_fs_gtk_publish_directory_dialog.glade", ctx); |
1452 | GNUNET_FS_GTK_setup_expiration_year_adjustment (ctx->open_directory_builder); | 1424 | GNUNET_FS_GTK_setup_expiration_year_adjustment (ctx->open_directory_builder); |
1453 | 1425 | ||
@@ -1462,15 +1434,12 @@ GNUNET_GTK_master_publish_dialog_open_button_clicked_cb (GtkWidget * dummy, | |||
1462 | ad = GTK_WIDGET (gtk_builder_get_object | 1434 | ad = GTK_WIDGET (gtk_builder_get_object |
1463 | (ctx->open_directory_builder, "GNUNET_GTK_publish_directory_dialog")); | 1435 | (ctx->open_directory_builder, "GNUNET_GTK_publish_directory_dialog")); |
1464 | 1436 | ||
1465 | ctx->open_directory_handler_id = g_signal_connect (G_OBJECT (ad), "response", | 1437 | /* FIXME-UGLY: automatically connect using glade instead */ |
1466 | G_CALLBACK (publish_directory_dialog_response_cb), ctx); | 1438 | g_signal_connect (G_OBJECT (ad), "response", |
1467 | 1439 | G_CALLBACK (publish_directory_dialog_response_cb), ctx); | |
1468 | /* FIXME-BUG-MAYBE: possibly bad sharing of the anonymity tree model */ | ||
1469 | anon_treemodel = GTK_TREE_MODEL (gtk_builder_get_object (ctx->main_window_builder, | ||
1470 | "main_window_search_anonymity_liststore")); | ||
1471 | combo = GTK_COMBO_BOX (gtk_builder_get_object (ctx->open_directory_builder, | 1440 | combo = GTK_COMBO_BOX (gtk_builder_get_object (ctx->open_directory_builder, |
1472 | "GNUNET_GTK_publish_directory_dialog_anonymity_combobox")); | 1441 | "GNUNET_GTK_publish_directory_dialog_anonymity_combobox")); |
1473 | gtk_combo_box_set_model (combo, anon_treemodel); | 1442 | gtk_combo_box_set_model (combo, GNUNET_FS_GTK_get_anonymity_level_list_store ()); |
1474 | 1443 | ||
1475 | /* show dialog */ | 1444 | /* show dialog */ |
1476 | gtk_window_set_transient_for (GTK_WINDOW (ad), ctx->master_pubdialog); | 1445 | gtk_window_set_transient_for (GTK_WINDOW (ad), ctx->master_pubdialog); |