+/* Newly added tracks ------------------------------------------------------ */
+
+/** @brief Pop-up menu for recently played list */
+static struct queue_menuitem added_menu[] = {
+ { "Track properties", properties_activate, properties_sensitive, 0, 0 },
+ { "Play track", play_activate, play_sensitive, 0, 0 },
+ { "Select all tracks", selectall_activate, selectall_sensitive, 0, 0 },
+ { 0, 0, 0, 0, 0 }
+};
+
+/** @brief Create the newly-added list */
+GtkWidget *added_widget(void) {
+ D(("added_widget"));
+ register_reset(added_update);
+ return queuelike(&ql_added, 0/*fixup*/, 0/*notify*/, added_menu,
+ addedcolumns, NADDEDCOLUMNS);
+}
+
+/** @brief Called with an updated list of newly-added tracks
+ *
+ * This is called with a raw list of track names but the rest of @ref
+ * disobedience/queue.c requires @ref queue_entry structures with a valid and
+ * unique @c id field. This function fakes it.
+ */
+static void new_completed(void *v, int nvec, char **vec) {
+ struct queue_entry *q, *qh, *qlast = 0, **qq = &qh;
+ int n;
+
+ for(n = 0; n < nvec; ++n) {
+ q = xmalloc(sizeof *q);
+ q->prev = qlast;
+ q->track = vec[n];
+ q->id = vec[n];
+ *qq = q;
+ qq = &q->next;
+ qlast = q;
+ }
+ *qq = 0;
+ queuelike_completed(v, qh);
+}
+
+/** @brief Update the newly-added list */
+void added_update(void) {
+ struct callbackdata *cbd;
+ D(("added_updae"));
+
+ cbd = xmalloc(sizeof *cbd);
+ cbd->onerror = 0;
+ cbd->u.ql = &ql_added;
+ gtk_label_set_text(GTK_LABEL(report_label),
+ "updating newly added track list");
+ disorder_eclient_new_tracks(client, new_completed, 0/*all*/, cbd);
+}
+