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,23 +50,32 @@ template $MusicusEmptyPage: Adw.NavigationPage {
|
||||||
}
|
}
|
||||||
|
|
||||||
menu primary_menu {
|
menu primary_menu {
|
||||||
item {
|
section {
|
||||||
label: _("_Import music");
|
item {
|
||||||
action: "win.import";
|
label: _("_Import music");
|
||||||
|
action: "win.import";
|
||||||
|
}
|
||||||
|
|
||||||
|
item {
|
||||||
|
label: _("_Create album");
|
||||||
|
action: "win.create-album";
|
||||||
|
}
|
||||||
|
|
||||||
|
item {
|
||||||
|
label: _("_Library manager");
|
||||||
|
action: "win.library";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
item {
|
section {
|
||||||
label: _("_Library manager");
|
item {
|
||||||
action: "win.library";
|
label: _("_Preferences");
|
||||||
}
|
action: "win.preferences";
|
||||||
|
}
|
||||||
|
|
||||||
item {
|
item {
|
||||||
label: _("_Preferences");
|
label: _("_About Musicus");
|
||||||
action: "win.preferences";
|
action: "app.about";
|
||||||
}
|
}
|
||||||
|
|
||||||
item {
|
|
||||||
label: _("_About Musicus");
|
|
||||||
action: "app.about";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ template $MusicusSearchPage: Adw.NavigationPage {
|
||||||
activate => $select() swapped;
|
activate => $select() swapped;
|
||||||
|
|
||||||
styles [
|
styles [
|
||||||
"rounded-entry"
|
"rounded-entry",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -264,24 +264,33 @@ template $MusicusSearchPage: Adw.NavigationPage {
|
||||||
}
|
}
|
||||||
|
|
||||||
menu primary_menu {
|
menu primary_menu {
|
||||||
item {
|
section {
|
||||||
label: _("_Import music");
|
item {
|
||||||
action: "win.import";
|
label: _("_Import music");
|
||||||
|
action: "win.import";
|
||||||
|
}
|
||||||
|
|
||||||
|
item {
|
||||||
|
label: _("_Create album");
|
||||||
|
action: "win.create-album";
|
||||||
|
}
|
||||||
|
|
||||||
|
item {
|
||||||
|
label: _("_Library manager");
|
||||||
|
action: "win.library";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
item {
|
section {
|
||||||
label: _("_Library manager");
|
item {
|
||||||
action: "win.library";
|
label: _("_Preferences");
|
||||||
}
|
action: "win.preferences";
|
||||||
|
}
|
||||||
|
|
||||||
item {
|
item {
|
||||||
label: _("_Preferences");
|
label: _("_About Musicus");
|
||||||
action: "win.preferences";
|
action: "app.about";
|
||||||
}
|
}
|
||||||
|
|
||||||
item {
|
|
||||||
label: _("_About Musicus");
|
|
||||||
action: "app.about";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ use gtk::{gio, glib, glib::clone};
|
||||||
use crate::{
|
use crate::{
|
||||||
album_page::AlbumPage,
|
album_page::AlbumPage,
|
||||||
config,
|
config,
|
||||||
editor::tracks::TracksEditor,
|
editor::{album::AlbumEditor, tracks::TracksEditor},
|
||||||
empty_page::EmptyPage,
|
empty_page::EmptyPage,
|
||||||
library::{Library, LibraryQuery},
|
library::{Library, LibraryQuery},
|
||||||
library_manager::LibraryManager,
|
library_manager::LibraryManager,
|
||||||
|
|
@ -88,6 +88,16 @@ mod imp {
|
||||||
})
|
})
|
||||||
.build();
|
.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 obj = self.obj().to_owned();
|
||||||
let library_action = gio::ActionEntry::builder("library")
|
let library_action = gio::ActionEntry::builder("library")
|
||||||
.activate(move |_, _, _| {
|
.activate(move |_, _, _| {
|
||||||
|
|
@ -109,8 +119,12 @@ mod imp {
|
||||||
})
|
})
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
self.obj()
|
self.obj().add_action_entries([
|
||||||
.add_action_entries([import_action, library_action, preferences_action]);
|
import_action,
|
||||||
|
create_album_action,
|
||||||
|
library_action,
|
||||||
|
preferences_action,
|
||||||
|
]);
|
||||||
|
|
||||||
let player_bar = PlayerBar::new(&self.player);
|
let player_bar = PlayerBar::new(&self.player);
|
||||||
self.player_bar_revealer.set_child(Some(&player_bar));
|
self.player_bar_revealer.set_child(Some(&player_bar));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue