Sayonara Player
Public Slots | Signals | Public Member Functions | Protected Types | Protected Member Functions | List of all members
Directory::TreeView Class Reference

The DirectoryTreeView class. More...

#include <DirectoryTreeView.h>

Inheritance diagram for Directory::TreeView:
Gui::WidgetTemplate< QTreeView > InfoDialogContainer Gui::Dragable Gui::WidgetTemplateParent

Public Slots

void setBusy (bool b)
 

Signals

void sigDeleteClicked ()
 
void sigPlayClicked ()
 
void sigPlayNewTabClicked ()
 
void sigPlayNextClicked ()
 
void sigAppendClicked ()
 
void sigDirectoryLoaded (const QModelIndex &index)
 
void sigCurrentIndexChanged (const QModelIndex &index)
 
void sigEnterPressed ()
 
void sigImportRequested (LibraryId lib_id, const QStringList &v_md, const QString &targetDirectory)
 
void sigCopyRequested (const QStringList &paths, const QString &target)
 
void sigMoveRequested (const QStringList &paths, const QString &target)
 
void sigRenameRequested (const QString &path, const QString &target)
 
void sigCopyToLibraryRequested (LibraryId libraryId)
 
void sigMoveToLibraryRequested (LibraryId libraryId)
 

Public Member Functions

 TreeView (QWidget *parent=nullptr)
 
QString directoryName (const QModelIndex &index)
 
QModelIndexList selctedRows () const
 
QStringList selectedPaths () const
 
void setLibraryInfo (const Library::Info &info)
 
void setFilterTerm (const QString &filter)
 
virtual void showEvent (QShowEvent *e) override
 
void infoDialogClosed ()
 this function should not be called from outside. This function is triggered when the info dialog was closed.
 

Protected Types

enum  EditTab {
  TabText,
  TabCover,
  TabTagsFromPath
}
 
enum  ReleaseReason : char {
  Dropped,
  Destroyed
}
 

Protected Member Functions

QMimeData * dragableMimedata () const override
 
void skinChanged () override
 
void keyPressEvent (QKeyEvent *event) override
 
void contextMenuEvent (QContextMenuEvent *event) override
 
void dragEnterEvent (QDragEnterEvent *event) override
 
void dragLeaveEvent (QDragLeaveEvent *event) override
 
void dragMoveEvent (QDragMoveEvent *event) override
 
void dropEvent (QDropEvent *event) override
 
void selectionChanged (const QItemSelection &selected, const QItemSelection &deselected) override
 
MD::Interpretation metadataInterpretation () const override
 get the interpretation for the metadata. Maybe a list of metadata should be intrepeted as albums while others should be considered as tracks More...
 
MetaDataList infoDialogData () const override
 get the metadata that should be used for the info dialog So for lists, the selected tracks are used here More...
 
bool hasMetadata () const override
 returns, if the widget can provide metadata instantly If false, the info dialog will the pathlist More...
 
QStringList pathlist () const override
 Returns a list of paths. This is only used if has_metadata() returns false. More...
 
virtual void languageChanged ()
 
virtual void showInfo ()
 Show the Info dialogs' info tab.
 
virtual void showLyrics ()
 Show the Info dialogs' lyrics tab.
 
virtual void showEdit ()
 Show the tag editor.
 
virtual void showCoverEdit ()
 Show the cover tab withing the tag editor.
 
virtual bool isValidDragPosition (const QPoint &p) const
 
virtual bool hasDragLabel () const
 
virtual QString dragLabel () const
 

Detailed Description

The DirectoryTreeView class.

Member Function Documentation

◆ hasMetadata()

bool Directory::TreeView::hasMetadata ( ) const
overrideprotectedvirtual

returns, if the widget can provide metadata instantly If false, the info dialog will the pathlist

Returns
true in the basic implementation

Reimplemented from InfoDialogContainer.

◆ infoDialogData()

MetaDataList Directory::TreeView::infoDialogData ( ) const
overrideprotectedvirtual

get the metadata that should be used for the info dialog So for lists, the selected tracks are used here

Returns
MetaDataList

Implements InfoDialogContainer.

◆ metadataInterpretation()

MD::Interpretation Directory::TreeView::metadataInterpretation ( ) const
overrideprotectedvirtual

get the interpretation for the metadata. Maybe a list of metadata should be intrepeted as albums while others should be considered as tracks

Returns
interpretation of metadata

Implements InfoDialogContainer.

◆ pathlist()

QStringList Directory::TreeView::pathlist ( ) const
overrideprotectedvirtual

Returns a list of paths. This is only used if has_metadata() returns false.

Returns

Reimplemented from InfoDialogContainer.