From: Norbert Moutarde Date: Wed, 12 Nov 2014 08:04:54 +0000 (+0100) Subject: "page" is removed and few tweak) X-Git-Url: https://git.nothing2do.fr/?a=commitdiff_plain;h=c3e6d4c3f56c149474eca68626e4fb7625f85d88;p=diary-mobile.git "page" is removed and few tweak) --- diff --git a/mainwindow.cpp b/mainwindow.cpp index 8b4297b..a09c688 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -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"); } 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({conf->value(QString("add")+type).toString(), key, label, action})); else{exec(QList({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 : "<