if(!page)tmp=q->seek(0);
else tmp=q->seek(-t-max-1,true);
if(deb)QMessageBox::information(this, trUtf8("result", "box title to debug prevpage"), int(tmp));
- printItem();
+ printItem(*q);
}
else if(b[0]==QString("nextpage")){
page++;
flush();
- printItem();
+ printItem(*q);
}
else if(b[0]==QString("setfile")){
bool ok=0;
exec(tmp);
page=0;
//while(q->next()){
- printItem();
+ printItem(*q);
//}
}
void MainWindow::chooseDB(){
QList<QString> b({"delete from buttons;"});
exec(b);
}
-bool MainWindow::printItem(){
+bool MainWindow::printItem(const QSqlQuery & a){
int labCol = 0;//r.indexOf("label");
int actCol = 1;//r.indexOf("action");
int i=0;
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));
+ while(a.next()){
+ int tmp=addWidget(a.value(actCol).toString(), new CLabel(a.value(labCol).toString(), *conf));
if(tmp==1){
addWidget(QString("nextpage"), new CLabel(trUtf8("Next"), *conf));
return 1;
qDebug()<<"end printItem : "<<i<<" button(s) way.size()"<<way.size()<<" page : "<<page;
return 0;
}
+void MainWindow::get2(const QString & d, const QString &b){
+ if(deb)QMessageBox::information(this, trUtf8("action", "box title to debug get"), "type:"+d+" keyword:"+b);
+ QString a=b;lastprint=b;
+ if((b[0]!='-')&&(b[0]!='+'))way.append(a);
+ else a.remove(0, 1);
+ qDebug()<<"get"<<d<<"("<<a<<") way.size()"<<way.size();
+ if(b[0]!='+')flush();
+ if(updatelocker.tryLock(60000))updatelocker.unlock();
+ else{qDebug()<<"updatelocker is locked more than 1mn";}
+ QString t=QString("get"+d);
+ QString c="%"+a+"%", x=conf->value(t).toString();
+ qDebug()<<"l691 x="<<x<<" c="<<c<<" t="<<t;
+ QList<QString> tmp({x, c});
+ label->setText(c);
+ exec2(tmp);
+ page=0;
+ //while(q->next()){
+ printItem(*qq);
+ //}
+}
void addMedia(const QString &);
void editDB(const QString &, const QString &);
void get(const QString &, const QString &);
+ void get2(const QString &, const QString &);
void get(const QString &);
void downloadData();
void writeData();
void download(const QString &);
void download(const QString &,const QString &);
void use(const QString &);
- bool printItem();
+ bool printItem(const QSqlQuery &);
public slots:
signals: