android dialog changes

This commit is contained in:
doitux committed 2012-12-20 23:48:13 +01:00
1 parent a480dddd8c
commit 5b206ffe99
18 files changed
+630 -582

No files matched your search

@@ -27,6 +27,7 @@ newGameDialogImpl::newGameDialogImpl(QMainWindow *parent, ConfigFile *c)
setWindowFlags(Qt::WindowSystemMenuHint | Qt::CustomizeWindowHint | Qt::Dialog);
#endif
setupUi(this);
this->installEventFilter(this);
myChangeCompleteBlindsDialog = new changeCompleteBlindsDialogImpl;
connect( radioButton_changeBlindsSettings, SIGNAL( clicked(bool) ), this, SLOT( callChangeBlindsDialog(bool) ) );
@@ -65,7 +66,7 @@ void newGameDialogImpl::exec()
myChangeCompleteBlindsDialog->spinBox_afterThisAlwaysRaiseValue->setValue(myConfig->readConfigInt("AfterMBAlwaysRaiseValue"));
myChangeCompleteBlindsDialog->radioButton_afterThisStayAtLastBlind->setChecked(myConfig->readConfigInt("AfterMBStayAtLastBlind"));
QDialog::exec();
QDialog::exec();
}
void newGameDialogImpl::callChangeBlindsDialog(bool show)
@@ -80,3 +81,35 @@ void newGameDialogImpl::callChangeBlindsDialog(bool show)
}
}
bool newGameDialogImpl::eventFilter(QObject *obj, QEvent *event)
{
QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
#ifdef ANDROID
//androi hack for crash bug (hopefully useless from necessitas beta2)
if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Return) {
if(spinBox_gameSpeed->hasFocus()) {
spinBox_gameSpeed->clearFocus();
}
if(spinBox_quantityPlayers->hasFocus()) {
spinBox_quantityPlayers->clearFocus();
}
if(spinBox_startCash->hasFocus()) {
spinBox_startCash->clearFocus();
}
event->ignore();
return false;
}
else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Back) {
this->reject();
return true;
}
else {
// pass the event on to the parent class
return QDialog::eventFilter(obj, event);
}
#else
return QDialog::eventFilter(obj, event);
#endif
}
@@ -42,6 +42,8 @@ public:
return myChangeCompleteBlindsDialog;
}
bool eventFilter(QObject *obj, QEvent *event);
public slots:
void callChangeBlindsDialog(bool);