TTKMusicPlayer  3.7.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 *OS_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_dataItem = 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));
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(!isValid() || m_uploading)
205  {
206  MusicToastLabel::popup(tr("Please select one item first"));
207  return;
208  }
209 
210  QTableWidgetItem *it = item(currentRow(), 0);
211  if(it == nullptr)
212  {
213  return;
214  }
215 
216  const MusicCloudDataItem &data = it->data(TTK_DATA_ROLE).value<MusicCloudDataItem>();
217  removeRow(currentRow());
221 
223 }
224 
226 {
227  if(m_uploading)
228  {
229  return;
230  }
231 
232  selectAll();
233  const TTKIntList deletedList(selectedIndexList());
234 
235  for(int i = deletedList.count() - 1; i >= 0; --i)
236  {
237  const int index = deletedList[i];
238  QTableWidgetItem *it = item(index, 0);
239  if(it == nullptr)
240  {
241  continue;
242  }
243 
244  const MusicCloudDataItem &data = it->data(TTK_DATA_ROLE).value<MusicCloudDataItem>();
245  removeRow(index);
247 
250  }
251 
253 }
254 
256 {
257  if(!isValid())
258  {
259  MusicToastLabel::popup(tr("Please select one item first"));
260  return;
261  }
262 
263  QTableWidgetItem *it = item(currentRow(), 0);
264  if(it == nullptr)
265  {
266  return;
267  }
268 
269  const MusicCloudDataItem &data = it->data(TTK_DATA_ROLE).value<MusicCloudDataItem>();
271 
273  d->startToRequest();
274 }
275 
277 {
278  m_cancel = true;
279 }
280 
282 {
283  const QStringList &files = TTK::File::getOpenFileNames(this, MusicFormats::supportMusicInputFormats());
284  uploadFilesToServer(files);
285 }
286 
288 {
289  const QString &path = TTK::File::getExistingDirectory(this);
290  if(path.isEmpty())
291  {
292  return;
293  }
294 
296 }
297 
299 {
300  uploadFilesToServer(items);
301 }
302 
303 void MusicCloudManagerTableWidget::uploadProgress(const QString &time, qint64 bytesSent, qint64 bytesTotal)
304 {
305  if(bytesTotal != 0)
306  {
307  const int value = TTKStaticCast(int, (bytesSent * 1.0 / bytesTotal) * 100);
308  const int row = FindUploadItemRow(time);
309  if(row != -1)
310  {
311  QTableWidgetItem *it = item(row, 2);
312  if(it)
313  {
314  it->setData(TTK_PROGRESS_ROLE, value);
315  }
316  }
317  }
318 }
319 
321 {
322  m_uploading = false;
325 }
326 
328 {
329  if(!isValid())
330  {
331  return;
332  }
333 
334  QTableWidgetItem *it = item(currentRow(), 0);
335  if(it == nullptr)
336  {
337  return;
338  }
339 
341  MusicCloudDataItem data(it->data(TTK_DATA_ROLE).value<MusicCloudDataItem>());
342  widget.setFileInformation(&data.m_dataItem);
343  widget.exec();
344 }
345 
347 {
348  Q_UNUSED(event);
349  QMenu menu(this);
350  QMenu uploadMenu(tr("Upload"), &menu);
351  menu.setStyleSheet(TTK::UI::MenuStyle02);
352 
354  {
355  uploadMenu.addAction(tr("Cancel Upload"), this, SLOT(cancelUploadFilesToServer()));
356  }
357 
358  uploadMenu.addAction(tr("Upload File"), this, SLOT(uploadFilesToServer()));
359  uploadMenu.addAction(tr("Upload Files"), this, SLOT(uploadFileDirToServer()));
360  TTK::Widget::adjustMenuPosition(&uploadMenu);
361 
362  menu.addMenu(&uploadMenu);
363  menu.addAction(tr("Delete File"), this, SLOT(deleteFileToServer()))->setEnabled(!m_uploading);
364  menu.addAction(tr("Delete Files"), this, SLOT(deleteFilesToServer()))->setEnabled(!m_uploading);
365  menu.addSeparator();
366  menu.addAction(tr("Download"), this, SLOT(downloadFileToServer()))->setEnabled(!m_uploading);
367  menu.addAction(tr("Update List"), this, SLOT(updateListToServer()))->setEnabled(!m_uploading);
368  menu.addSeparator();
369  menu.addAction(tr("Song Info..."), this, SLOT(showFileInformationWidget()));
370 
372  menu.exec(QCursor::pos());
373 }
374 
376 {
377  return !QSyncConfig::NAME.isEmpty() && !QSyncConfig::KEY.isEmpty();
378 }
379 
381 {
382  int row = rowCount();
383  setRowCount(row + 1);
384 
385  QHeaderView *headerView = horizontalHeader();
386  QTableWidgetItem *item = new QTableWidgetItem;
387  item->setData(TTK_DATA_ROLE, QVariant::fromValue<MusicCloudDataItem>(data));
388  setItem(row, 0, item);
389 
390  item = new QTableWidgetItem;
391  item->setToolTip(data.m_dataItem.m_name);
392  item->setText(TTK::Widget::elidedText(font(), item->toolTip(), Qt::ElideRight, headerView->sectionSize(1) - 20));
393  item->setForeground(QColor(TTK::UI::Color01));
394  QtItemSetTextAlignment(item, Qt::AlignLeft | Qt::AlignVCenter);
395  setItem(row, 1, item);
396 
397  item = new QTableWidgetItem;
398  item->setData(TTK_PROGRESS_ROLE, data.m_dataItem.m_hash.isEmpty() ? 0 : 100);
399  setItem(row, 2, item);
400 
401  item = new QTableWidgetItem;
402  item->setToolTip(TTK::Number::sizeByteToLabel(data.m_dataItem.m_size));
403  item->setText(TTK::Widget::elidedText(font(), item->toolTip(), Qt::ElideRight, headerView->sectionSize(3) - 5));
404  item->setForeground(QColor(TTK::UI::Color01));
405  QtItemSetTextAlignment(item, Qt::AlignRight | Qt::AlignVCenter);
406  setItem(row, 3, item);
407 
408  item = new QTableWidgetItem;
409  item->setToolTip(data.m_dataItem.m_putTime);
410  item->setText(TTK::Widget::elidedText(font(), item->toolTip(), Qt::ElideRight, headerView->sectionSize(4) - 5));
411  item->setForeground(QColor(TTK::UI::Color01));
412  QtItemSetTextAlignment(item, Qt::AlignRight | Qt::AlignVCenter);
413  setItem(row, 4, item);
414 }
415 
416 
418 {
419  if(paths.isEmpty())
420  {
421  return;
422  }
423 
424  delete m_openFileWidget;
425  m_openFileWidget = nullptr;
426 
427  for(const QString &path : qAsConst(paths))
428  {
429  MusicCloudDataItem item;
430  const QFileInfo fin(path);
431  item.m_id = QString::number(TTKDateTime::currentTimestamp());
432  item.m_path = path;
434  item.m_dataItem.m_name = fin.fileName().trimmed();
435  item.m_dataItem.m_putTime = fin.lastModified().toString(TTK_DATE_TIME_FORMAT);
436  item.m_dataItem.m_size = fin.size();
437 
439 
440  addCellItem(item);
441  }
442 
443  if(!m_uploading)
444  {
446  }
447 
449 }
450 
452 {
453  if(rowCount() != 0)
454  {
455  return;
456  }
457 
458  if(m_openFileWidget == nullptr)
459  {
461  connect(m_openFileWidget, SIGNAL(uploadFileClicked()), SLOT(uploadFilesToServer()));
462  connect(m_openFileWidget, SIGNAL(uploadDirClicked()), SLOT(uploadFileDirToServer()));
463  m_openFileWidget->adjustWidgetRect(width(), height());
464  }
465 
466  m_openFileWidget->raise();
467  m_openFileWidget->show();
468 }
469 
471 {
472  m_uploading = true;
473  Q_EMIT updateLabelMessage(tr("Files is uploading..."));
474 
475  if(m_cancel)
476  {
477  m_cancel = false;
478  uploadDone();
479  return;
480  }
481 
484  {
485  uploadDone();
486  return;
487  }
488 
490 }
491 
493 {
494  for(int i = 0; i < rowCount(); ++i)
495  {
496  QTableWidgetItem *it = item(i, 0);
497  if(it == nullptr)
498  {
499  continue;
500  }
501 
502  const MusicCloudDataItem &data = it->data(TTK_DATA_ROLE).value<MusicCloudDataItem>();
503  if(data.m_id == time)
504  {
505  return i;
506  }
507  }
508  return -1;
509 }
510 
512 {
513  for(int i = 0; i < rowCount(); ++i)
514  {
515  QTableWidgetItem *it = item(i, 0);
516  if(it == nullptr)
517  {
518  continue;
519  }
520 
521  const MusicCloudDataItem &data = it->data(TTK_DATA_ROLE).value<MusicCloudDataItem>();
523  {
524  return data;
525  }
526  }
527  return MusicCloudDataItem();
528 }
529 
530 
531 
533  : QWidget(parent)
534 {
536 
537  QVBoxLayout *layout = new QVBoxLayout(this);
538  layout->setSpacing(0);
539  layout->setContentsMargins(0, 0, 0, 0);
540 
541  QWidget *mainWidget = new QWidget(this);
542  QVBoxLayout *mainLayout = new QVBoxLayout(mainWidget);
543  mainLayout->setSpacing(0);
544  mainLayout->setContentsMargins(30, 30, 30, 30);
545  mainWidget->setLayout(mainLayout);
546  layout->addWidget(mainWidget);
547  setLayout(layout);
548  //
549  QWidget *topWidget = new QWidget(mainWidget);
550  QHBoxLayout *topWidgetLayout = new QHBoxLayout(topWidget);
551  mainLayout->setContentsMargins(10, 10, 10, 10);
552 
553  QLabel *pLabel = new QLabel(tr("Personal Cloud"), topWidget);
554  QFont pLabelFont = pLabel->font();
555  pLabelFont.setPixelSize(20);
556  pLabel->setFont(pLabelFont);
557  pLabel->setStyleSheet(TTK::UI::ColorStyle01);
558 
559  QLabel *iLabel = new QLabel(tr("Sharing of cloud disk songs"), topWidget);
560  QFont iLabelFont = iLabel->font();
561  iLabelFont.setPixelSize(15);
562  iLabel->setFont(iLabelFont);
563  iLabel->setStyleSheet(TTK::UI::ColorStyle03);
564 
565  QLabel *sLabel = new QLabel(tr("Size"), topWidget);
566 
567  m_sizeValueBar = new QProgressBar(topWidget);
568  m_sizeValueBar->setRange(0, 100);
569  m_sizeValueBar->setValue(0);
570  m_sizeValueBar->setStyleSheet(TTK::UI::ProgressBar01);
571 
572  m_sizeValueLabel = new QLabel("0.0M/40.0G", topWidget);
573 
574  topWidgetLayout->addWidget(pLabel);
575  topWidgetLayout->addWidget(iLabel);
576  topWidgetLayout->addStretch(1);
577  topWidgetLayout->addWidget(sLabel);
578  topWidgetLayout->addWidget(m_sizeValueBar);
579  topWidgetLayout->addWidget(m_sizeValueLabel);
580  topWidget->setLayout(topWidgetLayout);
581  mainLayout->addWidget(topWidget);
582  //
583  QWidget *functionWidget = new QWidget(mainWidget);
584  QHBoxLayout *functionWidgetLayout = new QHBoxLayout(functionWidget);
585  functionWidgetLayout->setContentsMargins(10, 10, 10, 10);
586 
587  QPushButton *uploadButton = new QPushButton(tr("Upload"), functionWidget);
588  uploadButton->setFixedSize(70, 30);
589  uploadButton->setStyleSheet(TTK::UI::PushButtonStyle03);
590  uploadButton->setCursor(QCursor(Qt::PointingHandCursor));
591 
592  QPushButton *downloadButton = new QPushButton(tr("Download"), functionWidget);
593  downloadButton->setFixedSize(70, 30);
594  downloadButton->setStyleSheet(TTK::UI::PushButtonStyle03);
595  downloadButton->setCursor(QCursor(Qt::PointingHandCursor));
596 
597  QPushButton *deleteButton = new QPushButton(tr("Delete"), functionWidget);
598  deleteButton->setFixedSize(70, 30);
599  deleteButton->setStyleSheet(TTK::UI::PushButtonStyle03);
600  deleteButton->setCursor(QCursor(Qt::PointingHandCursor));
601 
602  QLabel *statusLabel = new QLabel(functionWidget);
603 
604  functionWidgetLayout->addWidget(uploadButton);
605  functionWidgetLayout->addWidget(downloadButton);
606  functionWidgetLayout->addWidget(deleteButton);
607  functionWidgetLayout->addStretch(1);
608  functionWidgetLayout->addWidget(statusLabel);
609  functionWidget->setLayout(functionWidgetLayout);
610  mainLayout->addWidget(functionWidget);
611 #ifdef Q_OS_UNIX
612  uploadButton->setFocusPolicy(Qt::NoFocus);
613  downloadButton->setFocusPolicy(Qt::NoFocus);
614  deleteButton->setFocusPolicy(Qt::NoFocus);
615 #endif
616  connect(uploadButton, SIGNAL(clicked(bool)), SLOT(uploadFilesToServer()));
617  connect(downloadButton, SIGNAL(clicked(bool)), SLOT(downloadFileToServer()));
618  connect(deleteButton, SIGNAL(clicked(bool)), SLOT(deleteFileToServer()));
619  //
620  QWidget *labelWidget = new QWidget(mainWidget);
621  labelWidget->setStyleSheet(TTK::UI::BackgroundStyle09);
622  QHBoxLayout *labelWidgetLayout = new QHBoxLayout(labelWidget);
623  functionWidgetLayout->setContentsMargins(10, 20, 10, 10);
624 
625  QLabel *label1 = new QLabel(tr("SongName"), labelWidget);
626  label1->setAlignment(Qt::AlignCenter);
627  label1->setStyleSheet(TTK::UI::FontStyle01);
628  labelWidgetLayout->addWidget(label1, 100);
629  m_resizeWidgets << label1;
630 
631  QLabel *label2 = new QLabel(tr("FileSize"), labelWidget);
632  label2->setAlignment(Qt::AlignCenter);
633  label2->setStyleSheet(TTK::UI::FontStyle01);
634  labelWidgetLayout->addWidget(label2, 1);
635 
636  QLabel *label3 = new QLabel(tr("UploadTime"), labelWidget);
637  label3->setAlignment(Qt::AlignCenter);
638  label3->setStyleSheet(TTK::UI::FontStyle01);
639  labelWidgetLayout->addWidget(label3, 1);
640  labelWidgetLayout->addStretch(3);
641 
642  labelWidget->setLayout(labelWidgetLayout);
643  mainLayout->addWidget(labelWidget);
644 
646 
647  connect(m_tableWidget, SIGNAL(updateLabelMessage(QString)), statusLabel, SLOT(setText(QString)));
648  connect(m_tableWidget, SIGNAL(updataSizeLabel(qint64)), SLOT(updataSizeLabel(qint64)));
649 
650  mainLayout->addWidget(m_tableWidget);
651 }
652 
654 {
655  delete m_sizeValueLabel;
656  delete m_sizeValueBar;
657  delete m_tableWidget;
658 }
659 
661 {
663 }
664 
666 {
668 
669  if(!m_resizeWidgets.isEmpty())
670  {
671  const int width = G_SETTING_PTR->value(MusicSettingManager::WidgetSize).toSize().width();
672  m_resizeWidgets[0]->setFixedWidth(480 + width - WINDOW_WIDTH_MIN);
673  }
674 }
675 
677 {
678  m_sizeValueLabel->setText(QString("%1/40.0G").arg(TTK::Number::sizeByteToLabel(size)));
679  m_sizeValueBar->setValue(size * TTK_RN_MAX / (10 * TTK_SN_GB2B));
680 }
681 
683 {
685 }
686 
688 {
690 }
691 
693 {
695 }
696 
697 void MusicCloudManagerWidget::resizeEvent(QResizeEvent *event)
698 {
699  QWidget::resizeEvent(event);
700  resizeWidget();
701 }
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
The class of the cloud shared song table widget.
void receiveDataFinshed(const QSyncDataItemList &items)
#define SYNC_MUSIC_BUCKET
Definition: qsyncconfig.h:25
MusicCloudDataItem FindWaitedItemRow() const
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.
void uploadDataOperator(const QString &time, const QString &bucket, const QString &fileName, const QString &filePath)
#define G_CONNECTION_PTR
static const QString FontStyle01
Font.
#define TTK_RN_MAX
Definition: ttkglobal.h:359
The class of the cloud file information widget.
QSyncDataItem m_dataItem
void deleteDataOperator(const QString &bucket, const QString &fileName)
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:320
#define TTK_NAN_STR
Definition: ttkglobal.h:201
QList< int > TTKIntList
Definition: ttkqtglobal.h:188
#define qAsConst
Definition: ttkqtglobal.h:53
static const QString ColorStyle02
Definition: musicuiobject.h:40
void listDataOperator(const QString &bucket)
The class of the sync cloud upload data.
static const QString PushButtonStyle03
The class of the data source download request.
The class of the sync cloud list data.
Definition: qsynclistdata.h:27
#define TTK_DATE_TIME_FORMAT
Definition: ttkglobal.h:233
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 uploadProgress(const QString &time, qint64 bytesSent, qint64 bytesTotal)
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
static qint64 currentTimestamp()
Definition: ttktime.cpp:249
QString m_hash
Definition: qsyncdataitem.h:30
virtual void contextMenuEvent(QContextMenuEvent *event) overridefinal
static constexpr const char * OS_CLOUD_URL
void reuploadFilesToServer(const QStringList &items)
void uploadFileFinished(const QString &time)
#define WINDOW_WIDTH_MIN
Definition: musicobject.h:153
TTK_MODULE_EXPORT QString musicDirPrefix()
TTKIntList selectedIndexList() const
TTK_MODULE_EXPORT QStringList getOpenFileNames(QWidget *parent, const QString &filter="Image Files (*.png *.bmp *.jpg)")
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:69
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.
#define TTK_DN_MS
Definition: ttkglobal.h:270
#define G_SETTING_PTR