]> git.nothing2do.fr Git - diary-mobile.git/commitdiff
"page" is removed and few tweak)
authorNorbert Moutarde <norbert.moutarde@nothing2do.eu>
Wed, 12 Nov 2014 08:04:54 +0000 (09:04 +0100)
committerNorbert Moutarde <norbert.moutarde@nothing2do.eu>
Wed, 12 Nov 2014 08:04:54 +0000 (09:04 +0100)
mainwindow.cpp

index 8b4297b66ea73c2f7942aebb8785979e321bbe93..a09c68872dfb4515be36aa4978a87c1949e019c6 100644 (file)
@@ -247,8 +247,8 @@ void MainWindow::action(const QString &a){
     }
     else if(b[0]==QString("sav")){
         Msav.lock();
-
         sav(c);
+
     }
     else if(b[0]==QString("back")){
         if(way.size()>1){
@@ -618,12 +618,13 @@ void MainWindow::entry(const QString &a){
     for(int b=0; b<way.size()-1;b++){
         qDebug()<<"way["<<b<<"]="<<way[b];
         context.append(way[b]);
-        context.append(" ");
+        context.append("<br>");
     }
     context.append(way.last());
     if(a=="")label=context+" : ";
     else label=context+", "+a+" : ";
-    entry=QInputDialog::getText(this, trUtf8("New entry"), label, QLineEdit::Normal, "", &ok);
+    //entry=QInputDialog::getText(this, trUtf8("New entry"), label, QLineEdit::Normal, "", &ok);
+    entry=QInputDialog::getMultiLineText(this, trUtf8("New entry"), label, QString(""), &ok);
     if(!ok)return;
     QString c;
     if(a=="")c=context+" : "+entry;
@@ -921,7 +922,12 @@ void MainWindow::insert(const QString & type, const QString & keyword, const QSt
         //count++;
         key=q->value(1).toString()+" "+key;
     }
-    if(!key.contains(keyword))key=key+" "+keyword;// it is possible to have 2 buttons with same label and action ? I've sayd "no"
+    if(!key.contains(keyword)){// it isn't possible to have 2 buttons with same label and action
+        key=key+" "+keyword;
+
+    }else{
+        if(deb)QMessageBox::information(this, trUtf8("key.contain(keyword)", "box title to debug insert"), trUtf8("la chaine est déja dans le bouton"));
+    }
     if(deb)QMessageBox::information(this, trUtf8("action", "box title to debug insert"), trUtf8("insert : key="+key.toLocal8Bit()+" label="+label.toLocal8Bit()+" action="+action.toLocal8Bit(), "label to debug insert"));
     if(!id.isValid())exec(QList<QString>({conf->value(QString("add")+type).toString(), key, label, action}));
     else{exec(QList<QString>({conf->value(QString("update")+type).toString(), key, label, action, id.toString()}));
@@ -1095,17 +1101,18 @@ bool MainWindow::printItem(){
     int actCol = 1;//r.indexOf("action");
     int i=0;
     qDebug()<<"bcl to add buttons";
-    if(page){
+    /*if(page){
         addWidget(QString("prevpage"), new CLabel(trUtf8("Prev."), *conf));
-    }
+    }*/
     while(q->next()){
         int tmp=addWidget(q->value(actCol).toString(), new CLabel(q->value(labCol).toString(), *conf));
-        if(tmp==1)break;
+        //if(tmp==1)return 1;
         i++;
     };
     grid->update();
     //scroll->updateGeometry();
     screen->updateGeometry();
+    return 0;
     qDebug()<<"end getButtons : "<<i<<" button(s) way.size()"<<way.size()<<" page : "<<page;
 
 }