conf->setValue(QString("first"), 1);
};
screen=new QWidget(this);
- scroll=new QScrollArea(screen);
- grid=new QGridLayout(scroll);
screen->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
+ /*scroll=new QScrollArea;
+ scroll->setWidget(screen);
+ scroll->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
+ scroll->setVerticalScrollBarPolicy(2);*/
+ grid=new QGridLayout(screen);
+ grid->setSizeConstraint(QLayout::SetMinimumSize);
+
+
signalmap=new QSignalMapper(this);
connect(signalmap, SIGNAL(mapped(const QString &)), this, SLOT(action(const QString &)));
connect(this, SIGNAL(datafilled()), this, SLOT(start()));
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 ?;", b});
+ QList<QString> tmp({"select label,action from ui where keyword like ? order by id;", b});
label->setText(a);
exec(tmp);
int labCol = 0;//r.indexOf("label");
}
void MainWindow::chooseButtonDB(const QString & a){
flush();
- qDebug()<<"exec()="<<exec(QList<QString>({"select id,label from ui where keyword like ?;", a}));
+ qDebug()<<"exec()="<<exec(QList<QString>({"select id,label from ui where keyword like ? order by id;", a}));
while (q->next()) {
const QString action="edit "+q->value(0).toString();
addWidget(action, new CLabel(q->value(1).toString(), conf->value(QString("button")).toString()));
}
void MainWindow::downloadUi(){
- qDebug()<<"updateUi() : "<<conf->value(QString("download"), QVariant("https://raw.github.com/Nothing2Do/diary-mobile-android/master/ui.sql")).toString();
+ qDebug()<<"updateUi() : "<<conf->value(QString("download")).toString();
download(conf->value(QString("download")).toString());
connect(m, SIGNAL(downloaded()), SLOT(writeUi()));
}