From: Norbert Moutarde Date: Wed, 8 Jan 2014 14:23:54 +0000 (+0100) Subject: entry has been fixed (it was ugly) and ui.sql is impersonnated X-Git-Url: https://git.nothing2do.fr/?a=commitdiff_plain;h=19be84703c08e012c649def9638ca88e744ab69f;p=diary-mobile.git entry has been fixed (it was ugly) and ui.sql is impersonnated --- diff --git a/mainwindow.cpp b/mainwindow.cpp index b13640e..e765598 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -145,12 +145,12 @@ void MainWindow::action(const QString &a){ } else if(a.split(QString(" "))[0]=="new"){ QString b=""; - for(int c=0;c & a){ else return 0; } void MainWindow::entry(const QString &a){ - QString time=QDateTime::currentDateTime().toString(QString("yyyy-MM-dd hh:mm:ss")), entry=""; + QString label, time=QDateTime::currentDateTime().toString(QString("yyyy-MM-dd hh:mm:ss")), entry=""; bool ok=0; - - entry=QInputDialog::getText(this, QString("nouvelle entrée"), a, QLineEdit::Normal, "", &ok); + if(a=="")label=time+" : "; + else label=time+", "+a+" : "; + entry=QInputDialog::getText(this, QString("nouvelle entrée"), label, QLineEdit::Normal, "", &ok); if(ok==0)return; - QString c=time+" "+entry; + QString c=label+entry; QFile fichier(conf->value(QString("file")).toString()); fichier.open(QIODevice::Append | QIODevice::Text); QTextStream flux(&fichier); - flux << c << endl; + flux << time << c << endl; fichier.close(); QList d({"INSERT INTO raw (date, texte) VALUES (:date, :txt);"}); d.append(time); - d.append(entry); + d.append(c); exec(d); //sql.unlock(); QSqlError b=q->lastError(); @@ -327,7 +328,7 @@ void MainWindow::addButtonDB(){ a+=" "; } a+=way.last(); - a.chop(1); + //a.chop(1); b=a+" "+b; a=QInputDialog::getText(this, QString("keyword"), QString("Entrez ses mots clé (no limit !)"), QLineEdit::Normal, cur, &ok); if ((a=="")||(ok==0))return; diff --git a/ui.sql b/ui.sql index 0fb5058..291f738 100644 --- a/ui.sql +++ b/ui.sql @@ -1,17 +1,4 @@ INSERT INTO ui (keyword, label, action) VALUES(?, ?, ?); -begin$new$new -begin$config$config -begin$odysseum$odysseum -odysseum$oliver's pub$oliver's pub -odysseum$gaumont$odysseum-gaumont -odysseum$subway$odysseum-subway -oliver's pub$audrey$audrey zanella -oliver's pub$chloé$chloé EN -oliver's pub$clochette$odysseum oliver's pub chloé -oliver's pub$valentine$odysseum oliver's pub valentine -audrey zanella$Pourquoi vous me prenez pour un perver ?$begi-olive-audre-perver -begi-lie-olive-audre-perver$"On ne te prends pas pour un perver."$begi-olive-audre-perve-non -begi-lie-olive-audre-perve-non$Pourquoi vous refusez qu'on se voit hors d'ici alors ?$begi-olive-audre-perve-non-hors config$max column$setint maxcolumn config$host$settext host config$port$setint port