9 #define ROOT_PATH APPBACKUP_DIR_FULL + "playlist/"
16 QHeaderView *headerView = horizontalHeader();
17 headerView->resizeSection(0, 372);
18 headerView->resizeSection(1, 45);
20 connect(
this, SIGNAL(cellDoubleClicked(
int,
int)), SLOT(
itemDoubleClicked(
int,
int)));
30 setRowCount(songs.count());
32 QHeaderView *headerView = horizontalHeader();
33 for(
int i = 0; i < songs.count(); ++i)
37 QTableWidgetItem *item =
new QTableWidgetItem;
38 item->setToolTip(v.
name());
44 item =
new QTableWidgetItem(v.
duration());
67 MusicAbstractSongsListTableWidget::contextMenuEvent(event);
71 menu.addAction(QIcon(
":/contextMenu/btn_play"), tr(
"Play"),
this, SLOT(
playClicked()));
78 menu.addAction(QIcon(
":/contextMenu/btn_local_file"), tr(
"Open File Dir"),
this, SLOT(
openFileDir()))->setEnabled(status);
79 menu.addAction(QIcon(
":/contextMenu/btn_ablum"), tr(
"Ablum"),
this, SLOT(
showAlbumQueryWidget()));
81 menu.exec(QCursor::pos());
91 QVBoxLayout *layout =
new QVBoxLayout(
this);
92 layout->setSpacing(0);
93 layout->setContentsMargins(0, 0, 0, 0);
95 QWidget *mainWidget =
new QWidget(
this);
96 QVBoxLayout *mainLayout =
new QVBoxLayout(mainWidget);
97 mainLayout->setSpacing(0);
98 mainLayout->setContentsMargins(0, 0, 0, 0);
99 mainWidget->setLayout(mainLayout);
100 layout->addWidget(mainWidget);
103 QWidget *topWidget =
new QWidget(mainWidget);
104 topWidget->setFixedHeight(60);
105 QHBoxLayout *topWidgetLayout =
new QHBoxLayout(topWidget);
106 topWidgetLayout->setContentsMargins(15, 10, 20, 10);
108 QLabel *pLabel =
new QLabel(tr(
"Playlist Backup"), topWidget);
109 QFont pLabelFont = pLabel->font();
110 pLabelFont.setPixelSize(20);
111 pLabel->setFont(pLabelFont);
114 QLabel *iLabel =
new QLabel(tr(
"Automatically backup your music"), topWidget);
115 QFont iLabelFont = iLabel->font();
116 iLabelFont.setPixelSize(15);
117 iLabel->setFont(iLabelFont);
120 QPushButton *exportButton =
new QPushButton(topWidget);
121 exportButton->setIcon(QIcon(
":/toolSets/btn_detect_download_normal"));
122 exportButton->setCursor(QCursor(Qt::PointingHandCursor));
124 exportButton->setFixedSize(25, 25);
134 topWidgetLayout->addWidget(pLabel);
135 topWidgetLayout->addWidget(iLabel);
136 topWidgetLayout->addStretch(1);
137 topWidgetLayout->addWidget(exportButton);
140 topWidget->setLayout(topWidgetLayout);
141 mainLayout->addWidget(topWidget);
143 QFrame *frame =
new QFrame(mainWidget);
144 frame->setFixedHeight(1);
145 frame->setFrameShape(QFrame::HLine);
146 frame->setFrameShadow(QFrame::Plain);
148 mainLayout->addWidget(frame);
150 QWidget *functionWidget =
new QWidget(mainWidget);
151 QHBoxLayout *functionWidgetLayout =
new QHBoxLayout(functionWidget);
152 functionWidgetLayout->setContentsMargins(10, 0, 10, 0);
153 functionWidget->setLayout(functionWidgetLayout);
154 mainLayout->addWidget(functionWidget);
156 QWidget *listWidget =
new QWidget(functionWidget);
157 listWidget->setFixedWidth(200);
158 QHBoxLayout *listWidgetLayout =
new QHBoxLayout(listWidget);
159 listWidgetLayout->setContentsMargins(0, 10, 0, 10);
160 listWidget->setLayout(listWidgetLayout);
165 m_listWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
168 QFrame *hFrame =
new QFrame(functionWidget);
169 hFrame->setFixedWidth(1);
170 hFrame->setFrameShape(QFrame::VLine);
171 hFrame->setFrameShadow(QFrame::Plain);
174 QWidget *containerWidget =
new QWidget(functionWidget);
175 QVBoxLayout *containerWidgetLayout =
new QVBoxLayout(containerWidget);
176 containerWidgetLayout->setContentsMargins(10, 10, 10, 10);
177 containerWidget->setLayout(containerWidgetLayout);
179 functionWidgetLayout->addWidget(listWidget);
180 functionWidgetLayout->addWidget(hFrame);
181 functionWidgetLayout->addWidget(containerWidget);
183 QWidget *containerTopWidget =
new QWidget(containerWidget);
184 containerTopWidget->setFixedHeight(30);
187 containerWidgetLayout->addWidget(containerTopWidget);
190 QHBoxLayout *containerTopWidgetLayout =
new QHBoxLayout(containerTopWidget);
191 containerTopWidgetLayout->setContentsMargins(0, 0, 0, 0);
192 containerTopWidget->setLayout(containerTopWidgetLayout);
194 QFrame *blueFrame =
new QFrame(containerTopWidget);
195 blueFrame->setFixedWidth(3);
196 blueFrame->setFrameShape(QFrame::VLine);
197 blueFrame->setFrameShadow(QFrame::Plain);
202 pLabelFont.setPixelSize(16);
205 QPushButton *restoreButton =
new QPushButton(tr(
"Restore"), containerTopWidget);
207 restoreButton->setCursor(QCursor(Qt::PointingHandCursor));
208 restoreButton->setFixedSize(84, 26);
210 containerTopWidgetLayout->addWidget(blueFrame);
212 containerTopWidgetLayout->addStretch(1);
213 containerTopWidgetLayout->addWidget(restoreButton);
216 exportButton->setFocusPolicy(Qt::NoFocus);
217 restoreButton->setFocusPolicy(Qt::NoFocus);
243 headerView->resizeSection(0, 372 + offset);
255 message.
setText(tr(
"Do you want to export the all backup list?"));
271 message.
setText(tr(
"Do you want to restore the original list after the restoration is overwritten?"));
278 if(index < 0 || index >
m_items.count())
293 for(
const QFileInfo &fin : dir.entryInfoList(QDir::Files, QDir::Time | QDir::Reversed))
303 if(index < 0 || index >=
m_timeBox->count())
324 const QString &text = QString(
"%1[%2]").arg(item.m_itemName).arg(item.m_songs.count());
325 QListWidgetItem *it =
new QListWidgetItem(
m_listWidget);
326 it->setToolTip(text);
336 if(index < 0 || index >=
m_items.count())
345 const QString &text = QString(
"%1[%2]").arg(item.
m_itemName).arg(item.
m_songs.count());
353 if(dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Time | QDir::Reversed).isEmpty())
359 m_dateBox->addItems(dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Time | QDir::Reversed));
TTK_MODULE_EXPORT QString getExistingDirectory(QWidget *parent)
#define TTKStaticCast(x, y)
static const QString ListWidgetStyle02
void setText(const QString &text) const
bool fromFile(const QString &name)
The class of the messagebox widget.
#define QtItemSetTextAlignment(p, a)
Item text alignment.
static const QString ColorStyle05
TTK_MODULE_EXPORT bool copyPath(const QString &srcPath, const QString &dstPath, bool overwrite)
virtual bool readBuffer(MusicSongItemList &items) overridefinal
static const QString ScrollBarStyle03
static const QString ColorStyle01
Color.
static const QString ColorStyle02
TTK_MODULE_EXPORT bool isNetworkUrl(const QString &path) noexcept
static const QString PushButtonStyle03
The class of the playlist backup module.
virtual void runBackup() overridefinal
#define TTK_LOG_STREAM(msg)
static const QString ColorStyle08
QString duration() const noexcept
static const QString BackgroundStyle10
QString name() const noexcept
static const QString MenuStyle02
static const QString ColorStyle03
The class of the music song item.
The class of the tkpl config manager.
static const QString BorderStyle02
static constexpr unsigned int Color01
Color QRgb.
The class of the music song info.
static QString format(const QString &time, const QString &format)