From 4173af3be7be18cac4333d6171d2bf5fd7fb678e Mon Sep 17 00:00:00 2001 From: doitux Date: Mon, 31 Dec 2012 02:01:28 +0100 Subject: [PATCH] mobile gui fixes, better keycode BACK handling --- .../createinternetgamedialogimpl.cpp | 3 +- .../createnetworkgamedialogimpl.cpp | 9 +- .../gamelobbydialog/gamelobbydialogimpl.cpp | 8 + .../createinternetgamedialog_800x480.ui | 828 ++++++++++-------- .../createnetworkgamedialog_800x480.ui | 181 ++-- .../qt/gui_800x480/newgamedialog_800x480.ui | 38 +- 6 files changed, 568 insertions(+), 499 deletions(-) diff --git a/src/gui/qt/createinternetgamedialog/createinternetgamedialogimpl.cpp b/src/gui/qt/createinternetgamedialog/createinternetgamedialogimpl.cpp index 8ff557e5..bd5dd387 100644 --- a/src/gui/qt/createinternetgamedialog/createinternetgamedialogimpl.cpp +++ b/src/gui/qt/createinternetgamedialog/createinternetgamedialogimpl.cpp @@ -278,8 +278,9 @@ bool createInternetGameDialogImpl::eventFilter(QObject *obj, QEvent *event) return false; } else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Back) { + event->ignore(); this->reject(); - return true; + return false; } else { // pass the event on to the parent class return QDialog::eventFilter(obj, event); diff --git a/src/gui/qt/createnetworkgamedialog/createnetworkgamedialogimpl.cpp b/src/gui/qt/createnetworkgamedialog/createnetworkgamedialogimpl.cpp index 11f72ae0..6dd80cec 100644 --- a/src/gui/qt/createnetworkgamedialog/createnetworkgamedialogimpl.cpp +++ b/src/gui/qt/createnetworkgamedialog/createnetworkgamedialogimpl.cpp @@ -53,17 +53,11 @@ createNetworkGameDialogImpl::createNetworkGameDialogImpl(QWidget *parent, Config #endif connect( pushButton_createGame, SIGNAL( clicked() ), this, SLOT( createGame() ) ); - //temporarely unused until ai is enabled in network -// label_5->hide(); -// spinBox_gameSpeed->hide(); - - } void createNetworkGameDialogImpl::exec() { - fillFormular(); QDialog::exec(); } @@ -165,8 +159,9 @@ bool createNetworkGameDialogImpl::eventFilter(QObject *obj, QEvent *event) event->ignore(); return false; } else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Back) { + event->ignore(); this->reject(); - return true; + return false; } else { // pass the event on to the parent class return QDialog::eventFilter(obj, event); diff --git a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp index f00d9ee4..6bfa5996 100644 --- a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp +++ b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp @@ -243,6 +243,7 @@ gameLobbyDialogImpl::gameLobbyDialogImpl(startWindowImpl *parent, ConfigFile *c) lineEdit_searchForPlayers->installEventFilter(this); lineEdit_ChatInput->installEventFilter(this); + this->installEventFilter(this); clearDialog(); @@ -384,6 +385,9 @@ void gameLobbyDialogImpl::createGame() mySession->clientCreateGame(gameData, currentGameName.toUtf8().constData(), myCreateInternetGameDialog->lineEdit_Password->text().toUtf8().constData()); } +#ifdef ANDROID + this->setFocus(); +#endif } void gameLobbyDialogImpl::joinGame() @@ -1396,6 +1400,10 @@ bool gameLobbyDialogImpl::eventFilter(QObject *obj, QEvent *event) } else if (obj == lineEdit_searchForPlayers && focusEvent->gotFocus() && lineEdit_searchForPlayers->text() == tr("search for player ...")) { lineEdit_searchForPlayers->clear(); return QDialog::eventFilter(obj, event); + } else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Back) { + event->ignore(); + this->reject(); + return false; } else { // pass the event on to the parent class return QDialog::eventFilter(obj, event); diff --git a/src/gui/qt/gui_800x480/createinternetgamedialog_800x480.ui b/src/gui/qt/gui_800x480/createinternetgamedialog_800x480.ui index 985085f1..dac0424f 100644 --- a/src/gui/qt/gui_800x480/createinternetgamedialog_800x480.ui +++ b/src/gui/qt/gui_800x480/createinternetgamedialog_800x480.ui @@ -25,14 +25,452 @@ Create Internet Game - - - 10 + + + 0 - + + 0 + + + 0 + + + 0 + + + 20 + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 1 + 20 + + + + + + + + QObject {font-size:26px} + + + + 0 + + + 0 + + + 7 + + + + + + + + 0 + 0 + + + + + + + Default game name: + + + + + + + + 400 + 0 + + + + + 16777215 + 16777215 + + + + Qt::ImhNoPredictiveText + + + 48 + + + + + + + + + + + + 0 + 0 + + + + Game type: + + + + + + + + 0 + 0 + + + + + 400 + 0 + + + + + Standard + + + + :/gfx/player_play.png:/gfx/player_play.png + + + + + Registered players only + + + + :/gfx/registered.png:/gfx/registered.png + + + + + Invited players only + + + + :/gfx/list_add_user.png:/gfx/list_add_user.png + + + + + Ranking game + + + + :/gfx/cup.png:/gfx/cup.png + + + + + + + + + + Blinds + + + + 0 + + + 0 + + + 0 + + + + + Use saved blinds settings + + + true + + + + + + + Change blinds settings ... + + + + + + + + + + 10 + + + + + + 0 + 0 + + + + Timeout for player action: + + + + + + + s + + + 5 + + + 60 + + + 20 + + + + + + + Delay between hands: + + + + + + + + 0 + 0 + + + + s + + + 5 + + + 20 + + + 7 + + + + + + + + + + + + 0 + 0 + + + + Start Cash: + + + + + + + + 0 + 0 + + + + + 150 + 0 + + + + + + + $ + + + 1000 + + + 1000000 + + + 50 + + + 2000 + + + + + + + + + 6 + + + 0 + + + + + + 0 + 0 + + + + Password: + + + + 32 + 32 + + + + + + + + false + + + + 400 + 0 + + + + QLineEdit::Password + + + + + + + + + + + + 0 + 0 + + + + Maximum number of players: + + + + + + + + 0 + 0 + + + + + 150 + 0 + + + + 2 + + + 10 + + + 10 + + + + + + + + + + + + Qt::Horizontal + + + + 1 + 20 + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + - 6 + 0 0 @@ -73,372 +511,24 @@ + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + - - - - QObject {font-size:26px} - - - - 0 - - - 0 - - - 7 - - - - - Blinds - - - - 0 - - - 0 - - - 0 - - - - - Use saved blinds settings - - - true - - - - - - - Change blinds settings ... - - - - - - - - - - - - - 0 - 0 - - - - Game type: - - - - - - - - 0 - 0 - - - - - 400 - 0 - - - - - Standard - - - - :/gfx/player_play.png:/gfx/player_play.png - - - - - Registered players only - - - - :/gfx/registered.png:/gfx/registered.png - - - - - Invited players only - - - - :/gfx/list_add_user.png:/gfx/list_add_user.png - - - - - Ranking game - - - - :/gfx/cup.png:/gfx/cup.png - - - - - - - - - - - - - 0 - 0 - - - - - - - Default game name: - - - - - - - - 400 - 0 - - - - - 16777215 - 16777215 - - - - Qt::ImhNoPredictiveText - - - 48 - - - - - - - - - - - - 0 - 0 - - - - Maximum number of players: - - - - - - - - 0 - 0 - - - - - 150 - 0 - - - - 2 - - - 10 - - - 10 - - - - - - - - - - - - 0 - 0 - - - - Start Cash: - - - - - - - - 0 - 0 - - - - - 150 - 0 - - - - - - - $ - - - 1000 - - - 1000000 - - - 50 - - - 2000 - - - - - - - - - - - - 0 - 0 - - - - Timeout for player action: - - - - - - - s - - - 5 - - - 60 - - - 20 - - - - - - - Delay between hands: - - - - - - - - 0 - 0 - - - - s - - - 5 - - - 20 - - - 7 - - - - - - - - - 6 - - - 0 - - - - - - 0 - 0 - - - - Password: - - - - 32 - 32 - - - - - - - - false - - - - 400 - 0 - - - - QLineEdit::Password - - - - - - - - diff --git a/src/gui/qt/gui_800x480/createnetworkgamedialog_800x480.ui b/src/gui/qt/gui_800x480/createnetworkgamedialog_800x480.ui index 5e525ba2..4c5456ba 100644 --- a/src/gui/qt/gui_800x480/createnetworkgamedialog_800x480.ui +++ b/src/gui/qt/gui_800x480/createnetworkgamedialog_800x480.ui @@ -20,31 +20,9 @@ Create Network Game - + 30 - - 0 - - - 30 - - - 30 - - - - - Qt::Vertical - - - - 20 - 40 - - - - @@ -58,65 +36,6 @@ - - - - 6 - - - 0 - - - - - Qt::Horizontal - - - - 181 - 20 - - - - - - - - QObject {font: 36px} - - - Create Game - - - - :/gfx/dialog_ok_apply.png:/gfx/dialog_ok_apply.png - - - - 32 - 32 - - - - false - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - @@ -280,22 +199,94 @@ - - - - Qt::Vertical - - - - 20 - 40 - - - - + + + + 6 + + + 0 + + + + + Qt::Horizontal + + + + 181 + 20 + + + + + + + + QObject {font: 36px} + + + Create Game + + + + :/gfx/dialog_ok_apply.png:/gfx/dialog_ok_apply.png + + + + 32 + 32 + + + + false + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + diff --git a/src/gui/qt/gui_800x480/newgamedialog_800x480.ui b/src/gui/qt/gui_800x480/newgamedialog_800x480.ui index 8ef6b900..447c6047 100755 --- a/src/gui/qt/gui_800x480/newgamedialog_800x480.ui +++ b/src/gui/qt/gui_800x480/newgamedialog_800x480.ui @@ -29,21 +29,9 @@ QObject {font: 26px} - - 16 - - + 30 - - 10 - - - 30 - - - 10 - @@ -93,6 +81,12 @@ QFrame::Plain + + 0 + + + 0 + @@ -246,7 +240,7 @@ - + Qt::Vertical @@ -260,6 +254,9 @@ + + 0 + @@ -298,19 +295,6 @@ - - - - Qt::Vertical - - - - 497 - 0 - - - -