1 /*=========================================================================
2 Program: vv http://www.creatis.insa-lyon.fr/rio/vv
5 - University of LYON http://www.universite-lyon.fr/
6 - Léon Bérard cancer center http://www.centreleonberard.fr
7 - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the copyright notices for more information.
13 It is distributed under dual licence
15 - BSD See included LICENSE.txt file
16 - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ===========================================================================**/
18 #include <QApplication>
20 #include "vvRegisterForm.h"
21 #include <QNetworkRequest>
24 #include "clitkConfiguration.h"
25 #include "vvConfiguration.h"
28 vvRegisterForm::vvRegisterForm(QUrl url, QString path, QSettings::Format format):url(url), settings(path, format){
29 manager = new QNetworkAccessManager(this);
31 textBrowser->viewport()->setAutoFillBackground(false);
34 void vvRegisterForm::sendData(){
36 url2.addQueryItem("name", firstName->text().toUtf8());
37 url2.addQueryItem("lastName", lastName->text().toUtf8());
38 url2.addQueryItem("email", email->text().toUtf8());
39 url2.addQueryItem("group", group->text().toUtf8());
40 url2.addQueryItem("os", OS_NAME);
41 url2.addQueryItem("vvVersion", VV_VERSION);
42 url2.addQueryItem("architecture", ARCHITECTURE);
43 url2.addQueryItem("adressing", QString::number(sizeof(char*)*8)+"-bit");
44 url2.addQueryItem("compilationDate", QString(__DATE__) + ", " + QString(__TIME__) );
46 manager->get(QNetworkRequest(url2));
48 void vvRegisterForm::accept(){
50 settings.setValue("name", firstName->text().toUtf8());
51 settings.setValue("lastName", lastName->text().toUtf8());
52 settings.setValue("email", email->text().toUtf8());
53 settings.setValue("group", group->text().toUtf8());
54 settings.setValue("os", osName->text().toUtf8());
57 bool vvRegisterForm::canPush(){
58 ///maybe we show this dialog only for new major release, not for any patches?
59 return settings.value("vvVersion").toString().toStdString()<VV_VERSION;
61 void vvRegisterForm::acquitPushed(){
62 settings.setValue("vvVersion", VV_VERSION);
64 void vvRegisterForm::show(){
65 firstName->setText(settings.value("name").toString());
66 lastName->setText(settings.value("lastName").toString());
67 email->setText(settings.value("email").toString());
68 group->setText(settings.value("group").toString());
69 osName->setText(QString::fromStdString(OS_NAME) + ", " +
71 QString::number(sizeof(char*)*8)+"-bit");