void ThunderPanel::slotCopyAria2cScript() { /// No bad case seen yet, escaping single quote seems necessary QString name = getUserDataByOffset(0); QString link = getUserDataByOffset(OFFSET_DOWNLOAD); if (name.isEmpty() || link.isEmpty()) return; QApplication::clipboard()->setText(QString(my_downloaderScriptTemplate) .arg(my_gdriveid) .arg(name.replace("'", "\\'")) .arg(link.replace("'", "\\'")) ); }
void ThunderPanel::slotCopyTaskName() { const QString & name = getUserDataByOffset(0); if (name.isEmpty()) return; QApplication::clipboard()->setText(name); }
QStringList ThunderPanel::getSelectedTaskIDs() { QStringList result; foreach (const QModelIndex & idx, ui->treeView->selectionModel()->selectedIndexes()) if (idx.column() == 0) { result.append(getUserDataByOffset(OFFSET_TASKID, idx.row())); } return result; }
void ThunderPanel::slotCopySourceAddress() { QClipboard *clipboard = QApplication::clipboard(); clipboard->setText(getUserDataByOffset(OFFSET_SOURCE)); }
void ThunderPanel::slotCopyDownloadAddress() { QClipboard *clipboard = QApplication::clipboard(); clipboard->setText(getUserDataByOffset(OFFSET_DOWNLOAD)); }
void ThunderPanel::slotPreviewThisTask() { const QString & url = getUserDataByOffset(OFFSET_DOWNLOAD); if (url.isEmpty()) return; emit doThisLink(getFirstSelectedTask(), Preview, false); }