chiark / gitweb /
Disobedience login window now has a 'remote' switch. When off it will
[disorder] / disobedience / added.c
index 9373af333bca8299d8ec9884d6f22f1ebc05b777..ce747c49a9a016a2426fb95dd0862a6d24f6be90 100644 (file)
@@ -18,6 +18,7 @@
  * USA
  */
 #include "disobedience.h"
+#include "popup.h"
 #include "queue-generic.h"
 
 /** @brief Called with an updated list of newly-added tracks
  * with a valid and unique @c id field.  This function fakes it.
  */
 static void added_completed(void attribute((unused)) *v,
-                            const char *error,
+                            const char *err,
                             int nvec, char **vec) {
-  if(error) {
-    popup_protocol_error(0, error);
+  if(err) {
+    popup_protocol_error(0, err);
     return;
   }
   /* Convert the vector result to a queue linked list */
@@ -65,19 +66,19 @@ static void added_changed(const char attribute((unused)) *event,
 
 /** @brief Called at startup */
 static void added_init(void) {
-  event_register("added-changed", added_changed, 0);
+  event_register("rescan-complete", added_changed, 0);
 }
 
 /** @brief Columns for the new tracks list */
 static const struct queue_column added_columns[] = {
-  { "Artist", column_namepart, "artist", 0 },
-  { "Album",  column_namepart, "album",  0 },
-  { "Title",  column_namepart, "title",  0 },
-  { "Length", column_length,   0,        1 }
+  { "Artist", column_namepart, "artist", COL_EXPAND|COL_ELLIPSIZE },
+  { "Album",  column_namepart, "album",  COL_EXPAND|COL_ELLIPSIZE },
+  { "Title",  column_namepart, "title",  COL_EXPAND|COL_ELLIPSIZE },
+  { "Length", column_length,   0,        COL_RIGHT }
 };
 
 /** @brief Pop-up menu for new tracks list */
-static struct queue_menuitem added_menuitems[] = {
+static struct menuitem added_menuitems[] = {
   { "Track properties", ql_properties_activate, ql_properties_sensitive, 0, 0 },
   { "Play track", ql_play_activate, ql_play_sensitive, 0, 0 },
   { "Select all tracks", ql_selectall_activate, ql_selectall_sensitive, 0, 0 },
@@ -85,6 +86,7 @@ static struct queue_menuitem added_menuitems[] = {
 };
 
 struct queuelike ql_added = {
+  .name = "added",
   .init = added_init,
   .columns = added_columns,
   .ncolumns = sizeof added_columns / sizeof *added_columns,