else if(b[0]==QString("edit")){
//QString e;
//bool ok;
+ action(beforekey);
if(bs==1){
/*e=QInputDialog::getText(this, QString("ID"), trUtf8("Enter ID of button to edit"), QLineEdit::Normal, QString(""), &ok);
if(!ok)return;*/
if(deb)QMessageBox::information(this, QString("val"), tmp);
}
else if(b[0]==QString("add")){
- addDB(c);
+ addDB(c, beforekey);
}
else if (b[0]==QString("hac")){
if (c=="")action();
void MainWindow::entry(){
entry(QString(""));
}
-void MainWindow::addDB(const QString & tmp){
- qDebug()<<"addDB";
+void MainWindow::addDB(const QString & tmp, const QString & cur){
+ qDebug()<<"addDB : tmp="<<tmp<<" cur="<<cur;
if(deb)QMessageBox::information(this, trUtf8("addDB", "box title to debug addDB"), "type : "+tmp);
bool ok=0;
- QString cur=label->text();
+ //QString cur=label->text();
QString a, b, c=QInputDialog::getText(this, trUtf8("label", "Title of box where ask for new label"), trUtf8("Enter his label", "his/her/?they? I've forget my school lesson"), QLineEdit::Normal, QString(""), &ok);
if ((c=="")||(ok==0))return;
- b=QInputDialog::getText(this, trUtf8("keyword", "Title of box where ask for new keyword"), trUtf8("Enter they keyword (no limit !)"), QLineEdit::Normal, cur, &ok);
+ b=QInputDialog::getText(this, trUtf8("keyword", "Title of box where ask for new keyword"), trUtf8("Enter they keyword (no limit !)"), QLineEdit::Normal, *&cur, &ok);
if ((b=="")||(ok==0))return;
a=QInputDialog::getText(this, trUtf8("action", "Title of box where ask for new action"), trUtf8("Enter his action"), QLineEdit::Normal, QString("new idem"), &ok);
if ((a=="")||(ok==0))return;
const QString a=conf->value(QString("actionmenu")).toString();
if(a!="")accepted=true;
if(a!=lastprint){
- beforeactionmenu=lastprint;
+ beforekey=lastprint;
action(a);
}else{
- action(beforeactionmenu);
+ action(beforekey);
};
}else if(k==Qt::Key_Back){
const QString a=conf->value(QString("menuback"), QString("")).toString();
if(a!="")accepted=true;
if(a!=lastprint){
- beforekeyback=lastprint;
+ beforekey=lastprint;
action(a);
}else{
- action(beforekeyback);
+ action(beforekey);
};
}else if(k==Qt::Key_VolumeDown){
qDebug()<<"keyvolumdown";
const QString a=conf->value(QString("volumdown")).toString();
if(a!="")accepted=true;
if(a!=lastprint){
- beforevolumedown=lastprint;
+ beforekey=lastprint;
action(a);
}else{
- action(beforevolumedown);
+ action(beforekey);
};
}else if(k==Qt::Key_VolumeUp){
const QString a=conf->value(QString("volumup")).toString();
if(a!="")accepted=true;
if(a!=lastprint){
- beforevolumeup=lastprint;
+ beforekey=lastprint;
action(a);
}else{
- action(beforevolumeup);
+ action(beforekey);
};
};
event->setAccepted(accepted);
get(conf->value(QString("currenttype")).toString(), lastprint);
}
void MainWindow::addDB(){
- addDB(conf->value(QString("currenttype")).toString());
+ addDB(conf->value(QString("currenttype")).toString(), label->text());
}
void MainWindow::savData(){
sav(conf->value(QString("currenttype")).toString());