TTKMusicPlayer  4.3.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musiccloudmanagerwidget.cpp
Go to the documentation of this file.
3 #include "musicopenfilewidget.h"
6 #include "musicfileutils.h"
7 #include "musicformats.h"
8 #include "musictoastlabel.h"
9 #include "musicconnectionpool.h"
10 #include "musiccloudtablewidget.h"
11 
12 #include "qsync/qsyncconfig.h"
13 #include "qsync/qsynclistdata.h"
14 #include "qsync/qsyncuploaddata.h"
15 #include "qsync/qsyncdeletedata.h"
17 
18 static constexpr const char *QUERY_CLOUD_URL = "cloud";
19 
20 Q_DECLARE_METATYPE(MusicCloudDataItem)
21 
23  : MusicAbstractTableWidget(parent),
24  m_uploading(false),
25  m_cancel(false),
26  m_totalFileSzie(0),
27  m_openFileWidget(nullptr)
28 {
29  setColumnCount(5);
30 
31  QHeaderView *headerView = horizontalHeader();
32  headerView->resizeSection(0, 10);
33  headerView->resizeSection(1, 360);
34  headerView->resizeSection(2, 110);
35  headerView->resizeSection(3, 50);
36  headerView->resizeSection(4, 120);
37 
39  setSelectionMode(QAbstractItemView::ExtendedSelection);
40  verticalScrollBar()->setStyleSheet(TTK::UI::ScrollBarStyle03);
41 
42  m_progressBarDelegate = new TTKProgressBarItemDelegate(this);
43  m_progressBarDelegate->setStyleSheet(TTK::UI::ProgressBar01);
44  setItemDelegateForColumn(2, m_progressBarDelegate);
45 
46  m_manager = new QNetworkAccessManager(this);
47  m_syncListData = new QSyncListData(m_manager, this);
48  m_syncDeleteData = new QSyncDeleteData(m_manager, this);
49  m_syncUploadData = new QSyncUploadData(m_manager, this);
50  m_syncDownloadData = new QSyncDownloadData(m_manager, this);
51 
52  connect(m_syncListData, SIGNAL(receiveFinshed(QSyncDataItemList)), SLOT(receiveDataFinshed(QSyncDataItemList)));
53  connect(m_syncDeleteData, SIGNAL(deleteFileFinished(bool)), SLOT(deleteFileFinished(bool)));
54  connect(m_syncUploadData, SIGNAL(uploadFileFinished(QString,bool)), SLOT(uploadFileFinished(QString,bool)));
55 
58 }
59 
61 {
63  delete m_syncListData;
64  delete m_syncDeleteData;
65  delete m_syncUploadData;
66  delete m_syncDownloadData;
67  delete m_manager;
68  delete m_openFileWidget;
69  delete m_progressBarDelegate;
70 }
71 
73 {
74  if(!cloudConfigValid())
75  {
76  TTKEventLoop loop;
77  connect(this, SIGNAL(finished()), &loop, SLOT(quit()));
78 
80  connect(req, SIGNAL(downloadRawDataChanged(QByteArray)), SLOT(downloadKeyFinished(QByteArray)));
82  loop.exec();
83  }
84 
85  if(!cloudConfigValid())
86  {
87  TTK_ERROR_STREAM("Sync cloud key is empty");
88  return false;
89  }
90 
92  return true;
93 }
94 
96 {
97  const int width = G_SETTING_PTR->value(MusicSettingManager::WidgetSize).toSize().width();
98  QHeaderView *headerView = horizontalHeader();
99  headerView->resizeSection(1, 360 + width - WINDOW_WIDTH_MIN);
100 
101  for(int i = 0; i < rowCount(); ++i)
102  {
103  QTableWidgetItem *it = item(i, 1);
104  it->setText(TTK::Widget::elidedText(font(), it->toolTip(), Qt::ElideRight, headerView->sectionSize(1) - 31));
105  }
106 
107  if(m_openFileWidget)
108  {
109  m_openFileWidget->adjustWidgetRect(this->width(), height());
110  }
111 }
112 
114 {
115  if(bytes.isEmpty())
116  {
117  TTK_ERROR_STREAM("Input byte data is empty");
118  }
119  else
120  {
121  QJsonParseError ok;
122  const QJsonDocument &json = QJsonDocument::fromJson(bytes, &ok);
124  {
125  const QVariantMap &value = json.toVariant().toMap();
126  QSyncConfig::NAME = value["key"].toString();
127  QSyncConfig::KEY = value["secret"].toByteArray();
128  TTK_INFO_STREAM("Download sync cloud key finished");
129  }
130  }
131 
132  Q_EMIT finished();
133 }
134 
135 void MusicCloudManagerTableWidget::receiveDataFinshed(const QSyncDataItemList &items)
136 {
137  removeItems();
138  m_totalFileSzie = 0;
139 
140  const int count = items.count();
141  if(count == 0)
142  {
143  Q_EMIT updateLabelMessage(tr("List is empty"));
145  return;
146  }
147 
148  for(const QSyncDataItem &item : qAsConst(items))
149  {
150  MusicCloudDataItem data;
151  data.m_id = QString::number(TTKDateTime::currentTimestamp());
152  data.m_path = item.m_name.trimmed();
154  data.m_data = item;
155  m_totalFileSzie += item.m_size;
156  addCellItem(data);
157  }
158 
159  Q_EMIT updateLabelMessage(tr("List update finished"));
161 }
162 
164 {
165  const int row = findUploadItemRow(time);
166  if(row != -1)
167  {
168  if(state)
169  {
170  QTableWidgetItem *it = item(row, 0);
171  if(it)
172  {
173  MusicCloudDataItem data = it->data(TTK_DATA_ROLE).value<MusicCloudDataItem>();
175  it->setData(TTK_DATA_ROLE, QVariant::fromValue<MusicCloudDataItem>(data));
176  m_totalFileSzie += data.m_data.m_size;
178  }
179  }
180  else
181  {
182  removeRow(row);
184  }
185  }
186 
188 }
189 
191 {
192  Q_EMIT updateLabelMessage(state ? tr("Delete current file success") : tr("Delete current file error"));
193 }
194 
196 {
197  Q_EMIT updateLabelMessage(tr("List updating"));
199 }
200 
202 {
203  if(m_uploading)
204  {
205  MusicToastLabel::popup(tr("Current mode is uploading files"));
206  return;
207  }
208 
209  if(!isValid())
210  {
211  MusicToastLabel::popup(tr("Please select one item first"));
212  return;
213  }
214 
215  const int index = currentRow();
216  QTableWidgetItem *it = item(index, 0);
217  if(it == nullptr)
218  {
219  return;
220  }
221 
222  const MusicCloudDataItem &data = it->data(TTK_DATA_ROLE).value<MusicCloudDataItem>();
223  removeRow(index);
224 
226  m_totalFileSzie -= data.m_data.m_size;
228 
230 }
231 
233 {
234  if(m_uploading)
235  {
236  MusicToastLabel::popup(tr("Current mode is uploading files"));
237  return;
238  }
239 
240  selectAll();
241  const TTKIntList deletedRows(selectedRows());
242 
243  for(int i = deletedRows.count() - 1; i >= 0; --i)
244  {
245  const int row = deletedRows[i];
246  QTableWidgetItem *it = item(row, 0);
247  if(it == nullptr)
248  {
249  continue;
250  }
251 
252  const MusicCloudDataItem &data = it->data(TTK_DATA_ROLE).value<MusicCloudDataItem>();
253  removeRow(row);
254 
256  m_totalFileSzie -= data.m_data.m_size;
258  }
259 
261 }
262 
264 {
265  if(!isValid())
266  {
267  MusicToastLabel::popup(tr("Please select one item first"));
268  return;
269  }
270 
271  QTableWidgetItem *it = item(currentRow(), 0);
272  if(it == nullptr)
273  {
274  return;
275  }
276 
277  const MusicCloudDataItem &data = it->data(TTK_DATA_ROLE).value<MusicCloudDataItem>();
278  const QString &format = QFileInfo(data.m_data.m_name).completeSuffix();
279  const QString &baseName = QFileInfo(data.m_data.m_name).completeBaseName();
280  const QString &url = m_syncDownloadData->downloadUrl(SYNC_MUSIC_BUCKET, data.m_data.m_name);
281 
282  int index = 1;
283  QString downloadPath;
284  QString fileName = baseName;
285 
286  do
287  {
288  downloadPath = QString("%1%2.%3").arg(TTK::String::musicDirPrefix(), fileName, format);
289  if(!QFile::exists(downloadPath))
290  {
291  break;
292  }
293 
294  fileName = baseName + QString("(%1)").arg(index++);
295  } while(index < 99);
296 
298  req->startToRequest();
299 }
300 
302 {
303  m_cancel = true;
304 }
305 
307 {
308  const QStringList &files = TTK::File::getOpenFileNames(this, MusicFormats::supportMusicInputFormats());
309  uploadFilesToServer(files);
310 }
311 
313 {
314  const QString &path = TTK::File::getExistingDirectory(this);
315  if(path.isEmpty())
316  {
317  return;
318  }
319 
321 }
322 
324 {
325  uploadFilesToServer(items);
326 }
327 
328 void MusicCloudManagerTableWidget::uploadProgress(const QString &time, qint64 percent, qint64 total)
329 {
330  if(total <= 0)
331  {
332  return;
333  }
334 
335  const int value = TTKStaticCast(int, (percent * 1.0 / total) * 100);
336  const int row = findUploadItemRow(time);
337  if(row != -1)
338  {
339  QTableWidgetItem *it = item(row, 2);
340  if(it)
341  {
342  it->setData(TTK_PROGRESS_ROLE, value);
343  }
344  }
345 }
346 
348 {
349  m_uploading = false;
352 }
353 
355 {
356  if(!isValid())
357  {
358  return;
359  }
360 
361  QTableWidgetItem *it = item(currentRow(), 0);
362  if(it == nullptr)
363  {
364  return;
365  }
366 
368  MusicCloudDataItem data(it->data(TTK_DATA_ROLE).value<MusicCloudDataItem>());
369  widget.setFileInformation(&data.m_data);
370  widget.exec();
371 }
372 
374 {
375  Q_UNUSED(event);
376  QMenu menu(this);
377  menu.setStyleSheet(TTK::UI::MenuStyle02);
378 
379  QMenu *uploadMenu = menu.addMenu(tr("Upload"));
381  {
382  uploadMenu->addAction(tr("Cancel Upload"), this, SLOT(cancelUploadFilesToServer()));
383  }
384 
385  uploadMenu->addAction(tr("Upload File"), this, SLOT(uploadFilesToServer()));
386  uploadMenu->addAction(tr("Upload Files"), this, SLOT(uploadFileDirToServer()));
388 
389  menu.addAction(tr("Delete File"), this, SLOT(deleteFileFromServer()))->setEnabled(!m_uploading);
390  menu.addAction(tr("Delete Files"), this, SLOT(deleteFilesFromServer()))->setEnabled(!m_uploading);
391  menu.addSeparator();
392  menu.addAction(tr("Download"), this, SLOT(downloadFileFromServer()))->setEnabled(!m_uploading);
393  menu.addAction(tr("Update List"), this, SLOT(updateListFromServer()))->setEnabled(!m_uploading);
394  menu.addSeparator();
395  menu.addAction(tr("Song Info..."), this, SLOT(showFileInformationWidget()));
396 
398  menu.exec(QCursor::pos());
399 }
400 
402 {
403  return !QSyncConfig::NAME.isEmpty() && !QSyncConfig::KEY.isEmpty();
404 }
405 
407 {
408  const int row = rowCount();
409  setRowCount(row + 1);
410 
411  QHeaderView *headerView = horizontalHeader();
412  QTableWidgetItem *item = new QTableWidgetItem;
413  item->setData(TTK_DATA_ROLE, QVariant::fromValue<MusicCloudDataItem>(data));
414  setItem(row, 0, item);
415 
416  item = new QTableWidgetItem;
417  item->setToolTip(data.m_data.m_name);
418  item->setText(TTK::Widget::elidedText(font(), item->toolTip(), Qt::ElideRight, headerView->sectionSize(1) - 20));
419  item->setForeground(QColor(TTK::UI::Color01));
420  QtItemSetTextAlignment(item, Qt::AlignLeft | Qt::AlignVCenter);
421  setItem(row, 1, item);
422 
423  item = new QTableWidgetItem;
424  item->setData(TTK_PROGRESS_ROLE, data.m_data.m_hash.isEmpty() ? 0 : 100);
425  setItem(row, 2, item);
426 
427  item = new QTableWidgetItem;
428  item->setToolTip(TTK::Number::sizeByteToLabel(data.m_data.m_size));
429  item->setText(TTK::Widget::elidedText(font(), item->toolTip(), Qt::ElideRight, headerView->sectionSize(3) - 5));
430  item->setForeground(QColor(TTK::UI::Color01));
431  QtItemSetTextAlignment(item, Qt::AlignRight | Qt::AlignVCenter);
432  setItem(row, 3, item);
433 
434  item = new QTableWidgetItem;
435  item->setToolTip(data.m_data.m_putTime);
436  item->setText(TTK::Widget::elidedText(font(), item->toolTip(), Qt::ElideRight, headerView->sectionSize(4) - 5));
437  item->setForeground(QColor(TTK::UI::Color01));
438  QtItemSetTextAlignment(item, Qt::AlignRight | Qt::AlignVCenter);
439  setItem(row, 4, item);
440 }
441 
442 
444 {
445  if(paths.isEmpty())
446  {
447  return;
448  }
449 
450  delete m_openFileWidget;
451  m_openFileWidget = nullptr;
452 
453  for(const QString &path : qAsConst(paths))
454  {
455  const QFileInfo fin(path);
456  MusicCloudDataItem item;
457  item.m_id = QString::number(TTKDateTime::currentTimestamp());
458  item.m_path = path;
460  item.m_data.m_name = fin.fileName().trimmed();
461  item.m_data.m_putTime = fin.lastModified().toString(TTK_DATE_TIMEM_FORMAT);
462  item.m_data.m_size = fin.size();
463 
465 
466  addCellItem(item);
467  }
468 
469  if(!m_uploading)
470  {
472  }
473 
475 }
476 
478 {
479  if(rowCount() != 0)
480  {
481  return;
482  }
483 
484  if(m_openFileWidget == nullptr)
485  {
487  connect(m_openFileWidget, SIGNAL(uploadFileClicked()), SLOT(uploadFilesToServer()));
488  connect(m_openFileWidget, SIGNAL(uploadDirClicked()), SLOT(uploadFileDirToServer()));
489  m_openFileWidget->adjustWidgetRect(width(), height());
490  }
491 
492  m_openFileWidget->raise();
493  m_openFileWidget->show();
494 }
495 
497 {
498  m_uploading = true;
499  Q_EMIT updateLabelMessage(tr("Files is uploading..."));
500 
501  if(m_cancel)
502  {
503  m_cancel = false;
504  uploadDone();
505  return;
506  }
507 
510  {
511  uploadDone();
512  return;
513  }
514 
516 }
517 
519 {
520  for(int i = 0; i < rowCount(); ++i)
521  {
522  QTableWidgetItem *it = item(i, 0);
523  if(it == nullptr)
524  {
525  continue;
526  }
527 
528  const MusicCloudDataItem &data = it->data(TTK_DATA_ROLE).value<MusicCloudDataItem>();
529  if(data.m_id == time)
530  {
531  return i;
532  }
533  }
534  return -1;
535 }
536 
538 {
539  for(int i = 0; i < rowCount(); ++i)
540  {
541  QTableWidgetItem *it = item(i, 0);
542  if(it == nullptr)
543  {
544  continue;
545  }
546 
547  const MusicCloudDataItem &data = it->data(TTK_DATA_ROLE).value<MusicCloudDataItem>();
549  {
550  return data;
551  }
552  }
553  return MusicCloudDataItem();
554 }
555 
556 
557 
559  : QWidget(parent)
560 {
561  setObjectName(MusicCloudManagerWidget::metaObject()->className());
563 
564  QVBoxLayout *layout = new QVBoxLayout(this);
565  layout->setSpacing(0);
566  layout->setContentsMargins(0, 0, 0, 0);
567 
568  QWidget *mainWidget = new QWidget(this);
569  QVBoxLayout *mainLayout = new QVBoxLayout(mainWidget);
570  mainLayout->setSpacing(0);
571  mainLayout->setContentsMargins(30, 30, 30, 30);
572  mainWidget->setLayout(mainLayout);
573  layout->addWidget(mainWidget);
574  setLayout(layout);
575  //
576  QWidget *topWidget = new QWidget(mainWidget);
577  QHBoxLayout *topWidgetLayout = new QHBoxLayout(topWidget);
578  mainLayout->setContentsMargins(10, 10, 10, 10);
579 
580  QLabel *pLabel = new QLabel(tr("Personal Cloud"), topWidget);
581  QFont pLabelFont = pLabel->font();
582  pLabelFont.setPixelSize(20);
583  pLabel->setFont(pLabelFont);
584  pLabel->setStyleSheet(TTK::UI::ColorStyle01);
585 
586  QLabel *iLabel = new QLabel(tr("Sharing of cloud disk songs"), topWidget);
587  QFont iLabelFont = iLabel->font();
588  iLabelFont.setPixelSize(15);
589  iLabel->setFont(iLabelFont);
590  iLabel->setStyleSheet(TTK::UI::ColorStyle03);
591 
592  QLabel *sLabel = new QLabel(tr("Size"), topWidget);
593 
594  m_sizeValueBar = new QProgressBar(topWidget);
595  m_sizeValueBar->setRange(0, 100);
596  m_sizeValueBar->setValue(0);
597  m_sizeValueBar->setStyleSheet(TTK::UI::ProgressBar01);
598 
599  m_sizeValueLabel = new QLabel("0.0M/40.0G", topWidget);
600 
601  topWidgetLayout->addWidget(pLabel);
602  topWidgetLayout->addWidget(iLabel);
603  topWidgetLayout->addStretch(1);
604  topWidgetLayout->addWidget(sLabel);
605  topWidgetLayout->addWidget(m_sizeValueBar);
606  topWidgetLayout->addWidget(m_sizeValueLabel);
607  topWidget->setLayout(topWidgetLayout);
608  mainLayout->addWidget(topWidget);
609  //
610  QWidget *functionWidget = new QWidget(mainWidget);
611  QHBoxLayout *functionWidgetLayout = new QHBoxLayout(functionWidget);
612  functionWidgetLayout->setContentsMargins(10, 10, 10, 10);
613 
614  QPushButton *uploadButton = new QPushButton(tr("Upload"), functionWidget);
615  uploadButton->setFixedSize(70, 30);
616  uploadButton->setStyleSheet(TTK::UI::PushButtonStyle03);
617  uploadButton->setCursor(QCursor(Qt::PointingHandCursor));
618 
619  QPushButton *downloadButton = new QPushButton(tr("Download"), functionWidget);
620  downloadButton->setFixedSize(70, 30);
621  downloadButton->setStyleSheet(TTK::UI::PushButtonStyle03);
622  downloadButton->setCursor(QCursor(Qt::PointingHandCursor));
623 
624  QPushButton *deleteButton = new QPushButton(tr("Delete"), functionWidget);
625  deleteButton->setFixedSize(70, 30);
626  deleteButton->setStyleSheet(TTK::UI::PushButtonStyle03);
627  deleteButton->setCursor(QCursor(Qt::PointingHandCursor));
628 
629  QLabel *statusLabel = new QLabel(functionWidget);
630 
631  functionWidgetLayout->addWidget(uploadButton);
632  functionWidgetLayout->addWidget(downloadButton);
633  functionWidgetLayout->addWidget(deleteButton);
634  functionWidgetLayout->addStretch(1);
635  functionWidgetLayout->addWidget(statusLabel);
636  functionWidget->setLayout(functionWidgetLayout);
637  mainLayout->addWidget(functionWidget);
638 #ifdef Q_OS_UNIX
639  uploadButton->setFocusPolicy(Qt::NoFocus);
640  downloadButton->setFocusPolicy(Qt::NoFocus);
641  deleteButton->setFocusPolicy(Qt::NoFocus);
642 #endif
643  connect(uploadButton, SIGNAL(clicked(bool)), SLOT(uploadFilesToServer()));
644  connect(downloadButton, SIGNAL(clicked(bool)), SLOT(downloadFileFromServer()));
645  connect(deleteButton, SIGNAL(clicked(bool)), SLOT(deleteFileFromServer()));
646  //
647  QWidget *labelWidget = new QWidget(mainWidget);
648  labelWidget->setStyleSheet(TTK::UI::BackgroundStyle09);
649  QHBoxLayout *labelWidgetLayout = new QHBoxLayout(labelWidget);
650  functionWidgetLayout->setContentsMargins(10, 20, 10, 10);
651 
652  QLabel *label1 = new QLabel(tr("SongName"), labelWidget);
653  label1->setAlignment(Qt::AlignCenter);
654  label1->setStyleSheet(TTK::UI::FontStyle01);
655  labelWidgetLayout->addWidget(label1, 100);
656  m_resizeWidgets << label1;
657 
658  QLabel *label2 = new QLabel(tr("FileSize"), labelWidget);
659  label2->setAlignment(Qt::AlignCenter);
660  label2->setStyleSheet(TTK::UI::FontStyle01);
661  labelWidgetLayout->addWidget(label2, 1);
662 
663  QLabel *label3 = new QLabel(tr("UploadTime"), labelWidget);
664  label3->setAlignment(Qt::AlignCenter);
665  label3->setStyleSheet(TTK::UI::FontStyle01);
666  labelWidgetLayout->addWidget(label3, 1);
667  labelWidgetLayout->addStretch(3);
668 
669  labelWidget->setLayout(labelWidgetLayout);
670  mainLayout->addWidget(labelWidget);
671 
673 
674  connect(m_tableWidget, SIGNAL(updateLabelMessage(QString)), statusLabel, SLOT(setText(QString)));
675  connect(m_tableWidget, SIGNAL(updataSizeLabel(qint64)), SLOT(updataSizeLabel(qint64)));
676 
677  mainLayout->addWidget(m_tableWidget);
678 }
679 
681 {
682  delete m_sizeValueLabel;
683  delete m_sizeValueBar;
684  delete m_tableWidget;
685 }
686 
688 {
690 }
691 
693 {
695 
696  if(m_resizeWidgets.isEmpty())
697  {
698  return;
699  }
700 
701  const int width = G_SETTING_PTR->value(MusicSettingManager::WidgetSize).toSize().width();
702  m_resizeWidgets[0]->setFixedWidth(480 + width - WINDOW_WIDTH_MIN);
703 }
704 
706 {
707  m_sizeValueLabel->setText(QString("%1/40.0G").arg(TTK::Number::sizeByteToLabel(size)));
708  m_sizeValueBar->setValue(size * TTK_RN_MAX / (40 * TTK_SN_GB2B));
709 }
710 
712 {
714 }
715 
717 {
719 }
720 
722 {
724 }
725 
726 void MusicCloudManagerWidget::resizeEvent(QResizeEvent *event)
727 {
728  QWidget::resizeEvent(event);
729  resizeGeometry();
730 }
TTKProgressBarItemDelegate * m_progressBarDelegate
void updataSizeLabel(qint64 size)
TTK_MODULE_EXPORT QString getExistingDirectory(QWidget *parent)
#define TTKStaticCast(x, y)
Definition: ttkglobal.h:231
void request(const QString &bucket, const QString &fileName)
The class of the cloud shared song table widget.
void receiveDataFinshed(const QSyncDataItemList &items)
#define SYNC_MUSIC_BUCKET
Definition: qsyncconfig.h:25
static qint64 currentTimestamp() noexcept
Definition: ttktime.cpp:249
static QStringList supportMusicInputFilterFormats() noexcept
MusicCloudDataItem FindWaitedItemRow() const
void request(const QString &bucket)
void adjustWidgetRect(int w, int h)
QVariant toVariant() const
The class of the table widget base.
static QJsonDocument fromJson(const QByteArray &json, QJsonParseError *error=0)
void updateLabelMessage(const QString &text)
void uploadFileFinished(const QString &time, bool state)
int findUploadItemRow(const QString &time) const
The class of the progress bar item delegate.
The class of the download the type of data.
#define TTK_PROGRESS_ROLE
voidpf void uLong size
Definition: ioapi.h:136
int exec(ProcessEventsFlags flags=AllEvents)
The class of the sync data item.
Definition: qsyncdataitem.h:27
MusicCloudManagerWidget(QWidget *parent=nullptr)
static QByteArray KEY
Definition: qsyncconfig.h:34
MusicCloudManagerTableWidget * m_tableWidget
#define QtItemSetTextAlignment(p, a)
Item text alignment.
Definition: ttkqtcompat.h:45
void clear() noexcept
TTK_MODULE_EXPORT QString sizeByteToLabel(qint64 size)
QString m_name
Definition: qsyncdataitem.h:29
static const QString ProgressBar01
ProgressBar.
static const QString FontStyle01
Font.
#define TTK_RN_MAX
Definition: ttkglobal.h:439
The class of the cloud file information widget.
The class of the ttk event loop.
Definition: ttkeventloop.h:29
static void popup(const QString &text)
virtual void resizeEvent(QResizeEvent *event) overridefinal
MusicOpenFileWidget * m_openFileWidget
static const QString ScrollBarStyle03
static const QString ColorStyle01
Color.
Definition: musicuiobject.h:37
The class of the sync cloud download data.
The class of the cloud data item.
QString downloadUrl(const QString &bucket, const QString &fileName)
#define TTK_SN_GB2B
Definition: ttkglobal.h:399
TTKIntList selectedRows() const
ParseError error
QList< int > TTKIntList
Definition: ttkqtglobal.h:200
#define qAsConst
Definition: ttkqtglobal.h:57
static const QString ColorStyle02
Definition: musicuiobject.h:40
The class of the sync cloud upload data.
bool isValid() const noexcept
bool isValid() const noexcept
#define TTK_DATE_TIMEM_FORMAT
Definition: ttkglobal.h:311
static const QString PushButtonStyle03
#define TTK_INFO_STREAM(msg)
Definition: ttklogger.h:74
virtual void resizeGeometry() overridefinal
static QString supportMusicInputFormats() noexcept
The class of the data source download request.
void uploadProgress(const QString &time, qint64 percent, qint64 total)
The class of the sync cloud list data.
Definition: qsynclistdata.h:27
TTK_MODULE_EXPORT void setTransparent(QWidget *widget, int alpha)
TTK_MODULE_EXPORT void sleep(int ms)
TTK_MODULE_EXPORT QString elidedText(const QFont &font, const QString &text, Qt::TextElideMode mode, int width)
static const QString BackgroundStyle09
#define TTK_CONNECTIONPOOL_UNREGISTER(object)
void uploadFileError(const MusicCloudDataItem &item)
void downloadKeyFinished(const QByteArray &bytes)
static const QString BackgroundStyle10
static const QString MenuStyle02
void startToRequest(const QString &url)
static const QString ColorStyle03
Definition: musicuiobject.h:43
The class of the cloud shared song upload table widget.
QString m_hash
Definition: qsyncdataitem.h:30
virtual void contextMenuEvent(QContextMenuEvent *event) overridefinal
void reuploadFilesToServer(const QStringList &items)
#define WINDOW_WIDTH_MIN
Definition: musicobject.h:172
TTK_MODULE_EXPORT QString musicDirPrefix()
#define TTK_CONNECTIONPOOL_BIND_TO(object)
TTK_MODULE_EXPORT QStringList getOpenFileNames(QWidget *parent, const QString &filter="Image Files (*.png *.bmp *.jpg)")
void request(const QString &time, const QString &bucket, const QString &fileName, const QString &filePath)
TTK_MODULE_EXPORT QStringList fileListByPath(const QString &dpath, const QStringList &filter={}, bool recursively=true)
static constexpr unsigned int Color01
Color QRgb.
Definition: musicuiobject.h:32
TTK_MODULE_EXPORT void adjustMenuPosition(QMenu *menu)
#define TTK_ERROR_STREAM(msg)
Definition: ttklogger.h:76
static QString NAME
Definition: qsyncconfig.h:33
virtual void startToRequest() override
The class of the open file widget.
QString m_putTime
Definition: qsyncdataitem.h:32
void addCellItem(const MusicCloudDataItem &data)
static QString makeDataBucketUrl()
Definition: qsyncutils.cpp:89
state
Definition: http_parser.c:279
#define TTK_DATA_ROLE
The class of the sync cloud delete data.
static constexpr const char * QUERY_CLOUD_URL
#define TTK_CONNECTIONPOOL_REGISTER(object)
#define TTK_DN_MS
Definition: ttkglobal.h:349
#define G_SETTING_PTR