-// Copyright (c) 2014, PIOT Gabriel
+// Copyright (c) 2014-2015, PIOT Gabriel
// All rights reserved.
// Redistribution and use in source and binary forms, with or without modification,
menuBar()->setVisible(conf->value(QString("menu")).toBool());
//d.lock();
- //start();
+ start();
}
void MainWindow::start(){
QString a=conf->value(QString("currenttype"), QString("buttons")).toString();
//if(c==(maxc*maxl)-1)return 1;
//(p-1)*(ml*mc)+c nombre de boutons en tout osef,
-/* if((c==((maxc*maxl)-1))&&(!np)){
+ if((c==((maxc*maxl)-1))&&(!np)){
np=1;
CLabel * next=new CLabel(QString("Next page"), *conf);
addWidget(QString("nextpage"), next);
- page++;
return 1;
}
-*/
+
return 0;
}
void MainWindow::action(const QString &a){
page--;
int maxc=conf->value(QString("maxcolumn")).toInt(), maxl=conf->value(QString("maxline")).toInt();
q->seek(0-(maxc*maxl),1);
+ printItem();
}
else if(b[0]==QString("nextpage")){
page++;
int maxc=conf->value(QString("maxcolumn")).toInt(), maxl=conf->value(QString("maxline")).toInt();
q->seek(maxc*maxl,1);
-
+ printItem();
}
else if(b[0]==QString("setfile")){
bool ok=0;
}
else if(b[0]==QString("val")){
for(int a=0;a<((bs-1)/2); a++){
- valeur->insert(b[2*a], b[2*a+1]);
- qDebug()<<"val.size()=="<<valeur->size()<<endl;
+ valeur->insert(b[(2*a)+1], b[(2*a)+2]);
+ if(deb)QMessageBox::information(this, QString("val"), QString("val("+b[(2*a)+1]+")=="+b[(2*a)+2]));
}
+ if(deb)QMessageBox::information(this, QString("val"), QString("val.size()=="+valeur->size()));
}
else {
conf->setValue(QString("maxcolumn"), QVariant(3));
conf->setValue(QString("maxline"), QVariant(3));
conf->setValue(QString("SQLsettings"), QVariant("connect_timeout=10000"));
- conf->setValue(QString("buttons"), QVariant("background-color: red;border-style: outset;border-width: 15px;border-radius: 10px;border-color: beige;font: bold 15px;padding: 6px;"));
+ conf->setValue(QString("buttons"), QVariant("background-color: red;border-style: outset;border-width: 15px;border-radius: 10px;border-color: beige;font-size: 30px;padding: 6px;"));
conf->setValue(QString("buttonsbefore"), QVariant("background-color: red;"));
conf->setValue(QString("buttonsafter"), QVariant("background-color: blue;"));
conf->setValue(QString("menu"), QVariant(1));
conf->setValue(QString("download"), QVariant("http://www.nothing2do.eu/"+conf->value(QString("filebuttons")).toString()));
conf->setValue(QString("init"), QVariant("http://www.nothing2do.eu/init"));
- conf->setValue(QString("userftp"), QVariant("<user>"));
- conf->setValue(QString("hostftp"), QVariant("<host>"));
- conf->setValue(QString("passftp"), QVariant("<pass>"));
+ conf->setValue(QString("userftp"), QVariant("<userftp>"));
+ conf->setValue(QString("hostftp"), QVariant("<hostftp>"));
+ conf->setValue(QString("passftp"), QVariant("<passftp>"));
conf->setValue(QString("start"), QVariant("begin"));
conf->setValue(QString("restore"), QVariant("http://www.abc.de/db"));
conf->setValue(QString("db"), QVariant("/data/data/eu.nothing2do.diarymobile/files/db"));
if (k==Qt::Key_Menu){
action(conf->value(QString("actionmenu")).toString());
- accepted==false;
+ accepted=false;
}
else if(k==Qt::Key_Back){
action(conf->value(QString("menuback")).toString());
- accepted==false;
+ accepted=false;
}
else if(k==Qt::Key_VolumeDown){
qDebug()<<"keyvolumdown";
const QString a=conf->value(QString("volumdown")).toString();
+ accepted=false;
action(a);
}
else if(k==Qt::Key_VolumeUp){
action(conf->value(QString("volumup")).toString());
+ accepted=false;
};
}
void CLabel::SetTextToLabel(const QString& text)
QUrl url(a);
m = new FileDownloader(url, this);
}
-void MainWindow::download(const QString & a, const QString & b){//write downloaded data into "b"
+void MainWindow::download(const QString & a, const QString & b){//write downloaded data from "a" into "b"
qDebug()<<"download("<<a<<") in "<<b;
d.lock();
QUrl url(a);
int actCol = 1;//r.indexOf("action");
int i=0;
qDebug()<<"printItem()";
- /*if(page){
+ 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)return 1;
+ if(tmp==1)return 1;
i++;
};
//grid->update();