implement functionality to save queues to playlists
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use std::cmp::{max, min};
|
||||
use std::sync::{Arc, RwLock};
|
||||
use std::sync::{Arc, RwLock, RwLockReadGuard};
|
||||
|
||||
use cursive::align::HAlign;
|
||||
use cursive::event::{Event, EventResult, MouseButton, MouseEvent};
|
||||
@@ -54,6 +54,12 @@ impl<I: ListItem> ListView<I> {
|
||||
let new = self.selected as i32 + delta;
|
||||
self.move_focus_to(max(new, 0) as usize);
|
||||
}
|
||||
|
||||
pub fn content(&self) -> RwLockReadGuard<Vec<I>> {
|
||||
self.content
|
||||
.read()
|
||||
.expect("could not readlock listview content")
|
||||
}
|
||||
}
|
||||
|
||||
impl<I: ListItem> View for ListView<I> {
|
||||
|
||||
Reference in New Issue
Block a user