/** @brief Determine whether the menu's play option should be sensitive */
static gboolean sensitive_track_play(struct choosenode attribute((unused)) *cn) {
return (!!files_selected
- && (disorder_eclient_state(client) & DISORDER_CONNECTED));
+ && (disorder_eclient_state(client) & DISORDER_CONNECTED)
+ && (last_rights & RIGHT_PLAY));
}
/** @brief Determine whether the menu's properties option should be sensitive */
static gboolean sensitive_track_properties(struct choosenode attribute((unused)) *cn) {
- return !!files_selected && (disorder_eclient_state(client) & DISORDER_CONNECTED);
+ return (!!files_selected
+ && (disorder_eclient_state(client) & DISORDER_CONNECTED)
+ && (last_rights & RIGHT_PREFS));
}
/* Directory menu items ---------------------------------------------------- */
/* We can scratch if the playing track is selected */
return (playing_track
&& (disorder_eclient_state(client) & DISORDER_CONNECTED)
- && selection_selected(ql->selection, playing_track->id));
+ && selection_selected(ql->selection, playing_track->id)
+ && (last_rights & RIGHT_SCRATCH__MASK));
+ /* TODO: rights is more complicated than that */
}
/** @brief Called when disorder_eclient_scratch completes */
return ((disorder_eclient_state(client) & DISORDER_CONNECTED)
&& ((q
&& q != playing_track)
- || count_selected_nonplaying(ql)));
+ || count_selected_nonplaying(ql))
+ && (last_rights & RIGHT_REMOVE__MASK));
+ /* TODO: rights is more complicated than that */
}
static void remove_completed(void attribute((unused)) *v,
struct queue_entry attribute((unused)) *q) {
/* "Properties" is sensitive if at least something is selected */
return (hash_count(ql->selection) > 0
- && (disorder_eclient_state(client) & DISORDER_CONNECTED));
+ && (disorder_eclient_state(client) & DISORDER_CONNECTED)
+ && (last_rights & RIGHT_PREFS));
}
/** @brief Pop up properties for the selected tracks */
struct queue_entry attribute((unused)) *q) {
/* "Play" is sensitive if at least something is selected */
return (hash_count(ql->selection) > 0
- && (disorder_eclient_state(client) & DISORDER_CONNECTED));
+ && (disorder_eclient_state(client) & DISORDER_CONNECTED)
+ && (last_rights & RIGHT_PLAY));
}
/** @brief Play the selected tracks */
static int queue_properties_sensitive(GtkWidget *w) {
return (!!queue_count_selected(g_object_get_data(G_OBJECT(w), "queue"))
- && (disorder_eclient_state(client) & DISORDER_CONNECTED));
+ && (disorder_eclient_state(client) & DISORDER_CONNECTED)
+ && (last_rights & RIGHT_PREFS));
}
static int queue_selectall_sensitive(GtkWidget *w) {