From: Norbert Moutarde Date: Mon, 9 Jun 2014 18:27:29 +0000 (+0200) Subject: I've attempted to get one function to savbuttons and sendRAW but X-Git-Url: https://git.nothing2do.fr/?a=commitdiff_plain;h=ea120fd1b80a9c598b4b305f2e1eed669a6fbbd4;p=diary-mobile.git I've attempted to get one function to savbuttons and sendRAW but firstline scare me ! --- diff --git a/diary-mobile_en_EN.ts b/diary-mobile_en_EN.ts index 09d92fc..d9783a4 100644 --- a/diary-mobile_en_EN.ts +++ b/diary-mobile_en_EN.ts @@ -14,381 +14,462 @@ - + + 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 + + + Variable's name ? + text to ask value's name before changing it (set) + + + + + + Error + title if action("set") has too much value + + + + + + Too much value in button's action + text if action("set") has too much value + + + variable text change + title to warn about variable content change + + + + + + value of + + + + + + Variable's name ? + text to ask value's name before changing it (setint) + + + + + variable integer change + title to warn about variable content change + + + + + Value of + + + + choice title of box who ask multiple choice - + Please choose an action. text to ask multiple choice - + + variable file change + title to warn about variable content change + + + + + Error + title if action("edit") has too much value + + + + + Too much value in button's action + text if action("edit") has too much value + + + + 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 - + + Error + title of box if action("read" has too much (or too "less") value + + + + + Bad number of value + text of box if action("read") has too much (or too "less") value + + + + &Download - + Ctrl+W Buttons|Downlad - + A&dd - + Sa&v - + Reset - + Ctrl+Z Buttons|Reset - + &Edit - + + &Hack + + + + 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 5659d9f..90db3d2 100644 --- a/diary-mobile_fr_FR.ts +++ b/diary-mobile_fr_FR.ts @@ -22,73 +22,74 @@ 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 +100,18 @@ Ctrl+Z - + &Quit &Quitter - + Ctrl+Q File|Quit Ctrl+Q - + &Buttons Boutons @@ -119,7 +120,7 @@ A&jouter un boutons - + Ctrl+D Buttons|Add Ctrl+D @@ -129,7 +130,7 @@ Sauvegardez les boutons - + Ctrl+V Buttons|Save Ctrl+V @@ -139,129 +140,208 @@ &Editer les boutons - + Ctrl+E Buttons|&Edit Ctrl+E - + &View/Hide menu Voir/Cacher le menu + + + Variable's name ? + text to ask value's name before changing it (set) + Nom de la variable + + + + + Error + title if action("set") has too much value + Erreur + + + + + Too much value in button's action + text if action("set") has too much value + Trop de mots dans l'action du bouton + + + + variable text change + title to warn about variable content change + changement du contenu de la variable + + + value of + Valeur de + + + + + Variable's name ? + text to ask value's name before changing it (setint) + Nom de la variable ? + + + + variable integer change + title to warn about variable content change + changement de valeur + + + + Value of + Valeur de + + + choice title of box who ask multiple choice Choix - + Please choose an action. text to ask multiple choice Choisissez une action - + + variable file change + title to warn about variable content change + changement de valeur + + + + Error + title if action("edit") has too much value + Erreur + + + + Too much value in button's action + text if action("edit") has too much value + Trop de mots dans l'action du bouton + + + 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 - + + Error + title of box if action("read" has too much (or too "less") value + Erreur + + + + Bad number of value + text of box if action("read") has too much (or too "less") value + Mauvais "nombre" de mot + + + Ctrl+T File|View menu Ctrl+C - &Help - Aide + Aide - - + + New entry - Nouvelle entré + Nouvelle entrée - + 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 @@ -271,154 +351,159 @@ 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 - + + &Hack + Bidouille + + + Download sql Télécharger un fichier 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 ff37edc..60708df 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -182,7 +182,8 @@ void MainWindow::action(const QString &a){ QMessageBox::critical(this, trUtf8("Error","title if action(\"set\") has too much value"), trUtf8("Too much value in button's action", "text if action(\"set\") has too much value")); return; } - QMessageBox::information(this, trUtf8("variable text change", "title to warn about variable content change"), trUtf8(d+" will be changed to "+e, "text to warn about variable content change")); + //QString z=d+" will be changed to "+e; + if(conf->value(QString("saychange")).toBool())QMessageBox::information(this, trUtf8("variable text change", "title to warn about variable content change"), trUtf8("value of "+d.toLocal8Bit()+" changed to "+e.toLocal8Bit(), "text to warn about variable content change")); conf->setValue(d, e); } else if(b[0]==QString("setint")){ @@ -190,7 +191,7 @@ void MainWindow::action(const QString &a){ int e; QString d; if(bs==1){ - d=QInputDialog::getText(this, "setInt", trUtf8("Variable's name ?", "text to ask value's name before changing it (setint)") , QString(""), 0, 100, 1, &ok); + d=QInputDialog::getText(this, "setInt", trUtf8("Variable's name ?", "text to ask value's name before changing it (setint)"), QLineEdit::Normal, QString(""), &ok); if(!ok)return; e=QInputDialog::getInt(this, "setInt", d, QLineEdit::Normal, conf->value(d).toInt(), &ok); if(!ok)return; @@ -205,7 +206,8 @@ void MainWindow::action(const QString &a){ QMessageBox::critical(this, trUtf8("Error","title if action(\"set\") has too much value"), trUtf8("Too much value in button's action", "text if action(\"set\") has too much value")); return; } - QMessageBox::information(this, trUtf8("variable integer change", "title to warn about variable content change"), trUtf8(d+" will be changed to "+e, "text to warn about variable content change")); + //QString z=d+" will be changed to "+e; + if(conf->value(QString("saychange")).toBool())QMessageBox::information(this, trUtf8("variable integer change", "title to warn about variable content change"), trUtf8("Value of "+d.toLocal8Bit()+" changed", "text to warn about variable content change")); conf->setValue(d, e); } else if(b[0]==QString("start")){ @@ -229,7 +231,7 @@ void MainWindow::action(const QString &a){ bool ok=0; QString d, e; if(bs==1){ - d=QInputDialog::getText(this, "setInt", trUtf8("Variable's name ?", "text to ask value's name before changing it (setint)") , QString(""), 0, 100, 1, &ok); + d=QInputDialog::getText(this, "setFile", trUtf8("Variable's name ?", "text to ask value's name before changing it (setint)") , QLineEdit::Normal, QString(""), &ok); if(!ok)return; e=QFileDialog::getSaveFileName(this, trUtf8("get file", "title to ask file"), conf->value(d).toString()); }else if(bs==2){ @@ -239,7 +241,7 @@ void MainWindow::action(const QString &a){ d=b[1]; e=b[2]; } - QMessageBox::information(this, trUtf8("variable file change", "title to warn about variable content change"), trUtf8(d+" will be changed to "+e, "text to warn about variable content change")); + if(conf->value(QString("saychange")).toBool())QMessageBox::information(this, trUtf8("variable file change", "title to warn about variable content change"), trUtf8("value of "+d.toLocal8Bit()+" has been changed to "+e.toLocal8Bit(), "text to warn about variable content change")); conf->setValue(d, e); } else if(b[0]==QString("box")){ @@ -332,7 +334,7 @@ void MainWindow::action(const QString &a){ a.open(QIODevice::ReadOnly); readData(a.readAll()); }else{ - QMessageBox::warning(this, trUtf8("Error", "title of box if action(\"read\" hasn't too much value")); + QMessageBox::warning(this, trUtf8("Error", "title of box if action(\"read\" has too much (or too \"less\") value"), trUtf8("Bad number of value", "text of box if action(\"read\") has too much (or too \"less\") value")); } } else { @@ -438,16 +440,14 @@ void MainWindow::firstrun(){ conf->setValue(QString("servercert"), QVariant("a.pem")); conf->setValue(QString("database"), QVariant("db")); conf->setValue(QString("password"), QVariant("pass")); - conf->setValue(QString("file"), QVariant("raw")); - conf->setValue(QString("buttonfile"), QVariant("ui.sql")); + conf->setValue(QString("rawfile"), QVariant("raw")); + conf->setValue(QString("buttonfile"), QVariant("ui.sql+")); conf->setValue(QString("maxcolumn"), QVariant(2)); - conf->setValue(QString("maxline"), QVariant(5)); + conf->setValue(QString("maxline"), QVariant(4)); conf->setValue(QString("SQLsettings"), QVariant("connect_timeout=10000")); conf->setValue(QString("button"), QVariant("background-color: red;border-style: outset;border-width: 7px;border-radius: 10px;border-color: beige;font: bold 15px;padding: 6px;")); - conf->setValue(QString("menu"), QVariant(1)); - 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("menu"), QVariant(0)); + conf->setValue(QString("download"), QVariant("http://www.nothing2do.eu/ui.sql+")); conf->setValue(QString("userftp"), QVariant("")); conf->setValue(QString("hostftp"), QVariant("")); conf->setValue(QString("passftp"), QVariant("")); @@ -455,7 +455,9 @@ void MainWindow::firstrun(){ conf->setValue(QString("restore"), QVariant("http://www.abc.de/db")); conf->setValue(QString("db"), QVariant("/data/data/eu.nothing2do.diarymobile/files/db")); conf->setValue(QString("selectbuttons"), QVariant("select keyword,label,action from ui order by label;")); + conf->setValue(QString("columnbuttons"), QVariant(3)); conf->setValue(QString("selectraw"), QVariant("select date,texte from raw order by date;")); + conf->setValue(QString("columnraw"), QVariant(2)); conf->setValue(QString("menuback"), QVariant("-menuback")); conf->setValue(QString("choosebuttons"), QVariant("select id,label from ui where keyword like ? order by label;")); conf->setValue(QString("addbuttons"), QVariant("insert into ui (label, keyword, action) values (:label, :keyword, :action)")); @@ -467,6 +469,7 @@ void MainWindow::firstrun(){ conf->setValue(QString("volumdown"), QVariant("back")); conf->setValue(QString("volumup"), QVariant("Montpellier")); conf->setValue(QString("askkeyword"), QVariant(0)); + conf->setValue(QString("saychange"), QVariant(0)); conf->setValue(QString("sepcmd"), QVariant("!@!")); conf->setValue(QString("sepchc"), QVariant("!#!")); conf->setValue(QString("sqlval"), QVariant("?")); @@ -505,7 +508,7 @@ void MainWindow::entry(const QString &a){ if(a=="")label=context+" : "; else label=context+", "+a+" : "; entry=QInputDialog::getText(this, trUtf8("New entry"), label, QLineEdit::Normal, "", &ok); - if(ok==0)return; + if(!ok)return; QString c; if(a=="")c=context+" : "+entry; else c=context+", "+a+" : "+entry; @@ -614,11 +617,12 @@ void MainWindow::writeData(){ } void MainWindow::sendRAW(){ exec(QList ({conf->value(QString("selectraw")).toString()})); - QFile a(conf->value(QString("file")).toString()); + QFile a(conf->value(QString("rawfile")).toString()); a.open(QIODevice::WriteOnly|QIODevice::Text); QTextStream b(&a); + int c=conf->value(QString("columnraw")).toInt()-1; while (q->next()) { - for (int i=0; i<1; i++){ + for (int i=0; ivalue(i).toString()<<" "; } b<value(1).toString()<<"\n"; @@ -759,9 +763,10 @@ void MainWindow::savButtons(){ QFile a(conf->value(QString("buttonfile")).toString()); a.open(QIODevice::WriteOnly|QIODevice::Text); QTextStream b(&a); + int c=conf->value(QString("columnbutton")).toInt()-1; b<value("firstline").toString()<<"\n"; while (q->next()) { - for (int i=0; i<2; i++){ + for (int i=0; ivalue(i).toString()<<"$"; } b<value(2).toString()<<"\n";