13 connect(
this, SIGNAL(cellDoubleClicked(
int,
int)), SLOT(
itemDoubleClicked(
int,
int)));
16 G_CONNECTION_PTR->connect(className(), MusicSongsContainerWidget::className());
47 for(
int i = 0; i <
m_songs->count(); ++i)
58 message.
setText(tr(
"Are you sure to delete?"));
59 if(!message.
exec() || rowCount() == 0)
65 if(deletedList.isEmpty())
70 for(
int i = deletedList.count() - 1; i >= 0; --i)
72 const int index = deletedList[i];
91 const QString &path =
m_songs->at(currentRow()).path();
92 Q_EMIT
addSongToPlaylist(QFile::exists(path) ? QStringList(path) : QStringList());
97 for(
int i = 0; i < rowCount(); ++i)
99 QTableWidgetItem *it = item(i, 3);
103 item(i, 3)->setText(total);
105 (*m_songs)[i].setSizeStr(total);
113 QString musicName =
name;
115 setRowCount(rowCount() + 1);
119 record.
setPath(QFileInfo(name).absoluteFilePath());
134 menu.addAction(QIcon(
":/contextMenu/btn_play"), tr(
"Play"),
this, SLOT(
playClicked()));
142 menu.addAction(QIcon(
":/contextMenu/btn_local_file"), tr(
"Open File Dir"),
this, SLOT(
openFileDir()))->setEnabled(status);
143 menu.addAction(QIcon(
":/contextMenu/btn_ablum"), tr(
"Ablum"),
this, SLOT(
showAlbumQueryWidget()));
146 menu.addAction(QIcon(
":/contextMenu/btn_delete"), tr(
"Delete"),
this, SLOT(
removeItemAt()))->setEnabled(status);
147 menu.addAction(tr(
"Delete All"),
this, SLOT(
clearItems()))->setEnabled(status);
149 menu.exec(QCursor::pos());
#define G_DOWNLOAD_MANAGER_PTR
void setText(const QString &text) const
virtual bool writeBuffer(const MusicSongList &items) overridefinal
bool fromFile(const QString &name)
The class of the progress bar item delegate.
#define TTK_PROGRESS_ROLE
void setStyleSheet(const QString &style) const
The class of the download record manager.
The class of the messagebox widget.
static const QString ProgressBar01
ProgressBar.
virtual bool readBuffer(MusicSongList &items) overridefinal
void setName(const QString &n) noexcept
void setAddTimeStr(const QString &t) noexcept
The namespace of the process utils.
void setSizeStr(const QString &s) noexcept
The class of the download manager pair.
static const QString MenuStyle02
QString addTimeStr() const noexcept
TTK_MODULE_EXPORT QString toString(Record type)
bool load(const QString &name)
TTK_MODULE_EXPORT QString musicDirPrefix()
The class of the music song info.
void setPath(const QString &p) noexcept
TTK_MODULE_EXPORT bool isNetworkUrl(const QString &path)