- return gtk_tree_selection_count_selected_rows(ql->selection) > 0;
- /* TODO ... but not if only selected track is playing track */
+ int counts[2] = { 0, 0 };
+ gtk_tree_selection_selected_foreach(ql->selection,
+ ql_remove_sensitive_callback,
+ counts);
+ /* Remove will work if we have at least some removable tracks selected, and
+ * no unremovable ones */
+ return counts[1] > 0 && counts[0] == 0;
+}
+
+static void ql_remove_completed(void attribute((unused)) *v,
+ const char *error) {
+ if(error)
+ popup_protocol_error(0, error);
+}
+
+static void ql_remove_activate_callback(GtkTreeModel *model,
+ GtkTreePath attribute((unused)) *path,
+ GtkTreeIter *iter,
+ gpointer attribute((unused)) data) {
+ struct queue_entry *q = ql_iter_to_q(model, iter);
+
+ disorder_eclient_remove(client, q->id, ql_remove_completed, q);