mirror of
https://github.com/johrpan/musicus.git
synced 2025-10-26 19:57:25 +01:00
Modularize main window
This commit is contained in:
parent
56c4268e4d
commit
cefd7dad95
30 changed files with 1905 additions and 1526 deletions
|
|
@ -3,16 +3,22 @@
|
||||||
<gresource prefix="/de/johrpan/musicus_editor">
|
<gresource prefix="/de/johrpan/musicus_editor">
|
||||||
<file preprocess="xml-stripblanks">ui/ensemble_editor.ui</file>
|
<file preprocess="xml-stripblanks">ui/ensemble_editor.ui</file>
|
||||||
<file preprocess="xml-stripblanks">ui/ensemble_selector.ui</file>
|
<file preprocess="xml-stripblanks">ui/ensemble_selector.ui</file>
|
||||||
|
<file preprocess="xml-stripblanks">ui/ensemble_screen.ui</file>
|
||||||
<file preprocess="xml-stripblanks">ui/instrument_editor.ui</file>
|
<file preprocess="xml-stripblanks">ui/instrument_editor.ui</file>
|
||||||
<file preprocess="xml-stripblanks">ui/instrument_selector.ui</file>
|
<file preprocess="xml-stripblanks">ui/instrument_selector.ui</file>
|
||||||
<file preprocess="xml-stripblanks">ui/part_editor.ui</file>
|
<file preprocess="xml-stripblanks">ui/part_editor.ui</file>
|
||||||
<file preprocess="xml-stripblanks">ui/performance_editor.ui</file>
|
<file preprocess="xml-stripblanks">ui/performance_editor.ui</file>
|
||||||
<file preprocess="xml-stripblanks">ui/person_editor.ui</file>
|
<file preprocess="xml-stripblanks">ui/person_editor.ui</file>
|
||||||
|
<file preprocess="xml-stripblanks">ui/person_list.ui</file>
|
||||||
|
<file preprocess="xml-stripblanks">ui/person_screen.ui</file>
|
||||||
<file preprocess="xml-stripblanks">ui/person_selector.ui</file>
|
<file preprocess="xml-stripblanks">ui/person_selector.ui</file>
|
||||||
|
<file preprocess="xml-stripblanks">ui/poe_list.ui</file>
|
||||||
<file preprocess="xml-stripblanks">ui/recording_editor.ui</file>
|
<file preprocess="xml-stripblanks">ui/recording_editor.ui</file>
|
||||||
|
<file preprocess="xml-stripblanks">ui/recording_screen.ui</file>
|
||||||
<file preprocess="xml-stripblanks">ui/section_editor.ui</file>
|
<file preprocess="xml-stripblanks">ui/section_editor.ui</file>
|
||||||
<file preprocess="xml-stripblanks">ui/window.ui</file>
|
<file preprocess="xml-stripblanks">ui/window.ui</file>
|
||||||
<file preprocess="xml-stripblanks">ui/work_editor.ui</file>
|
<file preprocess="xml-stripblanks">ui/work_editor.ui</file>
|
||||||
|
<file preprocess="xml-stripblanks">ui/work_screen.ui</file>
|
||||||
<file preprocess="xml-stripblanks">ui/work_selector.ui</file>
|
<file preprocess="xml-stripblanks">ui/work_selector.ui</file>
|
||||||
</gresource>
|
</gresource>
|
||||||
</gresources>
|
</gresources>
|
||||||
|
|
|
||||||
206
res/ui/ensemble_screen.ui
Normal file
206
res/ui/ensemble_screen.ui
Normal file
|
|
@ -0,0 +1,206 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!-- Generated with glade 3.38.1 -->
|
||||||
|
<interface>
|
||||||
|
<requires lib="gtk+" version="3.24"/>
|
||||||
|
<requires lib="libhandy" version="1.0"/>
|
||||||
|
<object class="GtkBox" id="widget">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<child>
|
||||||
|
<object class="HdyHeaderBar" id="header">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="show-close-button">True</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton" id="back_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">go-previous-symbolic</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkMenuButton" id="menu_button">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="focus-on-click">False</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">view-more-symbolic</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="pack-type">end</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkToggleButton" id="search_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-find-symbolic</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="pack-type">end</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="HdySearchBar">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="search-mode-enabled" bind-source="search_button" bind-property="active" bind-flags="bidirectional|sync-create">False</property>
|
||||||
|
<child>
|
||||||
|
<object class="HdyClamp">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="maximum-size">400</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkSearchEntry" id="search_entry">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="primary-icon-name">edit-find-symbolic</property>
|
||||||
|
<property name="primary-icon-activatable">False</property>
|
||||||
|
<property name="primary-icon-sensitive">False</property>
|
||||||
|
<property name="placeholder-text" translatable="yes">Search recordings …</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkStack" id="stack">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkSpinner">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="active">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="name">loading</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkScrolledWindow">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkViewport">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="shadow-type">none</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="border-width">18</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<property name="spacing">18</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox" id="recording_box">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<property name="spacing">12</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="halign">start</property>
|
||||||
|
<property name="label" translatable="yes">Recordings</property>
|
||||||
|
<attributes>
|
||||||
|
<attribute name="size" value="12288"/>
|
||||||
|
</attributes>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkFrame" id="recording_frame">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="label-xalign">0</property>
|
||||||
|
<property name="shadow-type">in</property>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="name">content</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="label" translatable="yes">No recordings found.</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="name">nothing</property>
|
||||||
|
<property name="position">2</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">True</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">2</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</interface>
|
||||||
75
res/ui/person_list.ui
Normal file
75
res/ui/person_list.ui
Normal file
|
|
@ -0,0 +1,75 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!-- Generated with glade 3.38.1 -->
|
||||||
|
<interface>
|
||||||
|
<requires lib="gtk+" version="3.24"/>
|
||||||
|
<requires lib="libhandy" version="1.0"/>
|
||||||
|
<object class="GtkBox" id="widget">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<child>
|
||||||
|
<object class="HdySearchBar">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="search-mode-enabled">True</property>
|
||||||
|
<child>
|
||||||
|
<object class="HdyClamp">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="maximum-size">400</property>
|
||||||
|
<property name="tightening-threshold">300</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkSearchEntry" id="search_entry">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="primary-icon-name">edit-find-symbolic</property>
|
||||||
|
<property name="primary-icon-activatable">False</property>
|
||||||
|
<property name="primary-icon-sensitive">False</property>
|
||||||
|
<property name="placeholder-text" translatable="yes">Search persons …</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkStack" id="stack">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkSpinner">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="active">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="name">loading</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkScrolledWindow" id="scrolled_window">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="name">content</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">True</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</interface>
|
||||||
251
res/ui/person_screen.ui
Normal file
251
res/ui/person_screen.ui
Normal file
|
|
@ -0,0 +1,251 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!-- Generated with glade 3.38.1 -->
|
||||||
|
<interface>
|
||||||
|
<requires lib="gtk+" version="3.24"/>
|
||||||
|
<requires lib="libhandy" version="1.0"/>
|
||||||
|
<object class="GtkBox" id="widget">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<child>
|
||||||
|
<object class="HdyHeaderBar" id="header">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="show-close-button">True</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton" id="back_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">go-previous-symbolic</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkMenuButton" id="menu_button">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="focus-on-click">False</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">view-more-symbolic</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="pack-type">end</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkToggleButton" id="search_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-find-symbolic</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="pack-type">end</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="HdySearchBar">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="search-mode-enabled" bind-source="search_button" bind-property="active" bind-flags="bidirectional|sync-create">False</property>
|
||||||
|
<child>
|
||||||
|
<object class="HdyClamp">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="maximum-size">400</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkSearchEntry" id="search_entry">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="primary-icon-name">edit-find-symbolic</property>
|
||||||
|
<property name="primary-icon-activatable">False</property>
|
||||||
|
<property name="primary-icon-sensitive">False</property>
|
||||||
|
<property name="placeholder-text" translatable="yes">Search works and recordings …</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkStack" id="stack">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkSpinner">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="active">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="name">loading</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkScrolledWindow">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkViewport">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="shadow-type">none</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="border-width">18</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<property name="spacing">18</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox" id="work_box">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<property name="spacing">12</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="halign">start</property>
|
||||||
|
<property name="label" translatable="yes">Works</property>
|
||||||
|
<attributes>
|
||||||
|
<attribute name="size" value="12288"/>
|
||||||
|
</attributes>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkFrame" id="work_frame">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="label-xalign">0</property>
|
||||||
|
<property name="shadow-type">in</property>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox" id="recording_box">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<property name="spacing">12</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="halign">start</property>
|
||||||
|
<property name="label" translatable="yes">Recordings</property>
|
||||||
|
<attributes>
|
||||||
|
<attribute name="size" value="12288"/>
|
||||||
|
</attributes>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkFrame" id="recording_frame">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="label-xalign">0</property>
|
||||||
|
<property name="shadow-type">in</property>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="name">content</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="label" translatable="yes">No works or recordings found.</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="name">nothing</property>
|
||||||
|
<property name="position">2</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">True</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">2</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</interface>
|
||||||
|
|
@ -1,86 +1,33 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!-- Generated with glade 3.36.0 -->
|
<!-- Generated with glade 3.38.1 -->
|
||||||
<interface>
|
<interface>
|
||||||
<requires lib="gtk+" version="3.22"/>
|
<requires lib="gtk+" version="3.22"/>
|
||||||
<object class="GtkWindow" id="window">
|
<object class="GtkWindow" id="window">
|
||||||
<property name="can_focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="modal">True</property>
|
<property name="modal">True</property>
|
||||||
<property name="default_width">350</property>
|
<property name="default-width">350</property>
|
||||||
<property name="default_height">300</property>
|
<property name="default-height">300</property>
|
||||||
<property name="destroy_with_parent">True</property>
|
<property name="destroy-with-parent">True</property>
|
||||||
<property name="type_hint">dialog</property>
|
<property name="type-hint">dialog</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox">
|
<placeholder/>
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="orientation">vertical</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkSearchEntry" id="search_entry">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="margin_start">6</property>
|
|
||||||
<property name="margin_end">6</property>
|
|
||||||
<property name="margin_top">6</property>
|
|
||||||
<property name="margin_bottom">6</property>
|
|
||||||
<property name="primary_icon_name">edit-find-symbolic</property>
|
|
||||||
<property name="primary_icon_activatable">False</property>
|
|
||||||
<property name="primary_icon_sensitive">False</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkScrolledWindow">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="shadow_type">in</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkViewport">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkListBox" id="list">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<child type="placeholder">
|
|
||||||
<object class="GtkLabel">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="label" translatable="yes">No persons found.</property>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">True</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
</child>
|
||||||
<child type="titlebar">
|
<child type="titlebar">
|
||||||
<object class="GtkHeaderBar">
|
<object class="GtkHeaderBar">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="title" translatable="yes">Select person</property>
|
<property name="title" translatable="yes">Select person</property>
|
||||||
<property name="show_close_button">True</property>
|
<property name="show-close-button">True</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkButton" id="add_button">
|
<object class="GtkButton" id="add_button">
|
||||||
<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>
|
<child>
|
||||||
<object class="GtkImage">
|
<object class="GtkImage">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="icon_name">list-add-symbolic</property>
|
<property name="icon-name">list-add-symbolic</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
|
|
||||||
75
res/ui/poe_list.ui
Normal file
75
res/ui/poe_list.ui
Normal file
|
|
@ -0,0 +1,75 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!-- Generated with glade 3.38.1 -->
|
||||||
|
<interface>
|
||||||
|
<requires lib="gtk+" version="3.24"/>
|
||||||
|
<requires lib="libhandy" version="1.0"/>
|
||||||
|
<object class="GtkBox" id="widget">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<child>
|
||||||
|
<object class="HdySearchBar">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="search-mode-enabled">True</property>
|
||||||
|
<child>
|
||||||
|
<object class="HdyClamp">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="maximum-size">400</property>
|
||||||
|
<property name="tightening-threshold">300</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkSearchEntry" id="search_entry">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="primary-icon-name">edit-find-symbolic</property>
|
||||||
|
<property name="primary-icon-activatable">False</property>
|
||||||
|
<property name="primary-icon-sensitive">False</property>
|
||||||
|
<property name="placeholder-text" translatable="yes">Search persons and ensembles …</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkStack" id="stack">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkSpinner">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="active">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="name">loading</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkScrolledWindow" id="scrolled_window">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="name">content</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">True</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</interface>
|
||||||
59
res/ui/recording_screen.ui
Normal file
59
res/ui/recording_screen.ui
Normal file
|
|
@ -0,0 +1,59 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!-- Generated with glade 3.38.1 -->
|
||||||
|
<interface>
|
||||||
|
<requires lib="gtk+" version="3.24" />
|
||||||
|
<requires lib="libhandy" version="1.0" />
|
||||||
|
<object class="GtkBox" id="widget">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<child>
|
||||||
|
<object class="HdyHeaderBar" id="header">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="show-close-button">True</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton" id="back_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">go-previous-symbolic</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkMenuButton" id="menu_button">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="focus-on-click">False</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">view-more-symbolic</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="pack-type">end</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder />
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</interface>
|
||||||
803
res/ui/window.ui
803
res/ui/window.ui
|
|
@ -3,182 +3,12 @@
|
||||||
<interface>
|
<interface>
|
||||||
<requires lib="gtk+" version="3.22" />
|
<requires lib="gtk+" version="3.22" />
|
||||||
<requires lib="libhandy" version="1.0" />
|
<requires lib="libhandy" version="1.0" />
|
||||||
<object class="HdyApplicationWindow" id="window">
|
<object class="GtkBox" id="empty_screen">
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="default-width">800</property>
|
|
||||||
<property name="default-height">566</property>
|
|
||||||
<child>
|
|
||||||
<object class="HdyLeaflet" id="leaflet">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="visible-child">sidebar_box</property>
|
|
||||||
<property name="can-swipe-back">True</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkBox" id="sidebar_box">
|
|
||||||
<property name="width-request">250</property>
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="hexpand">False</property>
|
|
||||||
<property name="orientation">vertical</property>
|
|
||||||
<child>
|
|
||||||
<object class="HdyHeaderBar" id="sidebar_header">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="show-close-button">True</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkMenuButton">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">True</property>
|
|
||||||
<property name="receives-default">True</property>
|
|
||||||
<property name="menu-model">add_menu</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>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkMenuButton">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">True</property>
|
|
||||||
<property name="focus-on-click">False</property>
|
|
||||||
<property name="receives-default">True</property>
|
|
||||||
<property name="menu-model">add_menu</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkImage">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="icon-name">open-menu-symbolic</property>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="pack-type">end</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="HdySearchBar">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="search-mode-enabled">True</property>
|
|
||||||
<child>
|
|
||||||
<object class="HdyClamp">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="maximum-size">400</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkSearchEntry" id="person_search_entry">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">True</property>
|
|
||||||
<property name="primary-icon-name">edit-find-symbolic</property>
|
|
||||||
<property name="primary-icon-activatable">False</property>
|
|
||||||
<property name="primary-icon-sensitive">False</property>
|
|
||||||
<property name="placeholder-text" translatable="yes">Search persons and ensembles …</property>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkStack" id="sidebar_stack">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="transition-type">crossfade</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkSpinner">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="active">True</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="name">loading</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkScrolledWindow">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">True</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkViewport">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="shadow-type">none</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkListBox" id="sidebar_list">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<child type="placeholder">
|
|
||||||
<object class="GtkLabel">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="label" translatable="yes">No persons or ensembles found.</property>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="name">content</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">True</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">2</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="name">sidebar</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkSeparator">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="orientation">vertical</property>
|
|
||||||
<style>
|
|
||||||
<class name="sidebar" />
|
|
||||||
</style>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="navigatable">False</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkStack" id="main_stack">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="hexpand">True</property>
|
|
||||||
<property name="transition-type">crossfade</property>
|
|
||||||
<child>
|
|
||||||
<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="orientation">vertical</property>
|
<property name="orientation">vertical</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="HdyHeaderBar" id="empty_header">
|
<object class="HdyHeaderBar">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="hexpand">True</property>
|
<property name="hexpand">True</property>
|
||||||
|
|
@ -253,73 +83,55 @@
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<object class="HdyApplicationWindow" id="window">
|
||||||
<property name="name">empty_screen</property>
|
<property name="can-focus">False</property>
|
||||||
</packing>
|
<property name="default-width">800</property>
|
||||||
</child>
|
<property name="default-height">566</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox">
|
<object class="HdyLeaflet" id="leaflet">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
|
<property name="visible-child">sidebar_box</property>
|
||||||
|
<property name="can-swipe-back">True</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox" id="sidebar_box">
|
||||||
|
<property name="width-request">250</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="hexpand">False</property>
|
||||||
<property name="orientation">vertical</property>
|
<property name="orientation">vertical</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="HdyHeaderBar" id="overview_header">
|
<object class="HdyHeaderBar">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="show-close-button">True</property>
|
<property name="show-close-button" bind-source="leaflet" bind-property="folded" bind-flags="sync-create">False</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkRevealer">
|
<object class="GtkMenuButton">
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="transition-type">crossfade</property>
|
|
||||||
<property name="transition-duration" bind-source="leaflet" bind-property="mode-transition-duration" bind-flags="bidirectional|sync-create">0</property>
|
|
||||||
<property name="reveal-child" bind-source="leaflet" bind-property="folded" bind-flags="sync-create">False</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkButton" id="overview_back_button">
|
|
||||||
<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>
|
||||||
<property name="action-name">win.back</property>
|
<property name="menu-model">add_menu</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkImage">
|
<object class="GtkImage">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="icon-name">go-previous-symbolic</property>
|
<property name="icon-name">list-add-symbolic</property>
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkMenuButton" id="overview_header_menu_button">
|
<object class="GtkMenuButton">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">True</property>
|
<property name="can-focus">True</property>
|
||||||
<property name="focus-on-click">False</property>
|
<property name="focus-on-click">False</property>
|
||||||
<property name="receives-default">True</property>
|
<property name="receives-default">True</property>
|
||||||
|
<property name="menu-model">add_menu</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkImage">
|
<object class="GtkImage">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="icon-name">view-more-symbolic</property>
|
<property name="icon-name">open-menu-symbolic</property>
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="pack-type">end</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkToggleButton" id="overview_search_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-find-symbolic</property>
|
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
|
@ -335,585 +147,30 @@
|
||||||
<property name="position">0</property>
|
<property name="position">0</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
|
||||||
<object class="HdySearchBar">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="search-mode-enabled" bind-source="overview_search_button" bind-property="active" bind-flags="bidirectional|sync-create">False</property>
|
|
||||||
<child>
|
|
||||||
<object class="HdyClamp">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="maximum-size">400</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkSearchEntry" id="overview_search_entry">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">True</property>
|
|
||||||
<property name="primary-icon-name">edit-find-symbolic</property>
|
|
||||||
<property name="primary-icon-activatable">False</property>
|
|
||||||
<property name="primary-icon-sensitive">False</property>
|
|
||||||
<property name="placeholder-text" translatable="yes">Search works and recordings …</property>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="name">sidebar</property>
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkStack" id="overview_stack">
|
<object class="GtkSeparator">
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="transition-type">crossfade</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkSpinner">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="active">True</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="name">loading</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkScrolledWindow">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">True</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkViewport">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="shadow-type">none</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkBox">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="border-width">18</property>
|
|
||||||
<property name="orientation">vertical</property>
|
|
||||||
<property name="spacing">18</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkBox" id="overview_work_box">
|
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="orientation">vertical</property>
|
<property name="orientation">vertical</property>
|
||||||
<property name="spacing">12</property>
|
<style>
|
||||||
<child>
|
<class name="sidebar" />
|
||||||
<object class="GtkLabel">
|
</style>
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="halign">start</property>
|
|
||||||
<property name="label" translatable="yes">Works</property>
|
|
||||||
<attributes>
|
|
||||||
<attribute name="size" value="12288" />
|
|
||||||
</attributes>
|
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="navigatable">False</property>
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkFrame">
|
<placeholder />
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="label-xalign">0</property>
|
|
||||||
<property name="shadow-type">in</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkListBox" id="overview_work_list">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<child type="placeholder">
|
|
||||||
<object class="GtkLabel">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="margin-left">6</property>
|
|
||||||
<property name="margin-right">6</property>
|
|
||||||
<property name="margin-start">6</property>
|
|
||||||
<property name="margin-end">6</property>
|
|
||||||
<property name="margin-top">6</property>
|
|
||||||
<property name="margin-bottom">6</property>
|
|
||||||
<property name="label" translatable="yes">No works found.</property>
|
|
||||||
</object>
|
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkBox" id="overview_recording_box">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="orientation">vertical</property>
|
|
||||||
<property name="spacing">12</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="halign">start</property>
|
|
||||||
<property name="label" translatable="yes">Recordings</property>
|
|
||||||
<attributes>
|
|
||||||
<attribute name="size" value="12288" />
|
|
||||||
</attributes>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkFrame">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="label-xalign">0</property>
|
|
||||||
<property name="shadow-type">in</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkListBox" id="overview_recording_list">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<child type="placeholder">
|
|
||||||
<object class="GtkLabel">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="margin-left">6</property>
|
|
||||||
<property name="margin-right">6</property>
|
|
||||||
<property name="margin-start">6</property>
|
|
||||||
<property name="margin-end">6</property>
|
|
||||||
<property name="margin-top">6</property>
|
|
||||||
<property name="margin-bottom">6</property>
|
|
||||||
<property name="label" translatable="yes">No recordings found.</property>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="name">content</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">True</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">2</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="name">overview_screen</property>
|
|
||||||
<property name="title" translatable="yes">page0</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkBox">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="orientation">vertical</property>
|
|
||||||
<child>
|
|
||||||
<object class="HdyHeaderBar" id="work_details_header">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="show-close-button">True</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkButton" id="work_details_back_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">go-previous-symbolic</property>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkMenuButton" id="work_details_header_menu_button">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">True</property>
|
|
||||||
<property name="focus-on-click">False</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">view-more-symbolic</property>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="pack-type">end</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkToggleButton" id="work_details_search_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-find-symbolic</property>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="pack-type">end</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="HdySearchBar">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="search-mode-enabled" bind-source="work_details_search_button" bind-property="active" bind-flags="bidirectional|sync-create">False</property>
|
|
||||||
<child>
|
|
||||||
<object class="HdyClamp">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="maximum-size">400</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkSearchEntry" id="work_details_search_entry">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">True</property>
|
|
||||||
<property name="primary-icon-name">edit-find-symbolic</property>
|
|
||||||
<property name="primary-icon-activatable">False</property>
|
|
||||||
<property name="primary-icon-sensitive">False</property>
|
|
||||||
<property name="placeholder-text" translatable="yes">Search recordings …</property>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkStack" id="work_details_stack">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="transition-type">crossfade</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkSpinner">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="active">True</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="name">loading</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkScrolledWindow">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">True</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkViewport">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="shadow-type">none</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkBox">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="border-width">18</property>
|
|
||||||
<property name="orientation">vertical</property>
|
|
||||||
<property name="spacing">12</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="halign">start</property>
|
|
||||||
<property name="label" translatable="yes">Recordings</property>
|
|
||||||
<attributes>
|
|
||||||
<attribute name="size" value="12288" />
|
|
||||||
</attributes>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkFrame">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="label-xalign">0</property>
|
|
||||||
<property name="shadow-type">in</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkListBox" id="work_details_recording_list">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<child type="placeholder">
|
|
||||||
<object class="GtkLabel">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="margin-left">6</property>
|
|
||||||
<property name="margin-right">6</property>
|
|
||||||
<property name="margin-start">6</property>
|
|
||||||
<property name="margin-end">6</property>
|
|
||||||
<property name="margin-top">6</property>
|
|
||||||
<property name="margin-bottom">6</property>
|
|
||||||
<property name="label" translatable="yes">No recordings found.</property>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="name">content</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">True</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">2</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="name">work_details_screen</property>
|
|
||||||
<property name="position">2</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkBox">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="orientation">vertical</property>
|
|
||||||
<child>
|
|
||||||
<object class="HdyHeaderBar" id="recording_details_header">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="show-close-button">True</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkButton" id="recording_details_back_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">go-previous-symbolic</property>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkMenuButton" id="recording_details_header_menu_button">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">True</property>
|
|
||||||
<property name="focus-on-click">False</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">view-more-symbolic</property>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="pack-type">end</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkStack" id="recording_details_stack">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="transition-type">crossfade</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkSpinner">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="active">True</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="name">loading</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkScrolledWindow">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">True</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkViewport">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="shadow-type">none</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkBox">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="border-width">18</property>
|
|
||||||
<property name="orientation">vertical</property>
|
|
||||||
<property name="spacing">12</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="halign">start</property>
|
|
||||||
<property name="label" translatable="yes">Tracks</property>
|
|
||||||
<attributes>
|
|
||||||
<attribute name="size" value="12288" />
|
|
||||||
</attributes>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkFrame">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="label-xalign">0</property>
|
|
||||||
<property name="shadow-type">in</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkListBox" id="recording_details_track_list">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<child type="placeholder">
|
|
||||||
<object class="GtkLabel">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
<property name="margin-left">6</property>
|
|
||||||
<property name="margin-right">6</property>
|
|
||||||
<property name="margin-start">6</property>
|
|
||||||
<property name="margin-end">6</property>
|
|
||||||
<property name="margin-top">6</property>
|
|
||||||
<property name="margin-bottom">6</property>
|
|
||||||
<property name="label" translatable="yes">No tracks found.</property>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="name">content</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">True</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">2</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="name">recording_details_screen</property>
|
|
||||||
<property name="position">3</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="name">content</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<object class="HdyHeaderGroup" id="inner_header_group">
|
|
||||||
<headerbars>
|
|
||||||
<headerbar name="empty_header" />
|
|
||||||
<headerbar name="overview_header" />
|
|
||||||
<headerbar name="work_details_header" />
|
|
||||||
<headerbar name="recording_details_header" />
|
|
||||||
</headerbars>
|
|
||||||
</object>
|
|
||||||
<object class="HdyHeaderGroup">
|
|
||||||
<headerbars>
|
|
||||||
<headerbar name="sidebar_header" />
|
|
||||||
<headerbar name="inner_header_group" />
|
|
||||||
</headerbars>
|
|
||||||
</object>
|
|
||||||
<menu id="add_menu">
|
<menu id="add_menu">
|
||||||
<section>
|
<section>
|
||||||
<item>
|
<item>
|
||||||
|
|
|
||||||
206
res/ui/work_screen.ui
Normal file
206
res/ui/work_screen.ui
Normal file
|
|
@ -0,0 +1,206 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!-- Generated with glade 3.38.1 -->
|
||||||
|
<interface>
|
||||||
|
<requires lib="gtk+" version="3.24"/>
|
||||||
|
<requires lib="libhandy" version="1.0"/>
|
||||||
|
<object class="GtkBox" id="widget">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<child>
|
||||||
|
<object class="HdyHeaderBar" id="header">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="show-close-button">True</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton" id="back_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">go-previous-symbolic</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkMenuButton" id="menu_button">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="focus-on-click">False</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">view-more-symbolic</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="pack-type">end</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkToggleButton" id="search_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-find-symbolic</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="pack-type">end</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="HdySearchBar">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="search-mode-enabled" bind-source="search_button" bind-property="active" bind-flags="bidirectional|sync-create">False</property>
|
||||||
|
<child>
|
||||||
|
<object class="HdyClamp">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="maximum-size">400</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkSearchEntry" id="search_entry">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="primary-icon-name">edit-find-symbolic</property>
|
||||||
|
<property name="primary-icon-activatable">False</property>
|
||||||
|
<property name="primary-icon-sensitive">False</property>
|
||||||
|
<property name="placeholder-text" translatable="yes">Search recordings …</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkStack" id="stack">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkSpinner">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="active">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="name">loading</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkScrolledWindow">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkViewport">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="shadow-type">none</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="border-width">18</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<property name="spacing">18</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox" id="recording_box">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<property name="spacing">12</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="halign">start</property>
|
||||||
|
<property name="label" translatable="yes">Recordings</property>
|
||||||
|
<attributes>
|
||||||
|
<attribute name="size" value="12288"/>
|
||||||
|
</attributes>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkFrame" id="recording_frame">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="label-xalign">0</property>
|
||||||
|
<property name="shadow-type">in</property>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="name">content</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="label" translatable="yes">No recordings found.</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="name">nothing</property>
|
||||||
|
<property name="position">2</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">True</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">2</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</interface>
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
use super::selector_row::SelectorRow;
|
|
||||||
use super::EnsembleEditor;
|
use super::EnsembleEditor;
|
||||||
use crate::backend::Backend;
|
use crate::backend::Backend;
|
||||||
use crate::database::*;
|
use crate::database::*;
|
||||||
|
use crate::widgets::*;
|
||||||
use gio::prelude::*;
|
use gio::prelude::*;
|
||||||
use glib::clone;
|
use glib::clone;
|
||||||
use gtk::prelude::*;
|
use gtk::prelude::*;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
use super::selector_row::SelectorRow;
|
|
||||||
use super::InstrumentEditor;
|
use super::InstrumentEditor;
|
||||||
use crate::backend::Backend;
|
use crate::backend::Backend;
|
||||||
use crate::database::*;
|
use crate::database::*;
|
||||||
|
use crate::widgets::*;
|
||||||
use gio::prelude::*;
|
use gio::prelude::*;
|
||||||
use glib::clone;
|
use glib::clone;
|
||||||
use gtk::prelude::*;
|
use gtk::prelude::*;
|
||||||
|
|
|
||||||
|
|
@ -28,9 +28,6 @@ pub use recording_editor::*;
|
||||||
pub mod section_editor;
|
pub mod section_editor;
|
||||||
pub use section_editor::*;
|
pub use section_editor::*;
|
||||||
|
|
||||||
pub mod selector_row;
|
|
||||||
pub use selector_row::*;
|
|
||||||
|
|
||||||
pub mod work_editor;
|
pub mod work_editor;
|
||||||
pub use work_editor::*;
|
pub use work_editor::*;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
use super::selector_row::SelectorRow;
|
|
||||||
use super::{InstrumentSelector, PersonSelector};
|
use super::{InstrumentSelector, PersonSelector};
|
||||||
use crate::backend::*;
|
use crate::backend::*;
|
||||||
use crate::database::*;
|
use crate::database::*;
|
||||||
|
use crate::widgets::*;
|
||||||
use glib::clone;
|
use glib::clone;
|
||||||
use gtk::prelude::*;
|
use gtk::prelude::*;
|
||||||
use gtk_macros::get_widget;
|
use gtk_macros::get_widget;
|
||||||
|
|
|
||||||
|
|
@ -1,104 +1,58 @@
|
||||||
use super::selector_row::SelectorRow;
|
|
||||||
use super::PersonEditor;
|
use super::PersonEditor;
|
||||||
use crate::backend::Backend;
|
use crate::backend::Backend;
|
||||||
use crate::database::*;
|
use crate::database::*;
|
||||||
|
use crate::widgets::*;
|
||||||
use gio::prelude::*;
|
use gio::prelude::*;
|
||||||
use glib::clone;
|
use glib::clone;
|
||||||
use gtk::prelude::*;
|
use gtk::prelude::*;
|
||||||
use gtk_macros::get_widget;
|
use gtk_macros::get_widget;
|
||||||
use std::convert::TryInto;
|
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
|
|
||||||
pub struct PersonSelector<F>
|
pub struct PersonSelector {
|
||||||
where
|
|
||||||
F: Fn(Person) -> () + 'static,
|
|
||||||
{
|
|
||||||
backend: Rc<Backend>,
|
|
||||||
window: gtk::Window,
|
window: gtk::Window,
|
||||||
callback: F,
|
|
||||||
list: gtk::ListBox,
|
|
||||||
search_entry: gtk::SearchEntry,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<F> PersonSelector<F>
|
impl PersonSelector {
|
||||||
|
pub fn new<P, F>(backend: Rc<Backend>, parent: &P, callback: F) -> Self
|
||||||
where
|
where
|
||||||
|
P: IsA<gtk::Window>,
|
||||||
F: Fn(Person) -> () + 'static,
|
F: Fn(Person) -> () + 'static,
|
||||||
{
|
{
|
||||||
pub fn new<P: IsA<gtk::Window>>(backend: Rc<Backend>, parent: &P, callback: F) -> Rc<Self> {
|
|
||||||
let builder =
|
let builder =
|
||||||
gtk::Builder::from_resource("/de/johrpan/musicus_editor/ui/person_selector.ui");
|
gtk::Builder::from_resource("/de/johrpan/musicus_editor/ui/person_selector.ui");
|
||||||
|
|
||||||
get_widget!(builder, gtk::Window, window);
|
get_widget!(builder, gtk::Window, window);
|
||||||
get_widget!(builder, gtk::Button, add_button);
|
get_widget!(builder, gtk::Button, add_button);
|
||||||
get_widget!(builder, gtk::SearchEntry, search_entry);
|
|
||||||
get_widget!(builder, gtk::ListBox, list);
|
|
||||||
|
|
||||||
let result = Rc::new(PersonSelector {
|
let callback = Rc::new(callback);
|
||||||
backend: backend,
|
|
||||||
window: window,
|
|
||||||
callback: callback,
|
|
||||||
search_entry: search_entry,
|
|
||||||
list: list,
|
|
||||||
});
|
|
||||||
|
|
||||||
let c = glib::MainContext::default();
|
let list = PersonList::new(backend.clone());
|
||||||
let clone = result.clone();
|
|
||||||
c.spawn_local(async move {
|
|
||||||
let persons = clone.backend.get_persons().await.unwrap();
|
|
||||||
|
|
||||||
for (index, person) in persons.iter().enumerate() {
|
list.set_selected(clone!(@strong window, @strong callback => move |person| {
|
||||||
let label = gtk::Label::new(Some(&person.name_lf()));
|
window.close();
|
||||||
label.set_halign(gtk::Align::Start);
|
callback(person.clone());
|
||||||
let row = SelectorRow::new(index.try_into().unwrap(), &label);
|
|
||||||
row.show_all();
|
|
||||||
clone.list.insert(&row, -1);
|
|
||||||
}
|
|
||||||
|
|
||||||
clone.list.connect_row_activated(
|
|
||||||
clone!(@strong clone, @strong persons => move |_, row| {
|
|
||||||
clone.window.close();
|
|
||||||
let row = row.get_child().unwrap().downcast::<SelectorRow>().unwrap();
|
|
||||||
let index: usize = row.get_index().try_into().unwrap();
|
|
||||||
(clone.callback)(persons[index].clone());
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
|
|
||||||
clone
|
|
||||||
.list
|
|
||||||
.set_filter_func(Some(Box::new(clone!(@strong clone => move |row| {
|
|
||||||
let row = row.get_child().unwrap().downcast::<SelectorRow>().unwrap();
|
|
||||||
let index: usize = row.get_index().try_into().unwrap();
|
|
||||||
let search = clone.search_entry.get_text().to_string().to_lowercase();
|
|
||||||
search.is_empty() || persons[index]
|
|
||||||
.name_lf()
|
|
||||||
.to_lowercase()
|
|
||||||
.contains(&search)
|
|
||||||
}))));
|
|
||||||
});
|
|
||||||
|
|
||||||
result
|
|
||||||
.search_entry
|
|
||||||
.connect_search_changed(clone!(@strong result => move |_| {
|
|
||||||
result.list.invalidate_filter();
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
add_button.connect_clicked(clone!(@strong result => move |_| {
|
window.set_transient_for(Some(parent));
|
||||||
|
window.add(&list.widget);
|
||||||
|
|
||||||
|
add_button.connect_clicked(
|
||||||
|
clone!(@strong backend, @strong window, @strong callback => move |_| {
|
||||||
let editor = PersonEditor::new(
|
let editor = PersonEditor::new(
|
||||||
result.backend.clone(),
|
backend.clone(),
|
||||||
&result.window,
|
&window,
|
||||||
None,
|
None,
|
||||||
clone!(@strong result => move |person| {
|
clone!(@strong window, @strong callback => move |person| {
|
||||||
result.window.close();
|
window.close();
|
||||||
(result.callback)(person);
|
callback(person);
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
editor.show();
|
editor.show();
|
||||||
}));
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
result.window.set_transient_for(Some(parent));
|
Self { window }
|
||||||
|
|
||||||
result
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn show(&self) {
|
pub fn show(&self) {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::backend::Backend;
|
use crate::backend::Backend;
|
||||||
use crate::database::*;
|
use crate::database::*;
|
||||||
|
use crate::widgets::*;
|
||||||
use glib::clone;
|
use glib::clone;
|
||||||
use gtk::prelude::*;
|
use gtk::prelude::*;
|
||||||
use gtk_macros::get_widget;
|
use gtk_macros::get_widget;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
use super::selector_row::SelectorRow;
|
|
||||||
use super::{InstrumentSelector, PersonSelector, PartEditor, SectionEditor};
|
use super::{InstrumentSelector, PersonSelector, PartEditor, SectionEditor};
|
||||||
use crate::backend::*;
|
use crate::backend::*;
|
||||||
use crate::database::*;
|
use crate::database::*;
|
||||||
|
use crate::widgets::*;
|
||||||
use glib::clone;
|
use glib::clone;
|
||||||
use gtk::prelude::*;
|
use gtk::prelude::*;
|
||||||
use gtk_macros::get_widget;
|
use gtk_macros::get_widget;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::backend::Backend;
|
use crate::backend::Backend;
|
||||||
use crate::database::*;
|
use crate::database::*;
|
||||||
|
use crate::widgets::*;
|
||||||
use gio::prelude::*;
|
use gio::prelude::*;
|
||||||
use glib::clone;
|
use glib::clone;
|
||||||
use gtk::prelude::*;
|
use gtk::prelude::*;
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,8 @@ use std::rc::Rc;
|
||||||
mod backend;
|
mod backend;
|
||||||
mod database;
|
mod database;
|
||||||
mod dialogs;
|
mod dialogs;
|
||||||
|
mod screens;
|
||||||
|
mod widgets;
|
||||||
|
|
||||||
mod window;
|
mod window;
|
||||||
use window::Window;
|
use window::Window;
|
||||||
|
|
|
||||||
110
src/screens/ensemble_screen.rs
Normal file
110
src/screens/ensemble_screen.rs
Normal file
|
|
@ -0,0 +1,110 @@
|
||||||
|
use crate::backend::*;
|
||||||
|
use crate::database::*;
|
||||||
|
use crate::widgets::*;
|
||||||
|
use glib::clone;
|
||||||
|
use gtk::prelude::*;
|
||||||
|
use gtk_macros::get_widget;
|
||||||
|
use libhandy::HeaderBarExt;
|
||||||
|
use std::cell::RefCell;
|
||||||
|
use std::rc::Rc;
|
||||||
|
|
||||||
|
pub struct EnsembleScreen {
|
||||||
|
pub widget: gtk::Box,
|
||||||
|
stack: gtk::Stack,
|
||||||
|
recording_list: Rc<List<RecordingDescription>>,
|
||||||
|
back: RefCell<Option<Box<dyn Fn() -> () + 'static>>>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl EnsembleScreen {
|
||||||
|
pub fn new(backend: Rc<Backend>, ensemble: Ensemble) -> Rc<Self> {
|
||||||
|
let builder =
|
||||||
|
gtk::Builder::from_resource("/de/johrpan/musicus_editor/ui/ensemble_screen.ui");
|
||||||
|
|
||||||
|
get_widget!(builder, gtk::Box, widget);
|
||||||
|
get_widget!(builder, libhandy::HeaderBar, header);
|
||||||
|
get_widget!(builder, gtk::Button, back_button);
|
||||||
|
get_widget!(builder, gtk::MenuButton, menu_button);
|
||||||
|
get_widget!(builder, gtk::SearchEntry, search_entry);
|
||||||
|
get_widget!(builder, gtk::Stack, stack);
|
||||||
|
get_widget!(builder, gtk::Frame, recording_frame);
|
||||||
|
|
||||||
|
header.set_title(Some(&ensemble.name));
|
||||||
|
|
||||||
|
let recording_list = List::new(
|
||||||
|
|recording: &RecordingDescription| {
|
||||||
|
let work_label = gtk::Label::new(Some(&recording.work.get_title()));
|
||||||
|
|
||||||
|
work_label.set_ellipsize(pango::EllipsizeMode::End);
|
||||||
|
work_label.set_halign(gtk::Align::Start);
|
||||||
|
|
||||||
|
let performers_label = gtk::Label::new(Some(&recording.get_performers()));
|
||||||
|
performers_label.set_ellipsize(pango::EllipsizeMode::End);
|
||||||
|
performers_label.set_opacity(0.5);
|
||||||
|
performers_label.set_halign(gtk::Align::Start);
|
||||||
|
|
||||||
|
let vbox = gtk::Box::new(gtk::Orientation::Vertical, 0);
|
||||||
|
vbox.add(&work_label);
|
||||||
|
vbox.add(&performers_label);
|
||||||
|
|
||||||
|
vbox.upcast()
|
||||||
|
},
|
||||||
|
clone!(@strong search_entry => move |recording: &RecordingDescription| {
|
||||||
|
let search = search_entry.get_text().to_string().to_lowercase();
|
||||||
|
let text = recording.work.get_title() + &recording.get_performers();
|
||||||
|
search.is_empty() || text.contains(&search)
|
||||||
|
}),
|
||||||
|
"No recordings found.",
|
||||||
|
);
|
||||||
|
|
||||||
|
recording_frame.add(&recording_list.widget.clone());
|
||||||
|
|
||||||
|
let result = Rc::new(Self {
|
||||||
|
widget,
|
||||||
|
stack,
|
||||||
|
recording_list,
|
||||||
|
back: RefCell::new(None),
|
||||||
|
});
|
||||||
|
|
||||||
|
search_entry.connect_search_changed(clone!(@strong result => move |_| {
|
||||||
|
result.recording_list.invalidate_filter();
|
||||||
|
}));
|
||||||
|
|
||||||
|
back_button.connect_clicked(clone!(@strong result => move |_| {
|
||||||
|
if let Some(back) = &*result.back.borrow() {
|
||||||
|
back();
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
|
||||||
|
let context = glib::MainContext::default();
|
||||||
|
let clone = result.clone();
|
||||||
|
context.spawn_local(async move {
|
||||||
|
let recordings = backend
|
||||||
|
.get_recordings_for_ensemble(ensemble.id)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
|
if recordings.is_empty() {
|
||||||
|
clone.stack.set_visible_child_name("nothing");
|
||||||
|
} else {
|
||||||
|
clone.recording_list.show_items(recordings);
|
||||||
|
clone.stack.set_visible_child_name("content");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
result
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn set_back<B>(&self, back: B)
|
||||||
|
where
|
||||||
|
B: Fn() -> () + 'static,
|
||||||
|
{
|
||||||
|
self.back.replace(Some(Box::new(back)));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn set_recording_selected<S>(&self, selected: S)
|
||||||
|
where
|
||||||
|
S: Fn(&RecordingDescription) -> () + 'static,
|
||||||
|
{
|
||||||
|
self.recording_list.set_selected(selected);
|
||||||
|
}
|
||||||
|
}
|
||||||
11
src/screens/mod.rs
Normal file
11
src/screens/mod.rs
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
pub mod ensemble_screen;
|
||||||
|
pub use ensemble_screen::*;
|
||||||
|
|
||||||
|
pub mod person_screen;
|
||||||
|
pub use person_screen::*;
|
||||||
|
|
||||||
|
pub mod work_screen;
|
||||||
|
pub use work_screen::*;
|
||||||
|
|
||||||
|
pub mod recording_screen;
|
||||||
|
pub use recording_screen::*;
|
||||||
146
src/screens/person_screen.rs
Normal file
146
src/screens/person_screen.rs
Normal file
|
|
@ -0,0 +1,146 @@
|
||||||
|
use crate::backend::*;
|
||||||
|
use crate::database::*;
|
||||||
|
use crate::widgets::*;
|
||||||
|
use glib::clone;
|
||||||
|
use gtk::prelude::*;
|
||||||
|
use gtk_macros::get_widget;
|
||||||
|
use libhandy::HeaderBarExt;
|
||||||
|
use std::cell::RefCell;
|
||||||
|
use std::rc::Rc;
|
||||||
|
|
||||||
|
pub struct PersonScreen {
|
||||||
|
pub widget: gtk::Box,
|
||||||
|
stack: gtk::Stack,
|
||||||
|
work_list: Rc<List<WorkDescription>>,
|
||||||
|
recording_list: Rc<List<RecordingDescription>>,
|
||||||
|
back: RefCell<Option<Box<dyn Fn() -> () + 'static>>>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl PersonScreen {
|
||||||
|
pub fn new(backend: Rc<Backend>, person: Person) -> Rc<Self> {
|
||||||
|
let builder = gtk::Builder::from_resource("/de/johrpan/musicus_editor/ui/person_screen.ui");
|
||||||
|
|
||||||
|
get_widget!(builder, gtk::Box, widget);
|
||||||
|
get_widget!(builder, libhandy::HeaderBar, header);
|
||||||
|
get_widget!(builder, gtk::Button, back_button);
|
||||||
|
get_widget!(builder, gtk::MenuButton, menu_button);
|
||||||
|
get_widget!(builder, gtk::SearchEntry, search_entry);
|
||||||
|
get_widget!(builder, gtk::Stack, stack);
|
||||||
|
get_widget!(builder, gtk::Box, work_box);
|
||||||
|
get_widget!(builder, gtk::Frame, work_frame);
|
||||||
|
get_widget!(builder, gtk::Box, recording_box);
|
||||||
|
get_widget!(builder, gtk::Frame, recording_frame);
|
||||||
|
|
||||||
|
header.set_title(Some(&person.name_fl()));
|
||||||
|
|
||||||
|
let work_list = List::new(
|
||||||
|
|work: &WorkDescription| {
|
||||||
|
let label = gtk::Label::new(Some(&work.title));
|
||||||
|
label.set_halign(gtk::Align::Start);
|
||||||
|
label.upcast()
|
||||||
|
},
|
||||||
|
clone!(@strong search_entry => move |work: &WorkDescription| {
|
||||||
|
let search = search_entry.get_text().to_string().to_lowercase();
|
||||||
|
let title = work.title.to_lowercase();
|
||||||
|
search.is_empty() || title.contains(&search)
|
||||||
|
}),
|
||||||
|
"No works found.",
|
||||||
|
);
|
||||||
|
|
||||||
|
let recording_list = List::new(
|
||||||
|
|recording: &RecordingDescription| {
|
||||||
|
let work_label = gtk::Label::new(Some(&recording.work.get_title()));
|
||||||
|
|
||||||
|
work_label.set_ellipsize(pango::EllipsizeMode::End);
|
||||||
|
work_label.set_halign(gtk::Align::Start);
|
||||||
|
|
||||||
|
let performers_label = gtk::Label::new(Some(&recording.get_performers()));
|
||||||
|
performers_label.set_ellipsize(pango::EllipsizeMode::End);
|
||||||
|
performers_label.set_opacity(0.5);
|
||||||
|
performers_label.set_halign(gtk::Align::Start);
|
||||||
|
|
||||||
|
let vbox = gtk::Box::new(gtk::Orientation::Vertical, 0);
|
||||||
|
vbox.add(&work_label);
|
||||||
|
vbox.add(&performers_label);
|
||||||
|
|
||||||
|
vbox.upcast()
|
||||||
|
},
|
||||||
|
clone!(@strong search_entry => move |recording: &RecordingDescription| {
|
||||||
|
let search = search_entry.get_text().to_string().to_lowercase();
|
||||||
|
let text = recording.work.get_title() + &recording.get_performers();
|
||||||
|
search.is_empty() || text.contains(&search)
|
||||||
|
}),
|
||||||
|
"No recordings found.",
|
||||||
|
);
|
||||||
|
|
||||||
|
work_frame.add(&work_list.widget);
|
||||||
|
recording_frame.add(&recording_list.widget);
|
||||||
|
|
||||||
|
let result = Rc::new(Self {
|
||||||
|
widget,
|
||||||
|
stack,
|
||||||
|
work_list,
|
||||||
|
recording_list,
|
||||||
|
back: RefCell::new(None),
|
||||||
|
});
|
||||||
|
|
||||||
|
search_entry.connect_search_changed(clone!(@strong result => move |_| {
|
||||||
|
result.work_list.invalidate_filter();
|
||||||
|
result.recording_list.invalidate_filter();
|
||||||
|
}));
|
||||||
|
|
||||||
|
back_button.connect_clicked(clone!(@strong result => move |_| {
|
||||||
|
if let Some(back) = &*result.back.borrow() {
|
||||||
|
back();
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
|
||||||
|
let context = glib::MainContext::default();
|
||||||
|
let clone = result.clone();
|
||||||
|
context.spawn_local(async move {
|
||||||
|
let works = backend.get_work_descriptions(person.id).await.unwrap();
|
||||||
|
let recordings = backend.get_recordings_for_person(person.id).await.unwrap();
|
||||||
|
|
||||||
|
if works.is_empty() && recordings.is_empty() {
|
||||||
|
clone.stack.set_visible_child_name("nothing");
|
||||||
|
} else {
|
||||||
|
if works.is_empty() {
|
||||||
|
work_box.hide();
|
||||||
|
} else {
|
||||||
|
clone.work_list.show_items(works);
|
||||||
|
}
|
||||||
|
|
||||||
|
if recordings.is_empty() {
|
||||||
|
recording_box.hide();
|
||||||
|
} else {
|
||||||
|
clone.recording_list.show_items(recordings);
|
||||||
|
}
|
||||||
|
|
||||||
|
clone.stack.set_visible_child_name("content");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
result
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn set_back<B>(&self, back: B)
|
||||||
|
where
|
||||||
|
B: Fn() -> () + 'static,
|
||||||
|
{
|
||||||
|
self.back.replace(Some(Box::new(back)));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn set_work_selected<S>(&self, selected: S)
|
||||||
|
where
|
||||||
|
S: Fn(&WorkDescription) -> () + 'static,
|
||||||
|
{
|
||||||
|
self.work_list.set_selected(selected);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn set_recording_selected<S>(&self, selected: S)
|
||||||
|
where
|
||||||
|
S: Fn(&RecordingDescription) -> () + 'static,
|
||||||
|
{
|
||||||
|
self.recording_list.set_selected(selected);
|
||||||
|
}
|
||||||
|
}
|
||||||
48
src/screens/recording_screen.rs
Normal file
48
src/screens/recording_screen.rs
Normal file
|
|
@ -0,0 +1,48 @@
|
||||||
|
use crate::backend::*;
|
||||||
|
use crate::database::*;
|
||||||
|
use glib::clone;
|
||||||
|
use gtk::prelude::*;
|
||||||
|
use gtk_macros::get_widget;
|
||||||
|
use libhandy::HeaderBarExt;
|
||||||
|
use std::cell::RefCell;
|
||||||
|
use std::rc::Rc;
|
||||||
|
|
||||||
|
pub struct RecordingScreen {
|
||||||
|
pub widget: gtk::Box,
|
||||||
|
back: RefCell<Option<Box<dyn Fn() -> () + 'static>>>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl RecordingScreen {
|
||||||
|
pub fn new(backend: Rc<Backend>, recording: RecordingDescription) -> Rc<Self> {
|
||||||
|
let builder =
|
||||||
|
gtk::Builder::from_resource("/de/johrpan/musicus_editor/ui/recording_screen.ui");
|
||||||
|
|
||||||
|
get_widget!(builder, gtk::Box, widget);
|
||||||
|
get_widget!(builder, libhandy::HeaderBar, header);
|
||||||
|
get_widget!(builder, gtk::Button, back_button);
|
||||||
|
get_widget!(builder, gtk::MenuButton, menu_button);
|
||||||
|
|
||||||
|
header.set_title(Some(&recording.work.get_title()));
|
||||||
|
header.set_subtitle(Some(&recording.get_performers()));
|
||||||
|
|
||||||
|
let result = Rc::new(Self {
|
||||||
|
widget,
|
||||||
|
back: RefCell::new(None),
|
||||||
|
});
|
||||||
|
|
||||||
|
back_button.connect_clicked(clone!(@strong result => move |_| {
|
||||||
|
if let Some(back) = &*result.back.borrow() {
|
||||||
|
back();
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
|
||||||
|
result
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn set_back<B>(&self, back: B)
|
||||||
|
where
|
||||||
|
B: Fn() -> () + 'static,
|
||||||
|
{
|
||||||
|
self.back.replace(Some(Box::new(back)));
|
||||||
|
}
|
||||||
|
}
|
||||||
107
src/screens/work_screen.rs
Normal file
107
src/screens/work_screen.rs
Normal file
|
|
@ -0,0 +1,107 @@
|
||||||
|
use crate::backend::*;
|
||||||
|
use crate::database::*;
|
||||||
|
use crate::widgets::*;
|
||||||
|
use glib::clone;
|
||||||
|
use gtk::prelude::*;
|
||||||
|
use gtk_macros::get_widget;
|
||||||
|
use libhandy::HeaderBarExt;
|
||||||
|
use std::cell::RefCell;
|
||||||
|
use std::rc::Rc;
|
||||||
|
|
||||||
|
pub struct WorkScreen {
|
||||||
|
pub widget: gtk::Box,
|
||||||
|
stack: gtk::Stack,
|
||||||
|
recording_list: Rc<List<RecordingDescription>>,
|
||||||
|
back: RefCell<Option<Box<dyn Fn() -> () + 'static>>>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl WorkScreen {
|
||||||
|
pub fn new(backend: Rc<Backend>, work: WorkDescription) -> Rc<Self> {
|
||||||
|
let builder = gtk::Builder::from_resource("/de/johrpan/musicus_editor/ui/work_screen.ui");
|
||||||
|
|
||||||
|
get_widget!(builder, gtk::Box, widget);
|
||||||
|
get_widget!(builder, libhandy::HeaderBar, header);
|
||||||
|
get_widget!(builder, gtk::Button, back_button);
|
||||||
|
get_widget!(builder, gtk::MenuButton, menu_button);
|
||||||
|
get_widget!(builder, gtk::SearchEntry, search_entry);
|
||||||
|
get_widget!(builder, gtk::Stack, stack);
|
||||||
|
get_widget!(builder, gtk::Frame, recording_frame);
|
||||||
|
|
||||||
|
header.set_title(Some(&work.title));
|
||||||
|
header.set_subtitle(Some(&work.composer.name_fl()));
|
||||||
|
|
||||||
|
let recording_list = List::new(
|
||||||
|
|recording: &RecordingDescription| {
|
||||||
|
let work_label = gtk::Label::new(Some(&recording.work.get_title()));
|
||||||
|
|
||||||
|
work_label.set_ellipsize(pango::EllipsizeMode::End);
|
||||||
|
work_label.set_halign(gtk::Align::Start);
|
||||||
|
|
||||||
|
let performers_label = gtk::Label::new(Some(&recording.get_performers()));
|
||||||
|
performers_label.set_ellipsize(pango::EllipsizeMode::End);
|
||||||
|
performers_label.set_opacity(0.5);
|
||||||
|
performers_label.set_halign(gtk::Align::Start);
|
||||||
|
|
||||||
|
let vbox = gtk::Box::new(gtk::Orientation::Vertical, 0);
|
||||||
|
vbox.add(&work_label);
|
||||||
|
vbox.add(&performers_label);
|
||||||
|
|
||||||
|
vbox.upcast()
|
||||||
|
},
|
||||||
|
clone!(@strong search_entry => move |recording: &RecordingDescription| {
|
||||||
|
let search = search_entry.get_text().to_string().to_lowercase();
|
||||||
|
let text = recording.work.get_title() + &recording.get_performers();
|
||||||
|
search.is_empty() || text.contains(&search)
|
||||||
|
}),
|
||||||
|
"No recordings found.",
|
||||||
|
);
|
||||||
|
|
||||||
|
recording_frame.add(&recording_list.widget);
|
||||||
|
|
||||||
|
let result = Rc::new(Self {
|
||||||
|
widget,
|
||||||
|
stack,
|
||||||
|
recording_list,
|
||||||
|
back: RefCell::new(None),
|
||||||
|
});
|
||||||
|
|
||||||
|
search_entry.connect_search_changed(clone!(@strong result => move |_| {
|
||||||
|
result.recording_list.invalidate_filter();
|
||||||
|
}));
|
||||||
|
|
||||||
|
back_button.connect_clicked(clone!(@strong result => move |_| {
|
||||||
|
if let Some(back) = &*result.back.borrow() {
|
||||||
|
back();
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
|
||||||
|
let context = glib::MainContext::default();
|
||||||
|
let clone = result.clone();
|
||||||
|
context.spawn_local(async move {
|
||||||
|
let recordings = backend.get_recordings_for_work(work.id).await.unwrap();
|
||||||
|
|
||||||
|
if recordings.is_empty() {
|
||||||
|
clone.stack.set_visible_child_name("nothing");
|
||||||
|
} else {
|
||||||
|
clone.recording_list.show_items(recordings);
|
||||||
|
clone.stack.set_visible_child_name("content");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
result
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn set_back<B>(&self, back: B)
|
||||||
|
where
|
||||||
|
B: Fn() -> () + 'static,
|
||||||
|
{
|
||||||
|
self.back.replace(Some(Box::new(back)));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn set_recording_selected<S>(&self, selected: S)
|
||||||
|
where
|
||||||
|
S: Fn(&RecordingDescription) -> () + 'static,
|
||||||
|
{
|
||||||
|
self.recording_list.set_selected(selected);
|
||||||
|
}
|
||||||
|
}
|
||||||
90
src/widgets/list.rs
Normal file
90
src/widgets/list.rs
Normal file
|
|
@ -0,0 +1,90 @@
|
||||||
|
use super::*;
|
||||||
|
use glib::clone;
|
||||||
|
use gtk::prelude::*;
|
||||||
|
use std::cell::RefCell;
|
||||||
|
use std::convert::TryInto;
|
||||||
|
use std::rc::Rc;
|
||||||
|
|
||||||
|
pub struct List<T>
|
||||||
|
where
|
||||||
|
T: 'static,
|
||||||
|
{
|
||||||
|
pub widget: gtk::ListBox,
|
||||||
|
items: RefCell<Vec<T>>,
|
||||||
|
make_widget: Box<dyn Fn(&T) -> gtk::Widget + 'static>,
|
||||||
|
selected: RefCell<Option<Box<dyn Fn(&T) -> () + 'static>>>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<T> List<T>
|
||||||
|
where
|
||||||
|
T: 'static,
|
||||||
|
{
|
||||||
|
pub fn new<M, F>(make_widget: M, filter: F, placeholder_text: &str) -> Rc<Self>
|
||||||
|
where
|
||||||
|
M: Fn(&T) -> gtk::Widget + 'static,
|
||||||
|
F: Fn(&T) -> bool + 'static,
|
||||||
|
{
|
||||||
|
let placeholder_label = gtk::Label::new(Some(placeholder_text));
|
||||||
|
placeholder_label.set_margin_top(6);
|
||||||
|
placeholder_label.set_margin_bottom(6);
|
||||||
|
placeholder_label.set_margin_start(6);
|
||||||
|
placeholder_label.set_margin_end(6);
|
||||||
|
placeholder_label.show();
|
||||||
|
|
||||||
|
let widget = gtk::ListBox::new();
|
||||||
|
widget.set_placeholder(Some(&placeholder_label));
|
||||||
|
widget.show();
|
||||||
|
|
||||||
|
let result = Rc::new(Self {
|
||||||
|
widget,
|
||||||
|
items: RefCell::new(Vec::new()),
|
||||||
|
make_widget: Box::new(make_widget),
|
||||||
|
selected: RefCell::new(None),
|
||||||
|
});
|
||||||
|
|
||||||
|
result
|
||||||
|
.widget
|
||||||
|
.connect_row_activated(clone!(@strong result => move |_, row| {
|
||||||
|
if let Some(selected) = &*result.selected.borrow() {
|
||||||
|
let row = row.get_child().unwrap().downcast::<SelectorRow>().unwrap();
|
||||||
|
let index: usize = row.get_index().try_into().unwrap();
|
||||||
|
selected(&result.items.borrow()[index]);
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
|
||||||
|
result
|
||||||
|
.widget
|
||||||
|
.set_filter_func(Some(Box::new(clone!(@strong result => move |row| {
|
||||||
|
let row = row.get_child().unwrap().downcast::<SelectorRow>().unwrap();
|
||||||
|
let index: usize = row.get_index().try_into().unwrap();
|
||||||
|
filter(&result.items.borrow()[index])
|
||||||
|
}))));
|
||||||
|
|
||||||
|
result
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn set_selected<S>(&self, selected: S)
|
||||||
|
where
|
||||||
|
S: Fn(&T) -> () + 'static,
|
||||||
|
{
|
||||||
|
self.selected.replace(Some(Box::new(selected)));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn show_items(&self, items: Vec<T>) {
|
||||||
|
self.items.replace(items);
|
||||||
|
|
||||||
|
for child in self.widget.get_children() {
|
||||||
|
self.widget.remove(&child);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (index, item) in self.items.borrow().iter().enumerate() {
|
||||||
|
let row = SelectorRow::new(index.try_into().unwrap(), &(self.make_widget)(item));
|
||||||
|
row.show_all();
|
||||||
|
self.widget.insert(&row, -1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn invalidate_filter(&self) {
|
||||||
|
self.widget.invalidate_filter();
|
||||||
|
}
|
||||||
|
}
|
||||||
14
src/widgets/mod.rs
Normal file
14
src/widgets/mod.rs
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
pub mod list;
|
||||||
|
pub use list::*;
|
||||||
|
|
||||||
|
pub mod person_list;
|
||||||
|
pub use person_list::*;
|
||||||
|
|
||||||
|
pub mod poe_list;
|
||||||
|
pub use poe_list::*;
|
||||||
|
|
||||||
|
pub mod selector_row;
|
||||||
|
pub use selector_row::*;
|
||||||
|
|
||||||
|
pub mod stack;
|
||||||
|
pub use stack::*;
|
||||||
77
src/widgets/person_list.rs
Normal file
77
src/widgets/person_list.rs
Normal file
|
|
@ -0,0 +1,77 @@
|
||||||
|
use super::*;
|
||||||
|
use crate::backend::Backend;
|
||||||
|
use crate::database::*;
|
||||||
|
use glib::clone;
|
||||||
|
use gtk::prelude::*;
|
||||||
|
use gtk_macros::get_widget;
|
||||||
|
use std::rc::Rc;
|
||||||
|
|
||||||
|
pub struct PersonList {
|
||||||
|
pub widget: gtk::Box,
|
||||||
|
list: Rc<List<Person>>,
|
||||||
|
backend: Rc<Backend>,
|
||||||
|
stack: gtk::Stack,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl PersonList {
|
||||||
|
pub fn new(backend: Rc<Backend>) -> Rc<Self> {
|
||||||
|
let builder = gtk::Builder::from_resource("/de/johrpan/musicus_editor/ui/person_list.ui");
|
||||||
|
|
||||||
|
get_widget!(builder, gtk::Box, widget);
|
||||||
|
get_widget!(builder, gtk::SearchEntry, search_entry);
|
||||||
|
get_widget!(builder, gtk::Stack, stack);
|
||||||
|
get_widget!(builder, gtk::ScrolledWindow, scrolled_window);
|
||||||
|
|
||||||
|
let list = List::new(
|
||||||
|
|person: &Person| {
|
||||||
|
let label = gtk::Label::new(Some(&person.name_lf()));
|
||||||
|
label.set_halign(gtk::Align::Start);
|
||||||
|
label.upcast()
|
||||||
|
},
|
||||||
|
clone!(@strong search_entry => move |person: &Person| {
|
||||||
|
let search = search_entry.get_text().to_string().to_lowercase();
|
||||||
|
let name = person.name_fl().to_lowercase();
|
||||||
|
search.is_empty() || name.contains(&search)
|
||||||
|
}),
|
||||||
|
"No persons found.",
|
||||||
|
);
|
||||||
|
|
||||||
|
scrolled_window.add(&list.widget);
|
||||||
|
|
||||||
|
let result = Rc::new(Self {
|
||||||
|
widget,
|
||||||
|
list,
|
||||||
|
backend,
|
||||||
|
stack,
|
||||||
|
});
|
||||||
|
|
||||||
|
search_entry.connect_search_changed(clone!(@strong result => move |_| {
|
||||||
|
result.list.invalidate_filter();
|
||||||
|
}));
|
||||||
|
|
||||||
|
result.clone().reload();
|
||||||
|
|
||||||
|
result
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn set_selected<S>(&self, selected: S)
|
||||||
|
where
|
||||||
|
S: Fn(&Person) -> () + 'static,
|
||||||
|
{
|
||||||
|
self.list.set_selected(selected);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn reload(self: Rc<Self>) {
|
||||||
|
self.stack.set_visible_child_name("loading");
|
||||||
|
|
||||||
|
let context = glib::MainContext::default();
|
||||||
|
let backend = self.backend.clone();
|
||||||
|
let list = self.list.clone();
|
||||||
|
|
||||||
|
context.spawn_local(async move {
|
||||||
|
let persons = backend.get_persons().await.unwrap();
|
||||||
|
list.show_items(persons);
|
||||||
|
self.stack.set_visible_child_name("content");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
104
src/widgets/poe_list.rs
Normal file
104
src/widgets/poe_list.rs
Normal file
|
|
@ -0,0 +1,104 @@
|
||||||
|
use super::*;
|
||||||
|
use crate::backend::Backend;
|
||||||
|
use crate::database::*;
|
||||||
|
use glib::clone;
|
||||||
|
use gtk::prelude::*;
|
||||||
|
use gtk_macros::get_widget;
|
||||||
|
use std::rc::Rc;
|
||||||
|
|
||||||
|
#[derive(Clone)]
|
||||||
|
pub enum PersonOrEnsemble {
|
||||||
|
Person(Person),
|
||||||
|
Ensemble(Ensemble),
|
||||||
|
}
|
||||||
|
|
||||||
|
impl PersonOrEnsemble {
|
||||||
|
pub fn get_title(&self) -> String {
|
||||||
|
match self {
|
||||||
|
PersonOrEnsemble::Person(person) => person.name_lf(),
|
||||||
|
PersonOrEnsemble::Ensemble(ensemble) => ensemble.name.clone(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct PoeList {
|
||||||
|
pub widget: gtk::Box,
|
||||||
|
list: Rc<List<PersonOrEnsemble>>,
|
||||||
|
backend: Rc<Backend>,
|
||||||
|
stack: gtk::Stack,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl PoeList {
|
||||||
|
pub fn new(backend: Rc<Backend>) -> Rc<Self> {
|
||||||
|
let builder = gtk::Builder::from_resource("/de/johrpan/musicus_editor/ui/poe_list.ui");
|
||||||
|
|
||||||
|
get_widget!(builder, gtk::Box, widget);
|
||||||
|
get_widget!(builder, gtk::SearchEntry, search_entry);
|
||||||
|
get_widget!(builder, gtk::Stack, stack);
|
||||||
|
get_widget!(builder, gtk::ScrolledWindow, scrolled_window);
|
||||||
|
|
||||||
|
let list = List::new(
|
||||||
|
|poe: &PersonOrEnsemble| {
|
||||||
|
let label = gtk::Label::new(Some(&poe.get_title()));
|
||||||
|
label.set_halign(gtk::Align::Start);
|
||||||
|
label.upcast()
|
||||||
|
},
|
||||||
|
clone!(@strong search_entry => move |poe: &PersonOrEnsemble| {
|
||||||
|
let search = search_entry.get_text().to_string().to_lowercase();
|
||||||
|
let title = poe.get_title().to_lowercase();
|
||||||
|
search.is_empty() || title.contains(&search)
|
||||||
|
}),
|
||||||
|
"No persons or ensembles found.",
|
||||||
|
);
|
||||||
|
|
||||||
|
scrolled_window.add(&list.widget);
|
||||||
|
|
||||||
|
let result = Rc::new(Self {
|
||||||
|
widget,
|
||||||
|
list,
|
||||||
|
backend,
|
||||||
|
stack,
|
||||||
|
});
|
||||||
|
|
||||||
|
search_entry.connect_search_changed(clone!(@strong result => move |_| {
|
||||||
|
result.list.invalidate_filter();
|
||||||
|
}));
|
||||||
|
|
||||||
|
result.clone().reload();
|
||||||
|
|
||||||
|
result
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn set_selected<S>(&self, selected: S)
|
||||||
|
where
|
||||||
|
S: Fn(&PersonOrEnsemble) -> () + 'static,
|
||||||
|
{
|
||||||
|
self.list.set_selected(selected);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn reload(self: Rc<Self>) {
|
||||||
|
self.stack.set_visible_child_name("loading");
|
||||||
|
|
||||||
|
let context = glib::MainContext::default();
|
||||||
|
let backend = self.backend.clone();
|
||||||
|
let list = self.list.clone();
|
||||||
|
|
||||||
|
context.spawn_local(async move {
|
||||||
|
let persons = backend.get_persons().await.unwrap();
|
||||||
|
let ensembles = backend.get_ensembles().await.unwrap();
|
||||||
|
let mut poes: Vec<PersonOrEnsemble> = Vec::new();
|
||||||
|
|
||||||
|
for person in persons {
|
||||||
|
poes.push(PersonOrEnsemble::Person(person));
|
||||||
|
}
|
||||||
|
|
||||||
|
for ensemble in ensembles {
|
||||||
|
poes.push(PersonOrEnsemble::Ensemble(ensemble));
|
||||||
|
}
|
||||||
|
|
||||||
|
list.show_items(poes);
|
||||||
|
|
||||||
|
self.stack.set_visible_child_name("content");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
77
src/widgets/stack.rs
Normal file
77
src/widgets/stack.rs
Normal file
|
|
@ -0,0 +1,77 @@
|
||||||
|
use glib::clone;
|
||||||
|
use gtk::prelude::*;
|
||||||
|
use std::cell::RefCell;
|
||||||
|
|
||||||
|
pub struct Stack {
|
||||||
|
pub widget: gtk::Stack,
|
||||||
|
old_children: RefCell<Vec<gtk::Widget>>,
|
||||||
|
current_child: RefCell<Option<gtk::Widget>>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Stack {
|
||||||
|
pub fn new<W>(empty_screen: &W) -> Self
|
||||||
|
where
|
||||||
|
W: IsA<gtk::Widget>,
|
||||||
|
{
|
||||||
|
let old_children = RefCell::new(Vec::new());
|
||||||
|
|
||||||
|
let widget = gtk::Stack::new();
|
||||||
|
widget.set_transition_type(gtk::StackTransitionType::Crossfade);
|
||||||
|
widget.set_hexpand(true);
|
||||||
|
widget.add_named(empty_screen, "empty_screen");
|
||||||
|
|
||||||
|
unsafe {
|
||||||
|
widget.connect_notify_unsafe(
|
||||||
|
Some("transition-running"),
|
||||||
|
clone!(@strong old_children => move |stack, _| {
|
||||||
|
for child in old_children.borrow().iter() {
|
||||||
|
stack.remove(child);
|
||||||
|
}
|
||||||
|
|
||||||
|
old_children.borrow_mut().clear();
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
widget.show();
|
||||||
|
|
||||||
|
Self {
|
||||||
|
widget: widget.clone(),
|
||||||
|
old_children,
|
||||||
|
current_child: RefCell::new(None),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn set_child<W>(&self, child: W)
|
||||||
|
where
|
||||||
|
W: IsA<gtk::Widget>,
|
||||||
|
{
|
||||||
|
if let Some(child) = self.current_child.borrow_mut().take() {
|
||||||
|
self.old_children.borrow_mut().push(child);
|
||||||
|
}
|
||||||
|
|
||||||
|
self.current_child.replace(Some(child.clone().upcast()));
|
||||||
|
self.widget.add(&child);
|
||||||
|
self.widget.set_visible_child(&child);
|
||||||
|
|
||||||
|
if !self.widget.get_transition_running() {
|
||||||
|
for child in self.old_children.borrow().iter() {
|
||||||
|
self.widget.remove(child);
|
||||||
|
}
|
||||||
|
|
||||||
|
self.old_children.borrow_mut().clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn reset_child(&self) {
|
||||||
|
self.widget.set_visible_child_name("empty_screen");
|
||||||
|
|
||||||
|
if !self.widget.get_transition_running() {
|
||||||
|
for child in self.old_children.borrow().iter() {
|
||||||
|
self.widget.remove(child);
|
||||||
|
}
|
||||||
|
|
||||||
|
self.old_children.borrow_mut().clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
656
src/window.rs
656
src/window.rs
|
|
@ -1,152 +1,125 @@
|
||||||
use super::backend::Backend;
|
use crate::backend::*;
|
||||||
use super::database::*;
|
use crate::dialogs::*;
|
||||||
use super::dialogs::*;
|
use crate::screens::*;
|
||||||
|
use crate::widgets::*;
|
||||||
use gio::prelude::*;
|
use gio::prelude::*;
|
||||||
use glib::clone;
|
use glib::clone;
|
||||||
use gtk::prelude::*;
|
use gtk::prelude::*;
|
||||||
use gtk_macros::{action, get_widget};
|
use gtk_macros::{action, get_widget};
|
||||||
use libhandy::prelude::*;
|
use libhandy::prelude::*;
|
||||||
use libhandy::HeaderBarExt;
|
|
||||||
use std::cell::{Cell, RefCell};
|
|
||||||
use std::convert::TryInto;
|
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
|
|
||||||
#[derive(Clone)]
|
|
||||||
enum PersonOrEnsemble {
|
|
||||||
Person(Person),
|
|
||||||
Ensemble(Ensemble),
|
|
||||||
}
|
|
||||||
|
|
||||||
impl PersonOrEnsemble {
|
|
||||||
pub fn get_title(&self) -> String {
|
|
||||||
match self {
|
|
||||||
PersonOrEnsemble::Person(person) => person.name_lf(),
|
|
||||||
PersonOrEnsemble::Ensemble(ensemble) => ensemble.name.clone(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Clone)]
|
|
||||||
enum WindowState {
|
|
||||||
Loading,
|
|
||||||
Selection(Vec<PersonOrEnsemble>),
|
|
||||||
OverviewScreenLoading(PersonOrEnsemble),
|
|
||||||
OverviewScreen(
|
|
||||||
PersonOrEnsemble,
|
|
||||||
Vec<WorkDescription>,
|
|
||||||
Vec<RecordingDescription>,
|
|
||||||
String,
|
|
||||||
),
|
|
||||||
WorkScreenLoading(PersonOrEnsemble, WorkDescription),
|
|
||||||
WorkScreen(
|
|
||||||
PersonOrEnsemble,
|
|
||||||
WorkDescription,
|
|
||||||
Vec<RecordingDescription>,
|
|
||||||
String,
|
|
||||||
),
|
|
||||||
RecordingScreenLoading(PersonOrEnsemble, RecordingDescription),
|
|
||||||
}
|
|
||||||
|
|
||||||
pub struct Window {
|
pub struct Window {
|
||||||
window: libhandy::ApplicationWindow,
|
|
||||||
state: RefCell<WindowState>,
|
|
||||||
backend: Rc<Backend>,
|
backend: Rc<Backend>,
|
||||||
|
window: libhandy::ApplicationWindow,
|
||||||
leaflet: libhandy::Leaflet,
|
leaflet: libhandy::Leaflet,
|
||||||
sidebar_stack: gtk::Stack,
|
sidebar_box: gtk::Box,
|
||||||
person_search_entry: gtk::SearchEntry,
|
poe_list: Rc<PoeList>,
|
||||||
sidebar_list: gtk::ListBox,
|
stack: Stack,
|
||||||
main_stack: gtk::Stack,
|
|
||||||
overview_header: libhandy::HeaderBar,
|
|
||||||
overview_header_menu_button: gtk::MenuButton,
|
|
||||||
overview_search_entry: gtk::SearchEntry,
|
|
||||||
overview_stack: gtk::Stack,
|
|
||||||
overview_work_box: gtk::Box,
|
|
||||||
overview_work_list: gtk::ListBox,
|
|
||||||
overview_recording_box: gtk::Box,
|
|
||||||
overview_recording_list: gtk::ListBox,
|
|
||||||
work_details_header: libhandy::HeaderBar,
|
|
||||||
work_details_stack: gtk::Stack,
|
|
||||||
work_details_recording_list: gtk::ListBox,
|
|
||||||
recording_details_header: libhandy::HeaderBar,
|
|
||||||
recording_details_stack: gtk::Stack,
|
|
||||||
sidebar_list_row_activated_handler_id: Cell<Option<glib::SignalHandlerId>>,
|
|
||||||
overview_work_list_row_activated_handler_id: Cell<Option<glib::SignalHandlerId>>,
|
|
||||||
overview_recording_list_row_activated_handler_id: Cell<Option<glib::SignalHandlerId>>,
|
|
||||||
work_details_recording_list_row_activated_handler_id: Cell<Option<glib::SignalHandlerId>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Window {
|
impl Window {
|
||||||
pub fn new(app: >k::Application) -> Rc<Self> {
|
pub fn new(app: >k::Application) -> Rc<Self> {
|
||||||
use WindowState::*;
|
|
||||||
|
|
||||||
let builder = gtk::Builder::from_resource("/de/johrpan/musicus_editor/ui/window.ui");
|
let builder = gtk::Builder::from_resource("/de/johrpan/musicus_editor/ui/window.ui");
|
||||||
|
|
||||||
get_widget!(builder, libhandy::ApplicationWindow, window);
|
get_widget!(builder, libhandy::ApplicationWindow, window);
|
||||||
get_widget!(builder, libhandy::Leaflet, leaflet);
|
get_widget!(builder, libhandy::Leaflet, leaflet);
|
||||||
get_widget!(builder, gtk::SearchEntry, person_search_entry);
|
get_widget!(builder, gtk::Box, sidebar_box);
|
||||||
get_widget!(builder, gtk::Stack, sidebar_stack);
|
get_widget!(builder, gtk::Box, empty_screen);
|
||||||
get_widget!(builder, gtk::ListBox, sidebar_list);
|
|
||||||
get_widget!(builder, gtk::Stack, main_stack);
|
|
||||||
get_widget!(builder, libhandy::HeaderBar, overview_header);
|
|
||||||
get_widget!(builder, gtk::MenuButton, overview_header_menu_button);
|
|
||||||
get_widget!(builder, gtk::SearchEntry, overview_search_entry);
|
|
||||||
get_widget!(builder, gtk::Stack, overview_stack);
|
|
||||||
get_widget!(builder, gtk::Box, overview_work_box);
|
|
||||||
get_widget!(builder, gtk::ListBox, overview_work_list);
|
|
||||||
get_widget!(builder, gtk::Box, overview_recording_box);
|
|
||||||
get_widget!(builder, gtk::ListBox, overview_recording_list);
|
|
||||||
get_widget!(builder, libhandy::HeaderBar, work_details_header);
|
|
||||||
get_widget!(builder, gtk::Button, work_details_back_button);
|
|
||||||
get_widget!(builder, gtk::Stack, work_details_stack);
|
|
||||||
get_widget!(builder, gtk::ListBox, work_details_recording_list);
|
|
||||||
get_widget!(builder, libhandy::HeaderBar, recording_details_header);
|
|
||||||
get_widget!(builder, gtk::Button, recording_details_back_button);
|
|
||||||
get_widget!(builder, gtk::Stack, recording_details_stack);
|
|
||||||
|
|
||||||
let backend = Backend::new("test.sqlite");
|
let backend = Rc::new(Backend::new("test.sqlite"));
|
||||||
|
let poe_list = PoeList::new(backend.clone());
|
||||||
|
let stack = Stack::new(&empty_screen);
|
||||||
|
|
||||||
let result = Rc::new(Window {
|
let result = Rc::new(Self {
|
||||||
window: window,
|
backend,
|
||||||
state: RefCell::new(Loading),
|
window,
|
||||||
backend: Rc::new(backend),
|
leaflet,
|
||||||
leaflet: leaflet,
|
sidebar_box,
|
||||||
sidebar_stack: sidebar_stack,
|
poe_list,
|
||||||
sidebar_list: sidebar_list,
|
stack,
|
||||||
person_search_entry: person_search_entry,
|
|
||||||
main_stack: main_stack,
|
|
||||||
overview_header: overview_header,
|
|
||||||
overview_header_menu_button: overview_header_menu_button,
|
|
||||||
overview_search_entry: overview_search_entry,
|
|
||||||
overview_stack: overview_stack,
|
|
||||||
overview_work_box: overview_work_box,
|
|
||||||
overview_work_list: overview_work_list,
|
|
||||||
overview_recording_box: overview_recording_box,
|
|
||||||
overview_recording_list: overview_recording_list,
|
|
||||||
work_details_header: work_details_header,
|
|
||||||
work_details_stack: work_details_stack,
|
|
||||||
work_details_recording_list: work_details_recording_list,
|
|
||||||
recording_details_header: recording_details_header,
|
|
||||||
recording_details_stack: recording_details_stack,
|
|
||||||
sidebar_list_row_activated_handler_id: Cell::new(None),
|
|
||||||
overview_work_list_row_activated_handler_id: Cell::new(None),
|
|
||||||
overview_recording_list_row_activated_handler_id: Cell::new(None),
|
|
||||||
work_details_recording_list_row_activated_handler_id: Cell::new(None),
|
|
||||||
});
|
});
|
||||||
|
|
||||||
action!(
|
result
|
||||||
result.window,
|
.poe_list
|
||||||
"back",
|
.set_selected(clone!(@strong result => move |poe| {
|
||||||
clone!(@strong result => move |_, _| {
|
result.leaflet.set_visible_child(&result.stack.widget);
|
||||||
result.back();
|
match poe {
|
||||||
})
|
PersonOrEnsemble::Person(person) => {
|
||||||
);
|
let person_screen = Rc::new(PersonScreen::new(result.backend.clone(), person.clone()));
|
||||||
|
|
||||||
|
person_screen.set_back(clone!(@strong result => move || {
|
||||||
|
result.leaflet.set_visible_child(&result.sidebar_box);
|
||||||
|
result.stack.reset_child();
|
||||||
|
}));
|
||||||
|
|
||||||
|
person_screen.set_work_selected(clone!(@strong result, @strong person_screen => move |work| {
|
||||||
|
let work_screen = Rc::new(WorkScreen::new(result.backend.clone(), work.clone()));
|
||||||
|
|
||||||
|
work_screen.set_back(clone!(@strong result, @strong person_screen => move || {
|
||||||
|
result.stack.set_child(person_screen.widget.clone());
|
||||||
|
}));
|
||||||
|
|
||||||
|
work_screen.set_recording_selected(clone!(@strong result, @strong work_screen => move |recording| {
|
||||||
|
let recording_screen = RecordingScreen::new(result.backend.clone(), recording.clone());
|
||||||
|
|
||||||
|
recording_screen.set_back(clone!(@strong result, @strong work_screen => move || {
|
||||||
|
result.stack.set_child(work_screen.widget.clone());
|
||||||
|
}));
|
||||||
|
|
||||||
|
result.stack.set_child(recording_screen.widget.clone());
|
||||||
|
}));
|
||||||
|
|
||||||
|
result.stack.set_child(work_screen.widget.clone());
|
||||||
|
}));
|
||||||
|
|
||||||
|
person_screen.set_recording_selected(clone!(@strong result, @strong person_screen => move |recording| {
|
||||||
|
let recording_screen = Rc::new(RecordingScreen::new(result.backend.clone(), recording.clone()));
|
||||||
|
|
||||||
|
recording_screen.set_back(clone!(@strong result, @strong person_screen => move || {
|
||||||
|
result.stack.set_child(person_screen.widget.clone());
|
||||||
|
}));
|
||||||
|
|
||||||
|
result.stack.set_child(recording_screen.widget.clone());
|
||||||
|
}));
|
||||||
|
|
||||||
|
result.stack.set_child(person_screen.widget.clone());
|
||||||
|
}
|
||||||
|
PersonOrEnsemble::Ensemble(ensemble) => {
|
||||||
|
let ensemble_screen = EnsembleScreen::new(result.backend.clone(), ensemble.clone());
|
||||||
|
|
||||||
|
ensemble_screen.set_back(clone!(@strong result => move || {
|
||||||
|
result.leaflet.set_visible_child(&result.sidebar_box);
|
||||||
|
result.stack.reset_child();
|
||||||
|
}));
|
||||||
|
|
||||||
|
ensemble_screen.set_recording_selected(clone!(@strong result, @strong ensemble_screen => move |recording| {
|
||||||
|
let recording_screen = Rc::new(RecordingScreen::new(result.backend.clone(), recording.clone()));
|
||||||
|
|
||||||
|
recording_screen.set_back(clone!(@strong result, @strong ensemble_screen => move || {
|
||||||
|
result.stack.set_child(ensemble_screen.widget.clone());
|
||||||
|
}));
|
||||||
|
|
||||||
|
result.stack.set_child(recording_screen.widget.clone());
|
||||||
|
}));
|
||||||
|
|
||||||
|
result.stack.set_child(ensemble_screen.widget.clone());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
|
||||||
|
result.leaflet.add(&result.stack.widget);
|
||||||
|
result
|
||||||
|
.sidebar_box
|
||||||
|
.pack_start(&result.poe_list.widget, true, true, 0);
|
||||||
|
result.window.set_application(Some(app));
|
||||||
|
|
||||||
action!(
|
action!(
|
||||||
result.window,
|
result.window,
|
||||||
"add-person",
|
"add-person",
|
||||||
clone!(@strong result => move |_, _| {
|
clone!(@strong result => move |_, _| {
|
||||||
PersonEditor::new(result.backend.clone(), &result.window, None, clone!(@strong result => move |_| {
|
PersonEditor::new(result.backend.clone(), &result.window, None, clone!(@strong result => move |_| {
|
||||||
result.clone().set_state(Loading);
|
result.reload();
|
||||||
})).show();
|
})).show();
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
@ -166,7 +139,7 @@ impl Window {
|
||||||
"add-work",
|
"add-work",
|
||||||
clone!(@strong result => move |_, _| {
|
clone!(@strong result => move |_, _| {
|
||||||
WorkEditor::new(result.backend.clone(), &result.window, None, clone!(@strong result => move |_| {
|
WorkEditor::new(result.backend.clone(), &result.window, None, clone!(@strong result => move |_| {
|
||||||
result.clone().set_state(Loading);
|
result.reload();
|
||||||
})).show();
|
})).show();
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
@ -175,9 +148,9 @@ impl Window {
|
||||||
result.window,
|
result.window,
|
||||||
"add-ensemble",
|
"add-ensemble",
|
||||||
clone!(@strong result => move |_, _| {
|
clone!(@strong result => move |_, _| {
|
||||||
EnsembleEditor::new(result.backend.clone(), &result.window, None, |ensemble| {
|
EnsembleEditor::new(result.backend.clone(), &result.window, None, clone!(@strong result => move |_| {
|
||||||
println!("{:?}", ensemble);
|
result.reload();
|
||||||
}).show();
|
})).show();
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -186,7 +159,7 @@ impl Window {
|
||||||
"add-recording",
|
"add-recording",
|
||||||
clone!(@strong result => move |_, _| {
|
clone!(@strong result => move |_, _| {
|
||||||
RecordingEditor::new(result.backend.clone(), &result.window, None, clone!(@strong result => move |_| {
|
RecordingEditor::new(result.backend.clone(), &result.window, None, clone!(@strong result => move |_| {
|
||||||
result.clone().set_state(Loading);
|
result.reload();
|
||||||
})).show();
|
})).show();
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
@ -202,7 +175,7 @@ impl Window {
|
||||||
c.spawn_local(async move {
|
c.spawn_local(async move {
|
||||||
let person = result.backend.get_person(id).await.unwrap();
|
let person = result.backend.get_person(id).await.unwrap();
|
||||||
PersonEditor::new(result.backend.clone(), &result.window, Some(person), clone!(@strong result => move |_| {
|
PersonEditor::new(result.backend.clone(), &result.window, Some(person), clone!(@strong result => move |_| {
|
||||||
result.clone().set_state(Loading);
|
result.reload();
|
||||||
})).show();
|
})).show();
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
@ -218,7 +191,7 @@ impl Window {
|
||||||
let c = glib::MainContext::default();
|
let c = glib::MainContext::default();
|
||||||
c.spawn_local(async move {
|
c.spawn_local(async move {
|
||||||
result.backend.delete_person(id).await.unwrap();
|
result.backend.delete_person(id).await.unwrap();
|
||||||
result.clone().set_state(Loading);
|
result.reload();
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
@ -234,7 +207,7 @@ impl Window {
|
||||||
c.spawn_local(async move {
|
c.spawn_local(async move {
|
||||||
let ensemble = result.backend.get_ensemble(id).await.unwrap();
|
let ensemble = result.backend.get_ensemble(id).await.unwrap();
|
||||||
EnsembleEditor::new(result.backend.clone(), &result.window, Some(ensemble), clone!(@strong result => move |_| {
|
EnsembleEditor::new(result.backend.clone(), &result.window, Some(ensemble), clone!(@strong result => move |_| {
|
||||||
result.clone().set_state(Loading);
|
result.reload();
|
||||||
})).show();
|
})).show();
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
@ -250,50 +223,11 @@ impl Window {
|
||||||
let c = glib::MainContext::default();
|
let c = glib::MainContext::default();
|
||||||
c.spawn_local(async move {
|
c.spawn_local(async move {
|
||||||
result.backend.delete_ensemble(id).await.unwrap();
|
result.backend.delete_ensemble(id).await.unwrap();
|
||||||
result.clone().set_state(Loading);
|
result.reload();
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
result
|
|
||||||
.person_search_entry
|
|
||||||
.connect_search_changed(clone!(@strong result => move |_| {
|
|
||||||
result.sidebar_list.invalidate_filter();
|
|
||||||
}));
|
|
||||||
|
|
||||||
result.overview_search_entry.connect_search_changed(clone!(@strong result => move |_| {
|
|
||||||
match result.get_state() {
|
|
||||||
OverviewScreen(poe, works, recordings, _) => {
|
|
||||||
result.clone().set_state(OverviewScreen(poe, works.clone(), recordings.clone(), result.overview_search_entry.get_text().to_string()));
|
|
||||||
},
|
|
||||||
_ => (),
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
|
|
||||||
work_details_back_button.connect_clicked(clone!(@strong result => move |_| {
|
|
||||||
match result.get_state() {
|
|
||||||
WorkScreenLoading(poe, _) => {
|
|
||||||
result.clone().set_state(OverviewScreenLoading(poe));
|
|
||||||
},
|
|
||||||
WorkScreen(poe, _, _, _) => {
|
|
||||||
result.clone().set_state(OverviewScreenLoading(poe));
|
|
||||||
},
|
|
||||||
_ => (),
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
|
|
||||||
recording_details_back_button.connect_clicked(clone!(@strong result => move |_| {
|
|
||||||
match result.get_state() {
|
|
||||||
RecordingScreenLoading(poe, _) => {
|
|
||||||
result.clone().set_state(OverviewScreenLoading(poe));
|
|
||||||
},
|
|
||||||
_ => (),
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
|
|
||||||
result.window.set_application(Some(app));
|
|
||||||
result.clone().set_state(Loading);
|
|
||||||
|
|
||||||
result
|
result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -301,385 +235,9 @@ impl Window {
|
||||||
self.window.present();
|
self.window.present();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_state(&self) -> WindowState {
|
fn reload(&self) {
|
||||||
self.state.borrow().clone()
|
self.poe_list.clone().reload();
|
||||||
}
|
self.stack.reset_child();
|
||||||
|
self.leaflet.set_visible_child(&self.sidebar_box);
|
||||||
fn set_state(self: Rc<Self>, state: WindowState) {
|
|
||||||
use WindowState::*;
|
|
||||||
|
|
||||||
self.state.replace(state.clone());
|
|
||||||
|
|
||||||
match state {
|
|
||||||
Loading => {
|
|
||||||
let self_ = self.clone();
|
|
||||||
let c = glib::MainContext::default();
|
|
||||||
c.spawn_local(async move {
|
|
||||||
let persons = self_.backend.get_persons().await.unwrap();
|
|
||||||
let ensembles = self_.backend.get_ensembles().await.unwrap();
|
|
||||||
|
|
||||||
let mut poes: Vec<PersonOrEnsemble> = Vec::new();
|
|
||||||
|
|
||||||
for person in &persons {
|
|
||||||
poes.push(PersonOrEnsemble::Person(person.clone()));
|
|
||||||
}
|
|
||||||
|
|
||||||
for ensemble in &ensembles {
|
|
||||||
poes.push(PersonOrEnsemble::Ensemble(ensemble.clone()));
|
|
||||||
}
|
|
||||||
|
|
||||||
self_.clone().set_state(Selection(poes));
|
|
||||||
});
|
|
||||||
|
|
||||||
self.sidebar_stack.set_visible_child_name("loading");
|
|
||||||
self.main_stack.set_visible_child_name("empty_screen");
|
|
||||||
self.leaflet.set_visible_child_name("sidebar");
|
|
||||||
}
|
|
||||||
Selection(poes) => {
|
|
||||||
for child in self.sidebar_list.get_children() {
|
|
||||||
self.sidebar_list.remove(&child);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (index, poe) in poes.iter().enumerate() {
|
|
||||||
let label = gtk::Label::new(Some(&poe.get_title()));
|
|
||||||
label.set_ellipsize(pango::EllipsizeMode::End);
|
|
||||||
label.set_halign(gtk::Align::Start);
|
|
||||||
let row = SelectorRow::new(index.try_into().unwrap(), &label);
|
|
||||||
row.show_all();
|
|
||||||
self.sidebar_list.insert(&row, -1);
|
|
||||||
}
|
|
||||||
|
|
||||||
match self.sidebar_list_row_activated_handler_id.take() {
|
|
||||||
Some(id) => self.sidebar_list.disconnect(id),
|
|
||||||
None => (),
|
|
||||||
}
|
|
||||||
|
|
||||||
let handler_id = self.sidebar_list.connect_row_activated(
|
|
||||||
clone!(@strong self as self_, @strong poes => move |_, row| {
|
|
||||||
let row = row.get_child().unwrap().downcast::<SelectorRow>().unwrap();
|
|
||||||
let index: usize = row.get_index().try_into().unwrap();
|
|
||||||
let poe = poes[index].clone();
|
|
||||||
self_.clone().set_state(OverviewScreenLoading(poe));
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
|
|
||||||
self.sidebar_list_row_activated_handler_id
|
|
||||||
.set(Some(handler_id));
|
|
||||||
|
|
||||||
self.sidebar_list.set_filter_func(Some(Box::new(
|
|
||||||
clone!(@strong self as self_, @strong poes => move |row| {
|
|
||||||
let row = row.get_child().unwrap().downcast::<SelectorRow>().unwrap();
|
|
||||||
let index: usize = row.get_index().try_into().unwrap();
|
|
||||||
let search = self_.person_search_entry.get_text().to_string().to_lowercase();
|
|
||||||
|
|
||||||
search.is_empty() || poes[index]
|
|
||||||
.get_title()
|
|
||||||
.to_lowercase()
|
|
||||||
.contains(&search)
|
|
||||||
}),
|
|
||||||
)));
|
|
||||||
|
|
||||||
self.sidebar_stack.set_visible_child_name("content");
|
|
||||||
self.main_stack.set_visible_child_name("empty_screen");
|
|
||||||
self.leaflet.set_visible_child_name("sidebar");
|
|
||||||
}
|
|
||||||
OverviewScreenLoading(poe) => {
|
|
||||||
match poe.clone() {
|
|
||||||
PersonOrEnsemble::Person(person) => {
|
|
||||||
self.overview_header.set_title(Some(&person.name_fl()));
|
|
||||||
|
|
||||||
let edit_menu_item = gio::MenuItem::new(Some("Edit person"), None);
|
|
||||||
edit_menu_item.set_action_and_target_value(
|
|
||||||
Some("win.edit-person"),
|
|
||||||
Some(&glib::Variant::from(person.id)),
|
|
||||||
);
|
|
||||||
|
|
||||||
let delete_menu_item = gio::MenuItem::new(Some("Delete person"), None);
|
|
||||||
delete_menu_item.set_action_and_target_value(
|
|
||||||
Some("win.delete-person"),
|
|
||||||
Some(&glib::Variant::from(person.id)),
|
|
||||||
);
|
|
||||||
|
|
||||||
let menu = gio::Menu::new();
|
|
||||||
menu.append_item(&edit_menu_item);
|
|
||||||
menu.append_item(&delete_menu_item);
|
|
||||||
|
|
||||||
self.overview_header_menu_button.set_menu_model(Some(&menu));
|
|
||||||
|
|
||||||
let self_ = self.clone();
|
|
||||||
let c = glib::MainContext::default();
|
|
||||||
c.spawn_local(async move {
|
|
||||||
let works = self_
|
|
||||||
.backend
|
|
||||||
.get_work_descriptions(person.id)
|
|
||||||
.await
|
|
||||||
.unwrap();
|
|
||||||
let recordings = self_
|
|
||||||
.backend
|
|
||||||
.get_recordings_for_person(person.id)
|
|
||||||
.await
|
|
||||||
.unwrap();
|
|
||||||
self_.clone().set_state(OverviewScreen(
|
|
||||||
poe.clone(),
|
|
||||||
works.clone(),
|
|
||||||
recordings,
|
|
||||||
String::from(""),
|
|
||||||
));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
PersonOrEnsemble::Ensemble(ensemble) => {
|
|
||||||
self.overview_header.set_title(Some(&ensemble.name));
|
|
||||||
|
|
||||||
let edit_menu_item = gio::MenuItem::new(Some("Edit ensemble"), None);
|
|
||||||
edit_menu_item.set_action_and_target_value(
|
|
||||||
Some("win.edit-ensemble"),
|
|
||||||
Some(&glib::Variant::from(ensemble.id)),
|
|
||||||
);
|
|
||||||
|
|
||||||
let delete_menu_item = gio::MenuItem::new(Some("Delete ensemble"), None);
|
|
||||||
delete_menu_item.set_action_and_target_value(
|
|
||||||
Some("win.delete-ensemble"),
|
|
||||||
Some(&glib::Variant::from(ensemble.id)),
|
|
||||||
);
|
|
||||||
|
|
||||||
let menu = gio::Menu::new();
|
|
||||||
menu.append_item(&edit_menu_item);
|
|
||||||
menu.append_item(&delete_menu_item);
|
|
||||||
|
|
||||||
self.overview_header_menu_button.set_menu_model(Some(&menu));
|
|
||||||
|
|
||||||
let self_ = self.clone();
|
|
||||||
let c = glib::MainContext::default();
|
|
||||||
c.spawn_local(async move {
|
|
||||||
let recordings = self_
|
|
||||||
.backend
|
|
||||||
.get_recordings_for_ensemble(ensemble.id)
|
|
||||||
.await
|
|
||||||
.unwrap();
|
|
||||||
self_.clone().set_state(OverviewScreen(
|
|
||||||
poe.clone(),
|
|
||||||
Vec::new(),
|
|
||||||
recordings,
|
|
||||||
String::from(""),
|
|
||||||
));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
self.overview_search_entry.set_text("");
|
|
||||||
|
|
||||||
self.overview_stack.set_visible_child_name("loading");
|
|
||||||
self.main_stack.set_visible_child_name("overview_screen");
|
|
||||||
self.leaflet.set_visible_child_name("content");
|
|
||||||
}
|
|
||||||
OverviewScreen(poe, works, recordings, search) => {
|
|
||||||
for child in self.overview_work_list.get_children() {
|
|
||||||
self.overview_work_list.remove(&child);
|
|
||||||
}
|
|
||||||
|
|
||||||
for child in self.overview_recording_list.get_children() {
|
|
||||||
self.overview_recording_list.remove(&child);
|
|
||||||
}
|
|
||||||
|
|
||||||
if works.is_empty() {
|
|
||||||
self.overview_work_box.hide();
|
|
||||||
} else {
|
|
||||||
self.overview_work_box.show();
|
|
||||||
}
|
|
||||||
|
|
||||||
for (index, work) in works.iter().enumerate() {
|
|
||||||
if search.is_empty() || work.title.to_lowercase().contains(&search) {
|
|
||||||
let label = gtk::Label::new(Some(&work.title));
|
|
||||||
label.set_ellipsize(pango::EllipsizeMode::End);
|
|
||||||
label.set_halign(gtk::Align::Start);
|
|
||||||
let row = SelectorRow::new(index.try_into().unwrap(), &label);
|
|
||||||
row.show_all();
|
|
||||||
self.overview_work_list.insert(&row, -1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
match self.overview_work_list_row_activated_handler_id.take() {
|
|
||||||
Some(id) => self.overview_work_list.disconnect(id),
|
|
||||||
None => (),
|
|
||||||
}
|
|
||||||
|
|
||||||
let handler_id = self.overview_work_list.connect_row_activated(
|
|
||||||
clone!(@strong self as self_, @strong works, @strong poe => move |_, row| {
|
|
||||||
self_.overview_recording_list.unselect_all();
|
|
||||||
|
|
||||||
let row = row.get_child().unwrap().downcast::<SelectorRow>().unwrap();
|
|
||||||
let index: usize = row.get_index().try_into().unwrap();
|
|
||||||
let work = works[index].clone();
|
|
||||||
|
|
||||||
self_.clone().set_state(WorkScreenLoading(poe.clone(), work));
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
|
|
||||||
self.overview_work_list_row_activated_handler_id
|
|
||||||
.set(Some(handler_id));
|
|
||||||
|
|
||||||
if recordings.is_empty() {
|
|
||||||
self.overview_recording_box.hide();
|
|
||||||
} else {
|
|
||||||
self.overview_recording_box.show();
|
|
||||||
}
|
|
||||||
|
|
||||||
for (index, recording) in recordings.iter().enumerate() {
|
|
||||||
let work_text = recording.work.get_title();
|
|
||||||
let performers_text = recording.get_performers();
|
|
||||||
|
|
||||||
if search.is_empty()
|
|
||||||
|| (work_text.to_lowercase().contains(&search)
|
|
||||||
|| performers_text.to_lowercase().contains(&search))
|
|
||||||
{
|
|
||||||
let work_label = gtk::Label::new(Some(&work_text));
|
|
||||||
|
|
||||||
work_label.set_ellipsize(pango::EllipsizeMode::End);
|
|
||||||
work_label.set_halign(gtk::Align::Start);
|
|
||||||
|
|
||||||
let performers_label = gtk::Label::new(Some(&performers_text));
|
|
||||||
performers_label.set_ellipsize(pango::EllipsizeMode::End);
|
|
||||||
performers_label.set_opacity(0.5);
|
|
||||||
performers_label.set_halign(gtk::Align::Start);
|
|
||||||
|
|
||||||
let vbox = gtk::Box::new(gtk::Orientation::Vertical, 0);
|
|
||||||
vbox.add(&work_label);
|
|
||||||
vbox.add(&performers_label);
|
|
||||||
|
|
||||||
let row = SelectorRow::new(index.try_into().unwrap(), &vbox);
|
|
||||||
row.show_all();
|
|
||||||
self.overview_recording_list.insert(&row, -1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
match self.overview_recording_list_row_activated_handler_id.take() {
|
|
||||||
Some(id) => self.overview_recording_list.disconnect(id),
|
|
||||||
None => (),
|
|
||||||
}
|
|
||||||
|
|
||||||
let handler_id = self.overview_recording_list.connect_row_activated(
|
|
||||||
clone!(@strong self as self_, @strong recordings, @strong poe => move |_, row| {
|
|
||||||
self_.overview_work_list.unselect_all();
|
|
||||||
|
|
||||||
let row = row.get_child().unwrap().downcast::<SelectorRow>().unwrap();
|
|
||||||
let index: usize = row.get_index().try_into().unwrap();
|
|
||||||
let recording = recordings[index].clone();
|
|
||||||
|
|
||||||
self_.clone().set_state(RecordingScreenLoading(poe.clone(), recording));
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
|
|
||||||
self.overview_recording_list_row_activated_handler_id
|
|
||||||
.set(Some(handler_id));
|
|
||||||
|
|
||||||
self.overview_stack.set_visible_child_name("content");
|
|
||||||
self.main_stack.set_visible_child_name("overview_screen");
|
|
||||||
self.leaflet.set_visible_child_name("content");
|
|
||||||
}
|
|
||||||
WorkScreenLoading(poe, work) => {
|
|
||||||
self.work_details_header
|
|
||||||
.set_title(Some(&work.composer.name_fl()));
|
|
||||||
self.work_details_header.set_subtitle(Some(&work.title));
|
|
||||||
|
|
||||||
let c = glib::MainContext::default();
|
|
||||||
let self_ = self.clone();
|
|
||||||
c.spawn_local(async move {
|
|
||||||
let recordings = self_
|
|
||||||
.backend
|
|
||||||
.get_recordings_for_work(work.id)
|
|
||||||
.await
|
|
||||||
.unwrap();
|
|
||||||
self_.clone().set_state(WorkScreen(
|
|
||||||
poe.clone(),
|
|
||||||
work.clone(),
|
|
||||||
recordings,
|
|
||||||
String::new(),
|
|
||||||
));
|
|
||||||
});
|
|
||||||
|
|
||||||
self.work_details_stack.set_visible_child_name("loading");
|
|
||||||
self.main_stack
|
|
||||||
.set_visible_child_name("work_details_screen");
|
|
||||||
self.leaflet.set_visible_child_name("content");
|
|
||||||
}
|
|
||||||
WorkScreen(poe, _, recordings, search) => {
|
|
||||||
for child in self.work_details_recording_list.get_children() {
|
|
||||||
self.work_details_recording_list.remove(&child);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (index, recording) in recordings.iter().enumerate() {
|
|
||||||
let work_text = recording.work.get_title();
|
|
||||||
let performers_text = recording.get_performers();
|
|
||||||
|
|
||||||
if search.is_empty()
|
|
||||||
|| (work_text.to_lowercase().contains(&search)
|
|
||||||
|| performers_text.to_lowercase().contains(&search))
|
|
||||||
{
|
|
||||||
let work_label = gtk::Label::new(Some(&work_text));
|
|
||||||
|
|
||||||
work_label.set_ellipsize(pango::EllipsizeMode::End);
|
|
||||||
work_label.set_halign(gtk::Align::Start);
|
|
||||||
|
|
||||||
let performers_label = gtk::Label::new(Some(&performers_text));
|
|
||||||
performers_label.set_ellipsize(pango::EllipsizeMode::End);
|
|
||||||
performers_label.set_opacity(0.5);
|
|
||||||
performers_label.set_halign(gtk::Align::Start);
|
|
||||||
|
|
||||||
let vbox = gtk::Box::new(gtk::Orientation::Vertical, 0);
|
|
||||||
vbox.add(&work_label);
|
|
||||||
vbox.add(&performers_label);
|
|
||||||
|
|
||||||
let row = SelectorRow::new(index.try_into().unwrap(), &vbox);
|
|
||||||
row.show_all();
|
|
||||||
self.work_details_recording_list.insert(&row, -1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
match self
|
|
||||||
.work_details_recording_list_row_activated_handler_id
|
|
||||||
.take()
|
|
||||||
{
|
|
||||||
Some(id) => self.work_details_recording_list.disconnect(id),
|
|
||||||
None => (),
|
|
||||||
}
|
|
||||||
|
|
||||||
let handler_id = self.work_details_recording_list.connect_row_activated(
|
|
||||||
clone!(@strong self as self_, @strong recordings, @strong poe => move |_, row| {
|
|
||||||
self_.overview_work_list.unselect_all();
|
|
||||||
|
|
||||||
let row = row.get_child().unwrap().downcast::<SelectorRow>().unwrap();
|
|
||||||
let index: usize = row.get_index().try_into().unwrap();
|
|
||||||
let recording = recordings[index].clone();
|
|
||||||
|
|
||||||
self_.clone().set_state(RecordingScreenLoading(poe.clone(), recording));
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
|
|
||||||
self.work_details_recording_list_row_activated_handler_id
|
|
||||||
.set(Some(handler_id));
|
|
||||||
|
|
||||||
self.work_details_stack.set_visible_child_name("content");
|
|
||||||
self.main_stack
|
|
||||||
.set_visible_child_name("work_details_screen");
|
|
||||||
self.leaflet.set_visible_child_name("content");
|
|
||||||
}
|
|
||||||
RecordingScreenLoading(_, recording) => {
|
|
||||||
self.recording_details_header
|
|
||||||
.set_title(Some(&recording.work.get_title()));
|
|
||||||
self.recording_details_header
|
|
||||||
.set_subtitle(Some(&recording.get_performers()));
|
|
||||||
|
|
||||||
self.recording_details_stack
|
|
||||||
.set_visible_child_name("loading");
|
|
||||||
self.main_stack
|
|
||||||
.set_visible_child_name("recording_details_screen");
|
|
||||||
self.leaflet.set_visible_child_name("content");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn back(&self) {
|
|
||||||
self.main_stack.set_visible_child_name("empty_screen");
|
|
||||||
self.leaflet.set_visible_child_name("sidebar");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue