Allow editing tracks from the library pane. Thanks arnaud.bienner. Fixes issue #65
This commit is contained in:
parent
ea725cb5f7
commit
34532ed85f
|
@ -192,6 +192,10 @@ void LibraryView::contextMenuEvent(QContextMenuEvent *e) {
|
|||
delete_ = context_menu_->addAction(IconLoader::Load("edit-delete"),
|
||||
tr("Delete from disk..."), this, SLOT(Delete()));
|
||||
|
||||
context_menu_->addSeparator();
|
||||
edit_track_ = context_menu_->addAction(IconLoader::Load("edit-rename"),
|
||||
tr("Edit track information..."), this, SLOT(EditTracks()));
|
||||
|
||||
context_menu_->addSeparator();
|
||||
show_in_various_ = context_menu_->addAction(
|
||||
tr("Show in various artists"), this, SLOT(ShowInVarious()));
|
||||
|
@ -222,6 +226,7 @@ void LibraryView::contextMenuEvent(QContextMenuEvent *e) {
|
|||
|
||||
load_->setEnabled(enable_add);
|
||||
add_to_playlist_->setEnabled(enable_add);
|
||||
edit_track_->setEnabled(enable_add);
|
||||
show_in_various_->setEnabled(enable_various);
|
||||
no_show_in_various_->setEnabled(enable_various);
|
||||
|
||||
|
@ -323,6 +328,15 @@ void LibraryView::Delete() {
|
|||
delete_files->Start(GetSelectedSongs());
|
||||
}
|
||||
|
||||
void LibraryView::EditTracks() {
|
||||
if(!edit_tag_dialog_) {
|
||||
edit_tag_dialog_.reset(new EditTagDialog(this));
|
||||
}
|
||||
edit_tag_dialog_->SetSongs(GetSelectedSongs());
|
||||
edit_tag_dialog_->SetTagCompleter(library_->backend());
|
||||
edit_tag_dialog_->show();
|
||||
}
|
||||
|
||||
void LibraryView::CopyToDevice() {
|
||||
if (!organise_dialog_)
|
||||
organise_dialog_.reset(new OrganiseDialog(task_manager_));
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#define LIBRARYVIEW_H
|
||||
|
||||
#include "core/song.h"
|
||||
#include "ui/edittagdialog.h"
|
||||
#include "widgets/autoexpandingtreeview.h"
|
||||
|
||||
#include <QStyledItemDelegate>
|
||||
|
@ -81,6 +82,7 @@ class LibraryView : public AutoExpandingTreeView {
|
|||
void Organise();
|
||||
void CopyToDevice();
|
||||
void Delete();
|
||||
void EditTracks();
|
||||
void ShowInVarious();
|
||||
void NoShowInVarious();
|
||||
|
||||
|
@ -114,6 +116,7 @@ class LibraryView : public AutoExpandingTreeView {
|
|||
QAction* organise_;
|
||||
QAction* copy_to_device_;
|
||||
QAction* delete_;
|
||||
QAction* edit_track_;
|
||||
QAction* show_in_various_;
|
||||
QAction* no_show_in_various_;
|
||||
|
||||
|
@ -122,6 +125,7 @@ class LibraryView : public AutoExpandingTreeView {
|
|||
QAction* delete_smart_playlist_;
|
||||
|
||||
boost::scoped_ptr<OrganiseDialog> organise_dialog_;
|
||||
boost::scoped_ptr<EditTagDialog> edit_tag_dialog_;
|
||||
|
||||
bool is_in_keyboard_search_;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue