Esempio n. 1
0
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("'", "\\'"))
                                       );
}
Esempio n. 2
0
void ThunderPanel::slotCopyTaskName()
{
    const QString & name = getUserDataByOffset(0);
    if (name.isEmpty()) return;

    QApplication::clipboard()->setText(name);
}
Esempio n. 3
0
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;
}
Esempio n. 4
0
void ThunderPanel::slotCopySourceAddress()
{
    QClipboard *clipboard = QApplication::clipboard();
    clipboard->setText(getUserDataByOffset(OFFSET_SOURCE));
}
Esempio n. 5
0
void ThunderPanel::slotCopyDownloadAddress()
{
    QClipboard *clipboard = QApplication::clipboard();
    clipboard->setText(getUserDataByOffset(OFFSET_DOWNLOAD));
}
Esempio n. 6
0
void ThunderPanel::slotPreviewThisTask()
{
    const QString & url = getUserDataByOffset(OFFSET_DOWNLOAD);
    if (url.isEmpty()) return;
    emit doThisLink(getFirstSelectedTask(), Preview, false);
}