1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2025-04-21 12:27:27 +03:00

Rewrite of how the events are handled by the menusetting* objects.

This commit is contained in:
Ayla
2011-09-15 20:20:35 +02:00
parent fdee206d93
commit 7f2c7db8e2
12 changed files with 60 additions and 77 deletions

View File

@@ -110,53 +110,28 @@ bool SettingsDialog::exec() {
inputMgr.waitForEvent(&event);
} while (event.state != PRESSED);
switch (event.button) {
case SETTINGS:
close = true;
break;
case UP:
if (sel==0)
sel = voices.size()-1;
else
sel -= 1;
gmenu2x->setInputSpeed();
voices[sel]->adjustInput();
break;
case DOWN:
sel += 1;
if (sel>=voices.size()) sel = 0;
gmenu2x->setInputSpeed();
voices[sel]->adjustInput();
break;
default:
voices[sel]->manageInput(&event);
break;
}
/*
inputMgr.update();
if ( inputMgr[ACTION_START] ) action = SD_ACTION_CLOSE;
if ( inputMgr[ACTION_UP ] ) action = SD_ACTION_UP;
if ( inputMgr[ACTION_DOWN ] ) action = SD_ACTION_DOWN;
switch (action) {
case SD_ACTION_CLOSE: close = true; break;
case SD_ACTION_UP: {
if (sel==0)
sel = voices.size()-1;
else
sel -= 1;
gmenu2x->setInputSpeed();
voices[sel]->adjustInput();
} break;
case SD_ACTION_DOWN: {
sel += 1;
if (sel>=voices.size()) sel = 0;
gmenu2x->setInputSpeed();
voices[sel]->adjustInput();
} break;
if (voices[sel]->manageInput(&event) == false) {
switch (event.button) {
case SETTINGS:
close = true;
break;
case UP:
if (sel==0)
sel = voices.size()-1;
else
sel -= 1;
gmenu2x->setInputSpeed();
voices[sel]->adjustInput();
break;
case DOWN:
sel += 1;
if (sel>=voices.size()) sel = 0;
gmenu2x->setInputSpeed();
voices[sel]->adjustInput();
default:
break;
}
}
*/
}
gmenu2x->setInputSpeed();