]> git.nothing2do.fr Git - diary-mobile.git/commitdiff
I've added "printItem()" (to print maxc*maxl-2 buttons on each page)
authorNorbert Moutarde <norbert.moutarde@nothing2do.eu>
Wed, 5 Nov 2014 16:29:18 +0000 (17:29 +0100)
committerNorbert Moutarde <norbert.moutarde@nothing2do.eu>
Wed, 5 Nov 2014 16:29:18 +0000 (17:29 +0100)
mainwindow.cpp
mainwindow.h

index 291b3ff8b7dfde79781346fa05384470cbd24247..8b4297b66ea73c2f7942aebb8785979e321bbe93 100644 (file)
@@ -162,7 +162,7 @@ int unsigned MainWindow::addWidget(const QString &key, const CLabel *a){
     grid->addWidget(a, c/maxc, c%maxc, 1, 1, Qt::AlignJustify| Qt::AlignVCenter | Qt::AlignHCenter);
     QObject::connect(a, SIGNAL(released()), signalmap, SLOT(map()));
     signalmap->setMapping(a, key);
-
+    if(c==(maxc*maxl)-1)return 1;
 
     //p*(ml*mc)+c nombre de boutons en tout osef,
 /*    if((c==((maxc*maxl)-1))&&(!np)){
@@ -664,23 +664,9 @@ void MainWindow::get(const QString & d, const QString &b){
     QList<QString> tmp({x, c});
     label->setText(a);
     exec(tmp);
-    int labCol = 0;//r.indexOf("label");
-    int actCol = 1;//r.indexOf("action");
-    int i=0;
-    qDebug()<<"bcl to add buttons";
-    if(page){
-        addWidget(QString("prevpage"), new CLabel(trUtf8("Prev."), *conf));
-    }
-    //grid->count()%(maxl*maxc)!=0) here
     while(q->next()){
-        int tmp=addWidget(q->value(actCol).toString(), new CLabel(q->value(labCol).toString(), *conf));
-        if(tmp==1)break;
-        i++;
-    };
-    grid->update();
-    //scroll->updateGeometry();
-    screen->updateGeometry();
-    qDebug()<<"end getButtons : "<<i<<" button(s) way.size()"<<way.size()<<" page : "<<page;
+        printItem();
+    }
 }
 void MainWindow::chooseDB(){
     QString b;
@@ -1000,7 +986,6 @@ void MainWindow::addMedia(const QString & a){
 
         videoWidget = new QVideoWidget;
         video->setVideoOutput(videoWidget);
-        videoWidget->show();
         grid->addWidget(videoWidget,0,0,1,-1);
         connect(video, SIGNAL(videoAvailableChanged(bool)), video, SLOT(play()));
 
@@ -1105,6 +1090,22 @@ void MainWindow::reset(){
     QList<QString> b({"delete from buttons;"});
     exec(b);
 }
-bool MainWindow::printItem(const QString & key, const CLabel * a){
+bool MainWindow::printItem(){
+    int labCol = 0;//r.indexOf("label");
+    int actCol = 1;//r.indexOf("action");
+    int i=0;
+    qDebug()<<"bcl to add buttons";
+    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;
+        i++;
+    };
+    grid->update();
+    //scroll->updateGeometry();
+    screen->updateGeometry();
+    qDebug()<<"end getButtons : "<<i<<" button(s) way.size()"<<way.size()<<" page : "<<page;
 
 }
index 6002ec41006b41f402557091531108778baac4cd..a58849056fe8e43d59ef1895ee03230cc60ab757 100644 (file)
@@ -188,7 +188,7 @@ private slots:
     void download(const QString &);
     void download(const QString &,const QString &);
     void use(const QString &);
-    bool printItem(const QString &, const CLabel *);
+    bool printItem();
 public slots:
 
 signals: