예제 #1
0
void itemdetail::on_event_detail_copy_clicked()
{
    QClipboard *clipboard = QApplication::clipboard();
    clipboard->setText(ui->event_detail->text());
    emit log_changed("已复制活动详情地址链接...\r\n");
    log_ch("复制成功\r\n");
}
예제 #2
0
void itemdetail::on_copy_char_clicked()
{
    ui->templete_view->selectAll();
    ui->templete_view->copy();
    emit log_changed("文字复制成功\r\n");
    log_ch("复制成功\r\n");
}
예제 #3
0
QString itemdetail::get_tk_level(int level)
{
    QString s;
    switch(level)
    {
    case 0:
        s="新会员";
        break;
    case 1:
        s="普通会员";
        break;
    case 2:
        s="红心会员";
        break;
    case 3:
        s="钻石会员";
        break;
    case 4:
        s="皇冠会员";
        break;
    case 5:
        s="金冠会员";
        break;
    default:
        emit log_changed("获取活动发起者淘客等级失败,错误:"+QString::number(level)+"\r\n");
        s="";
        break;
    }
    return s;
}
예제 #4
0
void itemdetail::on_item_title_copy_clicked()
{
    QClipboard *clipboard = QApplication::clipboard();
    clipboard->setText(ui->item_title->text());
    emit log_changed("已复制商品标题链接...\r\n");
    log_ch("复制成功\r\n");
}
예제 #5
0
void itemdetail::on_dwz_complete(QString s)
{
    ui->dwz->setText(s);
    QString h("<html><img style=\"-webkit-user-select: none; cursor: zoom-in;\" src=\"temp.jpg\" width=\"250\" height=\"250\" />");
    h=h+"<br/>"+ui->item_title->text()+"<br/>原价:"+ui->auction_price->text()+"  现价:"+ui->discount_price->text()+"<br/>";
    h=h+"网址:"+ui->dwz->text()+("</html>");
    ui->templete_view->setHtml(h);
    log_ch("短网址生成成功\r\n");
    emit log_changed("短网址生成成功\r\n");
}
예제 #6
0
void itemdetail::on_item_href_copy_clicked()
{
    QString p(ui->pid->currentText());
    if(int i=p.indexOf("_mm_"))
    {
        if(i>-1)
        {
            emit log_changed(QString("正在生成特卖地址,当前推广位为:")+p+" ,请注意检查推广位是不是自己的!\r\n");
            p=p.right(p.size()-i-1);
        }
        else
        {
            emit log_ch("推广位错误!\r\n");
            emit log_changed(QString("推广位错误!!!")+p+"\r\n");
        }
    }
    emit need_item(QString::number(item.eventId),item.itemId,p);
    log_ch("正在生成特卖\r\n");
}
예제 #7
0
void itemdetail::on_copy_clicked()
{
    //ui->templete_view->selectAll();
    //ui->templete_view->copy();
    QImage img("temp.jpg");
    QClipboard *clipboard = QApplication::clipboard();
    clipboard->setImage(img);
    emit log_changed("已复制商品图片到剪切板...\r\n");
    log_ch("复制成功\r\n");
}
예제 #8
0
void MainWindow::updateProgressBar(QString str, bool show)
{
    QMutexLocker locker(&this->progress_mutex);
    if (str.isEmpty() == false) {
        QDateTime now;
        if (show == true)
            emit log_changed(str);
        str.prepend(now.currentDateTime().toString("yyyy-MM-dd hh:mm "));
        log.append(str);
    }
}
예제 #9
0
MainWindow::MainWindow(QWidget * parent):
QMainWindow(parent), ui(new Ui::MainWindow)
{
    const char *version = openconnect_get_version();
    QString txt;

    ui->setupUi(this);
    this->setWindowTitle(QLatin1String("openconnect " VERSION));

    txt = QLatin1String("Based on libopenconnect ") + QLatin1String(version);
    txt +=
        QLatin1String("\nGnuTLS: ") + QLatin1String(gnutls_check_version(NULL));
    ui->versionLabel->setText(txt);

    timer = new QTimer(this);
    blink_timer = new QTimer(this);
    this->cmd_fd = INVALID_SOCKET;

    connect(ui->actionQuit, SIGNAL(triggered()), qApp, SLOT(quit()));

    connect(blink_timer, SIGNAL(timeout(void)), this, SLOT(blink_ui(void)),
            Qt::QueuedConnection);
    connect(timer, SIGNAL(timeout()), this, SLOT(request_update_stats()),
            Qt::QueuedConnection);
    connect(ui->comboBox->lineEdit(), SIGNAL(returnPressed()), this,
            SLOT(on_connectBtn_clicked()), Qt::QueuedConnection);
    connect(this, SIGNAL(vpn_status_changed_sig(int)), this,
            SLOT(changeStatus(int)), Qt::QueuedConnection);
    QObject::connect(this, SIGNAL(log_changed(QString)), this,
                     SLOT(writeProgressBar(QString)), Qt::QueuedConnection);
    QObject::connect(this, SIGNAL(stats_changed_sig(QString, QString, QString)),
                     this, SLOT(statsChanged(QString, QString, QString)),
                     Qt::QueuedConnection);
    ui->iconLabel->setPixmap(OFF_ICON);
    QNetworkProxyFactory::setUseSystemConfiguration(true);

    if (QSystemTrayIcon::isSystemTrayAvailable()) {
        QIcon icon;
        createActions();
        createTrayIcon();

        connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
                this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));

        icon.addPixmap(TRAY_OFF_ICON, QIcon::Normal, QIcon::Off);
        trayIcon->setIcon(icon);
        trayIcon->show();
    } else {
        updateProgressBar(QLatin1String("System doesn't support tray icon"),
                          false);
        trayIcon = NULL;
    }
}
예제 #10
0
void itemdetail::on_dwz_copy_clicked()
{
    if(ui->dwz->text().size()>5)
    {
        QClipboard *clipboard = QApplication::clipboard();
        clipboard->setText(ui->dwz->text());
        emit log_changed("已复制特卖短网址到剪切板...\r\n");
        log_ch("短网址复制成功\r\n");
    }
    else
    {
        on_item_href_copy_clicked();
    }
}
예제 #11
0
QString itemdetail::get_remain_days(int endTime)
{
    QDate start=QDate::currentDate();
    QDate end=QDate::fromString(QString::number(endTime),"yyyyMMdd");
    if(end>=start)
    {
        return QString::number((end.year()-start.year())*365+(end.month()-start.month())*30+(end.day()-start.day()));
    }
    else
    {
        emit log_changed(QString("活动日期错误,当前时间为:")+start.toString("yyyy-MM-dd")+(",而活动结束时间为:")+end.toString("yyyy-MM-dd")+"\r\n");
        return "日期错误";
    }
}
예제 #12
0
void MainWindow::on_pushButton_3_clicked()
{
    if (logdialog == NULL) {
        logdialog = new LogDialog(this->log);

        QObject::connect(this, SIGNAL(log_changed(QString)), logdialog,
                         SLOT(append(QString)), Qt::QueuedConnection);
        QObject::connect(logdialog, SIGNAL(clear_log(void)), this,
                         SLOT(clear_log(void)), Qt::QueuedConnection);
        QObject::connect(logdialog, SIGNAL(clear_logdialog(void)), this,
                         SLOT(clear_logdialog(void)), Qt::DirectConnection);

        logdialog->show();
        logdialog->raise();
        logdialog->activateWindow();
    } else {
예제 #13
0
void itemdetail::on_item_complete(Item it)
{
    ui->item_href->setText(QString("http:")+it.href);
    QClipboard *clipboard = QApplication::clipboard();
    clipboard->setText(QString("http:")+it.href);
    emit log_changed("已复制特卖推广链接到剪切板...\r\n");
    log_ch("特卖生成成功\r\n");
    log_ch("特卖复制成功\r\n");

    item.auctionPrice=it.auctionPrice;
    item.commissionRate=it.commissionRate;
    item.discountPrice=it.discountPrice;
    item.discountRate=it.discountRate;
    item.isSoldOut=it.isSoldOut;
    item.itemTitle=it.itemTitle;
    item.soldQuantity=it.soldQuantity;
    item.sellerId=it.sellerId;
    item.mall=it.mall;
    item.picUrl=it.picUrl;

    update_window();
}