From 4ab911dc76824d254661a59516e97f5f55495874 Mon Sep 17 00:00:00 2001 From: Norbert Moutarde Date: Mon, 9 Jun 2014 10:49:39 +0200 Subject: [PATCH] I've added "tmpdown" and conf("hostftp"), conf("userftp") and conf("passftp") --- diary-mobile_en_EN.ts | 169 ++++++++++++++++++++++++++---------------- diary-mobile_fr_FR.ts | 169 ++++++++++++++++++++++++++---------------- mainwindow.cpp | 34 ++++++--- mainwindow.h | 2 + 4 files changed, 239 insertions(+), 135 deletions(-) diff --git a/diary-mobile_en_EN.ts b/diary-mobile_en_EN.ts index 365e75e..242580a 100644 --- a/diary-mobile_en_EN.ts +++ b/diary-mobile_en_EN.ts @@ -4,351 +4,394 @@ MainWindow - + first button file - + Enter the URL to download the first buttons file - + get file title to ask file - + box box title to show a text - + set - + Enter ID of button to edit - + &File - + &Start - + Ctrl+S File|Start - + &Back - + Ctrl+B File|Back - + sendRAW - + Ctrl+L File|Upload - + Reset RAW Reset Ui - + &Quit - + Ctrl+Q File|Quit - + &Buttons - + Ctrl+D Buttons|Add - + Ctrl+V Buttons|Save - + Ctrl+E Buttons|&Edit - + &View/Hide menu - + &Help - - + + New entry - + getButtons - + About Qt - + ctrl+H Help|About Qt - + C&reate Database - + Ctrl+R Help|CreateDB - + label Title of box where ask for new button's label - + Enter his label his/her/?they? I've forget my school lesson - + keyword Title of box where ask for new button's keyword - + Enter they keyword (no limit !) - + action Title of box where ask for new button's action - + Enter his action - + Ctrl+T File|View menu - + choice title of box who ask multiple choice - + Please choose an action. text to ask multiple choice - + + URL + title to download a custom file from URL + + + + + Enter the URL of the file + label to download a custom file + + + + + + File + title to write a file downloaded from URL + + + + + + Enter the name of the file + label to write the downloaded data + + + + &Download - + Ctrl+W Buttons|Downlad - + A&dd - + Sa&v - + Reset - + Ctrl+Z Buttons|Reset - + &Edit - + + Download sql + + + + chooseButtonDB - + Enter the keyword : - + keyword Title of box where ask for button's keyword - + new keyword question to get new button's keyword - + label Title of box where ask for button's label - + new label question to get new button's label - + action Title of box where ask for button's action - + new action question to get new button's action - + RAWsent message title when data has been send - + sendRAW finish message text when data has been send - + Upload finish : pop-up when data has been sent - + uploadDB pop-up title when data has been sent - + Uisent pop-up title when buttons has been sent - + savbuttons finish pop-up text when buttons has been sent - + Enter the keyword : ask keyword to get buttons - + getButtons title to ask keyword fot getbuttons - + writeFile pop-up title when file has been written - + File written : + + + tmp URL + Title of box where ask for button tmp's URL + + + + + Enter URL + Label of box where ask for button tmp's URL + + diff --git a/diary-mobile_fr_FR.ts b/diary-mobile_fr_FR.ts index caa978e..33775ed 100644 --- a/diary-mobile_fr_FR.ts +++ b/diary-mobile_fr_FR.ts @@ -4,12 +4,12 @@ MainWindow - + first button file Premier fichier de bouton - + Enter the URL to download the first buttons file Entrez l'URL pour télécharger vos boutons @@ -22,73 +22,73 @@ choisissez une action - + get file title to ask file choisissez un fichier - + box box title to show a text info - + set définir - + Enter ID of button to edit Entrez l'ID du bouton à éditer - + &File &Fichier - + &Start &Départ - + Ctrl+S File|Start Ctrl+D - + &Back &Retour - + Ctrl+B File|Back Ctrl+R - + Ctrl+W Buttons|Downlad Ctrl+D - + sendRAW Envoyer les données - + Ctrl+L File|Upload Ctrl+L - + Reset RAW Reset Ui Réinitialiser les donnés @@ -99,18 +99,18 @@ Ctrl+Z - + &Quit &Quitter - + Ctrl+Q File|Quit Ctrl+Q - + &Buttons Boutons @@ -119,7 +119,7 @@ A&jouter un boutons - + Ctrl+D Buttons|Add Ctrl+D @@ -129,7 +129,7 @@ Sauvegardez les boutons - + Ctrl+V Buttons|Save Ctrl+V @@ -139,103 +139,129 @@ &Editer les boutons - + Ctrl+E Buttons|&Edit Ctrl+E - + &View/Hide menu Voir/Cacher le menu - + choice title of box who ask multiple choice Choix - + Please choose an action. text to ask multiple choice Choisissez une action - + + URL + title to download a custom file from URL + Source + + + + Enter the URL of the file + label to download a custom file + Entrez l'URL des données + + + + + File + title to write a file downloaded from URL + Fichier + + + + + Enter the name of the file + label to write the downloaded data + Entrez le nom du fichier + + + Ctrl+T File|View menu Ctrl+C - + &Help Aide - - + + New entry Nouvelle entré - + getButtons getButtons - + About Qt A propos de Qt - + ctrl+H Help|About Qt Ctrl+A - + C&reate Database C&réer une base de donné - + Ctrl+R Help|CreateDB Ctrl+R - + label Title of box where ask for new button's label Etiquette - + Enter his label his/her/?they? I've forget my school lesson Entrez son étiquette - + keyword Title of box where ask for new button's keyword mot-clé - + Enter they keyword (no limit !) Entrez les mots clé (no limit !) - + action Title of box where ask for new button's action action - + Enter his action Entrez son action @@ -245,140 +271,157 @@ 0 (non) ou 1 (oui)? - + &Download &Téléchargement - + A&dd Nouveau - + Sa&v Sauvegardez - + Reset Remise à zéro - + Ctrl+Z Buttons|Reset Ctrl+Z - + &Edit Editez - + + Download sql + + + + chooseButtonDB chooseButtonDB - + Enter the keyword : Entrez le mot-clé : - + keyword Title of box where ask for button's keyword mot-clé - + new keyword question to get new button's keyword nouveau mot-clé - + label Title of box where ask for button's label étiquette - + new label question to get new button's label nouvel étiquette - + action Title of box where ask for button's action action - + new action question to get new button's action nouvelle action - + RAWsent message title when data has been send RAWsent - + sendRAW finish message text when data has been send données envoyées - + Upload finish : pop-up when data has been sent Upload finit : - + uploadDB pop-up title when data has been sent uploadDB - + Uisent pop-up title when buttons has been sent Envoyé - + savbuttons finish pop-up text when buttons has been sent boutons sauvegardés sur le serveur - + Enter the keyword : ask keyword to get buttons Entrez le mot-clé : - + getButtons title to ask keyword fot getbuttons getBoutons - + writeFile pop-up title when file has been written fichier - + File written : Fichier écrit : + + + tmp URL + Title of box where ask for button tmp's URL + tmp URL + + + + Enter URL + Label of box where ask for button tmp's URL + Entrez l'URL + diff --git a/mainwindow.cpp b/mainwindow.cpp index da842ef..1e6432c 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -260,14 +260,14 @@ void MainWindow::action(const QString &a){ else if(b[0]==QString("vid")){ addMedia(c); } - else if(b[0]==QString("history")){ + else if(b[0]==QString("hist")){ flush(); - QString wi, del; + QString wi; + lastprint=QString("hist"); for(int i=0; ivalue(QString("button")).toString())); - del="rm "+QString("%1").arg(i); - addWidget(del, new CLabel(QString("del"), conf->value(QString("button")).toString())); + addWidget(QString("rm %1").arg(i), new CLabel(QString("del"), conf->value(QString("button")).toString())); } } @@ -305,6 +305,8 @@ void MainWindow::createMenuBar(){ HelpMenu->addAction(trUtf8("getButtons"), this, SLOT(getButtons())); HelpMenu->addAction(trUtf8("About Qt"), qApp, SLOT(aboutQt()), QKeySequence(tr("ctrl+H", "Help|About Qt"))); HelpMenu->addAction(trUtf8("C&reate Database"), this, SLOT(createDB()), QKeySequence(trUtf8("Ctrl+R", "Help|CreateDB"))); + HelpMenu->addAction(trUtf8("Download sql"), this, SLOT(tmpdown())); + menuBar()->addMenu(HelpMenu); } void MainWindow::toggleMenu(){ @@ -390,6 +392,9 @@ void MainWindow::firstrun(){ conf->setValue(QString("download"), QVariant("http://www.nothing2do.eu/ui.sql")); conf->setValue(QString("uploadRAW"), QVariant("ftp://:@/raw")); conf->setValue(QString("uploadUi"), QVariant("ftp://:@/ui.sql")); + conf->setValue(QString("userftp"), QVariant("")); + conf->setValue(QString("hostftp"), QVariant("")); + conf->setValue(QString("passftp"), QVariant("")); conf->setValue(QString("start"), QVariant("begin")); conf->setValue(QString("restore"), QVariant("http://www.abc.de/db")); conf->setValue(QString("db"), QVariant("/data/data/eu.nothing2do.diarymobile/files/db")); @@ -563,10 +568,9 @@ void MainWindow::sendRAW(){ b<value(1).toString()<<"\n"; } a.close(); - qDebug()<<"a.open()="<value(QString("uploadRAW")).toString()); + //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()); net=new QNetworkAccessManager(this); //a.open(QIODevice::ReadOnly | QIODevice::Text); rep=net->put(QNetworkRequest(upload), a.readAll()); @@ -707,7 +711,8 @@ void MainWindow::savButtons(){ b<value(2).toString()<<"\n"; } a.close(); - QUrl upload(conf->value(QString("uploadUi")).toString()); + //QUrl upload(conf->value(QString("uploadUi")).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("buttonfile")).toString()); net=new QNetworkAccessManager(this); a.open(QIODevice::ReadOnly | QIODevice::Text); rep=net->put(QNetworkRequest(upload), a.readAll()); @@ -819,7 +824,18 @@ void MainWindow::resizeEvent(QResizeEvent *event) conf->setValue(QString("maxline"), a); orientation=isLandscape; flush(); - getButtons(lastprint); + action(lastprint); } } +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"; + download(url); + + connect(m, SIGNAL(downloaded()), this, SLOT(readData())); +} +void MainWindow::readData(){ + readData(m->downloadedData()); + m->disconnect(m, SIGNAL(downloaded()),this, SLOT(readData())); +} diff --git a/mainwindow.h b/mainwindow.h index b467f99..b78b3c2 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -133,6 +133,8 @@ public: const CLabel* addWidget(const QString &, const CLabel *); void resizeEvent(QResizeEvent *); private slots: + void tmpdown(); + void readData(); void play(); void datasent(); void back(); -- 2.45.1