conf->setValue(b[1], b[2]);
}
else if(b[0]==QString("settext")){
- conf->setValue(b[1], QInputDialog::getText(this, "setText", b[1], QLineEdit::Normal, conf->value(b[1]).toString()));
+ bool ok;
+ QString a=QInputDialog::getText(this, "setText", b[1], QLineEdit::Normal, conf->value(b[1]).toString(), *ok);
+ if(ok)conf->setValue(b[1], a);
}
else if(b[0]==QString("setint")){
- conf->setValue(b[1], QInputDialog::getInt(this, "setInt", b[1] , conf->value(QString(b[1])).toInt()));
+ bool ok;
+ QString a=QInputDialog::getInt(this, "setInt", b[1] , conf->value(QString(b[1])).toInt(), 0, 100, 1, *ok);
+ if(ok)conf->setValue(b[1], a);
}
else if(b[0]==QString("start")){
getButtons(conf->value(QString("start")).toString());
void MainWindow::keyReleaseEvent(QKeyEvent *event)
{
//static bool accepted=true;
- event->setAccepted(1);
+ event->setAccepted(true);
int k=event->key();
qDebug()<<"key pressed="<<k;
if(k==Qt::Key_Back){
}
else if(k==Qt::Key_VolumeDown){
qDebug()<<"keyvolumdown";
- action(conf->value(QString("volumdown")).toString());
+ const QString a=conf->value(QString("volumdown")).toString();
+ action(a);
}
else if(k==Qt::Key_VolumeUp){