]> git.nothing2do.fr Git - diary-mobile.git/commitdiff
addbuttons is now in action(), next, prev should work, and now you've to
authorNorbert Moutarde <norbert.moutarde@nothing2do.eu>
Tue, 11 Aug 2015 14:08:20 +0000 (16:08 +0200)
committerNorbert Moutarde <norbert.moutarde@nothing2do.eu>
Tue, 11 Aug 2015 14:08:20 +0000 (16:08 +0200)
type "del" to delete a buttons

main.cpp
mainwindow.cpp

index a9febd095d6b8f66728f22d38f4e02c9c548d35b..773a842cf9267d98739a7f80de253b1b041684f4 100644 (file)
--- 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();
 }
index 4a7ec41a20d988189930b3af210bee2a35b30acc..4a33f449d06446a88fd7c4885d15641a74211603 100644 (file)
@@ -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;