QTfrontend/ui/widget/feedbackdialog.cpp
branchios-develop
changeset 13418 ba39a1d396c0
parent 13405 6476721e1a38
child 14841 b9437746bffb
equal deleted inserted replaced
13416:6e8b807bda4b 13418:ba39a1d396c0
    18 
    18 
    19 #include <QHBoxLayout>
    19 #include <QHBoxLayout>
    20 #include <QLineEdit>
    20 #include <QLineEdit>
    21 #include <QTextBrowser>
    21 #include <QTextBrowser>
    22 #include <QLabel>
    22 #include <QLabel>
    23 #include <QHttp>
    23 #include <QNetworkAccessManager>
    24 #include <QSysInfo>
    24 #include <QSysInfo>
    25 #include <QDebug>
    25 #include <QDebug>
    26 #include <QBuffer>
    26 #include <QBuffer>
    27 #include <QApplication>
    27 #include <QApplication>
    28 #include <QDesktopWidget>
    28 #include <QDesktopWidget>
   107     feedbackLayout->addWidget(label_summary, 1, 0);
   107     feedbackLayout->addWidget(label_summary, 1, 0);
   108     feedbackLayout->addWidget(summary, 1, 1);
   108     feedbackLayout->addWidget(summary, 1, 1);
   109 
   109 
   110     CheckSendSpecs = new QCheckBox();
   110     CheckSendSpecs = new QCheckBox();
   111     CheckSendSpecs->setText(QLabel::tr("Send system information"));
   111     CheckSendSpecs->setText(QLabel::tr("Send system information"));
   112     CheckSendSpecs->setChecked(true);
   112     CheckSendSpecs->setChecked(false);
       
   113     CheckSendSpecs->setToolTip(tr("This is optional, but this information might help us to resolve bugs and other technical problems."));
   113     BtnViewInfo = new QPushButton(tr("View"));
   114     BtnViewInfo = new QPushButton(tr("View"));
   114     BtnViewInfo->setFixedHeight(40);
   115     BtnViewInfo->setFixedHeight(40);
   115     feedbackLayout->addWidget(CheckSendSpecs, 0, 2, 2, 1);
   116     feedbackLayout->addWidget(CheckSendSpecs, 0, 2, 2, 1);
   116     feedbackLayout->addWidget(BtnViewInfo, 0, 3, 2, 1);
   117     feedbackLayout->addWidget(BtnViewInfo, 0, 3, 2, 1);
   117     connect(BtnViewInfo, SIGNAL(clicked()), this, SLOT(ShowSpecs()));
   118     connect(BtnViewInfo, SIGNAL(clicked()), this, SLOT(ShowSpecs()));
   134     BtnCancel->setFixedHeight(40);
   135     BtnCancel->setFixedHeight(40);
   135     connect(BtnCancel, SIGNAL(clicked()), this, SLOT(reject()));
   136     connect(BtnCancel, SIGNAL(clicked()), this, SLOT(reject()));
   136 
   137 
   137     label_captcha = new QLabel();
   138     label_captcha = new QLabel();
   138     label_captcha->setStyleSheet("border: 3px solid #ffcc00; border-radius: 4px");
   139     label_captcha->setStyleSheet("border: 3px solid #ffcc00; border-radius: 4px");
   139     label_captcha->setText("loading<br>captcha");
   140     label_captcha->setText(QLabel::tr("Loading<br>CAPTCHA ..."));
   140     label_captcha->setFixedSize(200, 50);
   141     label_captcha->setFixedSize(200, 50);
   141     captchaLayout->addWidget(label_captcha);
   142     captchaLayout->addWidget(label_captcha);
   142 
   143 
   143     label_captcha_input = new QLabel();
   144     label_captcha_input = new QLabel();
   144     label_captcha_input->setText(QLabel::tr("Type the security code:"));
   145     label_captcha_input->setText(QLabel::tr("Type the security code:"));
   472     nam = new QNetworkAccessManager(this);
   473     nam = new QNetworkAccessManager(this);
   473     connect(nam, SIGNAL(finished(QNetworkReply*)),
   474     connect(nam, SIGNAL(finished(QNetworkReply*)),
   474             this, SLOT(finishedSlot(QNetworkReply*)));
   475             this, SLOT(finishedSlot(QNetworkReply*)));
   475 
   476 
   476     QNetworkRequest header(QUrl("https://hedgewars.org/feedback/?submit"));
   477     QNetworkRequest header(QUrl("https://hedgewars.org/feedback/?submit"));
   477     header.setRawHeader("Content-Length", QString::number(body.size()).toAscii());
   478     header.setRawHeader("Content-Length", QString::number(body.size()).toLatin1());
   478     header.setRawHeader("Content-Type", "application/x-www-form-urlencoded");
   479     header.setRawHeader("Content-Type", "application/x-www-form-urlencoded");
   479 
   480 
   480     nam->post(header, body);
   481     nam->post(header, body);
   481 }
   482 }