From 1c6847b5fdab10af98397e6ef65d72eae1590e00 Mon Sep 17 00:00:00 2001 From: Norbert Moutarde Date: Tue, 11 Aug 2015 16:08:20 +0200 Subject: [PATCH] addbuttons is now in action(), next, prev should work, and now you've to type "del" to delete a buttons --- main.cpp | 2 +- mainwindow.cpp | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/main.cpp b/main.cpp index a9febd0..773a842 100644 --- a/main.cpp +++ b/main.cpp @@ -36,7 +36,7 @@ int main(int argc, char *argv[]) translator.load(QString("diary-mobile_") + locale); app.installTranslator(&translator); MainWindow w; - w.showMaximized(); + w.showExpanded(); return app.exec(); } diff --git a/mainwindow.cpp b/mainwindow.cpp index 4a7ec41..4a33f44 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -275,9 +275,9 @@ void MainWindow::action(const QString &a){ int t=grid->count(); flush(); - //int max=conf->value(QString("maxcolumn")).toInt()*conf->value(QString("maxline")).toInt(); + int max=conf->value(QString("maxcolumn")).toInt()*conf->value(QString("maxline")).toInt(); if(!page)tmp=q->seek(0); - else tmp=q->seek(-t,true); + else tmp=q->seek(-t-max,true); if(deb)QMessageBox::information(this, trUtf8("result", "box title to debug prevpage"), int(tmp)); printItem(); @@ -443,6 +443,9 @@ void MainWindow::action(const QString &a){ } if(deb)QMessageBox::information(this, QString("val"), QString("val.size()=="+valeur->size())); } + else if(b[0]==QString("add")){ + addDB(c); + } else{ get(conf->value(QString("currenttype")).toString(),a); //a=""; @@ -754,7 +757,7 @@ void MainWindow::editDB(const QString & a, const QString & b){ else tmpaction=QInputDialog::getText(this, trUtf8("action", "Title of box where ask for button's action"), trUtf8("new action", "question to get new button's action"), QLineEdit::Normal, action, &ok); if(!ok)return; - if((tmpkeyword=="")||(tmplabel=="")||(tmpaction=="")){ + if((tmpkeyword=="del")||(tmplabel=="del")||(tmpaction=="del")){ remove(a, keyword, label, action); if(deb)QMessageBox::information(this, trUtf8("EditDB", "title of box to say a button was deleted"), trUtf8("button was deleted", "text to say button was deleted")); return; -- 2.45.1