if(!ok)return;
}else if(bs==2){
d=b[1];
- e=QInputDialog::getInt(this, "setInt", b[1] , conf->value(QString(d)).toInt(), 0, 100, 1, &ok);
+ e=QInputDialog::getInt(this, "setInt", b[1] , conf->value(QString(d)).toInt(), -100, 100, 1, &ok);
if(!ok)return;
}else if(bs==3){
d=b[1];
QString e=QInputDialog::getItem(this, trUtf8("choice", "title of box who ask multiple choice"), trUtf8("Please choose an action.", "text to ask multiple choice"), c.split(conf->value(QString("sepchc")).toString()), 0, 0, &ok);
if(ok)action(e);
}
+ else if(b[0]==QString("send")){
+ if(bs==2)send(b[1]);
+ }
else if(b[0]==QString("back")){
if(way.size()>=2){
way.removeLast();
conf->setValue(QString("lastdownload"), QDateTime::currentDateTime().toString(Qt::ISODate));
}
void MainWindow::sendRAW(){
+ //send(QString("raw"))
exec(QList<QString> ({conf->value(QString("selectraw")).toString()}));
QFile a(conf->value(QString("rawfile")).toString());
a.open(QIODevice::WriteOnly|QIODevice::Text);
a.close();
qDebug()<<"a.open()="<<a.open(QIODevice::ReadOnly | QIODevice::Text);
//QUrl upload(conf->value(QString("uploadRAW")).toString());
- QUrl upload(QString("ftp://")+conf->value(QString("userftp")).toString()+QString(":")+conf->value(QString("passftp")).toString()+QString("@")+conf->value(QString("hostftp")).toString()+QString("/")+conf->value(QString("file")).toString());
+ QUrl upload(QString("ftp://")+conf->value(QString("userftp")).toString()+QString(":")+conf->value(QString("passftp")).toString()+QString("@")+conf->value(QString("hostftp")).toString()+QString("/")+conf->value(QString("rawfile")).toString());
net=new QNetworkAccessManager(this);
//a.open(QIODevice::ReadOnly | QIODevice::Text);
rep=net->put(QNetworkRequest(upload), a.readAll());
void MainWindow::writeTr(){
QString a="diary-mobile_" + QLocale::system().name()+".qm";
qDebug()<<"writeTr->a="<<a;
- QFile file(a);
- file.open(QIODevice::WriteOnly);
- file.write(m->downloadedData());
- file.close();
+ QFile tmp(a);
+ tmp.open(QIODevice::WriteOnly);
+ tmp.write(m->downloadedData());
+ tmp.close();
}
void MainWindow::writeFile(){
QFile tmp(file);
}
void MainWindow::tmpdown(){
bool ok;
- QString url=QInputDialog::getText(this, trUtf8("tmp URL", "Title of box where ask for button tmp's URL"), trUtf8("Enter URL", "Label of box where ask for button tmp's URL"), QLineEdit::Normal, QString(""), &ok), tmp="tmp";
+ QString url=QInputDialog::getText(this, trUtf8("tmp URL", "Title of box where ask for button file's URL"), trUtf8("Enter URL", "Label of box where ask for button file's URL"), QLineEdit::Normal, QString(""), &ok), file="file";
download(url);
connect(m, SIGNAL(downloaded()), this, SLOT(readData()));
readData(m->downloadedData());
m->disconnect(m, SIGNAL(downloaded()),this, SLOT(readData()));
}
+void MainWindows::send(const QString & a){
+ QString t="select"+a;
+ exec(QList<QString> ({conf->value(t).toString()}));
+ t=a+"file";
+ QFile tmp(conf->value(t).toString());
+ tmp.open(QIODevice::WriteOnly|QIODevice::Text);
+ QTextStream b(&tmp);
+ t="column"+a;
+ int c=conf->value(t).toInt()-1;
+
+ while (q->next()) {
+ for (int i=0; i<c; i++){
+ b<<q->value(i).toString()<<" ";
+ }
+ b<<q->value(1).toString()<<"\n";
+ }
+ tmp.close();
+ qDebug()<<"a.open()="<<tmp.open(QIODevice::ReadOnly | QIODevice::Text);
+ //QUrl upload(conf->value(QString("uploadRAW")).toString());
+ QUrl upload(QString("ftp://")+conf->value(QString("userftp")).toString()+QString(":")+conf->value(QString("passftp")).toString()+QString("@")+conf->value(QString("hostftp")).toString()+QString("/")+conf->value(t).toString());
+ net=new QNetworkAccessManager(this);
+ //a.open(QIODevice::ReadOnly | QIODevice::Text);
+ rep=net->put(QNetworkRequest(upload), tmp.readAll());
+ qDebug()<<"net->put : "<<rep<< " upload : "<<upload.url();
+ connect(rep, SIGNAL(finished()), this, SLOT(RAWsent()));
+}