]> git.nothing2do.fr Git - diary-mobile.git/commitdiff
entry has been fixed (it was ugly) and ui.sql is impersonnated
authorNorbert Moutarde <norbert.moutarde@nothing2do.eu>
Wed, 8 Jan 2014 14:23:54 +0000 (15:23 +0100)
committerNorbert Moutarde <norbert.moutarde@nothing2do.eu>
Wed, 8 Jan 2014 14:23:54 +0000 (15:23 +0100)
mainwindow.cpp
ui.sql

index b13640e06e4e2de559badafa998b4d19b4c68072..e7655980ca9cbb1778448cadf8f3e2707dae2c64 100644 (file)
@@ -145,12 +145,12 @@ void MainWindow::action(const QString &a){
     }
     else if(a.split(QString(" "))[0]=="new"){
         QString b="";
-        for(int c=0;c<way.size()-1;c++){
+        for(int c=0;c<way.size()-2;c++){
             b+=way[c];
             b+=" ";
         };
         b+=way.last();
-        b+=" : ";
+        b+=", ";
         b+=a.remove(0,4);
         entry(b);
     }
@@ -287,20 +287,21 @@ int MainWindow::exec(const QList<QString> & 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<QString> 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 0fb50583d74e7058d5f3014b602e021a28fcda0f..291f738f36f559c2c5af8675d510ac075f86449d 100644 (file)
--- 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