mirror of
https://github.com/johrpan/musicus.git
synced 2025-10-26 19:57:25 +01:00
Refresh recording editor
This commit is contained in:
parent
0e7a2f1f3d
commit
3339945380
7 changed files with 195 additions and 179 deletions
|
|
@ -2,7 +2,7 @@
|
||||||
<!-- Generated with glade 3.38.1 -->
|
<!-- Generated with glade 3.38.1 -->
|
||||||
<interface>
|
<interface>
|
||||||
<requires lib="gtk+" version="3.22"/>
|
<requires lib="gtk+" version="3.22"/>
|
||||||
<requires lib="libhandy" version="0.0"/>
|
<requires lib="libhandy" version="1.0"/>
|
||||||
<object class="GtkStack" id="widget">
|
<object class="GtkStack" id="widget">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
|
|
@ -17,20 +17,32 @@
|
||||||
<property name="can-focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="title" translatable="yes">Recording</property>
|
<property name="title" translatable="yes">Recording</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkButton" id="cancel_button">
|
<object class="GtkButton" id="back_button">
|
||||||
<property name="label" translatable="yes">Cancel</property>
|
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">True</property>
|
<property name="can-focus">True</property>
|
||||||
<property name="receives-default">True</property>
|
<property name="receives-default">True</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkImage">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="icon-name">go-previous-symbolic</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkButton" id="save_button">
|
<object class="GtkButton" id="save_button">
|
||||||
<property name="label" translatable="yes">Save</property>
|
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="sensitive">False</property>
|
<property name="sensitive">False</property>
|
||||||
<property name="can-focus">True</property>
|
<property name="can-focus">True</property>
|
||||||
<property name="receives-default">True</property>
|
<property name="receives-default">True</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkImage">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="icon-name">object-select-symbolic</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
<style>
|
<style>
|
||||||
<class name="suggested-action"/>
|
<class name="suggested-action"/>
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -52,6 +64,26 @@
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="revealed">False</property>
|
<property name="revealed">False</property>
|
||||||
|
<child internal-child="action_area">
|
||||||
|
<object class="GtkButtonBox">
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">False</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child internal-child="content_area">
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">False</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<placeholder/>
|
<placeholder/>
|
||||||
</child>
|
</child>
|
||||||
|
|
@ -68,91 +100,99 @@
|
||||||
<property name="can-focus">True</property>
|
<property name="can-focus">True</property>
|
||||||
<property name="show-border">False</property>
|
<property name="show-border">False</property>
|
||||||
<child>
|
<child>
|
||||||
<!-- n-columns=2 n-rows=3 -->
|
<object class="HdyClamp">
|
||||||
<object class="GtkGrid">
|
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="border-width">18</property>
|
<property name="maximum-size">500</property>
|
||||||
<property name="row-spacing">12</property>
|
<property name="tightening-threshold">300</property>
|
||||||
<property name="column-spacing">6</property>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel">
|
<!-- n-columns=2 n-rows=3 -->
|
||||||
|
<object class="GtkGrid">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="halign">end</property>
|
<property name="border-width">18</property>
|
||||||
<property name="label" translatable="yes">Comment</property>
|
<property name="row-spacing">12</property>
|
||||||
</object>
|
<property name="column-spacing">6</property>
|
||||||
<packing>
|
|
||||||
<property name="left-attach">0</property>
|
|
||||||
<property name="top-attach">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkButton" id="work_button">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">True</property>
|
|
||||||
<property name="receives-default">True</property>
|
|
||||||
<property name="hexpand">True</property>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel" id="work_label">
|
<object class="GtkLabel">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="halign">start</property>
|
<property name="halign">end</property>
|
||||||
<property name="label" translatable="yes">Select …</property>
|
<property name="label" translatable="yes">Comment</property>
|
||||||
<property name="ellipsize">end</property>
|
|
||||||
</object>
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left-attach">0</property>
|
||||||
|
<property name="top-attach">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton" id="work_button">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="receives-default">True</property>
|
||||||
|
<property name="hexpand">True</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="work_label">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="halign">start</property>
|
||||||
|
<property name="label" translatable="yes">Select …</property>
|
||||||
|
<property name="ellipsize">end</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left-attach">1</property>
|
||||||
|
<property name="top-attach">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkEntry" id="comment_entry">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left-attach">1</property>
|
||||||
|
<property name="top-attach">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="halign">end</property>
|
||||||
|
<property name="label" translatable="yes">Work</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left-attach">0</property>
|
||||||
|
<property name="top-attach">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="halign">end</property>
|
||||||
|
<property name="label" translatable="yes">Publish</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left-attach">0</property>
|
||||||
|
<property name="top-attach">2</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkSwitch" id="upload_switch">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="halign">start</property>
|
||||||
|
<property name="active">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left-attach">1</property>
|
||||||
|
<property name="top-attach">2</property>
|
||||||
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="left-attach">1</property>
|
|
||||||
<property name="top-attach">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkEntry" id="comment_entry">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">True</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left-attach">1</property>
|
|
||||||
<property name="top-attach">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="halign">end</property>
|
|
||||||
<property name="label" translatable="yes">Work</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left-attach">0</property>
|
|
||||||
<property name="top-attach">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="halign">end</property>
|
|
||||||
<property name="label" translatable="yes">Publish</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left-attach">0</property>
|
|
||||||
<property name="top-attach">2</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkSwitch" id="upload_switch">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">True</property>
|
|
||||||
<property name="halign">start</property>
|
|
||||||
<property name="active">True</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left-attach">1</property>
|
|
||||||
<property name="top-attach">2</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
|
@ -167,63 +207,94 @@
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox">
|
<object class="HdyClamp">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="border-width">18</property>
|
<property name="tightening-threshold">300</property>
|
||||||
<property name="spacing">6</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkScrolledWindow" id="scroll">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">True</property>
|
|
||||||
<property name="shadow-type">in</property>
|
|
||||||
<child>
|
|
||||||
<placeholder/>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">True</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox">
|
<object class="GtkBox">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="border-width">0</property>
|
<property name="border-width">18</property>
|
||||||
<property name="orientation">vertical</property>
|
|
||||||
<property name="spacing">6</property>
|
<property name="spacing">6</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkButton" id="add_performer_button">
|
<object class="GtkScrolledWindow" id="scroll">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">True</property>
|
<property name="can-focus">True</property>
|
||||||
<property name="receives-default">True</property>
|
<property name="shadow-type">in</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkImage">
|
<placeholder/>
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="icon-name">list-add-symbolic</property>
|
|
||||||
</object>
|
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">True</property>
|
||||||
<property name="fill">True</property>
|
<property name="fill">True</property>
|
||||||
<property name="position">0</property>
|
<property name="position">0</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkButton" id="edit_performer_button">
|
<object class="GtkBox">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">True</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="receives-default">True</property>
|
<property name="border-width">0</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<property name="spacing">6</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkImage">
|
<object class="GtkButton" id="add_performer_button">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">False</property>
|
<property name="can-focus">True</property>
|
||||||
<property name="icon-name">edit-symbolic</property>
|
<property name="receives-default">True</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkImage">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="icon-name">list-add-symbolic</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton" id="edit_performer_button">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="receives-default">True</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkImage">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="icon-name">edit-symbolic</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton" id="remove_performer_button">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="receives-default">True</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkImage">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="icon-name">list-remove-symbolic</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">2</property>
|
||||||
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
|
|
@ -232,31 +303,7 @@
|
||||||
<property name="position">1</property>
|
<property name="position">1</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
|
||||||
<object class="GtkButton" id="remove_performer_button">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">True</property>
|
|
||||||
<property name="receives-default">True</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkImage">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="icon-name">list-remove-symbolic</property>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">2</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,6 @@ pub struct RecordingEditor {
|
||||||
work: RefCell<Option<Work>>,
|
work: RefCell<Option<Work>>,
|
||||||
performances: RefCell<Vec<Performance>>,
|
performances: RefCell<Vec<Performance>>,
|
||||||
selected_cb: RefCell<Option<Box<dyn Fn(Recording) -> ()>>>,
|
selected_cb: RefCell<Option<Box<dyn Fn(Recording) -> ()>>>,
|
||||||
back_cb: RefCell<Option<Box<dyn Fn() -> ()>>>,
|
|
||||||
navigator: RefCell<Option<Rc<Navigator>>>,
|
navigator: RefCell<Option<Rc<Navigator>>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -38,7 +37,7 @@ impl RecordingEditor {
|
||||||
let builder = gtk::Builder::from_resource("/de/johrpan/musicus/ui/recording_editor.ui");
|
let builder = gtk::Builder::from_resource("/de/johrpan/musicus/ui/recording_editor.ui");
|
||||||
|
|
||||||
get_widget!(builder, gtk::Stack, widget);
|
get_widget!(builder, gtk::Stack, widget);
|
||||||
get_widget!(builder, gtk::Button, cancel_button);
|
get_widget!(builder, gtk::Button, back_button);
|
||||||
get_widget!(builder, gtk::Button, save_button);
|
get_widget!(builder, gtk::Button, save_button);
|
||||||
get_widget!(builder, gtk::InfoBar, info_bar);
|
get_widget!(builder, gtk::InfoBar, info_bar);
|
||||||
get_widget!(builder, gtk::Button, work_button);
|
get_widget!(builder, gtk::Button, work_button);
|
||||||
|
|
@ -74,17 +73,12 @@ impl RecordingEditor {
|
||||||
work: RefCell::new(work),
|
work: RefCell::new(work),
|
||||||
performances: RefCell::new(performances),
|
performances: RefCell::new(performances),
|
||||||
selected_cb: RefCell::new(None),
|
selected_cb: RefCell::new(None),
|
||||||
back_cb: RefCell::new(None),
|
|
||||||
navigator: RefCell::new(None),
|
navigator: RefCell::new(None),
|
||||||
});
|
});
|
||||||
|
|
||||||
// Connect signals and callbacks
|
// Connect signals and callbacks
|
||||||
|
|
||||||
cancel_button.connect_clicked(clone!(@strong this => move |_| {
|
back_button.connect_clicked(clone!(@strong this => move |_| {
|
||||||
if let Some(cb) = &*this.back_cb.borrow() {
|
|
||||||
cb();
|
|
||||||
}
|
|
||||||
|
|
||||||
let navigator = this.navigator.borrow().clone();
|
let navigator = this.navigator.borrow().clone();
|
||||||
if let Some(navigator) = navigator {
|
if let Some(navigator) = navigator {
|
||||||
navigator.clone().pop();
|
navigator.clone().pop();
|
||||||
|
|
@ -216,11 +210,6 @@ impl RecordingEditor {
|
||||||
this
|
this
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Set the closure to be called if the editor is canceled.
|
|
||||||
pub fn set_back_cb<F: Fn() -> () + 'static>(&self, cb: F) {
|
|
||||||
self.back_cb.replace(Some(Box::new(cb)));
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Set the closure to be called if the recording was created.
|
/// Set the closure to be called if the recording was created.
|
||||||
pub fn set_selected_cb<F: Fn(Recording) -> () + 'static>(&self, cb: F) {
|
pub fn set_selected_cb<F: Fn(Recording) -> () + 'static>(&self, cb: F) {
|
||||||
self.selected_cb.replace(Some(Box::new(cb)));
|
self.selected_cb.replace(Some(Box::new(cb)));
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@ use std::rc::Rc;
|
||||||
|
|
||||||
pub struct EnsembleScreen {
|
pub struct EnsembleScreen {
|
||||||
backend: Rc<Backend>,
|
backend: Rc<Backend>,
|
||||||
window: gtk::Window,
|
|
||||||
ensemble: Ensemble,
|
ensemble: Ensemble,
|
||||||
widget: gtk::Box,
|
widget: gtk::Box,
|
||||||
stack: gtk::Stack,
|
stack: gtk::Stack,
|
||||||
|
|
@ -23,10 +22,7 @@ pub struct EnsembleScreen {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl EnsembleScreen {
|
impl EnsembleScreen {
|
||||||
pub fn new<W>(backend: Rc<Backend>, window: &W, ensemble: Ensemble) -> Rc<Self>
|
pub fn new(backend: Rc<Backend>, ensemble: Ensemble) -> Rc<Self> {
|
||||||
where
|
|
||||||
W: IsA<gtk::Window>,
|
|
||||||
{
|
|
||||||
let builder = gtk::Builder::from_resource("/de/johrpan/musicus/ui/ensemble_screen.ui");
|
let builder = gtk::Builder::from_resource("/de/johrpan/musicus/ui/ensemble_screen.ui");
|
||||||
|
|
||||||
get_widget!(builder, gtk::Box, widget);
|
get_widget!(builder, gtk::Box, widget);
|
||||||
|
|
@ -80,7 +76,6 @@ impl EnsembleScreen {
|
||||||
|
|
||||||
let result = Rc::new(Self {
|
let result = Rc::new(Self {
|
||||||
backend,
|
backend,
|
||||||
window: window.clone().upcast(),
|
|
||||||
ensemble,
|
ensemble,
|
||||||
widget,
|
widget,
|
||||||
stack,
|
stack,
|
||||||
|
|
@ -104,7 +99,7 @@ impl EnsembleScreen {
|
||||||
.set_selected(clone!(@strong result => move |recording| {
|
.set_selected(clone!(@strong result => move |recording| {
|
||||||
let navigator = result.navigator.borrow().clone();
|
let navigator = result.navigator.borrow().clone();
|
||||||
if let Some(navigator) = navigator {
|
if let Some(navigator) = navigator {
|
||||||
navigator.push(RecordingScreen::new(result.backend.clone(), &result.window, recording.clone()));
|
navigator.push(RecordingScreen::new(result.backend.clone(), recording.clone()));
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@ use std::rc::Rc;
|
||||||
|
|
||||||
pub struct PersonScreen {
|
pub struct PersonScreen {
|
||||||
backend: Rc<Backend>,
|
backend: Rc<Backend>,
|
||||||
window: gtk::Window,
|
|
||||||
person: Person,
|
person: Person,
|
||||||
widget: gtk::Box,
|
widget: gtk::Box,
|
||||||
stack: gtk::Stack,
|
stack: gtk::Stack,
|
||||||
|
|
@ -24,10 +23,7 @@ pub struct PersonScreen {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PersonScreen {
|
impl PersonScreen {
|
||||||
pub fn new<W>(backend: Rc<Backend>, window: &W, person: Person) -> Rc<Self>
|
pub fn new(backend: Rc<Backend>, person: Person) -> Rc<Self> {
|
||||||
where
|
|
||||||
W: IsA<gtk::Window>,
|
|
||||||
{
|
|
||||||
let builder = gtk::Builder::from_resource("/de/johrpan/musicus/ui/person_screen.ui");
|
let builder = gtk::Builder::from_resource("/de/johrpan/musicus/ui/person_screen.ui");
|
||||||
|
|
||||||
get_widget!(builder, gtk::Box, widget);
|
get_widget!(builder, gtk::Box, widget);
|
||||||
|
|
@ -103,7 +99,6 @@ impl PersonScreen {
|
||||||
|
|
||||||
let result = Rc::new(Self {
|
let result = Rc::new(Self {
|
||||||
backend,
|
backend,
|
||||||
window: window.clone().upcast(),
|
|
||||||
person,
|
person,
|
||||||
widget,
|
widget,
|
||||||
stack,
|
stack,
|
||||||
|
|
@ -130,7 +125,7 @@ impl PersonScreen {
|
||||||
result.recording_list.clear_selection();
|
result.recording_list.clear_selection();
|
||||||
let navigator = result.navigator.borrow().clone();
|
let navigator = result.navigator.borrow().clone();
|
||||||
if let Some(navigator) = navigator {
|
if let Some(navigator) = navigator {
|
||||||
navigator.push(WorkScreen::new(result.backend.clone(), &result.window, work.clone()));
|
navigator.push(WorkScreen::new(result.backend.clone(), work.clone()));
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
@ -140,7 +135,7 @@ impl PersonScreen {
|
||||||
result.work_list.clear_selection();
|
result.work_list.clear_selection();
|
||||||
let navigator = result.navigator.borrow().clone();
|
let navigator = result.navigator.borrow().clone();
|
||||||
if let Some(navigator) = navigator {
|
if let Some(navigator) = navigator {
|
||||||
navigator.push(RecordingScreen::new(result.backend.clone(), &result.window, recording.clone()));
|
navigator.push(RecordingScreen::new(result.backend.clone(), recording.clone()));
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@ use std::rc::Rc;
|
||||||
|
|
||||||
pub struct RecordingScreen {
|
pub struct RecordingScreen {
|
||||||
backend: Rc<Backend>,
|
backend: Rc<Backend>,
|
||||||
window: gtk::Window,
|
|
||||||
recording: Recording,
|
recording: Recording,
|
||||||
widget: gtk::Box,
|
widget: gtk::Box,
|
||||||
stack: gtk::Stack,
|
stack: gtk::Stack,
|
||||||
|
|
@ -23,10 +22,7 @@ pub struct RecordingScreen {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RecordingScreen {
|
impl RecordingScreen {
|
||||||
pub fn new<W>(backend: Rc<Backend>, window: &W, recording: Recording) -> Rc<Self>
|
pub fn new(backend: Rc<Backend>, recording: Recording) -> Rc<Self> {
|
||||||
where
|
|
||||||
W: IsA<gtk::Window>,
|
|
||||||
{
|
|
||||||
let builder = gtk::Builder::from_resource("/de/johrpan/musicus/ui/recording_screen.ui");
|
let builder = gtk::Builder::from_resource("/de/johrpan/musicus/ui/recording_screen.ui");
|
||||||
|
|
||||||
get_widget!(builder, gtk::Box, widget);
|
get_widget!(builder, gtk::Box, widget);
|
||||||
|
|
@ -57,7 +53,6 @@ impl RecordingScreen {
|
||||||
|
|
||||||
let result = Rc::new(Self {
|
let result = Rc::new(Self {
|
||||||
backend,
|
backend,
|
||||||
window: window.clone().upcast(),
|
|
||||||
recording,
|
recording,
|
||||||
widget,
|
widget,
|
||||||
stack,
|
stack,
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@ use std::rc::Rc;
|
||||||
|
|
||||||
pub struct WorkScreen {
|
pub struct WorkScreen {
|
||||||
backend: Rc<Backend>,
|
backend: Rc<Backend>,
|
||||||
window: gtk::Window,
|
|
||||||
work: Work,
|
work: Work,
|
||||||
widget: gtk::Box,
|
widget: gtk::Box,
|
||||||
stack: gtk::Stack,
|
stack: gtk::Stack,
|
||||||
|
|
@ -23,10 +22,7 @@ pub struct WorkScreen {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl WorkScreen {
|
impl WorkScreen {
|
||||||
pub fn new<W>(backend: Rc<Backend>, window: &W, work: Work) -> Rc<Self>
|
pub fn new(backend: Rc<Backend>, work: Work) -> Rc<Self> {
|
||||||
where
|
|
||||||
W: IsA<gtk::Window>,
|
|
||||||
{
|
|
||||||
let builder = gtk::Builder::from_resource("/de/johrpan/musicus/ui/work_screen.ui");
|
let builder = gtk::Builder::from_resource("/de/johrpan/musicus/ui/work_screen.ui");
|
||||||
|
|
||||||
get_widget!(builder, gtk::Box, widget);
|
get_widget!(builder, gtk::Box, widget);
|
||||||
|
|
@ -79,7 +75,6 @@ impl WorkScreen {
|
||||||
|
|
||||||
let result = Rc::new(Self {
|
let result = Rc::new(Self {
|
||||||
backend,
|
backend,
|
||||||
window: window.clone().upcast(),
|
|
||||||
work,
|
work,
|
||||||
widget,
|
widget,
|
||||||
stack,
|
stack,
|
||||||
|
|
@ -103,7 +98,7 @@ impl WorkScreen {
|
||||||
.set_selected(clone!(@strong result => move |recording| {
|
.set_selected(clone!(@strong result => move |recording| {
|
||||||
let navigator = result.navigator.borrow().clone();
|
let navigator = result.navigator.borrow().clone();
|
||||||
if let Some(navigator) = navigator {
|
if let Some(navigator) = navigator {
|
||||||
navigator.push(RecordingScreen::new(result.backend.clone(), &result.window, recording.clone()));
|
navigator.push(RecordingScreen::new(result.backend.clone(), recording.clone()));
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -163,10 +163,10 @@ impl Window {
|
||||||
result.leaflet.set_visible_child(&result.navigator.widget);
|
result.leaflet.set_visible_child(&result.navigator.widget);
|
||||||
match poe {
|
match poe {
|
||||||
PersonOrEnsemble::Person(person) => {
|
PersonOrEnsemble::Person(person) => {
|
||||||
result.navigator.clone().replace(PersonScreen::new(result.backend.clone(), &result.window, person.clone()));
|
result.navigator.clone().replace(PersonScreen::new(result.backend.clone(), person.clone()));
|
||||||
}
|
}
|
||||||
PersonOrEnsemble::Ensemble(ensemble) => {
|
PersonOrEnsemble::Ensemble(ensemble) => {
|
||||||
result.navigator.clone().replace(EnsembleScreen::new(result.backend.clone(), &result.window, ensemble.clone()));
|
result.navigator.clone().replace(EnsembleScreen::new(result.backend.clone(), ensemble.clone()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue