TTKMusicPlayer  4.1.3.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  TTKSemaphoreLoop loop;
77  connect(this, SIGNAL(finished()), &loop, SLOT(quit()));
78 
80  connect(d, SIGNAL(downLoadRawDataChanged(QByteArray)), SLOT(downLoadFinished(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  QJson::Parser json;
121  bool ok = false;
122  const QVariant &data = json.parse(bytes, &ok);
123  if(ok)
124  {
125  QVariantMap value = data.toMap();
126  QSyncConfig::NAME = value["key"].toString();
127  QSyncConfig::KEY = value["secret"].toByteArray();
128  }
129  }
130 
131  Q_EMIT finished();
132 }
133 
134 void MusicCloudManagerTableWidget::receiveDataFinshed(const QSyncDataItemList &items)
135 {
136  removeItems();
137  m_totalFileSzie = 0;
138 
139  const int count = items.count();
140  if(count == 0)
141  {
142  Q_EMIT updateLabelMessage(tr("List is empty"));
144  return;
145  }
146 
147  for(const QSyncDataItem &item : qAsConst(items))
148  {
149  MusicCloudDataItem data;
150  data.m_id = QString::number(TTKDateTime::currentTimestamp());
151  data.m_path = item.m_name.trimmed();
153  data.m_data = item;
154  m_totalFileSzie += item.m_size;
155 
156  addCellItem(data);
157  }
158 
159  Q_EMIT updateLabelMessage(tr("List update finished"));
161 }
162 
164 {
165  if(time == TTK_NAN_STR)
166  {
168  }
169 
170  const int row = FindUploadItemRow(time);
171  if(row != -1)
172  {
173  QTableWidgetItem *it = item(row, 0);
174  if(it)
175  {
176  MusicCloudDataItem data = it->data(TTK_DATA_ROLE).value<MusicCloudDataItem>();
178  it->setData(TTK_DATA_ROLE, QVariant::fromValue<MusicCloudDataItem>(data));
179  m_totalFileSzie += data.m_data.m_size;
180  }
182  }
183  else
184  {
186  }
187 
189 }
190 
192 {
193  Q_EMIT updateLabelMessage(state ? tr("Delete current file success") : tr("Delete current file error"));
194 }
195 
197 {
198  Q_EMIT updateLabelMessage(tr("List updating"));
200 }
201 
203 {
204  if(m_uploading)
205  {
206  MusicToastLabel::popup(tr("Current mode is uploading files"));
207  return;
208  }
209 
210  if(!isValid())
211  {
212  MusicToastLabel::popup(tr("Please select one item first"));
213  return;
214  }
215 
216  const int index = currentRow();
217  QTableWidgetItem *it = item(index, 0);
218  if(it == nullptr)
219  {
220  return;
221  }
222 
223  const MusicCloudDataItem &data = it->data(TTK_DATA_ROLE).value<MusicCloudDataItem>();
224  removeRow(index);
225 
227  m_totalFileSzie -= data.m_data.m_size;
229 
231 }
232 
234 {
235  if(m_uploading)
236  {
237  MusicToastLabel::popup(tr("Current mode is uploading files"));
238  return;
239  }
240 
241  selectAll();
242  const TTKIntList deletedList(selectedIndexList());
243 
244  for(int i = deletedList.count() - 1; i >= 0; --i)
245  {
246  const int index = deletedList[i];
247  QTableWidgetItem *it = item(index, 0);
248  if(it == nullptr)
249  {
250  continue;
251  }
252 
253  const MusicCloudDataItem &data = it->data(TTK_DATA_ROLE).value<MusicCloudDataItem>();
254  removeRow(index);
255 
257  m_totalFileSzie -= data.m_data.m_size;
259  }
260 
262 }
263 
265 {
266  if(!isValid())
267  {
268  MusicToastLabel::popup(tr("Please select one item first"));
269  return;
270  }
271 
272  QTableWidgetItem *it = item(currentRow(), 0);
273  if(it == nullptr)
274  {
275  return;
276  }
277 
278  const MusicCloudDataItem &data = it->data(TTK_DATA_ROLE).value<MusicCloudDataItem>();
279  const QString &format = QFileInfo(data.m_data.m_name).completeSuffix();
280  const QString &baseName = QFileInfo(data.m_data.m_name).completeBaseName();
281  const QString &url = m_syncDownloadData->downloadUrl(SYNC_MUSIC_BUCKET, data.m_data.m_name);
282 
283  int index = 1;
284  QString downloadPath;
285  QString fileName = baseName;
286 
287  do
288  {
289  downloadPath = QString("%1%2.%3").arg(TTK::String::musicDirPrefix(), fileName, format);
290  if(!QFile::exists(downloadPath))
291  {
292  break;
293  }
294 
295  fileName = baseName + QString("(%1)").arg(index++);
296  } while(index < 99);
297 
299  d->startToRequest();
300 }
301 
303 {
304  m_cancel = true;
305 }
306 
308 {
309  const QStringList &files = TTK::File::getOpenFileNames(this, MusicFormats::supportMusicInputFormats());
310  uploadFilesToServer(files);
311 }
312 
314 {
315  const QString &path = TTK::File::getExistingDirectory(this);
316  if(path.isEmpty())
317  {
318  return;
319  }
320 
322 }
323 
325 {
326  uploadFilesToServer(items);
327 }
328 
329 void MusicCloudManagerTableWidget::uploadProgress(const QString &time, qint64 percent, qint64 total)
330 {
331  if(total != 0)
332  {
333  const int value = TTKStaticCast(int, (percent * 1.0 / total) * 100);
334  const int row = FindUploadItemRow(time);
335  if(row != -1)
336  {
337  QTableWidgetItem *it = item(row, 2);
338  if(it)
339  {
340  it->setData(TTK_PROGRESS_ROLE, value);
341  }
342  }
343  }
344 }
345 
347 {
348  m_uploading = false;
351 }
352 
354 {
355  if(!isValid())
356  {
357  return;
358  }
359 
360  QTableWidgetItem *it = item(currentRow(), 0);
361  if(it == nullptr)
362  {
363  return;
364  }
365 
367  MusicCloudDataItem data(it->data(TTK_DATA_ROLE).value<MusicCloudDataItem>());
368  widget.setFileInformation(&data.m_data);
369  widget.exec();
370 }
371 
373 {
374  Q_UNUSED(event);
375  QMenu menu(this);
376  QMenu uploadMenu(tr("Upload"), &menu);
377  menu.setStyleSheet(TTK::UI::MenuStyle02);
378 
380  {
381  uploadMenu.addAction(tr("Cancel Upload"), this, SLOT(cancelUploadFilesToServer()));
382  }
383 
384  uploadMenu.addAction(tr("Upload File"), this, SLOT(uploadFilesToServer()));
385  uploadMenu.addAction(tr("Upload Files"), this, SLOT(uploadFileDirToServer()));
386  TTK::Widget::adjustMenuPosition(&uploadMenu);
387 
388  menu.addMenu(&uploadMenu);
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  MusicCloudDataItem item;
456  const QFileInfo fin(path);
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 {
562 
563  QVBoxLayout *layout = new QVBoxLayout(this);
564  layout->setSpacing(0);
565  layout->setContentsMargins(0, 0, 0, 0);
566 
567  QWidget *mainWidget = new QWidget(this);
568  QVBoxLayout *mainLayout = new QVBoxLayout(mainWidget);
569  mainLayout->setSpacing(0);
570  mainLayout->setContentsMargins(30, 30, 30, 30);
571  mainWidget->setLayout(mainLayout);
572  layout->addWidget(mainWidget);
573  setLayout(layout);
574  //
575  QWidget *topWidget = new QWidget(mainWidget);
576  QHBoxLayout *topWidgetLayout = new QHBoxLayout(topWidget);
577  mainLayout->setContentsMargins(10, 10, 10, 10);
578 
579  QLabel *pLabel = new QLabel(tr("Personal Cloud"), topWidget);
580  QFont pLabelFont = pLabel->font();
581  pLabelFont.setPixelSize(20);
582  pLabel->setFont(pLabelFont);
583  pLabel->setStyleSheet(TTK::UI::ColorStyle01);
584 
585  QLabel *iLabel = new QLabel(tr("Sharing of cloud disk songs"), topWidget);
586  QFont iLabelFont = iLabel->font();
587  iLabelFont.setPixelSize(15);
588  iLabel->setFont(iLabelFont);
589  iLabel->setStyleSheet(TTK::UI::ColorStyle03);
590 
591  QLabel *sLabel = new QLabel(tr("Size"), topWidget);
592 
593  m_sizeValueBar = new QProgressBar(topWidget);
594  m_sizeValueBar->setRange(0, 100);
595  m_sizeValueBar->setValue(0);
596  m_sizeValueBar->setStyleSheet(TTK::UI::ProgressBar01);
597 
598  m_sizeValueLabel = new QLabel("0.0M/40.0G", topWidget);
599 
600  topWidgetLayout->addWidget(pLabel);
601  topWidgetLayout->addWidget(iLabel);
602  topWidgetLayout->addStretch(1);
603  topWidgetLayout->addWidget(sLabel);
604  topWidgetLayout->addWidget(m_sizeValueBar);
605  topWidgetLayout->addWidget(m_sizeValueLabel);
606  topWidget->setLayout(topWidgetLayout);
607  mainLayout->addWidget(topWidget);
608  //
609  QWidget *functionWidget = new QWidget(mainWidget);
610  QHBoxLayout *functionWidgetLayout = new QHBoxLayout(functionWidget);
611  functionWidgetLayout->setContentsMargins(10, 10, 10, 10);
612 
613  QPushButton *uploadButton = new QPushButton(tr("Upload"), functionWidget);
614  uploadButton->setFixedSize(70, 30);
615  uploadButton->setStyleSheet(TTK::UI::PushButtonStyle03);
616  uploadButton->setCursor(QCursor(Qt::PointingHandCursor));
617 
618  QPushButton *downloadButton = new QPushButton(tr("Download"), functionWidget);
619  downloadButton->setFixedSize(70, 30);
620  downloadButton->setStyleSheet(TTK::UI::PushButtonStyle03);
621  downloadButton->setCursor(QCursor(Qt::PointingHandCursor));
622 
623  QPushButton *deleteButton = new QPushButton(tr("Delete"), functionWidget);
624  deleteButton->setFixedSize(70, 30);
625  deleteButton->setStyleSheet(TTK::UI::PushButtonStyle03);
626  deleteButton->setCursor(QCursor(Qt::PointingHandCursor));
627 
628  QLabel *statusLabel = new QLabel(functionWidget);
629 
630  functionWidgetLayout->addWidget(uploadButton);
631  functionWidgetLayout->addWidget(downloadButton);
632  functionWidgetLayout->addWidget(deleteButton);
633  functionWidgetLayout->addStretch(1);
634  functionWidgetLayout->addWidget(statusLabel);
635  functionWidget->setLayout(functionWidgetLayout);
636  mainLayout->addWidget(functionWidget);
637 #ifdef Q_OS_UNIX
638  uploadButton->setFocusPolicy(Qt::NoFocus);
639  downloadButton->setFocusPolicy(Qt::NoFocus);
640  deleteButton->setFocusPolicy(Qt::NoFocus);
641 #endif
642  connect(uploadButton, SIGNAL(clicked(bool)), SLOT(uploadFilesToServer()));
643  connect(downloadButton, SIGNAL(clicked(bool)), SLOT(downloadFileFromServer()));
644  connect(deleteButton, SIGNAL(clicked(bool)), SLOT(deleteFileFromServer()));
645  //
646  QWidget *labelWidget = new QWidget(mainWidget);
647  labelWidget->setStyleSheet(TTK::UI::BackgroundStyle09);
648  QHBoxLayout *labelWidgetLayout = new QHBoxLayout(labelWidget);
649  functionWidgetLayout->setContentsMargins(10, 20, 10, 10);
650 
651  QLabel *label1 = new QLabel(tr("SongName"), labelWidget);
652  label1->setAlignment(Qt::AlignCenter);
653  label1->setStyleSheet(TTK::UI::FontStyle01);
654  labelWidgetLayout->addWidget(label1, 100);
655  m_resizeWidgets << label1;
656 
657  QLabel *label2 = new QLabel(tr("FileSize"), labelWidget);
658  label2->setAlignment(Qt::AlignCenter);
659  label2->setStyleSheet(TTK::UI::FontStyle01);
660  labelWidgetLayout->addWidget(label2, 1);
661 
662  QLabel *label3 = new QLabel(tr("UploadTime"), labelWidget);
663  label3->setAlignment(Qt::AlignCenter);
664  label3->setStyleSheet(TTK::UI::FontStyle01);
665  labelWidgetLayout->addWidget(label3, 1);
666  labelWidgetLayout->addStretch(3);
667 
668  labelWidget->setLayout(labelWidgetLayout);
669  mainLayout->addWidget(labelWidget);
670 
672 
673  connect(m_tableWidget, SIGNAL(updateLabelMessage(QString)), statusLabel, SLOT(setText(QString)));
674  connect(m_tableWidget, SIGNAL(updataSizeLabel(qint64)), SLOT(updataSizeLabel(qint64)));
675 
676  mainLayout->addWidget(m_tableWidget);
677 }
678 
680 {
681  delete m_sizeValueLabel;
682  delete m_sizeValueBar;
683  delete m_tableWidget;
684 }
685 
687 {
689 }
690 
692 {
694 
695  if(!m_resizeWidgets.isEmpty())
696  {
697  const int width = G_SETTING_PTR->value(MusicSettingManager::WidgetSize).toSize().width();
698  m_resizeWidgets[0]->setFixedWidth(480 + width - WINDOW_WIDTH_MIN);
699  }
700 }
701 
703 {
704  m_sizeValueLabel->setText(QString("%1/40.0G").arg(TTK::Number::sizeByteToLabel(size)));
705  m_sizeValueBar->setValue(size * TTK_RN_MAX / (40 * TTK_SN_GB2B));
706 }
707 
709 {
711 }
712 
714 {
716 }
717 
719 {
721 }
722 
723 void MusicCloudManagerWidget::resizeEvent(QResizeEvent *event)
724 {
725  QWidget::resizeEvent(event);
726  resizeWidget();
727 }
TTKProgressBarItemDelegate * m_progressBarDelegate
void updataSizeLabel(qint64 size)
TTK_MODULE_EXPORT QString getExistingDirectory(QWidget *parent)
#define TTKStaticCast(x, y)
Definition: ttkglobal.h:159
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
MusicCloudDataItem FindWaitedItemRow() const
void request(const QString &bucket)
int FindUploadItemRow(const QString &time) const
void adjustWidgetRect(int w, int h)
static QStringList supportMusicInputFilterFormats()
The class of the table widget base.
void updateLabelMessage(const QString &text)
The class of the progress bar item delegate.
The class of the download the type of data.
static QString supportMusicInputFormats()
#define TTK_PROGRESS_ROLE
voidpf void uLong size
Definition: ioapi.h:136
The class of the sync data item.
Definition: qsyncdataitem.h:27
MusicCloudManagerWidget(QWidget *parent=nullptr)
int exec(ProcessEventsFlags flags=AllEvents)
static QByteArray KEY
Definition: qsyncconfig.h:34
MusicCloudManagerTableWidget * m_tableWidget
#define QtItemSetTextAlignment(p, a)
Item text alignment.
Definition: ttkqtcompat.h:45
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:364
The class of the cloud file information widget.
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:325
#define TTK_NAN_STR
Definition: ttkglobal.h:204
QList< int > TTKIntList
Definition: ttkqtglobal.h:204
#define qAsConst
Definition: ttkqtglobal.h:51
static const QString ColorStyle02
Definition: musicuiobject.h:40
The class of the sync cloud upload data.
#define TTK_DATE_TIMEM_FORMAT
Definition: ttkglobal.h:237
static const QString PushButtonStyle03
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
QVariant parse(QIODevice *io, bool *ok=0)
Read JSON string from the I/O Device and converts it to a QVariant object.
Definition: parser.cpp:69
void downLoadFinished(const QByteArray &bytes)
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:155
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
Main class used to convert JSON data to QVariant objects.
Definition: parser.h:40
TTK_MODULE_EXPORT void adjustMenuPosition(QMenu *menu)
#define TTK_ERROR_STREAM(msg)
Definition: ttklogger.h:70
static QString NAME
Definition: qsyncconfig.h:33
The class of the semaphore event loop.
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:90
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:275
#define G_SETTING_PTR