diff options
Diffstat (limited to 'src/fs/gnunet-fs-gtk_event-handler.c')
-rw-r--r-- | src/fs/gnunet-fs-gtk_event-handler.c | 39 |
1 files changed, 30 insertions, 9 deletions
diff --git a/src/fs/gnunet-fs-gtk_event-handler.c b/src/fs/gnunet-fs-gtk_event-handler.c index b46c7ec0..a55cbe49 100644 --- a/src/fs/gnunet-fs-gtk_event-handler.c +++ b/src/fs/gnunet-fs-gtk_event-handler.c | |||
@@ -1236,26 +1236,47 @@ populate_popup_with_uri_items (void *cls, | |||
1236 | { | 1236 | { |
1237 | struct UriPopulationContext *ctx = cls; | 1237 | struct UriPopulationContext *ctx = cls; |
1238 | GtkWidget *child; | 1238 | GtkWidget *child; |
1239 | char *label; | 1239 | char *labels; |
1240 | GtkWidget *ns_association_icon; | 1240 | GtkWidget *ns_association_icon; |
1241 | char *uris; | 1241 | char *uris; |
1242 | GtkWidget *box; | ||
1243 | GtkWidget *label; | ||
1244 | GtkAccelGroup *accel_group; | ||
1242 | 1245 | ||
1243 | ctx->counter++; | 1246 | ctx->counter++; |
1244 | uris = GNUNET_FS_uri_to_string (uri); | 1247 | uris = GNUNET_FS_uri_to_string (uri); |
1245 | GNUNET_asprintf (&label, | 1248 | GNUNET_asprintf (&labels, |
1246 | _("URI #%d: %s"), | 1249 | _("URI #%d: %s"), |
1247 | ctx->counter, | 1250 | ctx->counter, |
1248 | uris); | 1251 | uris); |
1249 | GNUNET_free (uris); | 1252 | GNUNET_free (uris); |
1250 | child = gtk_image_menu_item_new_with_label (label); | 1253 | label = gtk_accel_label_new (labels); |
1251 | GNUNET_free (label); | 1254 | GNUNET_free (labels); |
1252 | 1255 | box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, | |
1256 | 2); | ||
1257 | child = gtk_menu_item_new (); | ||
1253 | ns_association_icon = gtk_image_new_from_icon_name ("gnunet-fs-gtk-ns-association", | 1258 | ns_association_icon = gtk_image_new_from_icon_name ("gnunet-fs-gtk-ns-association", |
1254 | GTK_ICON_SIZE_MENU); | 1259 | GTK_ICON_SIZE_MENU); |
1255 | 1260 | gtk_container_add (GTK_CONTAINER (box), | |
1256 | /* Takes ownership of the icon */ | 1261 | ns_association_icon); |
1257 | gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (child), | 1262 | gtk_label_set_xalign (GTK_LABEL (label), |
1258 | ns_association_icon); | 1263 | 0.0); |
1264 | accel_group = gtk_accel_group_new (); | ||
1265 | gtk_widget_add_accelerator (child, | ||
1266 | "activate", | ||
1267 | accel_group, | ||
1268 | GDK_KEY_m, | ||
1269 | GDK_CONTROL_MASK, | ||
1270 | GTK_ACCEL_VISIBLE); | ||
1271 | gtk_accel_label_set_accel_widget (GTK_ACCEL_LABEL (label), | ||
1272 | child); | ||
1273 | gtk_box_pack_end (GTK_BOX (box), | ||
1274 | label, | ||
1275 | TRUE, | ||
1276 | TRUE, | ||
1277 | 0); | ||
1278 | gtk_container_add (GTK_CONTAINER (child), | ||
1279 | box); | ||
1259 | 1280 | ||
1260 | g_object_set_data_full (G_OBJECT (child), | 1281 | g_object_set_data_full (G_OBJECT (child), |
1261 | "fs-uri", | 1282 | "fs-uri", |