]> git.nothing2do.fr Git - diary-mobile.git/commitdiff
i've added the possibility to push a button once to get menu and a
authorNorbert Moutarde <norbert.moutarde@nothing2do.eu>
Sun, 13 Mar 2016 19:18:47 +0000 (20:18 +0100)
committerNorbert Moutarde <norbert.moutarde@nothing2do.eu>
Sun, 13 Mar 2016 19:18:47 +0000 (20:18 +0100)
second time to get back

mainwindow.cpp
mainwindow.h

index 599677a4d7a2d3e30039b9acf7c605afbc442d23..04af2346f2bb24f08e9264b3d9acecf10dd25f86 100644 (file)
@@ -895,59 +895,46 @@ void MainWindow::keyReleaseEvent(QKeyEvent *event)
     qDebug()<<"key released="<<k;
     if(deb)QMessageBox::information(this, trUtf8("key released", "box title to debug keyReleaseEvent"), "key : "+tmp);
     if (k==Qt::Key_Menu){
-        const QString a=conf->value(QString("actionmenu"), QString("")).toString();
-        if(a!=""){
-            if(beforekey.isEmpty()){
-                beforekey=lastprint;
-                action(a);
-            }else{
-                action(beforekey);
-                beforekey.clear();
-            };
-            //accepted=true;
+        const QString a=conf->value(QString("actionmenu")).toString();
+        if(a!=lastprint){
+            beforeactionmenu=lastprint;
+            action(a);
         }else{
-            accepted=false;
-        }
-    }
-    else if(k==Qt::Key_Back){
+            action(beforeactionmenu);
+
+        };
+        accepted=true;
+    }else if(k==Qt::Key_Back){
         const QString a=conf->value(QString("menuback"), QString("")).toString();
-        if(a!=""){
-            if(beforekey.isEmpty()){
-                beforekey=lastprint;
-                action(a);
-            }else{
-                action(beforekey);
-                beforekey.clear();
-            };
-            accepted=true;
-        }
-    }
-    else if(k==Qt::Key_VolumeDown){
+        if(a!=lastprint){
+            beforekeyback=lastprint;
+            action(a);
+        }else{
+            action(beforekeyback);
+
+        };
+        accepted=true;
+    }else if(k==Qt::Key_VolumeDown){
         qDebug()<<"keyvolumdown";
         const QString a=conf->value(QString("volumdown")).toString();
-        if(a!=""){
-            if(beforekey.isEmpty()){
-                beforekey=lastprint;
-                action(a);
-            }else{
-                action(beforekey);
-                beforekey.clear();
-            };
-            accepted=true;
-        }
-    }
-    else if(k==Qt::Key_VolumeUp){
+        if(a!=lastprint){
+            beforevolumedown=lastprint;
+            action(a);
+        }else{
+            action(beforevolumedown);
+
+        };
+        accepted=true;
+    }else if(k==Qt::Key_VolumeUp){
         const QString a=conf->value(QString("volumup")).toString();
-        if(a!=""){
-            if(beforekey.isEmpty()){
-                beforekey=lastprint;
-                action(a);
-            }else{
-                action(beforekey);
-                beforekey.clear();
-            };
-            accepted=true;
-        }
+        if(a!=lastprint){
+            beforevolumeup=lastprint;
+            action(a);
+        }else{
+            action(beforevolumeup);
+
+        };
+        accepted=true;
     };
     event->setAccepted(accepted);
 }
@@ -1310,7 +1297,7 @@ void MainWindow::get2(const QString & d, const QString &b){
     QString c="%"+a+"%", x=conf->value(t).toString();
     qDebug()<<"l691 x="<<x<<" c="<<c<<" t="<<t;
     QList<QString> tmp({x, c});
-    label->setText(c);
+    label->setText(a);
     exec2(tmp);
     page=0;
     //while(q->next()){
index 05a30989ad6e44943f507a8b6f728e4c4c03784d..87941f0f2431b976f9a41e5c5bd9f860f364e21f 100644 (file)
@@ -195,7 +195,7 @@ private:
     QGridLayout *grid;
     QLabel *label;
     QSettings *conf;
-    QString tmp, tmp2, file, lastprint, currenttype, savtitle, beforekey;//host, user, tmp, password, servercert,database;
+    QString tmp, tmp2, file, lastprint, currenttype, savtitle, beforekey, beforeactionmenu, beforekeyback, beforevolumedown, beforevolumeup;//host, user, tmp, password, servercert,database;
     QMenu *FileMenu, *EditMenu, *HackMenu;
     QSignalMapper *signalmap;
     QStringList way;