示例#1
0
void MainWindow::showAddUrlsDialog(const QStringList &urls) {
    AddUrlsDialog addDialog(this);
    addDialog.setUrls(urls);

    if (addDialog.exec() == QDialog::Accepted) {
        const QStringList urls = addDialog.urls();

        if (!urls.isEmpty()) {
            UrlCheckDialog checkDialog(this);
            checkDialog.addUrls(urls);
            checkDialog.exec();
        }
    }
}
示例#2
0
void GuideManager::nextStep(int step)
{
    CCLOG("step = %d",step);

    const StepInfo& stepInfo = m_vecStep.at(step);
    
    if (getWait())
    {
        return;
    }
    
    if (isLimit(stepInfo))
    {
        return;
    }
    
    m_guideLayer->removeFromParent();
    getParent()->addChild(m_guideLayer, GUIDE_LAYER_ZORDER);
    
    if (stepInfo.getNextStepId() == END)
    {
        endGuide();
        return;
    }
    else if (stepInfo.getNextStepId() == WAIT)
    {
        setWait(true);
    }
    else if (stepInfo.getNextStepId() == SLEEP)
    {
        getGuideLayer()->sleep();
    }
    else if (stepInfo.getNextStepId() == WAKE)
    {
        getGuideLayer()->wake();
    }
    
    
    // by order
    checkDialog(stepInfo);
    checkRect(stepInfo);
    checkTalk(stepInfo);
    checkHand(stepInfo);
    checkEvent(stepInfo);
    
    setNextStepId(step + 1);
}
示例#3
0
void MainWindow::showAddUrlsDialog() {
    AddUrlsDialog addDialog(this);

    if (addDialog.exec() == QDialog::Accepted) {
        const QStringList urls = addDialog.urls();

        if (!urls.isEmpty()) {
            if (addDialog.usePlugins()) {
                UrlCheckDialog checkDialog(this);
                checkDialog.addUrls(urls);
                checkDialog.exec();
            }
            else {
                TransferModel::instance()->append(urls, addDialog.requestMethod(), addDialog.requestHeaders(),
                                                  addDialog.postData());
            }
        }
    }
}
示例#4
0
void ClipboardUrlsDialog::addUrls() {
    AddUrlsDialog addDialog(this);
    addDialog.setUrls(selectedUrls());

    if (addDialog.exec() == QDialog::Accepted) {
        const QStringList urls = addDialog.urls();

        if (!urls.isEmpty()) {
            if (addDialog.usePlugins()) {
                UrlCheckDialog checkDialog(this);
                checkDialog.addUrls(urls, addDialog.category(), addDialog.createSubfolder(), addDialog.priority(),
                        addDialog.customCommand(), addDialog.customCommandOverrideEnabled(),
                        addDialog.startAutomatically());
                checkDialog.exec();
            }
            else {
                TransferModel::instance()->append(urls, addDialog.requestMethod(), addDialog.requestHeaders(),
                        addDialog.postData(), addDialog.category(), addDialog.createSubfolder(), addDialog.priority(),
                        addDialog.customCommand(), addDialog.customCommandOverrideEnabled(),
                        addDialog.startAutomatically());
            }
        }
    }
}
示例#5
0
void MainWindow::showImportUrlsDialog() {
    const QString filePath = QFileDialog::getOpenFileName(this, tr("Import URLs"), HOME_PATH, "*.txt");
    
    if (!filePath.isEmpty()) {
        AddUrlsDialog addDialog(this);
        addDialog.importUrls(filePath);

        if (addDialog.exec() == QDialog::Accepted) {
            const QStringList urls = addDialog.urls();

            if (!urls.isEmpty()) {
                if (addDialog.usePlugins()) {
                    UrlCheckDialog checkDialog(this);
                    checkDialog.addUrls(urls);
                    checkDialog.exec();
                }
                else {
                    TransferModel::instance()->append(urls, addDialog.requestMethod(), addDialog.requestHeaders(),
                                                      addDialog.postData());
                }
            }
        }
    }
}