setCentralWidget(screen);
createMenuBar();
connectDB();
-
+ screen->show();
if((conf->value(QString("first")).toInt()==1)){
qDebug()<<"second";
QString ser=QInputDialog::getText(this, "fichier initial", "Entrez l'adresse du serveur où télécharger les premier boutons", QLineEdit::Normal, conf->value(QString("download")).toString());
conf->setValue(QString("db"), QVariant("/data/data/eu.nothing2do.diarymobile/files/db"));
conf->setValue(QString("selectbuttons"), QVariant("select keyword,label,action from ui order by label;"));
conf->setValue(QString("selectraw"), QVariant("select date,texte from raw;"));
- conf->setValue(QString("menuback"), QVariant("menuback"));
+ conf->setValue(QString("menuback"), QVariant("-menuback"));
}
QString &MainWindow::get(int row, int column){
q->seek(row);
exec(cmd);
return;
}
-void MainWindow::getButtons(const QString &a){
- if(a==conf->value(QString("start")).toString())way.clear();
+void MainWindow::getButtons(const QString &b){
+ QString a=b;
+ if(b[0]!='-')way.append(a);
+ else a.remove(0, 1);
+
qDebug()<<"getButtons("<<a<<") way.size()"<<way.size();
flush();
if(updatelocker.tryLock(60000))updatelocker.unlock();
else{qDebug()<<"updatelocker is locked more than 1mn";}
- QString b="%"+a+"%";
- QList<QString> tmp({"select label,action from ui where keyword like ? order by id;", b});
- label->setText(a);
+ QString c="%"+a+"%";
+ QList<QString> tmp({"select label,action from ui where keyword like ? order by id;", c});
+ label->setText(b);
exec(tmp);
int labCol = 0;//r.indexOf("label");
int actCol = 1;//r.indexOf("action");
addWidget(q->value(actCol).toString(), new CLabel(q->value(labCol).toString(), conf->value(QString("button")).toString()));
i++;
};
- way.append(a);
/*grid->update();
scroll->updateGeometry();
screen->updateGeometry();*/
void MainWindow::back(){
flush();
getButtons(conf->value(QString("menuback")).toString());
- //way.removeLast();
for(int i=0; i<way.size(); i++){
addWidget(QString(way[i]), new CLabel(QString(way[i]), conf->value(QString("button")).toString()));
}
back();
//accepted=false;// close the app next time when the user press back button
}
+ //Qt::Key_VolumeDown Qt::Key_VolumeUp
}
void CLabel::SetTextToLabel(const QString& text)