Initialize comment entry in recording editor

This commit is contained in:
Elias Projahn 2020-11-08 18:00:46 +01:00
parent a763b8a9c3
commit 9ee7bf166d

View file

@ -12,7 +12,6 @@ use std::rc::Rc;
/// A widget for creating or editing a recording. /// A widget for creating or editing a recording.
// TODO: Disable buttons if no performance is selected. // TODO: Disable buttons if no performance is selected.
// TODO: Initialize comment entry.
pub struct RecordingEditor { pub struct RecordingEditor {
pub widget: gtk::Box, pub widget: gtk::Box,
backend: Rc<Backend>, backend: Rc<Backend>,
@ -56,7 +55,10 @@ impl RecordingEditor {
scroll.add(&performance_list.widget); scroll.add(&performance_list.widget);
let (id, work, performances) = match recording { let (id, work, performances) = match recording {
Some(recording) => (recording.id, Some(recording.work), recording.performances), Some(recording) => {
comment_entry.set_text(&recording.comment);
(recording.id, Some(recording.work), recording.performances)
}
None => (rand::random::<u32>().into(), None, Vec::new()), None => (rand::random::<u32>().into(), None, Vec::new()),
}; };