fix a small bug in the quit dialog

svn-id: r33844
This commit is contained in:
Kostas Nakos 2008-08-13 19:32:25 +00:00
parent 5a54dc61a4
commit 56c9e3ab04
2 changed files with 10 additions and 6 deletions

View file

@ -215,7 +215,7 @@ CEActionsPocket::~CEActionsPocket() {
}
bool CEActionsPocket::perform(GUI::ActionType action, bool pushed) {
static bool keydialogrunning = false;
static bool keydialogrunning = false, quitdialog = false;
if (!pushed) {
switch(action) {
@ -292,12 +292,14 @@ bool CEActionsPocket::perform(GUI::ActionType action, bool pushed) {
_CESystem->move_cursor_right();
return true;
case POCKET_ACTION_QUIT:
{
if (!quitdialog) {
quitdialog = true;
GUI::MessageDialog alert(" Are you sure you want to quit ? ", "Yes", "No");
if (alert.runModal() == GUI::kMessageOK)
_mainSystem->quit();
return true;
quitdialog = false;
}
return true;
case POCKET_ACTION_BINDKEYS:
if (!keydialogrunning) {
keydialogrunning = true;

View file

@ -179,7 +179,7 @@ CEActionsSmartphone::~CEActionsSmartphone() {
}
bool CEActionsSmartphone::perform(GUI::ActionType action, bool pushed) {
static bool keydialogrunning = false;
static bool keydialogrunning = false, quitdialog = false;
if (!pushed) {
switch (action) {
@ -250,12 +250,14 @@ bool CEActionsSmartphone::perform(GUI::ActionType action, bool pushed) {
_CESystem->smartphone_rotate_display();
return true;
case SMARTPHONE_ACTION_QUIT:
{
if (!quitdialog) {
quitdialog = true;
GUI::MessageDialog alert(" Are you sure you want to quit ? ", "Yes", "No");
if (alert.runModal() == GUI::kMessageOK)
_mainSystem->quit();
return true;
quitdialog = false;
}
return true;
}
return false;