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

The ArtistView class. More...

#include <ArtistView.h>

Inheritance diagram for Library::ArtistView:
Library::TableView Library::ItemView Gui::WidgetTemplate< T > InfoDialogContainer Gui::Dragable Gui::WidgetTemplateParent SC::ArtistView

Signals

void sigSortorderChanged (SortOrder)
 
void sigDeleteClicked ()
 
void sigPlayClicked ()
 
void sigPlayNextClicked ()
 
void sigPlayNewTabClicked ()
 
void sigAppendClicked ()
 
void sigRefreshClicked ()
 
void sigReloadClicked ()
 
void sigImportFiles (const QStringList &files)
 
void sigSelectionChanged (const IndexSet &indexes)
 

Public Member Functions

 ArtistView (QWidget *parent=nullptr)
 
virtual void init (AbstractLibrary *library)
 
void setItemModel (ItemModel *model)
 
void showClearButton (bool visible)
 
void useClearButton (bool yesno)
 
virtual Library::ContextMenu::Entries contextMenuEntries () const
 
QMimeData * dragableMimedata () const override
 
bool isValidDragPosition (const QPoint &p) const override
 
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 Slots

void headerColumnsChanged (int oldCount, int newCount)
 
void sortorderChanged (int index, Qt::SortOrder sortorder)
 
void sectionResized (int logicalIndex, int oldSize, int newSize)
 
void sectionMoved (int logicalIndex, int old_visualIndex, int newVisualIndex)
 
void autoResizeTriggered (bool b)
 
virtual void showContextMenu (const QPoint &)
 
virtual void mergeActionTriggered ()
 
virtual void deleteClicked ()
 
virtual void reloadClicked ()
 
virtual void albumArtistsToggled ()
 
virtual void filterExtensionsTriggered (const QString &extension, bool b)
 
virtual void fill ()
 

Protected Member Functions

AbstractLibrarylibrary () const override
 
void selectedItemsChanged (const IndexSet &indexes) override
 
void playNextClicked () override
 
void appendClicked () override
 
void refreshClicked () override
 
void playClicked () override
 
void playNewTabClicked () override
 
void runMergeOperation (const Library::MergeData &mergedata) override
 
void initView (AbstractLibrary *library) override
 here, the model and delegate should be instantiated as well as connections and setting listeners More...
 
void initContextMenu () override
 
ColumnHeaderList columnHeaders () const override
 returns a list of ColumnHeader objects containing name, sortorder. Everytime when the language is changed, this method is fetched as well when the UI is instantiated More...
 
QByteArray columnHeaderState () const override
 This method returns the SAVED column header sizes as they were remembered since the last time sayonara was running. Also see save_column_header_sizes() More...
 
void saveColumnHeaderState (const QByteArray &state) override
 Here, the column headers sizes should be saved somewhere. More...
 
SortOrder sortorder () const override
 returns the current sortorder for the table view
 
void applySortorder (SortOrder s) override
 saves the current sortorder
 
bool autoResizeState () const override
 
void saveAutoResizeState (bool b) override
 
bool isMergeable () const override
 indicates if multiple ids can be merged into one. For example if the same artist is written in three different ways, they can be merged to one. On the other hand, for tracks that does not make sense More...
 
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...
 
void languageChanged () override
 
void setupColumnNames ()
 the column names are reloaded and updated with their corresponding texts
 
int mapModelIndexToIndex (const QModelIndex &idx) const override
 
ModelIndexRange mapIndexToModelIndexes (int idx) const override
 
virtual void mousePressEvent (QMouseEvent *event) override
 
virtual void contextMenuEvent (QContextMenuEvent *event) override
 
virtual void dragEnterEvent (QDragEnterEvent *event) override
 
virtual void dragMoveEvent (QDragMoveEvent *event) override
 
virtual void dropEvent (QDropEvent *event) override
 
virtual void changeEvent (QEvent *event) override
 
virtual void resizeEvent (QResizeEvent *event) override
 
virtual void selectionChanged (const QItemSelection &selected, const QItemSelection &deselected) override
 
Library::ContextMenucontextMenu () const
 
virtual void initCustomContextMenu (Library::ContextMenu *menu)
 
ItemModelitemModel () const
 
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...
 
virtual void importRequested (const QStringList &files)
 
int viewportHeight () const override
 
virtual void skinChanged ()
 
virtual bool hasMetadata () const
 returns, if the widget can provide metadata instantly If false, the info dialog will the pathlist More...
 
virtual QStringList pathlist () const
 Returns a list of paths. This is only used if has_metadata() returns false. More...
 
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 hasDragLabel () const
 
virtual QString dragLabel () const
 

Detailed Description

The ArtistView class.

Member Function Documentation

◆ columnHeaders()

ColumnHeaderList Library::ArtistView::columnHeaders ( ) const
overrideprotectedvirtual

returns a list of ColumnHeader objects containing name, sortorder. Everytime when the language is changed, this method is fetched as well when the UI is instantiated

Returns

Implements Library::TableView.

◆ columnHeaderState()

QByteArray Library::ArtistView::columnHeaderState ( ) const
overrideprotectedvirtual

This method returns the SAVED column header sizes as they were remembered since the last time sayonara was running. Also see save_column_header_sizes()

Returns
a list of widths in pixels

Implements Library::TableView.

◆ dragableMimedata()

QMimeData* Library::ItemView::dragableMimedata ( ) const
overridevirtualinherited

Dragable

Implements Gui::Dragable.

◆ hasMetadata()

virtual bool InfoDialogContainer::hasMetadata ( ) const
protectedvirtualinherited

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

Returns
true in the basic implementation

Reimplemented in Directory::FileListView, and Directory::TreeView.

◆ infoDialogData()

MetaDataList Library::ItemView::infoDialogData ( ) const
overrideprotectedvirtualinherited

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

Returns
MetaDataList

Implements InfoDialogContainer.

◆ initView()

void Library::ArtistView::initView ( AbstractLibrary library)
overrideprotectedvirtual

here, the model and delegate should be instantiated as well as connections and setting listeners

Parameters
library

Implements Library::TableView.

◆ isMergeable()

bool Library::ArtistView::isMergeable ( ) const
overrideprotectedvirtual

indicates if multiple ids can be merged into one. For example if the same artist is written in three different ways, they can be merged to one. On the other hand, for tracks that does not make sense

Returns

Implements Library::ItemView.

◆ metadataInterpretation()

MD::Interpretation Library::ArtistView::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()

virtual QStringList InfoDialogContainer::pathlist ( ) const
protectedvirtualinherited

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

Returns

Reimplemented in Directory::FileListView, and Directory::TreeView.

◆ saveColumnHeaderState()

void Library::ArtistView::saveColumnHeaderState ( const QByteArray &  state)
overrideprotectedvirtual

Here, the column headers sizes should be saved somewhere.

Parameters
alist of widths in pixels. The list should be as big as there are columns (even if they are not visible)

Implements Library::TableView.