mirror of
https://github.com/johrpan/musicus.git
synced 2025-10-26 03:47:23 +01:00
Expose AlbumEditor in primary menu
This commit is contained in:
parent
c50ef90e9b
commit
45338c1bf9
3 changed files with 67 additions and 35 deletions
|
|
@ -50,16 +50,24 @@ template $MusicusEmptyPage: Adw.NavigationPage {
|
|||
}
|
||||
|
||||
menu primary_menu {
|
||||
section {
|
||||
item {
|
||||
label: _("_Import music");
|
||||
action: "win.import";
|
||||
}
|
||||
|
||||
item {
|
||||
label: _("_Create album");
|
||||
action: "win.create-album";
|
||||
}
|
||||
|
||||
item {
|
||||
label: _("_Library manager");
|
||||
action: "win.library";
|
||||
}
|
||||
}
|
||||
|
||||
section {
|
||||
item {
|
||||
label: _("_Preferences");
|
||||
action: "win.preferences";
|
||||
|
|
@ -70,3 +78,4 @@ menu primary_menu {
|
|||
action: "app.about";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ template $MusicusSearchPage: Adw.NavigationPage {
|
|||
activate => $select() swapped;
|
||||
|
||||
styles [
|
||||
"rounded-entry"
|
||||
"rounded-entry",
|
||||
]
|
||||
}
|
||||
|
||||
|
|
@ -264,16 +264,24 @@ template $MusicusSearchPage: Adw.NavigationPage {
|
|||
}
|
||||
|
||||
menu primary_menu {
|
||||
section {
|
||||
item {
|
||||
label: _("_Import music");
|
||||
action: "win.import";
|
||||
}
|
||||
|
||||
item {
|
||||
label: _("_Create album");
|
||||
action: "win.create-album";
|
||||
}
|
||||
|
||||
item {
|
||||
label: _("_Library manager");
|
||||
action: "win.library";
|
||||
}
|
||||
}
|
||||
|
||||
section {
|
||||
item {
|
||||
label: _("_Preferences");
|
||||
action: "win.preferences";
|
||||
|
|
@ -284,6 +292,7 @@ menu primary_menu {
|
|||
action: "app.about";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
menu item_menu {
|
||||
section {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ use gtk::{gio, glib, glib::clone};
|
|||
use crate::{
|
||||
album_page::AlbumPage,
|
||||
config,
|
||||
editor::tracks::TracksEditor,
|
||||
editor::{album::AlbumEditor, tracks::TracksEditor},
|
||||
empty_page::EmptyPage,
|
||||
library::{Library, LibraryQuery},
|
||||
library_manager::LibraryManager,
|
||||
|
|
@ -88,6 +88,16 @@ mod imp {
|
|||
})
|
||||
.build();
|
||||
|
||||
let obj = self.obj().to_owned();
|
||||
let create_album_action = gio::ActionEntry::builder("create-album")
|
||||
.activate(move |_, _, _| {
|
||||
if let Some(library) = &*obj.imp().library.borrow() {
|
||||
let editor = AlbumEditor::new(&obj.imp().navigation_view, library, None);
|
||||
obj.imp().navigation_view.push(&editor);
|
||||
}
|
||||
})
|
||||
.build();
|
||||
|
||||
let obj = self.obj().to_owned();
|
||||
let library_action = gio::ActionEntry::builder("library")
|
||||
.activate(move |_, _, _| {
|
||||
|
|
@ -109,8 +119,12 @@ mod imp {
|
|||
})
|
||||
.build();
|
||||
|
||||
self.obj()
|
||||
.add_action_entries([import_action, library_action, preferences_action]);
|
||||
self.obj().add_action_entries([
|
||||
import_action,
|
||||
create_album_action,
|
||||
library_action,
|
||||
preferences_action,
|
||||
]);
|
||||
|
||||
let player_bar = PlayerBar::new(&self.player);
|
||||
self.player_bar_revealer.set_child(Some(&player_bar));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue