TTKMusicPlayer  4.2.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)), SLOT(uploadFileFinished(QString)));
55 
56  G_CONNECTION_PTR->setValue(className(), this);
57  G_CONNECTION_PTR->connect(className(), MusicCloudUploadTableWidget::className());
58 }
59 
61 {
62  G_CONNECTION_PTR->removeValue(this);
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(d, SIGNAL(downLoadRawDataChanged(QByteArray)), SLOT(downLoadKeyFinished(QByteArray)));
82  loop.exec();
83  }
84 
85  if(!cloudConfigValid())
86  {
87  return false;
88  }
89 
91  return true;
92 }
93 
95 {
96  const int width = G_SETTING_PTR->value(MusicSettingManager::WidgetSize).toSize().width();
97  QHeaderView *headerView = horizontalHeader();
98  headerView->resizeSection(1, 360 + width - WINDOW_WIDTH_MIN);
99 
100  for(int i = 0; i < rowCount(); ++i)
101  {
102  QTableWidgetItem *it = item(i, 1);
103  it->setText(TTK::Widget::elidedText(font(), it->toolTip(), Qt::ElideRight, headerView->sectionSize(1) - 31));
104  }
105 
106  if(m_openFileWidget)
107  {
108  m_openFileWidget->adjustWidgetRect(this->width(), height());
109  }
110 }
111 
113 {
114  if(bytes.isEmpty())
115  {
116  TTK_ERROR_STREAM("Input byte data is empty");
117  }
118  else
119  {
120  QJsonParseError ok;
121  const QJsonDocument &json = QJsonDocument::fromJson(bytes, &ok);
123  {
124  const QVariantMap &value = json.toVariant().toMap();
125  QSyncConfig::NAME = value["key"].toString();
126  QSyncConfig::KEY = value["secret"].toByteArray();
127  }
128  }
129 
130  Q_EMIT finished();
131 }
132 
133 void MusicCloudManagerTableWidget::receiveDataFinshed(const QSyncDataItemList &items)
134 {
135  removeItems();
136  m_totalFileSzie = 0;
137 
138  const int count = items.count();
139  if(count == 0)
140  {
141  Q_EMIT updateLabelMessage(tr("List is empty"));
143  return;
144  }
145 
146  for(const QSyncDataItem &item : qAsConst(items))
147  {
148  MusicCloudDataItem data;
149  data.m_id = QString::number(TTKDateTime::currentTimestamp());
150  data.m_path = item.m_name.trimmed();
152  data.m_data = item;
153  m_totalFileSzie += item.m_size;
154 
155  addCellItem(data);
156  }
157 
158  Q_EMIT updateLabelMessage(tr("List update finished"));
160 }
161 
163 {
164  if(time == TTK_NAN_STR)
165  {
167  }
168 
169  const int row = FindUploadItemRow(time);
170  if(row != -1)
171  {
172  QTableWidgetItem *it = item(row, 0);
173  if(it)
174  {
175  MusicCloudDataItem data = it->data(TTK_DATA_ROLE).value<MusicCloudDataItem>();
177  it->setData(TTK_DATA_ROLE, QVariant::fromValue<MusicCloudDataItem>(data));
178  m_totalFileSzie += data.m_data.m_size;
179  }
181  }
182  else
183  {
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 deletedList(selectedIndexList());
242 
243  for(int i = deletedList.count() - 1; i >= 0; --i)
244  {
245  const int index = deletedList[i];
246  QTableWidgetItem *it = item(index, 0);
247  if(it == nullptr)
248  {
249  continue;
250  }
251 
252  const MusicCloudDataItem &data = it->data(TTK_DATA_ROLE).value<MusicCloudDataItem>();
253  removeRow(index);
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  d->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  const int value = TTKStaticCast(int, (percent * 1.0 / total) * 100);
333  const int row = FindUploadItemRow(time);
334  if(row != -1)
335  {
336  QTableWidgetItem *it = item(row, 2);
337  if(it)
338  {
339  it->setData(TTK_PROGRESS_ROLE, value);
340  }
341  }
342  }
343 }
344 
346 {
347  m_uploading = false;
350 }
351 
353 {
354  if(!isValid())
355  {
356  return;
357  }
358 
359  QTableWidgetItem *it = item(currentRow(), 0);
360  if(it == nullptr)
361  {
362  return;
363  }
364 
366  MusicCloudDataItem data(it->data(TTK_DATA_ROLE).value<MusicCloudDataItem>());
367  widget.setFileInformation(&data.m_data);
368  widget.exec();
369 }
370 
372 {
373  Q_UNUSED(event);
374  QMenu menu(this);
375  menu.setStyleSheet(TTK::UI::MenuStyle02);
376 
377  QMenu *uploadMenu = menu.addMenu(tr("Upload"));
379  {
380  uploadMenu->addAction(tr("Cancel Upload"), this, SLOT(cancelUploadFilesToServer()));
381  }
382 
383  uploadMenu->addAction(tr("Upload File"), this, SLOT(uploadFilesToServer()));
384  uploadMenu->addAction(tr("Upload Files"), this, SLOT(uploadFileDirToServer()));
386 
387  menu.addAction(tr("Delete File"), this, SLOT(deleteFileFromServer()))->setEnabled(!m_uploading);
388  menu.addAction(tr("Delete Files"), this, SLOT(deleteFilesFromServer()))->setEnabled(!m_uploading);
389  menu.addSeparator();
390  menu.addAction(tr("Download"), this, SLOT(downloadFileFromServer()))->setEnabled(!m_uploading);
391  menu.addAction(tr("Update List"), this, SLOT(updateListFromServer()))->setEnabled(!m_uploading);
392  menu.addSeparator();
393  menu.addAction(tr("Song Info..."), this, SLOT(showFileInformationWidget()));
394 
396  menu.exec(QCursor::pos());
397 }
398 
400 {
401  return !QSyncConfig::NAME.isEmpty() && !QSyncConfig::KEY.isEmpty();
402 }
403 
405 {
406  const int row = rowCount();
407  setRowCount(row + 1);
408 
409  QHeaderView *headerView = horizontalHeader();
410  QTableWidgetItem *item = new QTableWidgetItem;
411  item->setData(TTK_DATA_ROLE, QVariant::fromValue<MusicCloudDataItem>(data));
412  setItem(row, 0, item);
413 
414  item = new QTableWidgetItem;
415  item->setToolTip(data.m_data.m_name);
416  item->setText(TTK::Widget::elidedText(font(), item->toolTip(), Qt::ElideRight, headerView->sectionSize(1) - 20));
417  item->setForeground(QColor(TTK::UI::Color01));
418  QtItemSetTextAlignment(item, Qt::AlignLeft | Qt::AlignVCenter);
419  setItem(row, 1, item);
420 
421  item = new QTableWidgetItem;
422  item->setData(TTK_PROGRESS_ROLE, data.m_data.m_hash.isEmpty() ? 0 : 100);
423  setItem(row, 2, item);
424 
425  item = new QTableWidgetItem;
426  item->setToolTip(TTK::Number::sizeByteToLabel(data.m_data.m_size));
427  item->setText(TTK::Widget::elidedText(font(), item->toolTip(), Qt::ElideRight, headerView->sectionSize(3) - 5));
428  item->setForeground(QColor(TTK::UI::Color01));
429  QtItemSetTextAlignment(item, Qt::AlignRight | Qt::AlignVCenter);
430  setItem(row, 3, item);
431 
432  item = new QTableWidgetItem;
433  item->setToolTip(data.m_data.m_putTime);
434  item->setText(TTK::Widget::elidedText(font(), item->toolTip(), Qt::ElideRight, headerView->sectionSize(4) - 5));
435  item->setForeground(QColor(TTK::UI::Color01));
436  QtItemSetTextAlignment(item, Qt::AlignRight | Qt::AlignVCenter);
437  setItem(row, 4, item);
438 }
439 
440 
442 {
443  if(paths.isEmpty())
444  {
445  return;
446  }
447 
448  delete m_openFileWidget;
449  m_openFileWidget = nullptr;
450 
451  for(const QString &path : qAsConst(paths))
452  {
453  MusicCloudDataItem item;
454  const QFileInfo fin(path);
455  item.m_id = QString::number(TTKDateTime::currentTimestamp());
456  item.m_path = path;
458  item.m_data.m_name = fin.fileName().trimmed();
459  item.m_data.m_putTime = fin.lastModified().toString(TTK_DATE_TIMEM_FORMAT);
460  item.m_data.m_size = fin.size();
461 
463 
464  addCellItem(item);
465  }
466 
467  if(!m_uploading)
468  {
470  }
471 
473 }
474 
476 {
477  if(rowCount() != 0)
478  {
479  return;
480  }
481 
482  if(m_openFileWidget == nullptr)
483  {
485  connect(m_openFileWidget, SIGNAL(uploadFileClicked()), SLOT(uploadFilesToServer()));
486  connect(m_openFileWidget, SIGNAL(uploadDirClicked()), SLOT(uploadFileDirToServer()));
487  m_openFileWidget->adjustWidgetRect(width(), height());
488  }
489 
490  m_openFileWidget->raise();
491  m_openFileWidget->show();
492 }
493 
495 {
496  m_uploading = true;
497  Q_EMIT updateLabelMessage(tr("Files is uploading..."));
498 
499  if(m_cancel)
500  {
501  m_cancel = false;
502  uploadDone();
503  return;
504  }
505 
508  {
509  uploadDone();
510  return;
511  }
512 
514 }
515 
517 {
518  for(int i = 0; i < rowCount(); ++i)
519  {
520  QTableWidgetItem *it = item(i, 0);
521  if(it == nullptr)
522  {
523  continue;
524  }
525 
526  const MusicCloudDataItem &data = it->data(TTK_DATA_ROLE).value<MusicCloudDataItem>();
527  if(data.m_id == time)
528  {
529  return i;
530  }
531  }
532  return -1;
533 }
534 
536 {
537  for(int i = 0; i < rowCount(); ++i)
538  {
539  QTableWidgetItem *it = item(i, 0);
540  if(it == nullptr)
541  {
542  continue;
543  }
544 
545  const MusicCloudDataItem &data = it->data(TTK_DATA_ROLE).value<MusicCloudDataItem>();
547  {
548  return data;
549  }
550  }
551  return MusicCloudDataItem();
552 }
553 
554 
555 
557  : QWidget(parent)
558 {
560 
561  QVBoxLayout *layout = new QVBoxLayout(this);
562  layout->setSpacing(0);
563  layout->setContentsMargins(0, 0, 0, 0);
564 
565  QWidget *mainWidget = new QWidget(this);
566  QVBoxLayout *mainLayout = new QVBoxLayout(mainWidget);
567  mainLayout->setSpacing(0);
568  mainLayout->setContentsMargins(30, 30, 30, 30);
569  mainWidget->setLayout(mainLayout);
570  layout->addWidget(mainWidget);
571  setLayout(layout);
572  //
573  QWidget *topWidget = new QWidget(mainWidget);
574  QHBoxLayout *topWidgetLayout = new QHBoxLayout(topWidget);
575  mainLayout->setContentsMargins(10, 10, 10, 10);
576 
577  QLabel *pLabel = new QLabel(tr("Personal Cloud"), topWidget);
578  QFont pLabelFont = pLabel->font();
579  pLabelFont.setPixelSize(20);
580  pLabel->setFont(pLabelFont);
581  pLabel->setStyleSheet(TTK::UI::ColorStyle01);
582 
583  QLabel *iLabel = new QLabel(tr("Sharing of cloud disk songs"), topWidget);
584  QFont iLabelFont = iLabel->font();
585  iLabelFont.setPixelSize(15);
586  iLabel->setFont(iLabelFont);
587  iLabel->setStyleSheet(TTK::UI::ColorStyle03);
588 
589  QLabel *sLabel = new QLabel(tr("Size"), topWidget);
590 
591  m_sizeValueBar = new QProgressBar(topWidget);
592  m_sizeValueBar->setRange(0, 100);
593  m_sizeValueBar->setValue(0);
594  m_sizeValueBar->setStyleSheet(TTK::UI::ProgressBar01);
595 
596  m_sizeValueLabel = new QLabel("0.0M/40.0G", topWidget);
597 
598  topWidgetLayout->addWidget(pLabel);
599  topWidgetLayout->addWidget(iLabel);
600  topWidgetLayout->addStretch(1);
601  topWidgetLayout->addWidget(sLabel);
602  topWidgetLayout->addWidget(m_sizeValueBar);
603  topWidgetLayout->addWidget(m_sizeValueLabel);
604  topWidget->setLayout(topWidgetLayout);
605  mainLayout->addWidget(topWidget);
606  //
607  QWidget *functionWidget = new QWidget(mainWidget);
608  QHBoxLayout *functionWidgetLayout = new QHBoxLayout(functionWidget);
609  functionWidgetLayout->setContentsMargins(10, 10, 10, 10);
610 
611  QPushButton *uploadButton = new QPushButton(tr("Upload"), functionWidget);
612  uploadButton->setFixedSize(70, 30);
613  uploadButton->setStyleSheet(TTK::UI::PushButtonStyle03);
614  uploadButton->setCursor(QCursor(Qt::PointingHandCursor));
615 
616  QPushButton *downloadButton = new QPushButton(tr("Download"), functionWidget);
617  downloadButton->setFixedSize(70, 30);
618  downloadButton->setStyleSheet(TTK::UI::PushButtonStyle03);
619  downloadButton->setCursor(QCursor(Qt::PointingHandCursor));
620 
621  QPushButton *deleteButton = new QPushButton(tr("Delete"), functionWidget);
622  deleteButton->setFixedSize(70, 30);
623  deleteButton->setStyleSheet(TTK::UI::PushButtonStyle03);
624  deleteButton->setCursor(QCursor(Qt::PointingHandCursor));
625 
626  QLabel *statusLabel = new QLabel(functionWidget);
627 
628  functionWidgetLayout->addWidget(uploadButton);
629  functionWidgetLayout->addWidget(downloadButton);
630  functionWidgetLayout->addWidget(deleteButton);
631  functionWidgetLayout->addStretch(1);
632  functionWidgetLayout->addWidget(statusLabel);
633  functionWidget->setLayout(functionWidgetLayout);
634  mainLayout->addWidget(functionWidget);
635 #ifdef Q_OS_UNIX
636  uploadButton->setFocusPolicy(Qt::NoFocus);
637  downloadButton->setFocusPolicy(Qt::NoFocus);
638  deleteButton->setFocusPolicy(Qt::NoFocus);
639 #endif
640  connect(uploadButton, SIGNAL(clicked(bool)), SLOT(uploadFilesToServer()));
641  connect(downloadButton, SIGNAL(clicked(bool)), SLOT(downloadFileFromServer()));
642  connect(deleteButton, SIGNAL(clicked(bool)), SLOT(deleteFileFromServer()));
643  //
644  QWidget *labelWidget = new QWidget(mainWidget);
645  labelWidget->setStyleSheet(TTK::UI::BackgroundStyle09);
646  QHBoxLayout *labelWidgetLayout = new QHBoxLayout(labelWidget);
647  functionWidgetLayout->setContentsMargins(10, 20, 10, 10);
648 
649  QLabel *label1 = new QLabel(tr("SongName"), labelWidget);
650  label1->setAlignment(Qt::AlignCenter);
651  label1->setStyleSheet(TTK::UI::FontStyle01);
652  labelWidgetLayout->addWidget(label1, 100);
653  m_resizeWidgets << label1;
654 
655  QLabel *label2 = new QLabel(tr("FileSize"), labelWidget);
656  label2->setAlignment(Qt::AlignCenter);
657  label2->setStyleSheet(TTK::UI::FontStyle01);
658  labelWidgetLayout->addWidget(label2, 1);
659 
660  QLabel *label3 = new QLabel(tr("UploadTime"), labelWidget);
661  label3->setAlignment(Qt::AlignCenter);
662  label3->setStyleSheet(TTK::UI::FontStyle01);
663  labelWidgetLayout->addWidget(label3, 1);
664  labelWidgetLayout->addStretch(3);
665 
666  labelWidget->setLayout(labelWidgetLayout);
667  mainLayout->addWidget(labelWidget);
668 
670 
671  connect(m_tableWidget, SIGNAL(updateLabelMessage(QString)), statusLabel, SLOT(setText(QString)));
672  connect(m_tableWidget, SIGNAL(updataSizeLabel(qint64)), SLOT(updataSizeLabel(qint64)));
673 
674  mainLayout->addWidget(m_tableWidget);
675 }
676 
678 {
679  delete m_sizeValueLabel;
680  delete m_sizeValueBar;
681  delete m_tableWidget;
682 }
683 
685 {
687 }
688 
690 {
692 
693  if(!m_resizeWidgets.isEmpty())
694  {
695  const int width = G_SETTING_PTR->value(MusicSettingManager::WidgetSize).toSize().width();
696  m_resizeWidgets[0]->setFixedWidth(480 + width - WINDOW_WIDTH_MIN);
697  }
698 }
699 
701 {
702  m_sizeValueLabel->setText(QString("%1/40.0G").arg(TTK::Number::sizeByteToLabel(size)));
703  m_sizeValueBar->setValue(size * TTK_RN_MAX / (40 * TTK_SN_GB2B));
704 }
705 
707 {
709 }
710 
712 {
714 }
715 
717 {
719 }
720 
721 void MusicCloudManagerWidget::resizeEvent(QResizeEvent *event)
722 {
723  QWidget::resizeEvent(event);
724  resizeWidget();
725 }
TTKProgressBarItemDelegate * m_progressBarDelegate
void updataSizeLabel(qint64 size)
TTK_MODULE_EXPORT QString getExistingDirectory(QWidget *parent)
#define TTKStaticCast(x, y)
Definition: ttkglobal.h:231
virtual void resizeWidget() overridefinal
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)
int FindUploadItemRow(const QString &time) const
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)
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.
#define G_CONNECTION_PTR
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
void downLoadKeyFinished(const QByteArray &bytes)
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
ParseError error
#define TTK_NAN_STR
Definition: ttkglobal.h:277
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
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
void uploadFileError(const MusicCloudDataItem &item)
static const QString BackgroundStyle10
static const QString MenuStyle02
void startToRequest(const QString &url)
static const QString ColorStyle03
Definition: musicuiobject.h:43
QString m_hash
Definition: qsyncdataitem.h:30
virtual void contextMenuEvent(QContextMenuEvent *event) overridefinal
void reuploadFilesToServer(const QStringList &items)
void uploadFileFinished(const QString &time)
#define WINDOW_WIDTH_MIN
Definition: musicobject.h:167
TTK_MODULE_EXPORT QString musicDirPrefix()
TTKIntList selectedIndexList() const
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_DN_MS
Definition: ttkglobal.h:349
#define G_SETTING_PTR